@zonease/aiworker-cli 0.10.2 → 0.10.4
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 +143 -60
- package/aiworker-bun.js +588 -680
- package/package.json +1 -1
- package/web/fleet/assets/index-bti7BCPc.js +1372 -0
- package/web/fleet/index.html +1 -1
- package/web/worker/assets/{index-K99vOXUf.js → index-DMK6sJoi.js} +193 -307
- package/web/worker/index.html +1 -1
- package/web/fleet/assets/index-RizR7tk6.js +0 -1486
|
@@ -6,7 +6,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
6
6
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?fe(n):``}function he(e,t){switch(e.tag){case 26:case 27:case 5:return fe(e.type);case 16:return fe(`Lazy`);case 13:return e.child!==t&&t!==null?fe(`Suspense Fallback`):fe(`Suspense`);case 19:return fe(`SuspenseList`);case 0:case 15:return me(e.type,!1);case 11:return me(e.type.render,!1);case 1:return me(e.type,!0);case 31:return fe(`Activity`);default:return``}}function ge(e){try{var t=``,n=null;do t+=he(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
7
|
Error generating stack: `+e.message+`
|
|
8
8
|
`+e.stack}}var _e=Object.prototype.hasOwnProperty,ve=t.unstable_scheduleCallback,ye=t.unstable_cancelCallback,be=t.unstable_shouldYield,xe=t.unstable_requestPaint,Se=t.unstable_now,Ce=t.unstable_getCurrentPriorityLevel,we=t.unstable_ImmediatePriority,Te=t.unstable_UserBlockingPriority,Ee=t.unstable_NormalPriority,De=t.unstable_LowPriority,Oe=t.unstable_IdlePriority,ke=t.log,Ae=t.unstable_setDisableYieldValue,je=null,Me=null;function Ne(e){if(typeof ke==`function`&&Ae(e),Me&&typeof Me.setStrictMode==`function`)try{Me.setStrictMode(je,e)}catch{}}var Fe=Math.clz32?Math.clz32:B,Ie=Math.log,z=Math.LN2;function B(e){return e>>>=0,e===0?32:31-(Ie(e)/z|0)|0}var Le=256,Re=262144,ze=4194304;function Be(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 Ve(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=Be(n))):i=Be(o):i=Be(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Be(n))):i=Be(o)):i=Be(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 He(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ue(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 We(){var e=ze;return ze<<=1,!(ze&62914560)&&(ze=4194304),e}function Ge(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ke(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function qe(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-Fe(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&&Je(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Je(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Fe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ye(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Xe(e,t){var n=t&-t;return n=n&42?1:Ze(n),(n&(e.suspendedLanes|t))===0?n:0}function Ze(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 Qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function $e(){var e=N.p;return e===0?(e=window.event,e===void 0?32:gp(e.type)):e}function et(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var tt=Math.random().toString(36).slice(2),nt=`__reactFiber$`+tt,rt=`__reactProps$`+tt,it=`__reactContainer$`+tt,at=`__reactEvents$`+tt,ot=`__reactListeners$`+tt,st=`__reactHandles$`+tt,ct=`__reactResources$`+tt,lt=`__reactMarker$`+tt;function ut(e){delete e[nt],delete e[rt],delete e[at],delete e[ot],delete e[st]}function dt(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[it]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pf(e);e!==null;){if(n=e[nt])return n;e=pf(e)}return t}e=n,n=e.parentNode}return null}function ft(e){if(e=e[nt]||e[it]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function mt(e){var t=e[ct];return t||=e[ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ht(e){e[lt]=!0}var gt=new Set,_t={};function vt(e,t){yt(e,t),yt(e+`Capture`,t)}function yt(e,t){for(_t[e]=t,e=0;e<t.length;e++)gt.add(t[e])}var bt=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]*$`),xt={},St={};function Ct(e){return _e.call(St,e)?!0:_e.call(xt,e)?!1:bt.test(e)?St[e]=!0:(xt[e]=!0,!1)}function wt(e,t,n){if(Ct(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 Tt(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 Et(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 Dt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ot(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function kt(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 At(e){if(!e._valueTracker){var t=Ot(e)?`checked`:`value`;e._valueTracker=kt(e,t,``+e[t])}}function jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ot(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Mt(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 Nt=/[\n"\\]/g;function Pt(e){return e.replace(Nt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ft(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=``+Dt(t)):e.value!==``+Dt(t)&&(e.value=``+Dt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Lt(e,o,Dt(n)):Lt(e,o,Dt(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=``+Dt(s):e.removeAttribute(`name`)}function It(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)){At(e);return}n=n==null?``:``+Dt(n),t=t==null?n:``+Dt(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),At(e)}function Lt(e,t,n){t===`number`&&Mt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Rt(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=``+Dt(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 zt(e,t,n){if(t!=null&&(t=``+Dt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Dt(n)}function Bt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(j(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Dt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),At(e)}function Vt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ht=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 Ut(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||Ht.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Wt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(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 a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ut(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ut(e,o,t[o])}function Gt(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 Kt=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`]]),qt=/^[\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 Jt(e){return qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Yt(){}var Xt=null;function Zt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qt=null,$t=null;function en(e){var t=ft(e);if(t&&(e=t.stateNode)){var n=e[rt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ft(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="`+Pt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[rt]||null;if(!a)throw Error(i(90));Ft(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&jt(r)}break a;case`textarea`:zt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Rt(e,!!n.multiple,t,!1)}}}var tn=!1;function nn(e,t,n){if(tn)return e(t,n);tn=!0;try{return e(t)}finally{if(tn=!1,(Qt!==null||$t!==null)&&(yu(),Qt&&(t=Qt,e=$t,$t=Qt=null,en(t),e)))for(t=0;t<e.length;t++)en(e[t])}}function rn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[rt]||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(i(231,t,typeof n));return n}var an=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),on=!1;if(an)try{var sn={};Object.defineProperty(sn,`passive`,{get:function(){on=!0}}),window.addEventListener(`test`,sn,sn),window.removeEventListener(`test`,sn,sn)}catch{on=!1}var cn=null,ln=null,un=null;function dn(){if(un)return un;var e,t=ln,n=t.length,r,i=`value`in cn?cn.value:cn.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 un=i.slice(e,1<r?1-r:void 0)}function fn(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 pn(){return!0}function mn(){return!1}function hn(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)?pn:mn,this.isPropagationStopped=mn,this}return f(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=pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=pn)},persist:function(){},isPersistent:pn}),t}var gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_n=hn(gn),vn=f({},gn,{view:0,detail:0}),yn=hn(vn),bn,xn,Sn,Cn=f({},vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pn,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!==Sn&&(Sn&&e.type===`mousemove`?(bn=e.screenX-Sn.screenX,xn=e.screenY-Sn.screenY):xn=bn=0,Sn=e),bn)},movementY:function(e){return`movementY`in e?e.movementY:xn}}),wn=hn(Cn),Tn=hn(f({},Cn,{dataTransfer:0})),En=hn(f({},vn,{relatedTarget:0})),Dn=hn(f({},gn,{animationName:0,elapsedTime:0,pseudoElement:0})),On=hn(f({},gn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),kn=hn(f({},gn,{data:0})),An={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},jn={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`},Mn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Nn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mn[e])?!!t[e]:!1}function Pn(){return Nn}var Fn=hn(f({},vn,{key:function(e){if(e.key){var t=An[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pn,charCode:function(e){return e.type===`keypress`?fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),In=hn(f({},Cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=hn(f({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pn})),Rn=hn(f({},gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=hn(f({},Cn,{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})),Bn=hn(f({},gn,{newState:0,oldState:0})),Vn=[9,13,27,32],Hn=an&&`CompositionEvent`in window,Un=null;an&&`documentMode`in document&&(Un=document.documentMode);var Wn=an&&`TextEvent`in window&&!Un,Gn=an&&(!Hn||Un&&8<Un&&11>=Un),Kn=` `,qn=!1;function Jn(e,t){switch(e){case`keyup`:return Vn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Yn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Xn=!1;function Zn(e,t){switch(e){case`compositionend`:return Yn(t);case`keypress`:return t.which===32?(qn=!0,Kn):null;case`textInput`:return e=t.data,e===Kn&&qn?null:e;default:return null}}function Qn(e,t){if(Xn)return e===`compositionend`||!Hn&&Jn(e,t)?(e=dn(),un=ln=cn=null,Xn=!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 Gn&&t.locale!==`ko`?null:t.data;default:return null}}var $n={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 er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!$n[e.type]:t===`textarea`}function tr(e,t,n,r){Qt?$t?$t.push(r):$t=[r]:Qt=r,t=Dd(t,`onChange`),0<t.length&&(n=new _n(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var nr=null,rr=null;function ir(e){yd(e,0)}function ar(e){if(jt(pt(e)))return e}function or(e,t){if(e===`change`)return t}var sr=!1;if(an){var cr;if(an){var lr=`oninput`in document;if(!lr){var ur=document.createElement(`div`);ur.setAttribute(`oninput`,`return;`),lr=typeof ur.oninput==`function`}cr=lr}else cr=!1;sr=cr&&(!document.documentMode||9<document.documentMode)}function dr(){nr&&(nr.detachEvent(`onpropertychange`,fr),rr=nr=null)}function fr(e){if(e.propertyName===`value`&&ar(rr)){var t=[];tr(t,rr,e,Zt(e)),nn(ir,t)}}function pr(e,t,n){e===`focusin`?(dr(),nr=t,rr=n,nr.attachEvent(`onpropertychange`,fr)):e===`focusout`&&dr()}function mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ar(rr)}function hr(e,t){if(e===`click`)return ar(t)}function gr(e,t){if(e===`input`||e===`change`)return ar(t)}function _r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var vr=typeof Object.is==`function`?Object.is:_r;function yr(e,t){if(vr(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(!_e.call(t,i)||!vr(e[i],t[i]))return!1}return!0}function br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xr(e,t){var n=br(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=br(n)}}function Sr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mt(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=Mt(e.document)}return t}function wr(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 Tr=an&&`documentMode`in document&&11>=document.documentMode,Er=null,Dr=null,Or=null,kr=!1;function Ar(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kr||Er==null||Er!==Mt(r)||(r=Er,`selectionStart`in r&&wr(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}),Or&&yr(Or,r)||(Or=r,r=Dd(Dr,`onSelect`),0<r.length&&(t=new _n(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Er)))}function jr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Mr={animationend:jr(`Animation`,`AnimationEnd`),animationiteration:jr(`Animation`,`AnimationIteration`),animationstart:jr(`Animation`,`AnimationStart`),transitionrun:jr(`Transition`,`TransitionRun`),transitionstart:jr(`Transition`,`TransitionStart`),transitioncancel:jr(`Transition`,`TransitionCancel`),transitionend:jr(`Transition`,`TransitionEnd`)},Nr={},Pr={};an&&(Pr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Mr.animationend.animation,delete Mr.animationiteration.animation,delete Mr.animationstart.animation),`TransitionEvent`in window||delete Mr.transitionend.transition);function Fr(e){if(Nr[e])return Nr[e];if(!Mr[e])return e;var t=Mr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Pr)return Nr[e]=t[n];return e}var Ir=Fr(`animationend`),Lr=Fr(`animationiteration`),Rr=Fr(`animationstart`),zr=Fr(`transitionrun`),Br=Fr(`transitionstart`),Vr=Fr(`transitioncancel`),Hr=Fr(`transitionend`),Ur=new Map,Wr=`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(` `);Wr.push(`scrollEnd`);function Gr(e,t){Ur.set(e,t),vt(t,[e])}var Kr=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)},qr=[],Jr=0,Yr=0;function Xr(){for(var e=Jr,t=Yr=Jr=0;t<e;){var n=qr[t];qr[t++]=null;var r=qr[t];qr[t++]=null;var i=qr[t];qr[t++]=null;var a=qr[t];if(qr[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&&ei(n,i,a)}}function Zr(e,t,n,r){qr[Jr++]=e,qr[Jr++]=t,qr[Jr++]=n,qr[Jr++]=r,Yr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Qr(e,t,n,r){return Zr(e,t,n,r),ti(e)}function $r(e,t){return Zr(e,null,null,t),ti(e)}function ei(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-Fe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ti(e){if(50<uu)throw uu=0,du=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ni={};function ri(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 ii(e,t,n,r){return new ri(e,t,n,r)}function ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oi(e,t){var n=e.alternate;return n===null?(n=ii(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 si(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 ci(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ai(e)&&(s=1);else if(typeof e==`string`)s=Gf(e,n,I.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=ii(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return li(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=ii(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=ii(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=ii(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ii(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function li(e,t,n,r){return e=ii(7,e,r,t),e.lanes=n,e}function ui(e,t,n){return e=ii(6,e,null,t),e.lanes=n,e}function di(e){var t=ii(18,null,null,0);return t.stateNode=e,t}function fi(e,t,n){return t=ii(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pi=new WeakMap;function mi(e,t){if(typeof e==`object`&&e){var n=pi.get(e);return n===void 0?(t={value:e,source:t,stack:ge(t)},pi.set(e,t),t):n}return{value:e,source:t,stack:ge(t)}}var hi=[],gi=0,_i=null,vi=0,yi=[],xi=0,Si=null,Ci=1,wi=``;function Ti(e,t){hi[gi++]=vi,hi[gi++]=_i,_i=e,vi=t}function Ei(e,t,n){yi[xi++]=Ci,yi[xi++]=wi,yi[xi++]=Si,Si=e;var r=Ci;e=wi;var i=32-Fe(r)-1;r&=~(1<<i),n+=1;var a=32-Fe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ci=1<<32-Fe(t)+i|n<<i|r,wi=a+e}else Ci=1<<a|n<<i|r,wi=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===_i;)_i=hi[--gi],hi[gi]=null,vi=hi[--gi],hi[gi]=null;for(;e===Si;)Si=yi[--xi],yi[xi]=null,wi=yi[--xi],yi[xi]=null,Ci=yi[--xi],yi[xi]=null}function ki(e,t){yi[xi++]=Ci,yi[xi++]=wi,yi[xi++]=Si,Ci=t.id,wi=t.overflow,Si=e}var Ai=null,ji=null,Mi=!1,Ni=null,Pi=!1,Fi=Error(i(519));function Ii(e){throw Hi(mi(Error(i(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[nt]=e,t[rt]=r,n){case`dialog`:bd(`cancel`,t),bd(`close`,t);break;case`iframe`:case`object`:case`embed`:bd(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)bd(_d[n],t);break;case`source`:bd(`error`,t);break;case`img`:case`image`:case`link`:bd(`error`,t),bd(`load`,t);break;case`details`:bd(`toggle`,t);break;case`input`:bd(`invalid`,t),It(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:bd(`invalid`,t);break;case`textarea`:bd(`invalid`,t),Bt(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||Nd(t.textContent,n)?(r.popover!=null&&(bd(`beforetoggle`,t),bd(`toggle`,t)),r.onScroll!=null&&bd(`scroll`,t),r.onScrollEnd!=null&&bd(`scrollend`,t),r.onClick!=null&&(t.onclick=Yt),t=!0):t=!1,t||Ii(e,!0)}function Ri(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:Ai=Ai.return}}function zi(e){if(e!==Ai)return!1;if(!Mi)return Ri(e),Mi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Gd(e.type,e.memoizedProps)),n=!n),n&&ji&&Ii(e),Ri(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=ff(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=ff(e)}else t===27?(t=ji,$d(e.type)?(e=df,df=null,ji=e):ji=t):ji=Ai?uf(e.stateNode.nextSibling):null;return!0}function Bi(){ji=Ai=null,Mi=!1}function Vi(){var e=Ni;return e!==null&&(Xl===null?Xl=e:Xl.push.apply(Xl,e),Ni=null),e}function Hi(e){Ni===null?Ni=[e]:Ni.push(e)}var Ui=re(null),Wi=null,Gi=null;function Ki(e,t,n){F(Ui,t._currentValue),t._currentValue=n}function qi(e){e._currentValue=Ui.current,ie(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 a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ji(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ji(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Xi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;vr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===L.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ep]:e.push(ep))}a=a.return}e!==null&&Yi(t,e,n,r),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!vr(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(i(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,oa={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sa(){return{controller:new na,data:new Map,refCount:0}}function ca(e){e.refCount--,e.refCount===0&&ra(ia,function(){e.controller.abort()})}var la=null,ua=0,da=0,fa=null;function pa(e,t){if(la===null){var n=la=[];ua=0,da=dd(),fa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ua++,t.then(ma,ma),t}function ma(){if(--ua===0&&la!==null){fa!==null&&(fa.status=`fulfilled`);var e=la;la=null,da=0,fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ha(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 ga=M.S;M.S=function(e,t){$l=Se(),typeof t==`object`&&t&&typeof t.then==`function`&&pa(e,t),ga!==null&&ga(e,t)};var _a=re(null);function va(){var e=_a.current;return e===null?Pl.pooledCache:e}function ya(e,t){t===null?F(_a,_a.current):F(_a,t.pool)}function ba(){var e=va();return e===null?null:{parent:oa._currentValue,pool:e}}var xa=Error(i(460)),Sa=Error(i(474)),Ca=Error(i(542)),wa={then:function(){}};function Ta(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ea(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Yt,Yt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Aa(e),e;default:if(typeof t.status==`string`)t.then(Yt,Yt);else{if(e=Pl,e!==null&&100<e.shellSuspendCounter)throw Error(i(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,Aa(e),e}throw Oa=t,xa}}function Da(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Oa=e,xa):e}}var Oa=null;function ka(){if(Oa===null)throw Error(i(459));var e=Oa;return Oa=null,e}function Aa(e){if(e===xa||e===Ca)throw Error(i(483))}var ja=null,Ma=0;function Na(e){var t=Ma;return Ma+=1,ja===null&&(ja=[]),Ea(ja,e,t)}function Pa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Fa(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ia(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 a(e,t){return e=oi(e,t),e.index=0,e.sibling=null,e}function o(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 s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ui(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&Da(i)===t.type)?(t=a(t,n.props),Pa(t,n),t.return=e,t):(t=ci(n.type,n.key,n.props,null,e.mode,r),Pa(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=fi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=li(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ui(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=ci(t.type,t.key,t.props,null,e.mode,n),Pa(n,t),n.return=e,n;case h:return t=fi(t,e.mode,n),t.return=e,t;case T:return t=Da(t),f(e,t,n)}if(j(t)||ee(t))return t=li(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Na(t),n);if(t.$$typeof===b)return f(e,ea(e,t),n);Fa(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 m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=Da(n),p(e,t,n,r)}if(j(n)||ee(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Na(n),r);if(n.$$typeof===b)return p(e,t,ea(e,n),r);Fa(e,n)}return null}function _(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 m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=Da(r),_(e,t,n,r,i)}if(j(r)||ee(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Na(r),i);if(r.$$typeof===b)return _(e,t,n,ea(t,r),i);Fa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Mi&&Ti(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Mi&&Ti(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Mi&&Ti(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Mi&&Ti(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Mi&&Ti(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Mi&&Ti(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Da(l)===r.type){n(e,r.sibling),c=a(r,o.props),Pa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=li(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ci(o.type,o.key,o.props,null,e.mode,c),Pa(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=fi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Da(o),x(e,r,o,c)}if(j(o))return v(e,r,o,c);if(ee(o)){if(l=ee(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Na(o),c);if(o.$$typeof===b)return x(e,r,ea(e,o),c);Fa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ui(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ma=0;var i=x(e,t,n,r);return ja=null,i}catch(t){if(t===xa||t===Ca)throw t;var a=ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var La=Ia(!0),Ra=Ia(!1),za=!1;function Ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Va(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 Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Nl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ti(e),ei(e,null,n),t}return Zr(e,r,t,n),ti(e)}function Wa(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,Ye(e,n)}}function Ga(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 Ka=!1;function qa(){if(Ka){var e=fa;if(e!==null)throw e}}function Ja(e,t,n,r){Ka=!1;var i=e.updateQueue;za=!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 p=s.lane&-536870913,m=p!==s.lane;if(m?(Il&p)===p:(r&p)===p){p!==0&&p===da&&(Ka=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:za=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,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),Wl|=o,e.lanes=o,e.memoizedState=d}}function Ya(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Xa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ya(n[e],t)}var Za=re(null),Qa=re(0);function $a(e,t){e=Hl,F(Qa,e),F(Za,t),Hl=e|t.baseLanes}function eo(){F(Qa,Hl),F(Za,Za.current)}function to(){Hl=Qa.current,ie(Za),ie(Qa)}var V=re(null),no=null;function H(e){var t=e.alternate;F(oo,oo.current&1),F(V,e),no===null&&(t===null||Za.current!==null||t.memoizedState!==null)&&(no=e)}function ro(e){F(oo,oo.current),F(V,e),no===null&&(no=e)}function U(e){e.tag===22?(F(oo,oo.current),F(V,e),no===null&&(no=e)):io(e)}function io(){F(oo,oo.current),F(V,V.current)}function ao(e){ie(V),no===e&&(no=null),ie(oo)}var oo=re(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||sf(n)||cf(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,lo=null,G=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,K=0;function _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vr(e[n],t[n]))return!1;return!0}function q(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?Ns:Ps,po=!1,a=n(r,i),po=!1,fo&&(a=bo(t,n,r,i)),yo(e),a}function yo(e){M.H=Y;var t=lo!==null&&lo.next!==null;if(co=0,G=lo=W=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||Xs||(e=e.dependencies,e!==null&&Zi(e)&&(Xs=!0))}function bo(e,t,n,r){W=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,G=lo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=Fs,o=t(n,r)}while(fo);return o}function xo(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?Oo(t):t,e=e.useState()[0],(lo===null?null:lo.memoizedState)!==e&&(W.flags|=1024),t}function So(){var e=mo!==0;return mo=0,e}function Co(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function wo(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,G=lo=W=null,fo=!1,ho=mo=0,go=null}function To(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return G===null?W.memoizedState=G=e:G=G.next=e,G}function Eo(){if(lo===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=lo.next;var t=G===null?W.memoizedState:G.next;if(t!==null)G=t,lo=e;else{if(e===null)throw W.alternate===null?Error(i(467)):Error(i(310));lo=e,e={memoizedState:lo.memoizedState,baseState:lo.baseState,baseQueue:lo.baseQueue,queue:lo.queue,next:null},G===null?W.memoizedState=G=e:G=G.next=e}return G}function Do(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oo(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Ea(go,e,t),t=W,(G===null?t.memoizedState:G.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Ns:Ps),e}function ko(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Oo(e);if(e.$$typeof===b)return $i(e)}throw Error(i(438,String(e)))}function Ao(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=Do(),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]=D;return t.index++,n}function jo(e,t){return typeof t==`function`?t(e):t}function Mo(e){return No(Eo(),lo,e)}function No(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(co&f)===f:(Il&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===da&&(d=!0);else if((co&p)===p){u=u.next,p===da&&(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,s=o):l=l.next=f,W.lanes|=p,Wl|=p;f=u.action,po&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,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,s=o):l=l.next=p,W.lanes|=f,Wl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!vr(o,e.memoizedState)&&(Xs=!0,d&&(n=fa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Po(e){var t=Eo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);vr(o,t.memoizedState)||(Xs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Fo(e,t,n){var r=W,a=Eo(),o=Mi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!vr((lo||a).memoizedState,n);if(s&&(a.memoizedState=n,Xs=!0),a=a.queue,os(Ro.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||G!==null&&G.memoizedState.tag&1){if(r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,a,n,t),null),Pl===null)throw Error(i(349));o||co&127||Io(r,t,n)}return n}function Io(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=Do(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Lo(e,t,n,r){t.value=n,t.getSnapshot=r,zo(t)&&Bo(e)}function Ro(e,t,n){return n(function(){zo(t)&&Bo(e)})}function zo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vr(e,n)}catch{return!0}}function Bo(e){var t=$r(e,2);t!==null&&mu(t,e,2)}function Vo(e){var t=To();if(typeof e==`function`){var n=e;if(e=n(),po){Ne(!0);try{n()}finally{Ne(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:e},t}function Ho(e,t,n,r){return e.baseState=n,No(e,lo,typeof r==`function`?r:jo)}function Uo(e,t,n,r,a){if(js(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Wo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Wo(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),Go(e,t,s)}catch(n){qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Go(e,t,a)}catch(n){qo(e,t,n)}}function Go(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ko(e,t,n)},function(n){return qo(e,t,n)}):Ko(e,t,n)}function Ko(e,t,n){t.status=`fulfilled`,t.value=n,Jo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Wo(e,n)))}function qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Jo(t),t=t.next;while(t!==r)}e.action=null}function Jo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Yo(e,t){return t}function Xo(e,t){if(Mi){var n=Pl.formState;if(n!==null){a:{var r=W;if(Mi){if(ji){b:{for(var i=ji,a=Pi;i.nodeType!==8;){if(!a){i=null;break b}if(i=uf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=uf(i.nextSibling),r=i.data===`F!`;break a}}Ii(r)}r=!1}r&&(t=n[0])}}return n=To(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:t},n.queue=r,n=Os.bind(null,W,r),r.dispatch=n,r=Vo(!1),a=As.bind(null,W,!1,r.queue),r=To(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Uo.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Zo(e){return Qo(Eo(),lo,e)}function Qo(e,t,n){if(t=No(e,t,Yo)[0],e=Mo(jo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Oo(t)}catch(e){throw e===xa?Ca:e}else r=t;t=Eo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,ts(9,{destroy:void 0},$o.bind(null,i,n),null)),[r,a,e]}function $o(e,t){e.action=t}function es(e){var t=Eo(),n=lo;if(n!==null)return Qo(t,n,e);Eo(),t=t.memoizedState,n=Eo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ts(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=Do(),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 ns(){return Eo().memoizedState}function rs(e,t,n,r){var i=To();W.flags|=e,i.memoizedState=ts(1|t,{destroy:void 0},n,r===void 0?null:r)}function is(e,t,n,r){var i=Eo();r=r===void 0?null:r;var a=i.memoizedState.inst;lo!==null&&r!==null&&vo(r,lo.memoizedState.deps)?i.memoizedState=ts(t,a,n,r):(W.flags|=e,i.memoizedState=ts(1|t,a,n,r))}function as(e,t){rs(8390656,8,e,t)}function os(e,t){is(2048,8,e,t)}function ss(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=Do(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function cs(e){var t=Eo().memoizedState;return ss({ref:t,nextImpl:e}),function(){if(Nl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ls(e,t){return is(4,2,e,t)}function us(e,t){return is(4,4,e,t)}function ds(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 fs(e,t,n){n=n==null?null:n.concat([e]),is(4,4,ds.bind(null,t,e),n)}function ps(){}function ms(e,t){var n=Eo();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 hs(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),po){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r}function gs(e,t,n){return n===void 0||co&1073741824&&!(Il&261930)?e.memoizedState=t:(e.memoizedState=n,e=pu(),W.lanes|=e,Wl|=e,n)}function _s(e,t,n,r){return vr(n,t)?n:Za.current===null?!(co&42)||co&1073741824&&!(Il&261930)?(Xs=!0,e.memoizedState=n):(e=pu(),W.lanes|=e,Wl|=e,t):(e=gs(e,n,r),vr(e,t)||(Xs=!0),e)}function vs(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,As(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ks(e,t,ha(c,r),fu(e)):ks(e,t,r,fu(e))}catch(n){ks(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=xs(e).queue;vs(e,a,t,te,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},fu())}function Cs(){return $i(ep)}function ws(){return Eo().memoizedState}function Ts(){return Eo().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Ha(n);var r=Ua(t,e,n);r!==null&&(mu(r,t,n),Wa(r,t,n)),t={cache:sa()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=Qr(e,t,n,r),n!==null&&(mu(n,e,r),J(n,t,r)))}function Os(e,t,n){ks(e,t,n,fu())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(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,vr(s,o))return Zr(e,t,i,0),Pl===null&&Xr(),!1}catch{}if(n=Qr(e,t,i,r),n!==null)return mu(n,e,r),J(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(i(479))}else t=Qr(e,n,r,2),t!==null&&mu(t,e,2)}function js(e){var t=e.alternate;return e===W||t!==null&&t===W}function Ms(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 J(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}var Y={readContext:$i,use:ko,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Y.useEffectEvent=_o;var Ns={readContext:$i,use:ko,useCallback:function(e,t){return To().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:as,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),rs(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=To();t=t===void 0?null:t;var r=e();if(po){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=To();if(n!==void 0){var i=n(t);if(po){Ne(!0);try{n(t)}finally{Ne(!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=Ds.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=To();return e={current:e},t.memoizedState=e},useState:function(e){e=Vo(e);var t=e.queue,n=Os.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(To(),e,t)},useTransition:function(){var e=Vo(!1);return e=vs.bind(null,W,e.queue,!0,!1),To().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,a=To();if(Mi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Pl===null)throw Error(i(349));Il&127||Io(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,as(Ro.bind(null,r,o,e),[e]),r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,o,n,t),null),n},useId:function(){var e=To(),t=Pl.identifierPrefix;if(Mi){var n=wi,r=Ci;n=(r&~(1<<32-Fe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=K++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Cs,useFormState:Xo,useActionState:Xo,useOptimistic:function(e){var t=To();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=As.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ao,useCacheRefresh:function(){return To().memoizedState=Es.bind(null,W)},useEffectEvent:function(e){var t=To(),n={impl:e};return t.memoizedState=n,function(){if(Nl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ps={readContext:$i,use:ko,useCallback:ms,useContext:$i,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Mo,useRef:ns,useState:function(){return Mo(jo)},useDebugValue:ps,useDeferredValue:function(e,t){return _s(Eo(),lo.memoizedState,e,t)},useTransition:function(){var e=Mo(jo)[0],t=Eo().memoizedState;return[typeof e==`boolean`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){return Ho(Eo(),lo,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Ps.useEffectEvent=cs;var Fs={readContext:$i,use:ko,useCallback:ms,useContext:$i,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Po,useRef:ns,useState:function(){return Po(jo)},useDebugValue:ps,useDeferredValue:function(e,t){var n=Eo();return lo===null?gs(n,e,t):_s(n,lo.memoizedState,e,t)},useTransition:function(){var e=Po(jo)[0],t=Eo().memoizedState;return[typeof e==`boolean`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:es,useActionState:es,useOptimistic:function(e,t){var n=Eo();return lo===null?(n.baseState=e,[e,n.queue.dispatch]):Ho(n,lo,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Fs.useEffectEvent=cs;function Is(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var X={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Ha(r);i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(mu(t,e,r),Wa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Ha(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(mu(t,e,r),Wa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fu(),r=Ha(n);r.tag=2,t!=null&&(r.callback=t),t=Ua(e,r,n),t!==null&&(mu(t,e,n),Wa(t,e,n))}};function Ls(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?!yr(n,r)||!yr(i,a):!0}function Rs(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&&X.enqueueReplaceState(t,t.state,null)}function zs(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=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Bs(e){Kr(e)}function Vs(e){console.error(e)}function Hs(e){Kr(e)}function Us(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ws(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 Gs(e,t,n){return n=Ha(n),n.tag=3,n.payload={element:null},n.callback=function(){Us(e,t)},n}function Ks(e){return e=Ha(e),e.tag=3,e}function qs(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(){Ws(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ws(t,n,r),typeof i!=`function`&&(nu===null?nu=new Set([this]):nu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Js(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Xi(t,n,a,!0),n=V.current,n!==null){switch(n.tag){case 31:case 13:return no===null?Eu():n.alternate===null&&Ul===0&&(Ul=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===wa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===wa?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,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Eu(),!1}if(Mi)return t=V.current,t===null?(r!==Fi&&(t=Error(i(423),{cause:r}),Hi(mi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=mi(r,n),a=Gs(e.stateNode,r,a),Ga(e,a),Ul!==4&&(Ul=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Fi&&(e=Error(i(422),{cause:r}),Hi(mi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=mi(o,n),Yl===null?Yl=[o]:Yl.push(o),Ul!==4&&(Ul=2),t===null)return!0;r=mi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Gs(n.stateNode,r,e),Ga(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(nu===null||!nu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ks(a),qs(a,e,n,r),Ga(n,a),!1}n=n.return}while(n!==null);return!1}var Ys=Error(i(461)),Xs=!1;function Zs(e,t,n,r){t.child=e===null?Ra(t,null,n,r):La(t,e.child,n,r)}function Qs(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=q(e,t,n,o,a,i),s=So(),e!==null&&!Xs?(Co(e,t,i),Sc(e,t,i)):(Mi&&s&&Di(t),t.flags|=1,Zs(e,t,r,i),t.child)}function $s(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ec(e,t,a,r,i)):(e=ci(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?yr:n,n(o,r)&&e.ref===t.ref)return Sc(e,t,i)}return t.flags|=1,e=oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function ec(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(yr(a,r)&&e.ref===t.ref)if(Xs=!1,t.pendingProps=r=a,Cc(e,i))e.flags&131072&&(Xs=!0);else return t.lanes=e.lanes,Sc(e,t,i)}return cc(e,t,n,r,i)}function tc(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 rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ya(t,a===null?null:a.cachePool),a===null?eo():$a(t,a),U(t);else return r=t.lanes=536870912,rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ya(t,null),eo(),io(t)):(ya(t,a.cachePool),$a(t,a),io(t),t.memoizedState=null);return Zs(e,t,i,n),t.child}function nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rc(e,t,n,r,i){var a=va();return a=a===null?null:{parent:oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ya(t,null),eo(),U(t),e!==null&&Xi(e,t,r,!0),t.childLanes=i,null}function ic(e,t){return t=_c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ac(e,t,n){return La(t,e.child,null,n),e=ic(t,t.pendingProps),e.flags|=2,ao(t),t.memoizedState=null,e}function oc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Mi){if(r.mode===`hidden`)return e=ic(t,r),t.lanes=536870912,nc(null,e);if(ro(t),(e=ji)?(e=of(e,Pi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=di(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return t.lanes=536870912,null}return ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ro(t),a)if(t.flags&256)t.flags&=-257,t=ac(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Xs||Xi(e,t,n,!1),a=(n&e.childLanes)!==0,Xs||a){if(r=Pl,r!==null&&(s=Xe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,$r(e,s),mu(r,e,s),Ys;Eu(),t=ac(e,t,n)}else e=o.treeContext,ji=uf(s.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=ic(t,r),t.flags|=4096;return t}return e=oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sc(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(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function cc(e,t,n,r,i){return Qi(t),n=q(e,t,n,r,void 0,i),r=So(),e!==null&&!Xs?(Co(e,t,i),Sc(e,t,i)):(Mi&&r&&Di(t),t.flags|=1,Zs(e,t,n,i),t.child)}function lc(e,t,n,r,i,a){return Qi(t),t.updateQueue=null,n=bo(t,r,n,i),yo(e),r=So(),e!==null&&!Xs?(Co(e,t,a),Sc(e,t,a)):(Mi&&r&&Di(t),t.flags|=1,Zs(e,t,n,a),t.child)}function uc(e,t,n,r,i){if(Qi(t),t.stateNode===null){var a=ni,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=X,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ba(t),o=n.contextType,a.context=typeof o==`object`&&o?$i(o):ni,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Is(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&&X.enqueueReplaceState(a,a.state,null),Ja(t,r,a,i),qa(),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=zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ni,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)&&Rs(t,a,r,o),za=!1;var f=t.memoizedState;a.state=f,Ja(t,r,a,i),qa(),l=t.memoizedState,s||f!==l||za?(typeof d==`function`&&(Is(t,n,d,r),l=t.memoizedState),(c=za||Ls(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,Va(e,t),o=t.memoizedProps,u=zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ni,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)&&Rs(t,a,r,c),za=!1,f=t.memoizedState,a.state=f,Ja(t,r,a,i),qa();var p=t.memoizedState;o!==d||f!==p||za||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof s==`function`&&(Is(t,n,s,r),p=t.memoizedState),(u=za||Ls(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,sc(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=La(t,e.child,null,i),t.child=La(t,null,n,i)):Zs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Sc(e,t,i),e}function dc(e,t,n,r){return Bi(),t.flags|=256,Zs(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pc(e){return{baseLanes:e,cachePool:ba()}}function mc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ql),e}function hc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(oo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Mi){if(a?H(t):io(t),(e=ji)?(e=of(e,Pi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=di(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return cf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(io(t),a=t.mode,c=_c({mode:`hidden`,children:c},a),r=li(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(null,r)):(H(t),gc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(H(t),t.flags&=-257,t=vc(e,t,n)):t.memoizedState===null?(io(t),c=r.fallback,a=t.mode,r=_c({mode:`visible`,children:r.children},a),c=li(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,La(t,e.child,null,n),r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,t=nc(null,r)):(io(t),t.child=e.child,t.flags|=128,t=null);else if(H(t),cf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Hi({value:r,source:null,stack:null}),t=vc(e,t,n)}else if(Xs||Xi(e,t,n,!1),s=(n&e.childLanes)!==0,Xs||s){if(s=Pl,s!==null&&(r=Xe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,$r(e,r),mu(s,e,r),Ys;sf(c)||Eu(),t=vc(e,t,n)}else sf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=uf(c.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=gc(t,r.children),t.flags|=4096);return t}return a?(io(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=oi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=li(c,a,n,null),c.flags|=2):c=oi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,nc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=pc(n):(a=c.cachePool,a===null?a=ba():(l=oa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(e.child,r)):(H(t),n=e.child,e=n.sibling,n=oi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function gc(e,t){return t=_c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function _c(e,t){return e=ii(22,e,null,t),e.lanes=0,e}function vc(e,t,n){return La(t,e.child,null,n),e=gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ji(e.return,t,n)}function bc(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 xc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=oo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,F(oo,o),Zs(e,t,r,n),r=Mi?vi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yc(e,n,t);else if(e.tag===19)yc(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),bc(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}bc(t,!0,n,null,a,r);break;case`together`:bc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Sc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wl|=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(i(153));if(t.child!==null){for(e=t.child,n=oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Zi(e))):!0}function wc(e,t,n){switch(t.tag){case 3:R(t,t.stateNode.containerInfo),Ki(t,oa,e.memoizedState.cache),Bi();break;case 27:case 5:ce(t);break;case 4:R(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?(H(t),e=Sc(e,t,n),e===null?null:e.sibling):hc(e,t,n):(H(t),t.flags|=128,null);H(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 xc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),F(oo,oo.current),r)break;return null;case 22:return t.lanes=0,tc(e,t,n,t.pendingProps);case 24:Ki(t,oa,e.memoizedState.cache)}return Sc(e,t,n)}function Tc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xs=!0;else{if(!Cc(e,n)&&!(t.flags&128))return Xs=!1,wc(e,t,n);Xs=!!(e.flags&131072)}else Xs=!1,Mi&&t.flags&1048576&&Ei(t,vi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Da(t.elementType),t.type=e,typeof e==`function`)ai(e)?(r=zs(e,r),t.tag=1,t=uc(null,t,e,r,n)):(t.tag=0,t=cc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=Qs(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=$s(null,t,e,r,n);break a}}throw t=A(e)||e,Error(i(306,t,``))}}return t;case 0:return cc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=zs(r,t.pendingProps),uc(e,t,r,a,n);case 3:a:{if(R(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Va(e,t),Ja(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ki(t,oa,r),r!==o.cache&&Yi(t,[oa],n,!0),qa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=dc(e,t,r,n);break a}else if(r!==a){a=mi(Error(i(424)),t),Hi(a),t=dc(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(ji=uf(e.firstChild),Ai=t,Mi=!0,Ni=null,Pi=!0,n=Ra(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Bi(),r===a){t=Sc(e,t,n);break a}Zs(e,t,r,n)}t=t.child}return t;case 26:return sc(e,t),e===null?(n=jf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Mi||(n=t.type,e=t.pendingProps,r=Hd(oe.current).createElement(n),r[nt]=t,r[rt]=e,Id(r,n,e),ht(r),t.stateNode=r):t.memoizedState=jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ce(t),e===null&&Mi&&(r=t.stateNode=mf(t.type,t.pendingProps,oe.current),Ai=t,Pi=!0,a=ji,$d(t.type)?(df=a,ji=uf(r.firstChild)):ji=a),Zs(e,t,t.pendingProps.children,n),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Mi&&((a=r=ji)&&(r=rf(r,t.type,t.pendingProps,Pi),r===null?a=!1:(t.stateNode=r,Ai=t,ji=uf(r.firstChild),Pi=!1,a=!0)),a||Ii(t)),ce(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Gd(a,o)?r=null:s!==null&&Gd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=q(e,t,xo,null,null,n),ep._currentValue=a),sc(e,t),Zs(e,t,r,n),t.child;case 6:return e===null&&Mi&&((e=n=ji)&&(n=af(n,t.pendingProps,Pi),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Ii(t)),null;case 13:return hc(e,t,n);case 4:return R(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=La(t,null,r,n):Zs(e,t,r,n),t.child;case 11:return Qs(e,t,t.type,t.pendingProps,n);case 7:return Zs(e,t,t.pendingProps,n),t.child;case 8:return Zs(e,t,t.pendingProps.children,n),t.child;case 12:return Zs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ki(t,t.type,r.value),Zs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Qi(t),a=$i(a),r=r(a),t.flags|=1,Zs(e,t,r,n),t.child;case 14:return $s(e,t,t.type,t.pendingProps,n);case 15:return ec(e,t,t.type,t.pendingProps,n);case 19:return xc(e,t,n);case 31:return oc(e,t,n);case 22:return tc(e,t,n,t.pendingProps);case 24:return Qi(t),r=$i(oa),e===null?(a=va(),a===null&&(a=Pl,o=sa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ba(t),Ki(t,oa,a)):((e.lanes&n)!==0&&(Va(e,t),Ja(t,null,null,n),qa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ki(t,oa,r),r!==a.cache&&Yi(t,[oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ki(t,oa,r))),Zs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ec(e){e.flags|=4}function Dc(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(Cu())e.flags|=8192;else throw Oa=wa,Sa}else e.flags&=-16777217}function Oc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Kf(t))if(Cu())e.flags|=8192;else throw Oa=wa,Sa}function kc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:We(),e.lanes|=t,Jl|=t)}function Ac(e,t){if(!Mi)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 jc(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 Mc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jc(t),null;case 1:return jc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),qi(oa),se(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zi(t)?Ec(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vi())),jc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ec(t),o===null?(jc(t),Dc(t,a,null,r,n)):(jc(t),Oc(t,o))):o?o===e.memoizedState?(jc(t),t.flags&=-16777217):(Ec(t),jc(t),Oc(t,o)):(e=e.memoizedProps,e!==r&&Ec(t),jc(t),Dc(t,a,e,r,n)),null;case 27:if(le(t),n=oe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}e=I.current,zi(t)?Li(t,e):(e=mf(a,r,n),t.stateNode=e,Ec(t))}return jc(t),null;case 5:if(le(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}if(o=I.current,zi(t))Li(t,o);else{var s=Hd(oe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[nt]=t,o[rt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Id(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ec(t)}}return jc(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=oe.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ai,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Nd(e.nodeValue,n)),e||Ii(t,!0)}else e=Hd(e).createTextNode(r),e[nt]=t,t.stateNode=e}return jc(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(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[nt]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(i(558))}return jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[nt]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),a=!1}else a=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),kc(t,t.updateQueue),jc(t),null);case 4:return se(),e===null&&Cd(t.stateNode.containerInfo),jc(t),null;case 10:return qi(t.type),jc(t),null;case 19:if(ie(oo),r=t.memoizedState,r===null)return jc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ac(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Ac(r,!1),e=o.updateQueue,t.updateQueue=e,kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)si(n,e),n=n.sibling;return F(oo,oo.current&1|2),Mi&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Se()>eu&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304)}else{if(!a)if(e=so(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,kc(t,e),Ac(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Mi)return jc(t),null}else 2*Se()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Se(),e.sibling=null,n=oo.current,F(oo,a?n&1|2:n&1),Mi&&Ti(t,r.treeForkCount),e);case 22:case 23:return ao(t),to(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(jc(t),t.subtreeFlags&6&&(t.flags|=8192)):jc(t),n=t.updateQueue,n!==null&&kc(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&&ie(_a),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(oa),jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Nc(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(oa),se(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return le(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ie(oo),null;case 4:return se(),null;case 10:return qi(t.type),null;case 22:case 23:return ao(t),to(),e!==null&&ie(_a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(oa),null;case 25:return null;default:return null}}function Pc(e,t){switch(Oi(t),t.tag){case 3:qi(oa),se();break;case 26:case 27:case 5:le(t);break;case 4:se();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:ie(oo);break;case 10:qi(t.type);break;case 22:case 23:ao(t),to(),e!==null&&ie(_a);break;case 24:qi(oa)}}function Fc(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){Wu(t,t.return,e)}}function Ic(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){Wu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Wu(t,t.return,e)}}function Lc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xa(t,n)}catch(t){Wu(e,e.return,t)}}}function Rc(e,t,n){n.props=zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Wu(e,t,n)}}function zc(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){Wu(e,t,n)}}function Bc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Wu(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){Wu(e,t,n)}else n.current=null}function Vc(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){Wu(e,e.return,t)}}function Hc(e,t,n){try{var r=e.stateNode;Ld(r,e.type,n,t),r[rt]=t}catch(t){Wu(e,e.return,t)}}function Uc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$d(e.type)||e.tag===4}function Wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(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&&$d(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 Gc(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=Yt));else if(r!==4&&(r===27&&$d(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(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&&$d(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Id(t,r,n),t[nt]=e,t[rt]=n}catch(t){Wu(e,e.return,t)}}var Z=!1,Jc=!1,Yc=!1,Xc=typeof WeakSet==`function`?WeakSet:Set,Zc=null;function Qc(e,t){if(e=e.containerInfo,Bd=lp,e=Cr(e),wr(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 a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(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(Vd={focusedElem:e,selectionRange:n},lp=!1,Zc=t;Zc!==null;)if(t=Zc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Zc=e;else for(;Zc!==null;){switch(t=Zc,o=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++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=zs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Wu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)nf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:nf(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(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Zc=e;break}Zc=t.return}}function $c(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ml(e,n),r&4&&Fc(5,n);break;case 1:if(ml(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Wu(n,n.return,e)}else{var i=zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Wu(n,n.return,e)}}r&64&&Lc(n),r&512&&zc(n,n.return);break;case 3:if(ml(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{Xa(e,t)}catch(e){Wu(n,n.return,e)}}break;case 27:t===null&&r&4&&qc(n);case 26:case 5:ml(e,n),t===null&&r&4&&Vc(n),r&512&&zc(n,n.return);break;case 12:ml(e,n);break;case 31:ml(e,n),r&4&&al(e,n);break;case 13:ml(e,n),r&4&&ol(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),lf(e,n))));break;case 22:if(r=n.memoizedState!==null||Z,!r){t=t!==null&&t.memoizedState!==null||Jc,i=Z;var a=Jc;Z=r,(Jc=t)&&!a?gl(e,n,(n.subtreeFlags&8772)!=0):ml(e,n),Z=i,Jc=a}break;case 30:break;default:ml(e,n)}}function el(e){var t=e.alternate;t!==null&&(e.alternate=null,el(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ut(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 tl=null,nl=!1;function rl(e,t,n){for(n=n.child;n!==null;)il(e,t,n),n=n.sibling}function il(e,t,n){if(Me&&typeof Me.onCommitFiberUnmount==`function`)try{Me.onCommitFiberUnmount(je,n)}catch{}switch(n.tag){case 26:Jc||Bc(n,t),rl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Jc||Bc(n,t);var r=tl,i=nl;$d(n.type)&&(tl=n.stateNode,nl=!1),rl(e,t,n),hf(n.stateNode),tl=r,nl=i;break;case 5:Jc||Bc(n,t);case 6:if(r=tl,i=nl,tl=null,rl(e,t,n),tl=r,nl=i,tl!==null)if(nl)try{(tl.nodeType===9?tl.body:tl.nodeName===`HTML`?tl.ownerDocument.body:tl).removeChild(n.stateNode)}catch(e){Wu(n,t,e)}else try{tl.removeChild(n.stateNode)}catch(e){Wu(n,t,e)}break;case 18:tl!==null&&(nl?(e=tl,ef(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Fp(e)):ef(tl,n.stateNode));break;case 4:r=tl,i=nl,tl=n.stateNode.containerInfo,nl=!0,rl(e,t,n),tl=r,nl=i;break;case 0:case 11:case 14:case 15:Ic(2,n,t),Jc||Ic(4,n,t),rl(e,t,n);break;case 1:Jc||(Bc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Rc(n,t,r)),rl(e,t,n);break;case 21:rl(e,t,n);break;case 22:Jc=(r=Jc)||n.memoizedState!==null,rl(e,t,n),Jc=r;break;default:rl(e,t,n)}}function al(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fp(e)}catch(e){Wu(t,t.return,e)}}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fp(e)}catch(e){Wu(t,t.return,e)}}function sl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Xc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Xc),t;default:throw Error(i(435,e.tag))}}function cl(e,t){var n=sl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function ll(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if($d(c.type)){tl=c.stateNode,nl=!1;break a}break;case 5:tl=c.stateNode,nl=!1;break a;case 3:case 4:tl=c.stateNode.containerInfo,nl=!0;break a}c=c.return}if(tl===null)throw Error(i(160));il(o,s,a),tl=null,nl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)dl(t,e),t=t.sibling}var ul=null;function dl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ll(t,e),fl(e),r&4&&(Ic(3,e,e.return),Fc(3,e),Ic(5,e,e.return));break;case 1:ll(t,e),fl(e),r&512&&(Jc||n===null||Bc(n,n.return)),r&64&&Z&&(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 a=ul;if(ll(t,e),fl(e),r&512&&(Jc||n===null||Bc(n,n.return)),r&4){var o=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,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[lt]||o[nt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Id(o,r,n),o[nt]=e,ht(o),r=o;break a;case`link`:var s=Uf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Uf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[nt]=e,ht(o),r=o}e.stateNode=r}else Wf(a,e.type,e.stateNode);else e.stateNode=Rf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Hc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Wf(a,e.type,e.stateNode):Rf(a,r,e.memoizedProps))}break;case 27:ll(t,e),fl(e),r&512&&(Jc||n===null||Bc(n,n.return)),n!==null&&r&4&&Hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ll(t,e),fl(e),r&512&&(Jc||n===null||Bc(n,n.return)),e.flags&32){a=e.stateNode;try{Vt(a,``)}catch(t){Wu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Hc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Yc=!0);break;case 6:if(ll(t,e),fl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Wu(e,e.return,t)}}break;case 3:if(Hf=null,a=ul,ul=vf(t.containerInfo),ll(t,e),ul=a,fl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fp(t.containerInfo)}catch(t){Wu(e,e.return,t)}Yc&&(Yc=!1,pl(e));break;case 4:r=ul,ul=vf(e.stateNode.containerInfo),ll(t,e),fl(e),ul=r;break;case 12:ll(t,e),fl(e);break;case 31:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 13:ll(t,e),fl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ql=Se()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Z,d=Jc;if(Z=u||a,Jc=d||l,ll(t,e),Jc=d,Z=u,fl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Z||Jc||hl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.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){Wu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Wu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?tf(m,!0):tf(l.stateNode,!1)}catch(e){Wu(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,cl(e,n))));break;case 19:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 30:break;case 21:break;default:ll(t,e),fl(e)}}function fl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Uc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Kc(e,Wc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Vt(o,``),n.flags&=-33),Kc(e,Wc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Gc(e,Wc(e),s);break;default:throw Error(i(161))}}catch(t){Wu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;pl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ml(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)$c(e,t.alternate,t),t=t.sibling}function hl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ic(4,t,t.return),hl(t);break;case 1:Bc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Rc(t,t.return,n),hl(t);break;case 27:hf(t.stateNode);case 26:case 5:Bc(t,t.return),hl(t);break;case 22:t.memoizedState===null&&hl(t);break;case 30:hl(t);break;default:hl(t)}e=e.sibling}}function gl(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:gl(i,a,n),Fc(4,a);break;case 1:if(gl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Wu(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++)Ya(c[i],s)}catch(e){Wu(r,r.return,e)}}n&&o&64&&Lc(a),zc(a,a.return);break;case 27:qc(a);case 26:case 5:gl(i,a,n),n&&r===null&&o&4&&Vc(a),zc(a,a.return);break;case 12:gl(i,a,n);break;case 31:gl(i,a,n),n&&o&4&&al(i,a);break;case 13:gl(i,a,n),n&&o&4&&ol(i,a);break;case 22:a.memoizedState===null&&gl(i,a,n),zc(a,a.return);break;case 30:break;default:gl(i,a,n)}t=t.sibling}}function _l(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&&ca(n))}function vl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ca(e))}function yl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bl(e,t,n,r),t=t.sibling}function bl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:yl(e,t,n,r),i&2048&&Fc(9,t);break;case 1:yl(e,t,n,r);break;case 3:yl(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&&ca(e)));break;case 12:if(i&2048){yl(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){Wu(t,t.return,e)}}else yl(e,t,n,r);break;case 31:yl(e,t,n,r);break;case 13:yl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?yl(e,t,n,r):(a._visibility|=2,xl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?yl(e,t,n,r):Sl(e,t),i&2048&&_l(o,t);break;case 24:yl(e,t,n,r),i&2048&&vl(t.alternate,t);break;default:yl(e,t,n,r)}}function xl(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:xl(a,o,s,c,i),Fc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,xl(a,o,s,c,i)):u._visibility&2?xl(a,o,s,c,i):Sl(a,o),i&&l&2048&&_l(o.alternate,o);break;case 24:xl(a,o,s,c,i),i&&l&2048&&vl(o.alternate,o);break;default:xl(a,o,s,c,i)}t=t.sibling}}function Sl(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:Sl(n,r),i&2048&&_l(r.alternate,r);break;case 24:Sl(n,r),i&2048&&vl(r.alternate,r);break;default:Sl(n,r)}t=t.sibling}}var Cl=8192;function wl(e,t,n){if(e.subtreeFlags&Cl)for(e=e.child;e!==null;)Tl(e,t,n),e=e.sibling}function Tl(e,t,n){switch(e.tag){case 26:wl(e,t,n),e.flags&Cl&&e.memoizedState!==null&&qf(n,ul,e.memoizedState,e.memoizedProps);break;case 5:wl(e,t,n);break;case 3:case 4:var r=ul;ul=vf(e.stateNode.containerInfo),wl(e,t,n),ul=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Cl,Cl=16777216,wl(e,t,n),Cl=r):wl(e,t,n));break;default:wl(e,t,n)}}function El(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 Dl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zc=r,Al(r,e)}El(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ol(e),e=e.sibling}function Ol(e){switch(e.tag){case 0:case 11:case 15:Dl(e),e.flags&2048&&Ic(9,e,e.return);break;case 3:Dl(e);break;case 12:Dl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,kl(e)):Dl(e);break;default:Dl(e)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zc=r,Al(r,e)}El(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ic(8,t,t.return),kl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,kl(t));break;default:kl(t)}e=e.sibling}}function Al(e,t){for(;Zc!==null;){var n=Zc;switch(n.tag){case 0:case 11:case 15:Ic(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:ca(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Zc=r;else a:for(n=e;Zc!==null;){r=Zc;var i=r.sibling,a=r.return;if(el(r),r===n){Zc=null;break a}if(i!==null){i.return=a,Zc=i;break a}Zc=a}}}var jl={getCacheForType:function(e){var t=$i(oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return $i(oa).controller.signal}},Ml=typeof WeakMap==`function`?WeakMap:Map,Nl=0,Pl=null,Fl=null,Il=0,Ll=0,Rl=null,zl=!1,Bl=!1,Vl=!1,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=null,Xl=null,Zl=!1,Ql=0,$l=0,eu=1/0,tu=null,nu=null,ru=0,iu=null,au=null,ou=0,su=0,cu=null,lu=null,uu=0,du=null;function fu(){return Nl&2&&Il!==0?Il&-Il:M.T===null?$e():dd()}function pu(){if(ql===0)if(!(Il&536870912)||Mi){var e=Re;Re<<=1,!(Re&3932160)&&(Re=262144),ql=e}else ql=536870912;return e=V.current,e!==null&&(e.flags|=32),ql}function mu(e,t,n){(e===Pl&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)&&(xu(e,0),vu(e,Il,ql,!1)),Ke(e,n),(!(Nl&2)||e!==Pl)&&(e===Pl&&(!(Nl&2)&&(Gl|=n),Ul===4&&vu(e,Il,ql,!1)),rd(e))}function hu(e,t,n){if(Nl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||He(e,t),a=r?ku(e,t):Du(e,t,!0),o=r;do{if(a===0){Bl&&!r&&vu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!_u(n)){a=Du(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Yl;var l=c.current.memoizedState.isDehydrated;if(l&&(xu(c,s).flags|=256),s=Du(c,s,!1),s!==2){if(Vl&&!l){c.errorRecoveryDisabledLanes|=o,Gl|=o,a=4;break a}o=Xl,Xl=a,o!==null&&(Xl===null?Xl=o:Xl.push.apply(Xl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){xu(e,0),vu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:vu(r,t,ql,!zl);break a;case 2:Xl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Ql+300-Se(),10<a)){if(vu(r,t,ql,!zl),Ve(r,0,!0)!==0)break a;ou=t,r.timeoutHandle=Jd(gu.bind(null,r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,`Throttled`,-0,0),a);break a}gu(r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,null,-0,0)}}break}while(1);rd(e)}function gu(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:Yt},Tl(t,a,d);var m=(a&62914560)===a?Ql-Se():(a&4194048)===a?$l-Se():0;if(m=Yf(d,m),m!==null){ou=a,e.cancelPendingCommit=m(Iu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),vu(e,a,o,!l);return}}Iu(e,t,a,n,r,i,o,s,c)}function _u(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(!vr(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 vu(e,t,n,r){t&=~Kl,t&=~Gl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Fe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Je(e,n,t)}function yu(){return Nl&6?!0:(id(0,!1),!1)}function bu(){if(Fl!==null){if(Ll===0)var e=Fl.return;else e=Fl,Gi=Wi=null,wo(e),ja=null,Ma=0,e=Fl;for(;e!==null;)Pc(e.alternate,e),e=e.return;Fl=null}}function xu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Yd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ou=0,bu(),Pl=e,Fl=n=oi(e.current,null),Il=t,Ll=0,Rl=null,zl=!1,Bl=He(e,t),Vl=!1,Jl=ql=Kl=Gl=Wl=Ul=0,Xl=Yl=null,Zl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Fe(r),a=1<<i;t|=e[i],r&=~a}return Hl=t,Xr(),n}function Su(e,t){W=null,M.H=Y,t===xa||t===Ca?(t=ka(),Ll=3):t===Sa?(t=ka(),Ll=4):Ll=t===Ys?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Rl=t,Fl===null&&(Ul=1,Us(e,mi(t,e.current)))}function Cu(){var e=V.current;return e===null?!0:(Il&4194048)===Il?no===null:(Il&62914560)===Il||Il&536870912?e===no:!1}function wu(){var e=M.H;return M.H=Y,e===null?Y:e}function Tu(){var e=M.A;return M.A=jl,e}function Eu(){Ul=4,zl||(Il&4194048)!==Il&&V.current!==null||(Bl=!0),!(Wl&134217727)&&!(Gl&134217727)||Pl===null||vu(Pl,Il,ql,!1)}function Du(e,t,n){var r=Nl;Nl|=2;var i=wu(),a=Tu();(Pl!==e||Il!==t)&&(tu=null,xu(e,t)),t=!1;var o=Ul;a:do try{if(Ll!==0&&Fl!==null){var s=Fl,c=Rl;switch(Ll){case 8:bu(),o=6;break a;case 3:case 2:case 9:case 6:V.current===null&&(t=!0);var l=Ll;if(Ll=0,Rl=null,Nu(e,s,c,l),n&&Bl){o=0;break a}break;default:l=Ll,Ll=0,Rl=null,Nu(e,s,c,l)}}Ou(),o=Ul;break}catch(t){Su(e,t)}while(1);return t&&e.shellSuspendCounter++,Gi=Wi=null,Nl=r,M.H=i,M.A=a,Fl===null&&(Pl=null,Il=0,Xr()),o}function Ou(){for(;Fl!==null;)ju(Fl)}function ku(e,t){var n=Nl;Nl|=2;var r=wu(),a=Tu();Pl!==e||Il!==t?(tu=null,eu=Se()+500,xu(e,t)):Bl=He(e,t);a:do try{if(Ll!==0&&Fl!==null){t=Fl;var o=Rl;b:switch(Ll){case 1:Ll=0,Rl=null,Nu(e,t,o,1);break;case 2:case 9:if(Ta(o)){Ll=0,Rl=null,Mu(t);break}t=function(){Ll!==2&&Ll!==9||Pl!==e||(Ll=7),rd(e)},o.then(t,t);break a;case 3:Ll=7;break a;case 4:Ll=5;break a;case 7:Ta(o)?(Ll=0,Rl=null,Mu(t)):(Ll=0,Rl=null,Nu(e,t,o,7));break;case 5:var s=null;switch(Fl.tag){case 26:s=Fl.memoizedState;case 5:case 27:var c=Fl;if(s?Kf(s):c.stateNode.complete){Ll=0,Rl=null;var l=c.sibling;if(l!==null)Fl=l;else{var u=c.return;u===null?Fl=null:(Fl=u,Pu(u))}break b}}Ll=0,Rl=null,Nu(e,t,o,5);break;case 6:Ll=0,Rl=null,Nu(e,t,o,6);break;case 8:bu(),Ul=6;break a;default:throw Error(i(462))}}Au();break}catch(t){Su(e,t)}while(1);return Gi=Wi=null,M.H=r,M.A=a,Nl=n,Fl===null?(Pl=null,Il=0,Xr(),Ul):0}function Au(){for(;Fl!==null&&!be();)ju(Fl)}function ju(e){var t=Tc(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?Pu(e):Fl=t}function Mu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=lc(n,t,t.pendingProps,t.type,void 0,Il);break;case 11:t=lc(n,t,t.pendingProps,t.type.render,t.ref,Il);break;case 5:wo(t);default:Pc(n,t),t=Fl=si(t,Hl),t=Tc(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?Pu(e):Fl=t}function Nu(e,t,n,r){Gi=Wi=null,wo(t),ja=null,Ma=0;var i=t.return;try{if(Js(e,i,t,n,Il)){Ul=1,Us(e,mi(n,e.current)),Fl=null;return}}catch(t){if(i!==null)throw Fl=i,t;Ul=1,Us(e,mi(n,e.current)),Fl=null;return}t.flags&32768?(Mi||r===1?e=!0:Bl||Il&536870912?e=!1:(zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=V.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fu(t,e)):Pu(t)}function Pu(e){var t=e;do{if(t.flags&32768){Fu(t,zl);return}e=t.return;var n=Mc(t.alternate,t,Hl);if(n!==null){Fl=n;return}if(t=t.sibling,t!==null){Fl=t;return}Fl=t=e}while(t!==null);Ul===0&&(Ul=5)}function Fu(e,t){do{var n=Nc(e.alternate,e);if(n!==null){n.flags&=32767,Fl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Fl=e;return}Fl=e=n}while(e!==null);Ul=6,Fl=null}function Iu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Vu();while(ru!==0);if(Nl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Yr,qe(e,n,o,s,c,l),e===Pl&&(Fl=Pl=null,Il=0),au=t,iu=e,ou=n,su=o,cu=a,lu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Ee,function(){return Hu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=M.T,M.T=null,a=N.p,N.p=2,s=Nl,Nl|=4;try{Qc(e,t,n)}finally{Nl=s,N.p=a,M.T=r}}ru=1,Lu(),Ru(),zu()}}function Lu(){if(ru===1){ru=0;var e=iu,t=au,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=Nl;Nl|=4;try{dl(t,e);var a=Vd,o=Cr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Sr(s.ownerDocument.documentElement,s)){if(c!==null&&wr(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 _=xr(s,h),v=xr(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}}lp=!!Bd,Vd=Bd=null}finally{Nl=i,N.p=r,M.T=n}}e.current=t,ru=2}}function Ru(){if(ru===2){ru=0;var e=iu,t=au,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=Nl;Nl|=4;try{$c(e,t.alternate,t)}finally{Nl=i,N.p=r,M.T=n}}ru=3}}function zu(){if(ru===4||ru===3){ru=0,xe();var e=iu,t=au,n=ou,r=lu;t.subtreeFlags&10256||t.flags&10256?ru=5:(ru=0,au=iu=null,Bu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(nu=null),Qe(n),t=t.stateNode,Me&&typeof Me.onCommitFiberRoot==`function`)try{Me.onCommitFiberRoot(je,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}}ou&3&&Vu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===du?uu++:(uu=0,du=e):uu=0,id(0,!1)}}function Bu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ca(t)))}function Vu(){return Lu(),Ru(),zu(),Hu()}function Hu(){if(ru!==5)return!1;var e=iu,t=su;su=0;var n=Qe(ou),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,Nl&6)throw Error(i(331));var c=Nl;if(Nl|=4,Ol(o.current),bl(o,o.current,s,n),Nl=c,id(0,!1),Me&&typeof Me.onPostCommitFiberRoot==`function`)try{Me.onPostCommitFiberRoot(je,o)}catch{}return!0}finally{N.p=a,M.T=r,Bu(e,t)}}function Uu(e,t,n){t=mi(n,t),t=Gs(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(Ke(e,2),rd(e))}function Wu(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=mi(n,e),n=Ks(2),r=Ua(t,n,2),r!==null&&(qs(n,r,t,e),Ke(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ml;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)||(Vl=!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,Pl===e&&(Il&n)===n&&(Ul===4||Ul===3&&(Il&62914560)===Il&&300>Se()-Ql?!(Nl&2)&&xu(e,0):Kl|=n,Jl===Il&&(Jl=0)),rd(e)}function qu(e,t){t===0&&(t=We()),e=$r(e,t),e!==null&&(Ke(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,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return ve(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-Fe(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=Il,a=Ve(r,r===Pl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||He(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&&qd()&&(e=nd);for(var t=Se(),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}ru!==0&&ru!==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-Fe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ue(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Pl,n=Il,n=Ve(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ye(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||He(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ye(r),Qe(n)){case 2:case 8:n=Te;break;case 32:n=Ee;break;case 268435456:n=Oe;break;default:n=Ee}return r=cd.bind(null,e),n=ve(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ye(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(ru!==0&&ru!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Vu()&&e.callbackNode!==n)return null;var r=Il;return r=Ve(e,e===Pl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(hu(e,r,t),sd(e,Se()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Vu())return null;hu(e,t,!0)}function ud(){Zd(function(){Nl&6?ve(we,ad):od()})}function dd(){if(nd===0){var e=da;e===0&&(e=Le,Le<<=1,!(Le&261888)&&(Le=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Jt(``+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[rt]||null).action),o=r.submitter;o&&(t=(t=o[rt]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new _n(`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);bs(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),bs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Wr.length;hd++){var gd=Wr[hd];Gr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Gr(Ir,`onAnimationEnd`),Gr(Lr,`onAnimationIteration`),Gr(Rr,`onAnimationStart`),Gr(`dblclick`,`onDoubleClick`),Gr(`focusin`,`onFocus`),Gr(`focusout`,`onBlur`),Gr(zr,`onTransitionRun`),Gr(Br,`onTransitionStart`),Gr(Vr,`onTransitionCancel`),Gr(Hr,`onTransitionEnd`),yt(`onMouseEnter`,[`mouseout`,`mouseover`]),yt(`onMouseLeave`,[`mouseout`,`mouseover`]),yt(`onPointerEnter`,[`pointerout`,`pointerover`]),yt(`onPointerLeave`,[`pointerout`,`pointerover`]),vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),vt(`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){Kr(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){Kr(e)}i.currentTarget=null,a=c}}}}function bd(e,t){var n=t[at];n===void 0&&(n=t[at]=new Set);var r=e+`__bubble`;n.has(r)||(wd(t,e,2,!1),n.add(r))}function xd(e,t,n){var r=0;t&&(r|=4),wd(n,e,r,t)}var Sd=`_reactListening`+Math.random().toString(36).slice(2);function Cd(e){if(!e[Sd]){e[Sd]=!0,gt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||xd(t,!1,e),xd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sd]||(t[Sd]=!0,xd(`selectionchange`,!1,t))}}function wd(e,t,n,r){switch(gp(t)){case 2:var i=up;break;case 8:i=dp;break;default:i=fp}n=i.bind(null,t,n,e),i=void 0,!on||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 Td(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=dt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}nn(function(){var r=a,i=Zt(n),s=[];a:{var c=Ur.get(e);if(c!==void 0){var l=_n,u=e;switch(e){case`keypress`:if(fn(n)===0)break a;case`keydown`:case`keyup`:l=Fn;break;case`focusin`:u=`focus`,l=En;break;case`focusout`:u=`blur`,l=En;break;case`beforeblur`:case`afterblur`:l=En;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`:l=wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Tn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Ln;break;case Ir:case Lr:case Rr:l=Dn;break;case Hr:l=Rn;break;case`scroll`:case`scrollend`:l=yn;break;case`wheel`:l=zn;break;case`copy`:case`cut`:case`paste`:l=On;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=In;break;case`toggle`:case`beforetoggle`:l=Bn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;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=rn(m,p),g!=null&&d.push(Ed(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Xt&&(u=n.relatedTarget||n.fromElement)&&(dt(u)||u[it]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?dt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=In,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:pt(l),h=u==null?c:pt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,dt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Od,p=l,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;l!==null&&kd(s,c,l,d,!1),u!==null&&f!==null&&kd(s,f,u,d,!0)}}a:{if(c=r?pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=or;else if(er(c))if(sr)v=gr;else{v=mr;var y=pr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Gt(r.elementType)&&(v=or):v=hr;if(v&&=v(e,r)){tr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Lt(c,`number`,c.value)}switch(y=r?pt(r):window,e){case`focusin`:(er(y)||y.contentEditable===`true`)&&(Er=y,Dr=r,Or=null);break;case`focusout`:Or=Dr=Er=null;break;case`mousedown`:kr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:kr=!1,Ar(s,n,i);break;case`selectionchange`:if(Tr)break;case`keydown`:case`keyup`:Ar(s,n,i)}var b;if(Hn)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 Xn?Jn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Gn&&n.locale!==`ko`&&(Xn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Xn&&(b=dn()):(cn=i,ln=`value`in cn?cn.value:cn.textContent,Xn=!0)),y=Dd(r,x),0<y.length&&(x=new kn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Yn(n),b!==null&&(x.data=b)))),(b=Wn?Zn(e,n):Qn(e,n))&&(x=Dd(r,`onBeforeInput`),0<x.length&&(y=new kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Ed(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Dd(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=rn(e,n),i!=null&&r.unshift(Ed(e,i,a)),i=rn(e,t),i!=null&&r.push(Ed(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Od(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kd(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=rn(n,a),l!=null&&o.unshift(Ed(n,l,c))):i||(l=rn(n,a),l!=null&&o.push(Ed(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Ad=/\r\n?/g,jd=/\u0000|\uFFFD/g;function Md(e){return(typeof e==`string`?e:``+e).replace(Ad,`
|
|
9
|
-
`).replace(jd,``)}function Nd(e,t){return t=Md(t),Md(e)===t}function Pd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Vt(e,``+r);break;case`className`:Tt(e,`class`,r);break;case`tabIndex`:Tt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Tt(e,n,r);break;case`style`:Wt(e,r,o);break;case`data`:if(t!==`object`){Tt(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=Jt(``+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 o==`function`&&(n===`formAction`?(t!==`input`&&Pd(e,t,`name`,a.name,a,null),Pd(e,t,`formEncType`,a.formEncType,a,null),Pd(e,t,`formMethod`,a.formMethod,a,null),Pd(e,t,`formTarget`,a.formTarget,a,null)):(Pd(e,t,`encType`,a.encType,a,null),Pd(e,t,`method`,a.method,a,null),Pd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(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=Jt(``+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`:bd(`beforetoggle`,e),bd(`toggle`,e),wt(e,`popover`,r);break;case`xlinkActuate`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:wt(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=Kt.get(n)||n,wt(e,n,r))}}function Fd(e,t,n,r,a,o){switch(n){case`style`:Wt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Vt(e,``+r);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!_t.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[rt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):wt(e,n,r)}}}function Id(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:bd(`error`,e),bd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Pd(e,t,o,s,n,null)}}a&&Pd(e,t,`srcSet`,n.srcSet,n,null),r&&Pd(e,t,`src`,n.src,n,null);return;case`input`:bd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Pd(e,t,r,d,n,null)}}It(e,o,c,l,u,s,a,!1);return;case`select`:for(a in bd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Pd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Rt(e,!!r,n,!0):Rt(e,!!r,t,!1);return;case`textarea`:for(s in bd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Pd(e,t,s,c,n,null)}Bt(e,r,a,o);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:Pd(e,t,l,r,n,null)}return;case`dialog`:bd(`beforetoggle`,e),bd(`toggle`,e),bd(`cancel`,e),bd(`close`,e);break;case`iframe`:case`object`:bd(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)bd(_d[r],e);break;case`image`:bd(`error`,e),bd(`load`,e);break;case`details`:bd(`toggle`,e);break;case`embed`:case`source`:case`link`:bd(`error`,e),bd(`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(i(137,t));default:Pd(e,t,u,r,n,null)}return;default:if(Gt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Fd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Pd(e,t,c,r,n,null))}function Ld(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 a=null,o=null,s=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)||Pd(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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Pd(e,t,p,m,r,f)}}Ft(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Pd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Pd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Rt(e,!!n,n?[]:``,!1):Rt(e,!!n,t,!0)):Rt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Pd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Pd(e,t,s,a,r,o)}zt(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:Pd(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:Pd(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)&&Pd(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(i(137,t));break;default:Pd(e,t,u,p,r,m)}return;default:if(Gt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Fd(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||Fd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Pd(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||Pd(e,t,f,p,r,m)}function Rd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function zd(){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&&Rd(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&&Rd(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 Bd=null,Vd=null;function Hd(e){return e.nodeType===9?e:e.ownerDocument}function Ud(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 Wd(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 Gd(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 Kd=null;function qd(){var e=window.event;return e&&e.type===`popstate`?e===Kd?!1:(Kd=e,!0):(Kd=null,!1)}var Jd=typeof setTimeout==`function`?setTimeout:void 0,Yd=typeof clearTimeout==`function`?clearTimeout:void 0,Xd=typeof Promise==`function`?Promise:void 0,Zd=typeof queueMicrotask==`function`?queueMicrotask:Xd===void 0?Jd:function(e){return Xd.resolve(null).then(e).catch(Qd)};function Qd(e){setTimeout(function(){throw e})}function $d(e){return e===`head`}function ef(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),Fp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)hf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,hf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[lt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&hf(e.ownerDocument.body);n=i}while(n);Fp(t)}function tf(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 nf(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`:nf(n),ut(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rf(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[lt])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=uf(e.nextSibling),e===null)break}return null}function af(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=uf(e.nextSibling),e===null))return null;return e}function of(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=uf(e.nextSibling),e===null))return null;return e}function sf(e){return e.data===`$?`||e.data===`$~`}function cf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lf(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 uf(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 df=null;function ff(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return uf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pf(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 mf(e,t,n){switch(t=Hd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function hf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ut(e)}var gf=new Map,_f=new Set;function vf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yf=N.d;N.d={f:bf,r:xf,D:wf,C:Tf,L:Ef,m:Df,X:kf,S:Of,M:Af};function bf(){var e=yf.f(),t=yu();return e||t}function xf(e){var t=ft(e);t!==null&&t.tag===5&&t.type===`form`?Ss(t):yf.r(e)}var Sf=typeof document>`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=Pt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),_f.has(i)||(_f.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Id(t,`link`,e),ht(t),r.head.appendChild(t)))}}function wf(e){yf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){yf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){yf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Pt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Pt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Pt(n.imageSizes)+`"]`)):i+=`[href="`+Pt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=If(e)}gf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),gf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Nf(a))||t===`script`&&r.querySelector(Lf(a))||(t=r.createElement(`link`),Id(t,`link`,e),ht(t),r.head.appendChild(t)))}}function Df(e,t){yf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Pt(r)+`"][href="`+Pt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=If(e)}if(!gf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),gf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Lf(a)))return}r=n.createElement(`link`),Id(r,`link`,e),ht(r),n.head.appendChild(r)}}}function Of(e,t,n){yf.S(e,t,n);var r=Sf;if(r&&e){var i=mt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Nf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=gf.get(a))&&Bf(e,n);var c=o=r.createElement(`link`);ht(c),Id(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,zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){yf.X(e,t);var n=Sf;if(n&&e){var r=mt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=f({src:e,async:!0},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),ht(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){yf.M(e,t);var n=Sf;if(n&&e){var r=mt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),ht(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var a=(a=oe.current)?vf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Mf(n.href),n=mt(a).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=Mf(n.href);var o=mt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Nf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),gf.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},gf.set(e,n),o||Ff(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=If(n),n=mt(a).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(i(444,e))}}function Mf(e){return`href="`+Pt(e)+`"`}function Nf(e){return`link[rel="stylesheet"][`+e+`]`}function Pf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Ff(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}),Id(t,`link`,n),ht(t),e.head.appendChild(t))}function If(e){return`[src="`+Pt(e)+`"]`}function Lf(e){return`script[async]`+e}function Rf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Pt(n.href)+`"]`);if(r)return t.instance=r,ht(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ht(r),Id(r,`style`,a),zf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Nf(a));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;r=Pf(n),(a=gf.get(a))&&Bf(r,a),o=(e.ownerDocument||e).createElement(`link`),ht(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Id(o,`link`,r),t.state.loading|=4,zf(o,n.precedence,e),t.instance=o;case`script`:return o=If(n.src),(a=e.querySelector(Lf(o)))?(t.instance=a,ht(a),a):(r=n,(a=gf.get(o))&&(r=f({},n),Vf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ht(a),Id(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,zf(r,n.precedence,e));return t.instance}function zf(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 Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Hf=null;function Uf(e,t,n){if(Hf===null){var r=new Map,i=Hf=new Map;i.set(n,r)}else i=Hf,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[lt]||a[nt]||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 Wf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Gf(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 Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(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=Mf(r.href),a=t.querySelector(Nf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ht(a);return}a=t.ownerDocument||t,r=Pf(r),(i=gf.get(i))&&Bf(r,i),a=a.createElement(`link`),ht(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Id(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=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.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=Xf.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 ep={$$typeof:b,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function tp(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=Ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ge(0),this.hiddenUpdates=Ge(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 np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ii(3,null,null,t),e.current=a,a.stateNode=e,t=sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ba(a),e}function rp(e){return e?(e=ni,e):ni}function ip(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ha(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ua(e,r,t),n!==null&&(mu(n,e,t),Wa(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=$r(e,67108864);t!==null&&mu(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=fu();t=Ze(t);var n=$r(e,t);n!==null&&mu(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,fp(e,t,n,r)}finally{N.p=a,M.T=i}}function dp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,fp(e,t,n,r)}finally{N.p=a,M.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Td(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Be(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Fe(o);s.entanglements[1]|=c,o&=~c}rd(a),!(Nl&6)&&(eu=Se()+500,id(0,!1))}}break;case 31:case 13:s=$r(a,2),s!==null&&mu(s,a,2),yu(),op(a,2)}if(a=pp(r),a===null&&Td(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Td(e,t,r,null,n)}}function pp(e){return e=Zt(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=dt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 mp=e,null}function gp(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(Ce()){case we:return 2;case Te:return 8;case Ee:case De:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`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 Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(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=ft(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=dt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,et(e.priority,function(){cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,et(e.priority,function(){cp(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 kp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Xt=r,n.target.dispatchEvent(r),Xt=null}else return t=ft(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){kp(e)&&n.delete(t)}function jp(){_p=!1,vp!==null&&kp(vp)&&(vp=null),yp!==null&&kp(yp)&&(yp=null),bp!==null&&kp(bp)&&(bp=null),xp.forEach(Ap),Sp.forEach(Ap)}function Mp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jp)))}var Np=null;function Pp(e){Np!==e&&(Np=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Np===e&&(Np=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(hp(r||n)===null)continue;break}var a=ft(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Fp(e){function t(t){return Mp(t,e)}vp!==null&&Mp(vp,e),yp!==null&&Mp(yp,e),bp!==null&&Mp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.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[rt]||null;if(typeof a==`function`)o||Pp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[rt]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Pp(n)}}}function Ip(){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 Lp(e){this._internalRoot=e}Rp.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,fu(),e,t,null,null)},Rp.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),yu(),t[it]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var zp=n.version;if(zp!==`19.2.5`)throw Error(i(527,zp,`19.2.5`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Bp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{je=Vp.inject(Bp),Me=Vp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Bs,s=Vs,c=Hs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=np(e,1,!1,null,null,n,r,null,o,s,c,Ip),e[it]=t.current,Cd(e),new Lp(t)}})),sa=o(((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=oa()}))();function ca(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var la=e=>{switch(e){case`success`:return fa;case`info`:return ma;case`warning`:return pa;case`error`:return ha;default:return null}},ua=Array(12).fill(0),da=({visible:e,className:t})=>z.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},z.createElement(`div`,{className:`sonner-spinner`},ua.map((e,t)=>z.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),fa=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),pa=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),ma=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),ha=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),ga=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),z.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),_a=()=>{let[e,t]=z.useState(document.hidden);return z.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},va=1,ya=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:va++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],z.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(xa(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||va++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ba=(e,t)=>{let n=t?.id||va++;return ya.addToast({title:e,...t,id:n}),n},xa=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`;Object.assign(ba,{success:ya.success,info:ya.info,warning:ya.warning,error:ya.error,custom:ya.custom,message:ya.message,promise:ya.promise,dismiss:ya.dismiss,loading:ya.loading},{getHistory:()=>ya.toasts,getToasts:()=>ya.getActiveToasts()}),ca(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Sa(e){return e.label!==void 0}var Ca=3,wa=`24px`,Ta=`16px`,Ea=4e3,Da=356,Oa=14,ka=45,Aa=200;function ja(...e){return e.filter(Boolean).join(` `)}function Ma(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Na=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=z.useState(null),[O,ee]=z.useState(null),[k,A]=z.useState(!1),[j,M]=z.useState(!1),[N,te]=z.useState(!1),[P,ne]=z.useState(!1),[re,ie]=z.useState(!1),[F,I]=z.useState(0),[ae,oe]=z.useState(0),L=z.useRef(n.duration||y||Ea),R=z.useRef(null),se=z.useRef(null),ce=c===0,le=c+1<=o,ue=n.type,de=n.dismissible!==!1,fe=n.className||``,pe=n.descriptionClassName||``,me=z.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),he=z.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ge=z.useMemo(()=>n.duration||y||Ea,[n.duration,y]),_e=z.useRef(0),ve=z.useRef(0),ye=z.useRef(0),be=z.useRef(null),[xe,Se]=b.split(`-`),Ce=z.useMemo(()=>s.reduce((e,t,n)=>n>=me?e:e+t.height,0),[s,me]),we=_a(),Te=n.invert||t,Ee=ue===`loading`;ve.current=z.useMemo(()=>me*x+Ce,[me,Ce]),z.useEffect(()=>{L.current=ge},[ge]),z.useEffect(()=>{A(!0)},[]),z.useEffect(()=>{let e=se.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),z.useLayoutEffect(()=>{if(!k)return;let e=se.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[k,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let De=z.useCallback(()=>{M(!0),I(ve.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Aa)},[n,d,a,ve]);z.useEffect(()=>{if(n.promise&&ue===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||we?(()=>{if(ye.current<_e.current){let e=new Date().getTime()-_e.current;L.current-=e}ye.current=new Date().getTime()})():L.current!==1/0&&(_e.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),De()},L.current)),()=>clearTimeout(e)},[u,i,n,ue,we,De]),z.useEffect(()=>{n.delete&&(De(),n.onDismiss==null||n.onDismiss.call(n,n))},[De,n.delete]);function Oe(){return w?.loading?z.createElement(`div`,{className:ja(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ue===`loading`},w.loading):z.createElement(da,{className:ja(C?.loader,n?.classNames?.loader),visible:ue===`loading`})}let ke=n.icon||w?.[ue]||la(ue);return z.createElement(`li`,{tabIndex:0,ref:se,className:ja(_,fe,C?.toast,n?.classNames?.toast,C?.default,C?.[ue],n?.classNames?.[ue]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":k,"data-promise":!!n.promise,"data-swiped":re,"data-removed":j,"data-visible":le,"data-y-position":xe,"data-x-position":Se,"data-index":c,"data-front":ce,"data-swiping":N,"data-dismissible":de,"data-type":ue,"data-invert":Te,"data-swipe-out":P,"data-swipe-direction":O,"data-expanded":!!(u||S&&k),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${j?F:ve.current}px`,"--initial-height":S?`auto`:`${ae}px`,...m,...n.style},onDragEnd:()=>{te(!1),D(null),be.current=null},onPointerDown:e=>{e.button!==2&&(Ee||!de||(R.current=new Date,I(ve.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(te(!0),be.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(P||!de)return;be.current=null;let e=Number(se.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(se.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-R.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=ka||a>.11){I(ve.current),n.onDismiss==null||n.onDismiss.call(n,n),ee(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),De(),ne(!0);return}else{var o,s;(o=se.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=se.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}ie(!1),te(!1),D(null)},onPointerMove:t=>{var n,r;if(!be.current||!de||window.getSelection()?.toString().length>0)return;let i=t.clientY-be.current.y,a=t.clientX-be.current.x,o=e.swipeDirections??Ma(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ie(!0),(n=se.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=se.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},he&&!n.jsx&&ue!==`loading`?z.createElement(`button`,{"aria-label":T,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!de?()=>{}:()=>{De(),n.onDismiss==null||n.onDismiss.call(n,n)},className:ja(C?.closeButton,n?.classNames?.closeButton)},w?.close??ga):null,(ue||n.icon||n.promise)&&n.icon!==null&&(w?.[ue]!==null||n.icon)?z.createElement(`div`,{"data-icon":``,className:ja(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Oe():null,n.type===`loading`?null:ke):null,z.createElement(`div`,{"data-content":``,className:ja(C?.content,n?.classNames?.content)},z.createElement(`div`,{"data-title":``,className:ja(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?z.createElement(`div`,{"data-description":``,className:ja(v,pe,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),z.isValidElement(n.cancel)?n.cancel:n.cancel&&Sa(n.cancel)?z.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Sa(n.cancel)&&de&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),De())},className:ja(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,z.isValidElement(n.action)?n.action:n.action&&Sa(n.action)?z.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Sa(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&De())},className:ja(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Pa(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Fa(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Ta:wa;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Ia=z.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Ca,toastOptions:g,dir:_=Pa(),gap:v=Oa,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=z.useState([]),C=z.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=z.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=z.useState([]),[D,O]=z.useState(!1),[ee,k]=z.useState(!1),[A,j]=z.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),M=z.useRef(null),N=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),te=z.useRef(null),P=z.useRef(!1),ne=z.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||ya.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return z.useEffect(()=>ya.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{xi.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),z.useEffect(()=>{if(d!==`system`){j(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?j(`dark`):j(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{j(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{j(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),z.useEffect(()=>{x.length<=1&&O(!1)},[x]),z.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=M.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===M.current||M.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),z.useEffect(()=>{if(M.current)return()=>{te.current&&(te.current.focus({preventScroll:!0}),te.current=null,P.current=!1)}},[M.current]),z.createElement(`section`,{ref:t,"aria-label":`${b} ${N}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?z.createElement(`ol`,{key:t,dir:_===`auto`?Pa():_,tabIndex:-1,ref:M,className:c,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${Da}px`,"--gap":`${v}px`,...m,...Fa(l,u)},onBlur:e=>{P.current&&!e.currentTarget.contains(e.relatedTarget)&&(P.current=!1,te.current&&=(te.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||P.current||(P.current=!0,te.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{ee||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||k(!0)},onPointerUp:()=>k(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>z.createElement(Na,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:ee,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:ne,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))}),La=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Ra=(e=>e?La(e):La),za=e=>e;function Ba(e,t=za){let n=z.useSyncExternalStore(e.subscribe,z.useCallback(()=>t(e.getState()),[e,t]),z.useCallback(()=>t(e.getInitialState()),[e,t]));return z.useDebugValue(n),n}var Va=e=>{let t=Ra(e),n=e=>Ba(t,e);return Object.assign(n,t),n},Ha=(e=>e?Va(e):Va),Ua=`aiworker-theme`,Wa=new Set([`light`,`dark`,`system`]),Ga=Ha()(e=>({theme:`system`,setTheme:t=>e({theme:t})}));function Ka(e){return`${Ua}:${e}`}function qa(e){return e!==null&&Wa.has(e)}function Ja(e){let t=window.localStorage.getItem(Ka(e));return qa(t)?t:null}function Ya(){return typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}function Xa(e){return e===`system`?Ya()?`dark`:`light`:e}function Za(e){let t=document.documentElement,n=Xa(e);t.dataset.theme=n,t.dataset.themePreference=e}function Qa(e){let t=Ja(e)??`system`;Ga.setState({theme:t}),Za(t)}function $a({scope:e}){let t=Ga(e=>e.theme),n=Ga(e=>e.setTheme),r=(0,z.useRef)(!1),i=(0,z.useRef)(!0);return(0,z.useEffect)(()=>{let t=Ja(e);t&&n(t),r.current=!0},[e,n]),(0,z.useEffect)(()=>{if(Za(t),i.current?i.current=!1:r.current&&window.localStorage.setItem(Ka(e),t),t!==`system`||typeof window.matchMedia!=`function`)return;let n=window.matchMedia(`(prefers-color-scheme: dark)`),a=()=>Za(`system`);return n.addEventListener(`change`,a),()=>n.removeEventListener(`change`,a)},[e,t]),null}function eo(e){return(0,B.jsx)(Ia,{theme:Ga(e=>e.theme),className:`toaster group`,toastOptions:{classNames:{toast:`group toast group-[.toaster]:rounded-sm group-[.toaster]:border-hairline group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:shadow-popover`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:rounded-pill group-[.toast]:border group-[.toast]:border-primary group-[.toast]:bg-primary group-[.toast]:font-medium group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-soft-stone group-[.toast]:text-muted-foreground`}},...e})}var to=new Me({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),V;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(V||={});var no;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(no||={});var H=V.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),ro=e=>{switch(typeof e){case`undefined`:return H.undefined;case`string`:return H.string;case`number`:return Number.isNaN(e)?H.nan:H.number;case`boolean`:return H.boolean;case`function`:return H.function;case`bigint`:return H.bigint;case`symbol`:return H.symbol;case`object`:return Array.isArray(e)?H.array:e===null?H.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?H.promise:typeof Map<`u`&&e instanceof Map?H.map:typeof Set<`u`&&e instanceof Set?H.set:typeof Date<`u`&&e instanceof Date?H.date:H.object;default:return H.unknown}},U=V.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),io=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,V.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};io.create=e=>new io(e);var ao=(e,t)=>{let n;switch(e.code){case U.invalid_type:n=e.received===H.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case U.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,V.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:n=`Unrecognized key(s) in object: ${V.joinValues(e.keys,`, `)}`;break;case U.invalid_union:n=`Invalid input`;break;case U.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${V.joinValues(e.options)}`;break;case U.invalid_enum_value:n=`Invalid enum value. Expected ${V.joinValues(e.options)}, received '${e.received}'`;break;case U.invalid_arguments:n=`Invalid function arguments`;break;case U.invalid_return_type:n=`Invalid function return type`;break;case U.invalid_date:n=`Invalid date`;break;case U.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:V.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case U.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case U.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case U.custom:n=`Invalid input`;break;case U.invalid_intersection_types:n=`Intersection results could not be merged`;break;case U.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case U.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,V.assertNever(e)}return{message:n}},oo=ao;function so(){return oo}var co=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function W(e,t){let n=so(),r=co({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ao?void 0:ao].filter(e=>!!e)});e.common.issues.push(r)}var lo=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return G;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return G;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},G=Object.freeze({status:`aborted`}),uo=e=>({status:`dirty`,value:e}),fo=e=>({status:`valid`,value:e}),po=e=>e.status===`aborted`,mo=e=>e.status===`dirty`,ho=e=>e.status===`valid`,go=e=>typeof Promise<`u`&&e instanceof Promise,K;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(K||={});var _o=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},vo=(e,t)=>{if(ho(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new io(e.common.issues);return this._error=t,this._error}}};function q(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var yo=class{get description(){return this._def.description}_getType(e){return ro(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ro(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new lo,ctx:{common:e.parent.common,data:e.data,parsedType:ro(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(go(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ro(e)};return vo(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ro(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return ho(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>ho(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ro(e)},r=this._parse({data:e,path:n.path,parent:n});return vo(n,await(go(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:U.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new Ss({schema:this,typeName:J.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return Cs.create(this,this._def)}nullable(){return ws.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rs.create(this)}promise(){return xs.create(this,this._def)}or(e){return os.create([this,e],this._def)}and(e){return us.create(this,e,this._def)}transform(e){return new Ss({...q(this._def),schema:this,typeName:J.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Ts({...q(this._def),innerType:this,defaultValue:t,typeName:J.ZodDefault})}brand(){return new Os({typeName:J.ZodBranded,type:this,...q(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Es({...q(this._def),innerType:this,catchValue:t,typeName:J.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ks.create(this,e)}readonly(){return As.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},bo=/^c[^\s-]{8,}$/i,xo=/^[0-9a-z]+$/,So=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Co=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wo=/^[a-z0-9_-]{21}$/i,To=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Eo=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Do=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Oo=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,ko,Ao=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,jo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Mo=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,No=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Po=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Fo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Io=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Lo=RegExp(`^${Io}$`);function Ro(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function zo(e){return RegExp(`^${Ro(e)}$`)}function Bo(e){let t=`${Io}T${Ro(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Vo(e,t){return!!((t===`v4`||!t)&&Ao.test(e)||(t===`v6`||!t)&&Mo.test(e))}function Ho(e,t){if(!To.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Uo(e,t){return!!((t===`v4`||!t)&&jo.test(e)||(t===`v6`||!t)&&No.test(e))}var Wo=class e extends yo{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==H.string){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.string,received:t.parsedType}),G}let t=new lo,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?W(n,{code:U.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&W(n,{code:U.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)Do.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`email`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)ko||=new RegExp(Oo,`u`),ko.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`emoji`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Co.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`uuid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)wo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`nanoid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)bo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cuid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)xo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cuid2`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)So.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`ulid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),W(n,{validation:`url`,code:U.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`regex`,code:U.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?Bo(r).test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?Lo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?zo(r).test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Eo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`duration`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Vo(e.data,r.version)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`ip`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Ho(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`jwt`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Uo(e.data,r.version)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cidr`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Po.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`base64`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Fo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`base64url`,code:U.invalid_string,message:r.message}),t.dirty()):V.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:U.invalid_string,...K.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...K.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...K.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...K.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...K.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...K.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...K.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...K.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...K.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...K.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...K.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...K.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...K.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...K.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...K.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...K.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...K.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...K.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...K.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...K.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...K.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...K.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...K.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...K.errToObj(t)})}nonempty(e){return this.min(1,K.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Wo.create=e=>new Wo({checks:[],typeName:J.ZodString,coerce:e?.coerce??!1,...q(e)});function Go(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Ko=class e extends yo{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==H.number){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.number,received:t.parsedType}),G}let t,n=new lo;for(let r of this._def.checks)r.kind===`int`?V.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),W(t,{code:U.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Go(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_finite,message:r.message}),n.dirty()):V.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,K.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,K.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,K.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,K.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:K.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:K.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:K.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:K.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:K.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:K.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:K.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&V.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};Ko.create=e=>new Ko({checks:[],typeName:J.ZodNumber,coerce:e?.coerce||!1,...q(e)});var qo=class e extends yo{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==H.bigint)return this._getInvalidInput(e);let t,n=new lo;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):V.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.bigint,received:t.parsedType}),G}gte(e,t){return this.setLimit(`min`,e,!0,K.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,K.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,K.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,K.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:K.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:K.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:K.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};qo.create=e=>new qo({checks:[],typeName:J.ZodBigInt,coerce:e?.coerce??!1,...q(e)});var Jo=class extends yo{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==H.boolean){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.boolean,received:t.parsedType}),G}return fo(e.data)}};Jo.create=e=>new Jo({typeName:J.ZodBoolean,coerce:e?.coerce||!1,...q(e)});var Yo=class e extends yo{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==H.date){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.date,received:t.parsedType}),G}if(Number.isNaN(e.data.getTime()))return W(this._getOrReturnCtx(e),{code:U.invalid_date}),G;let t=new lo,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):V.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:K.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:K.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};Yo.create=e=>new Yo({checks:[],coerce:e?.coerce||!1,typeName:J.ZodDate,...q(e)});var Xo=class extends yo{_parse(e){if(this._getType(e)!==H.symbol){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.symbol,received:t.parsedType}),G}return fo(e.data)}};Xo.create=e=>new Xo({typeName:J.ZodSymbol,...q(e)});var Zo=class extends yo{_parse(e){if(this._getType(e)!==H.undefined){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.undefined,received:t.parsedType}),G}return fo(e.data)}};Zo.create=e=>new Zo({typeName:J.ZodUndefined,...q(e)});var Qo=class extends yo{_parse(e){if(this._getType(e)!==H.null){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.null,received:t.parsedType}),G}return fo(e.data)}};Qo.create=e=>new Qo({typeName:J.ZodNull,...q(e)});var $o=class extends yo{constructor(){super(...arguments),this._any=!0}_parse(e){return fo(e.data)}};$o.create=e=>new $o({typeName:J.ZodAny,...q(e)});var es=class extends yo{constructor(){super(...arguments),this._unknown=!0}_parse(e){return fo(e.data)}};es.create=e=>new es({typeName:J.ZodUnknown,...q(e)});var ts=class extends yo{_parse(e){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.never,received:t.parsedType}),G}};ts.create=e=>new ts({typeName:J.ZodNever,...q(e)});var ns=class extends yo{_parse(e){if(this._getType(e)!==H.undefined){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.void,received:t.parsedType}),G}return fo(e.data)}};ns.create=e=>new ns({typeName:J.ZodVoid,...q(e)});var rs=class e extends yo{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==H.array)return W(t,{code:U.invalid_type,expected:H.array,received:t.parsedType}),G;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(W(t,{code:e?U.too_big:U.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(W(t,{code:U.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(W(t,{code:U.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new _o(t,e,t.path,n)))).then(e=>lo.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new _o(t,e,t.path,n)));return lo.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:K.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:K.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:K.toString(n)}})}nonempty(e){return this.min(1,e)}};rs.create=(e,t)=>new rs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...q(t)});function is(e){if(e instanceof as){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Cs.create(is(r))}return new as({...e._def,shape:()=>t})}else if(e instanceof rs)return new rs({...e._def,type:is(e.element)});else if(e instanceof Cs)return Cs.create(is(e.unwrap()));else if(e instanceof ws)return ws.create(is(e.unwrap()));else if(e instanceof ds)return ds.create(e.items.map(e=>is(e)));else return e}var as=class e extends yo{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=V.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==H.object){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.object,received:t.parsedType}),G}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ts&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new _o(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ts){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(W(n,{code:U.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new _o(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>lo.mergeObjectSync(t,e)):lo.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return K.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:K.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:J.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of V.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of V.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return is(this)}partial(t){let n={};for(let e of V.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of V.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Cs;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return vs(V.objectKeys(this.shape))}};as.create=(e,t)=>new as({shape:()=>e,unknownKeys:`strip`,catchall:ts.create(),typeName:J.ZodObject,...q(t)}),as.strictCreate=(e,t)=>new as({shape:()=>e,unknownKeys:`strict`,catchall:ts.create(),typeName:J.ZodObject,...q(t)}),as.lazycreate=(e,t)=>new as({shape:e,unknownKeys:`strip`,catchall:ts.create(),typeName:J.ZodObject,...q(t)});var os=class extends yo{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new io(e.ctx.common.issues));return W(t,{code:U.invalid_union,unionErrors:n}),G}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new io(e));return W(t,{code:U.invalid_union,unionErrors:i}),G}}get options(){return this._def.options}};os.create=(e,t)=>new os({options:e,typeName:J.ZodUnion,...q(t)});var ss=e=>e instanceof gs?ss(e.schema):e instanceof Ss?ss(e.innerType()):e instanceof _s?[e.value]:e instanceof ys?e.options:e instanceof bs?V.objectValues(e.enum):e instanceof Ts?ss(e._def.innerType):e instanceof Zo?[void 0]:e instanceof Qo?[null]:e instanceof Cs?[void 0,...ss(e.unwrap())]:e instanceof ws?[null,...ss(e.unwrap())]:e instanceof Os||e instanceof As?ss(e.unwrap()):e instanceof Es?ss(e._def.innerType):[],cs=class e extends yo{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.object)return W(t,{code:U.invalid_type,expected:H.object,received:t.parsedType}),G;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(W(t,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),G)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=ss(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:J.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...q(r)})}};function ls(e,t){let n=ro(e),r=ro(t);if(e===t)return{valid:!0,data:e};if(n===H.object&&r===H.object){let n=V.objectKeys(t),r=V.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=ls(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===H.array&&r===H.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ls(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===H.date&&r===H.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var us=class extends yo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(po(e)||po(r))return G;let i=ls(e.value,r.value);return i.valid?((mo(e)||mo(r))&&t.dirty(),{status:t.value,value:i.data}):(W(n,{code:U.invalid_intersection_types}),G)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};us.create=(e,t,n)=>new us({left:e,right:t,typeName:J.ZodIntersection,...q(n)});var ds=class e extends yo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.array)return W(n,{code:U.invalid_type,expected:H.array,received:n.parsedType}),G;if(n.data.length<this._def.items.length)return W(n,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),G;!this._def.rest&&n.data.length>this._def.items.length&&(W(n,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new _o(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>lo.mergeArray(t,e)):lo.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ds.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ds({items:e,typeName:J.ZodTuple,rest:null,...q(t)})};var fs=class e extends yo{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.object)return W(n,{code:U.invalid_type,expected:H.object,received:n.parsedType}),G;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new _o(n,e,n.path,e)),value:a._parse(new _o(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?lo.mergeObjectAsync(t,r):lo.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof yo?new e({keyType:t,valueType:n,typeName:J.ZodRecord,...q(r)}):new e({keyType:Wo.create(),valueType:t,typeName:J.ZodRecord,...q(n)})}},ps=class extends yo{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.map)return W(n,{code:U.invalid_type,expected:H.map,received:n.parsedType}),G;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new _o(n,e,n.path,[a,`key`])),value:i._parse(new _o(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return G;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return G;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};ps.create=(e,t,n)=>new ps({valueType:t,keyType:e,typeName:J.ZodMap,...q(n)});var ms=class e extends yo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.set)return W(n,{code:U.invalid_type,expected:H.set,received:n.parsedType}),G;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(W(n,{code:U.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(W(n,{code:U.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return G;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new _o(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:K.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:K.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ms.create=(e,t)=>new ms({valueType:e,minSize:null,maxSize:null,typeName:J.ZodSet,...q(t)});var hs=class e extends yo{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.function)return W(t,{code:U.invalid_type,expected:H.function,received:t.parsedType}),G;function n(e,n){return co({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,so(),ao].filter(e=>!!e),issueData:{code:U.invalid_arguments,argumentsError:n}})}function r(e,n){return co({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,so(),ao].filter(e=>!!e),issueData:{code:U.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof xs){let e=this;return fo(async function(...t){let o=new io([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return fo(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new io([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new io([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ds.create(t).rest(es.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||ds.create([]).rest(es.create()),returns:n||es.create(),typeName:J.ZodFunction,...q(r)})}},gs=class extends yo{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};gs.create=(e,t)=>new gs({getter:e,typeName:J.ZodLazy,...q(t)});var _s=class extends yo{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return W(t,{received:t.data,code:U.invalid_literal,expected:this._def.value}),G}return{status:`valid`,value:e.data}}get value(){return this._def.value}};_s.create=(e,t)=>new _s({value:e,typeName:J.ZodLiteral,...q(t)});function vs(e,t){return new ys({values:e,typeName:J.ZodEnum,...q(t)})}var ys=class e extends yo{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return W(t,{expected:V.joinValues(n),received:t.parsedType,code:U.invalid_type}),G}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return W(t,{received:t.data,code:U.invalid_enum_value,options:n}),G}return fo(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};ys.create=vs;var bs=class extends yo{_parse(e){let t=V.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==H.string&&n.parsedType!==H.number){let e=V.objectValues(t);return W(n,{expected:V.joinValues(e),received:n.parsedType,code:U.invalid_type}),G}if(this._cache||=new Set(V.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=V.objectValues(t);return W(n,{received:n.data,code:U.invalid_enum_value,options:e}),G}return fo(e.data)}get enum(){return this._def.values}};bs.create=(e,t)=>new bs({values:e,typeName:J.ZodNativeEnum,...q(t)});var xs=class extends yo{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==H.promise&&t.common.async===!1?(W(t,{code:U.invalid_type,expected:H.promise,received:t.parsedType}),G):fo((t.parsedType===H.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};xs.create=(e,t)=>new xs({type:e,typeName:J.ZodPromise,...q(t)});var Ss=class extends yo{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{W(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return G;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?G:r.status===`dirty`||t.value===`dirty`?uo(r.value):r});{if(t.value===`aborted`)return G;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?G:r.status===`dirty`||t.value===`dirty`?uo(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?G:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?G:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ho(e))return G;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>ho(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):G);V.assertNever(r)}};Ss.create=(e,t,n)=>new Ss({schema:e,typeName:J.ZodEffects,effect:t,...q(n)}),Ss.createWithPreprocess=(e,t,n)=>new Ss({schema:t,effect:{type:`preprocess`,transform:e},typeName:J.ZodEffects,...q(n)});var Cs=class extends yo{_parse(e){return this._getType(e)===H.undefined?fo(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Cs.create=(e,t)=>new Cs({innerType:e,typeName:J.ZodOptional,...q(t)});var ws=class extends yo{_parse(e){return this._getType(e)===H.null?fo(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ws.create=(e,t)=>new ws({innerType:e,typeName:J.ZodNullable,...q(t)});var Ts=class extends yo{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===H.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Ts.create=(e,t)=>new Ts({innerType:e,typeName:J.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...q(t)});var Es=class extends yo{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return go(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new io(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new io(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Es.create=(e,t)=>new Es({innerType:e,typeName:J.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...q(t)});var Ds=class extends yo{_parse(e){if(this._getType(e)!==H.nan){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.nan,received:t.parsedType}),G}return{status:`valid`,value:e.data}}};Ds.create=e=>new Ds({typeName:J.ZodNaN,...q(e)});var Os=class extends yo{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},ks=class e extends yo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?G:e.status===`dirty`?(t.dirty(),uo(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?G:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:J.ZodPipeline})}},As=class extends yo{_parse(e){let t=this._def.innerType._parse(e),n=e=>(ho(e)&&(e.value=Object.freeze(e.value)),e);return go(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};As.create=(e,t)=>new As({innerType:e,typeName:J.ZodReadonly,...q(t)});function js(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function Ms(e,t={},n){return e?$o.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=js(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=js(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):$o.create()}as.lazycreate;var J;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(J||={});var Y=Wo.create,Ns=Ko.create;Ds.create,qo.create;var Ps=Jo.create;Yo.create,Xo.create,Zo.create,Qo.create,$o.create;var Fs=es.create;ts.create,ns.create;var Is=rs.create,X=as.create;as.strictCreate;var Ls=os.create,Rs=cs.create;us.create,ds.create;var zs=fs.create;ps.create,ms.create,hs.create,gs.create;var Bs=_s.create,Vs=ys.create;bs.create,xs.create,Ss.create,Cs.create,ws.create,Ss.createWithPreprocess,ks.create;var Hs=/^[a-z0-9][a-z0-9._-]*$/,Us=/^[a-z][a-z0-9-]*$/,Ws=/^[a-z][a-z0-9-]*$/,Gs=Y().min(1).regex(Hs,`admission id must be lowercase alphanumeric with . _ -`),Ks=Y().min(1).regex(Us,`admission kind must be kebab-case`),qs=Vs([`low`,`medium`,`high`]),Js=Vs([`pending`,`approved`,`rejected`,`applied`,`failed`]),Ys=Vs([`approved`,`rejected`,`applied`,`failed`]),Xs=Vs([`conversation`,`message`,`tool-call`,`observation`,`artifact`,`memory`,`log`]),Zs=X({at:Y().min(1),kind:Xs,summary:Y().max(500).optional(),notes:Y().max(2e3).optional(),ref:Y().min(1)});X({confidence:Ns().min(0).max(1),createdAt:Y().min(1),evidence:Is(Zs).readonly(),id:Gs,kind:Ks,payload:zs(Y(),Fs()).optional(),risk:qs,rollback:Y().min(1),scopeId:Y().min(1).optional(),soulId:Y().min(1).regex(Ws),status:Js,summary:Y().min(1).max(2e3),target:Y().min(1),updatedAt:Y().min(1)}),X({confidence:Ns().min(0).max(1),evidence:Is(Zs).readonly().optional(),id:Gs,kind:Ks,payload:zs(Y(),Fs()).optional(),risk:qs.default(`high`),rollback:Y().min(1),scopeId:Y().min(1).optional(),soulId:Y().min(1).regex(Ws),summary:Y().min(1).max(2e3),target:Y().min(1)}),X({appliedAt:Y().min(1).optional(),decidedAt:Y().min(1),decidedBy:Y().min(1),decision:Ys,failureReason:Y().max(4e3).optional(),id:Ns().int().positive(),proposalId:Gs,reason:Y().max(2e3).optional()}),X({body:Y().min(1).max(2e4),topic:Y().min(1).regex(/^[a-z0-9][a-z0-9._-]*$/).optional(),indexEntry:Y().min(1).max(280).optional()}),X({body:Y().min(1).max(2e4),skillId:Y().min(1).regex(/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/),overwrite:Ps().optional()});var Qs=/^[a-z0-9][a-z0-9._-]*$/,$s=/^[a-z][a-z0-9-]*$/,ec=Y().min(1).regex(Qs,`artifact id must be lowercase alphanumeric with . _ -`),tc=Y().min(1).regex($s,`artifact type must be kebab-case`),nc=Vs([`public`,`internal`,`confidential`,`secret`]),rc=Vs([`active`,`archived`,`removed`]),ic=Vs([`operator`,`brain-runtime`,`executor`,`channel-import`]);X({createdAt:Y().min(1),evidenceRefs:Is(Y().min(1)).readonly(),hash:Y().regex(/^[a-f0-9]{64}$/).optional(),id:ec,metadata:zs(Y(),Fs()).optional(),ref:Y().min(1),retention:Y().min(1).optional(),scopeId:Y().min(1).optional(),sensitivity:nc,source:ic,status:rc,summary:Y().max(2e3).optional(),type:tc,updatedAt:Y().min(1)}),X({evidenceRefs:Is(Y().min(1)).readonly().optional(),hash:Y().regex(/^[a-f0-9]{64}$/).optional(),id:ec,metadata:zs(Y(),Fs()).optional(),ref:Y().min(1),retention:Y().min(1).optional(),scopeId:Y().min(1).optional(),sensitivity:nc.default(`internal`),source:ic,status:rc.default(`active`),summary:Y().max(2e3).optional(),type:tc});var ac=Y().min(1).regex(/^[a-z][a-z0-9-]*$/,`brief section id must be kebab-case`),oc=Vs([`agent-doc`,`soul-doc`,`memory-doc`,`rollup-doc`,`risk-policy`,`admission-summary`,`artifact-summary`,`scope-manifest`,`soul-skeleton`]),sc=X({body:Y().min(1),id:ac,protected:Ps(),source:oc,tokens:Ns().int().nonnegative()}),cc=X({estimatedTokens:Ns().int().nonnegative(),id:ac,reason:Y().min(1)});X({artifactRefs:Is(Fs()).transform(e=>e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(e=>e.length>0)).pipe(Is(Y().min(1)).readonly()).optional(),executor:Y().min(1).optional(),risk:qs.optional(),scopeId:Y().min(1).optional(),soulId:Y().min(1).optional(),task:Y().min(1).max(4e3),tokenBudget:Ns().int().min(200).max(5e4).optional()}),X({compiledAt:Y().min(1),droppedSections:Is(cc).readonly(),executor:Y().min(1).optional(),scopeId:Y().min(1).optional(),sections:Is(sc).readonly(),soulId:Y().min(1),task:Y().min(1),tokensBudget:Ns().int().positive(),tokensUsed:Ns().int().nonnegative(),warnings:Is(Y().min(1)).readonly()});var lc=Symbol.for(`yaml.alias`),uc=Symbol.for(`yaml.document`),dc=Symbol.for(`yaml.map`),fc=Symbol.for(`yaml.pair`),pc=Symbol.for(`yaml.scalar`),mc=Symbol.for(`yaml.seq`),hc=Symbol.for(`yaml.node.type`),gc=e=>!!e&&typeof e==`object`&&e[hc]===lc,_c=e=>!!e&&typeof e==`object`&&e[hc]===uc,vc=e=>!!e&&typeof e==`object`&&e[hc]===dc,yc=e=>!!e&&typeof e==`object`&&e[hc]===fc,bc=e=>!!e&&typeof e==`object`&&e[hc]===pc,xc=e=>!!e&&typeof e==`object`&&e[hc]===mc;function Sc(e){if(e&&typeof e==`object`)switch(e[hc]){case dc:case mc:return!0}return!1}function Cc(e){if(e&&typeof e==`object`)switch(e[hc]){case lc:case dc:case pc:case mc:return!0}return!1}var wc=e=>(bc(e)||Sc(e))&&!!e.anchor,Tc=Symbol(`break visit`),Ec=Symbol(`skip children`),Dc=Symbol(`remove node`);function Oc(e,t){let n=Mc(t);_c(e)?kc(null,e.contents,n,Object.freeze([e]))===Dc&&(e.contents=null):kc(null,e,n,Object.freeze([]))}Oc.BREAK=Tc,Oc.SKIP=Ec,Oc.REMOVE=Dc;function kc(e,t,n,r){let i=Nc(e,t,n,r);if(Cc(i)||yc(i))return Pc(e,r,i),kc(e,i,n,r);if(typeof i!=`symbol`){if(Sc(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=kc(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Tc)return Tc;else i===Dc&&(t.items.splice(e,1),--e)}}else if(yc(t)){r=Object.freeze(r.concat(t));let e=kc(`key`,t.key,n,r);if(e===Tc)return Tc;e===Dc&&(t.key=null);let i=kc(`value`,t.value,n,r);if(i===Tc)return Tc;i===Dc&&(t.value=null)}}return i}async function Ac(e,t){let n=Mc(t);_c(e)?await jc(null,e.contents,n,Object.freeze([e]))===Dc&&(e.contents=null):await jc(null,e,n,Object.freeze([]))}Ac.BREAK=Tc,Ac.SKIP=Ec,Ac.REMOVE=Dc;async function jc(e,t,n,r){let i=await Nc(e,t,n,r);if(Cc(i)||yc(i))return Pc(e,r,i),jc(e,i,n,r);if(typeof i!=`symbol`){if(Sc(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await jc(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Tc)return Tc;else i===Dc&&(t.items.splice(e,1),--e)}}else if(yc(t)){r=Object.freeze(r.concat(t));let e=await jc(`key`,t.key,n,r);if(e===Tc)return Tc;e===Dc&&(t.key=null);let i=await jc(`value`,t.value,n,r);if(i===Tc)return Tc;i===Dc&&(t.value=null)}}return i}function Mc(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Nc(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(vc(t))return n.Map?.(e,t,r);if(xc(t))return n.Seq?.(e,t,r);if(yc(t))return n.Pair?.(e,t,r);if(bc(t))return n.Scalar?.(e,t,r);if(gc(t))return n.Alias?.(e,t,r)}function Pc(e,t,n){let r=t[t.length-1];if(Sc(r))r.items[e]=n;else if(yc(r))e===`key`?r.key=n:r.value=n;else if(_c(r))r.contents=n;else{let e=gc(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var Fc={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},Ic=e=>e.replace(/[!,[\]{}]/g,e=>Fc[e]),Lc=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Ic(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&Cc(e.contents)){let t={};Oc(e.contents,(e,n)=>{Cc(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
9
|
+
`).replace(jd,``)}function Nd(e,t){return t=Md(t),Md(e)===t}function Pd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Vt(e,``+r);break;case`className`:Tt(e,`class`,r);break;case`tabIndex`:Tt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Tt(e,n,r);break;case`style`:Wt(e,r,o);break;case`data`:if(t!==`object`){Tt(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=Jt(``+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 o==`function`&&(n===`formAction`?(t!==`input`&&Pd(e,t,`name`,a.name,a,null),Pd(e,t,`formEncType`,a.formEncType,a,null),Pd(e,t,`formMethod`,a.formMethod,a,null),Pd(e,t,`formTarget`,a.formTarget,a,null)):(Pd(e,t,`encType`,a.encType,a,null),Pd(e,t,`method`,a.method,a,null),Pd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(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=Jt(``+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`:bd(`beforetoggle`,e),bd(`toggle`,e),wt(e,`popover`,r);break;case`xlinkActuate`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:wt(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=Kt.get(n)||n,wt(e,n,r))}}function Fd(e,t,n,r,a,o){switch(n){case`style`:Wt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Vt(e,``+r);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!_t.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[rt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):wt(e,n,r)}}}function Id(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:bd(`error`,e),bd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Pd(e,t,o,s,n,null)}}a&&Pd(e,t,`srcSet`,n.srcSet,n,null),r&&Pd(e,t,`src`,n.src,n,null);return;case`input`:bd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Pd(e,t,r,d,n,null)}}It(e,o,c,l,u,s,a,!1);return;case`select`:for(a in bd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Pd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Rt(e,!!r,n,!0):Rt(e,!!r,t,!1);return;case`textarea`:for(s in bd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Pd(e,t,s,c,n,null)}Bt(e,r,a,o);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:Pd(e,t,l,r,n,null)}return;case`dialog`:bd(`beforetoggle`,e),bd(`toggle`,e),bd(`cancel`,e),bd(`close`,e);break;case`iframe`:case`object`:bd(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)bd(_d[r],e);break;case`image`:bd(`error`,e),bd(`load`,e);break;case`details`:bd(`toggle`,e);break;case`embed`:case`source`:case`link`:bd(`error`,e),bd(`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(i(137,t));default:Pd(e,t,u,r,n,null)}return;default:if(Gt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Fd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Pd(e,t,c,r,n,null))}function Ld(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 a=null,o=null,s=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)||Pd(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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Pd(e,t,p,m,r,f)}}Ft(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Pd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Pd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Rt(e,!!n,n?[]:``,!1):Rt(e,!!n,t,!0)):Rt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Pd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Pd(e,t,s,a,r,o)}zt(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:Pd(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:Pd(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)&&Pd(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(i(137,t));break;default:Pd(e,t,u,p,r,m)}return;default:if(Gt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Fd(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||Fd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Pd(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||Pd(e,t,f,p,r,m)}function Rd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function zd(){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&&Rd(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&&Rd(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 Bd=null,Vd=null;function Hd(e){return e.nodeType===9?e:e.ownerDocument}function Ud(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 Wd(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 Gd(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 Kd=null;function qd(){var e=window.event;return e&&e.type===`popstate`?e===Kd?!1:(Kd=e,!0):(Kd=null,!1)}var Jd=typeof setTimeout==`function`?setTimeout:void 0,Yd=typeof clearTimeout==`function`?clearTimeout:void 0,Xd=typeof Promise==`function`?Promise:void 0,Zd=typeof queueMicrotask==`function`?queueMicrotask:Xd===void 0?Jd:function(e){return Xd.resolve(null).then(e).catch(Qd)};function Qd(e){setTimeout(function(){throw e})}function $d(e){return e===`head`}function ef(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),Fp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)hf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,hf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[lt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&hf(e.ownerDocument.body);n=i}while(n);Fp(t)}function tf(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 nf(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`:nf(n),ut(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rf(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[lt])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=uf(e.nextSibling),e===null)break}return null}function af(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=uf(e.nextSibling),e===null))return null;return e}function of(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=uf(e.nextSibling),e===null))return null;return e}function sf(e){return e.data===`$?`||e.data===`$~`}function cf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lf(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 uf(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 df=null;function ff(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return uf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pf(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 mf(e,t,n){switch(t=Hd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function hf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ut(e)}var gf=new Map,_f=new Set;function vf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yf=N.d;N.d={f:bf,r:xf,D:wf,C:Tf,L:Ef,m:Df,X:kf,S:Of,M:Af};function bf(){var e=yf.f(),t=yu();return e||t}function xf(e){var t=ft(e);t!==null&&t.tag===5&&t.type===`form`?Ss(t):yf.r(e)}var Sf=typeof document>`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=Pt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),_f.has(i)||(_f.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Id(t,`link`,e),ht(t),r.head.appendChild(t)))}}function wf(e){yf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){yf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){yf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Pt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Pt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Pt(n.imageSizes)+`"]`)):i+=`[href="`+Pt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=If(e)}gf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),gf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Nf(a))||t===`script`&&r.querySelector(Lf(a))||(t=r.createElement(`link`),Id(t,`link`,e),ht(t),r.head.appendChild(t)))}}function Df(e,t){yf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Pt(r)+`"][href="`+Pt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=If(e)}if(!gf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),gf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Lf(a)))return}r=n.createElement(`link`),Id(r,`link`,e),ht(r),n.head.appendChild(r)}}}function Of(e,t,n){yf.S(e,t,n);var r=Sf;if(r&&e){var i=mt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Nf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=gf.get(a))&&Bf(e,n);var c=o=r.createElement(`link`);ht(c),Id(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,zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){yf.X(e,t);var n=Sf;if(n&&e){var r=mt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=f({src:e,async:!0},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),ht(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){yf.M(e,t);var n=Sf;if(n&&e){var r=mt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),ht(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var a=(a=oe.current)?vf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Mf(n.href),n=mt(a).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=Mf(n.href);var o=mt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Nf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),gf.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},gf.set(e,n),o||Ff(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=If(n),n=mt(a).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(i(444,e))}}function Mf(e){return`href="`+Pt(e)+`"`}function Nf(e){return`link[rel="stylesheet"][`+e+`]`}function Pf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Ff(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}),Id(t,`link`,n),ht(t),e.head.appendChild(t))}function If(e){return`[src="`+Pt(e)+`"]`}function Lf(e){return`script[async]`+e}function Rf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Pt(n.href)+`"]`);if(r)return t.instance=r,ht(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ht(r),Id(r,`style`,a),zf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Nf(a));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;r=Pf(n),(a=gf.get(a))&&Bf(r,a),o=(e.ownerDocument||e).createElement(`link`),ht(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Id(o,`link`,r),t.state.loading|=4,zf(o,n.precedence,e),t.instance=o;case`script`:return o=If(n.src),(a=e.querySelector(Lf(o)))?(t.instance=a,ht(a),a):(r=n,(a=gf.get(o))&&(r=f({},n),Vf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ht(a),Id(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,zf(r,n.precedence,e));return t.instance}function zf(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 Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Hf=null;function Uf(e,t,n){if(Hf===null){var r=new Map,i=Hf=new Map;i.set(n,r)}else i=Hf,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[lt]||a[nt]||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 Wf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Gf(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 Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(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=Mf(r.href),a=t.querySelector(Nf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ht(a);return}a=t.ownerDocument||t,r=Pf(r),(i=gf.get(i))&&Bf(r,i),a=a.createElement(`link`),ht(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Id(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=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.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=Xf.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 ep={$$typeof:b,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function tp(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=Ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ge(0),this.hiddenUpdates=Ge(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 np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ii(3,null,null,t),e.current=a,a.stateNode=e,t=sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ba(a),e}function rp(e){return e?(e=ni,e):ni}function ip(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ha(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ua(e,r,t),n!==null&&(mu(n,e,t),Wa(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=$r(e,67108864);t!==null&&mu(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=fu();t=Ze(t);var n=$r(e,t);n!==null&&mu(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,fp(e,t,n,r)}finally{N.p=a,M.T=i}}function dp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,fp(e,t,n,r)}finally{N.p=a,M.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Td(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Be(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Fe(o);s.entanglements[1]|=c,o&=~c}rd(a),!(Nl&6)&&(eu=Se()+500,id(0,!1))}}break;case 31:case 13:s=$r(a,2),s!==null&&mu(s,a,2),yu(),op(a,2)}if(a=pp(r),a===null&&Td(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Td(e,t,r,null,n)}}function pp(e){return e=Zt(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=dt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 mp=e,null}function gp(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(Ce()){case we:return 2;case Te:return 8;case Ee:case De:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`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 Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(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=ft(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=dt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,et(e.priority,function(){cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,et(e.priority,function(){cp(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 kp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Xt=r,n.target.dispatchEvent(r),Xt=null}else return t=ft(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){kp(e)&&n.delete(t)}function jp(){_p=!1,vp!==null&&kp(vp)&&(vp=null),yp!==null&&kp(yp)&&(yp=null),bp!==null&&kp(bp)&&(bp=null),xp.forEach(Ap),Sp.forEach(Ap)}function Mp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jp)))}var Np=null;function Pp(e){Np!==e&&(Np=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Np===e&&(Np=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(hp(r||n)===null)continue;break}var a=ft(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Fp(e){function t(t){return Mp(t,e)}vp!==null&&Mp(vp,e),yp!==null&&Mp(yp,e),bp!==null&&Mp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.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[rt]||null;if(typeof a==`function`)o||Pp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[rt]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Pp(n)}}}function Ip(){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 Lp(e){this._internalRoot=e}Rp.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,fu(),e,t,null,null)},Rp.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),yu(),t[it]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var zp=n.version;if(zp!==`19.2.5`)throw Error(i(527,zp,`19.2.5`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Bp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{je=Vp.inject(Bp),Me=Vp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Bs,s=Vs,c=Hs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=np(e,1,!1,null,null,n,r,null,o,s,c,Ip),e[it]=t.current,Cd(e),new Lp(t)}})),sa=o(((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=oa()}))();function ca(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var la=e=>{switch(e){case`success`:return fa;case`info`:return ma;case`warning`:return pa;case`error`:return ha;default:return null}},ua=Array(12).fill(0),da=({visible:e,className:t})=>z.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},z.createElement(`div`,{className:`sonner-spinner`},ua.map((e,t)=>z.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),fa=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),pa=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),ma=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),ha=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),ga=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),z.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),_a=()=>{let[e,t]=z.useState(document.hidden);return z.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},va=1,ya=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:va++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],z.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(xa(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||va++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ba=(e,t)=>{let n=t?.id||va++;return ya.addToast({title:e,...t,id:n}),n},xa=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`;Object.assign(ba,{success:ya.success,info:ya.info,warning:ya.warning,error:ya.error,custom:ya.custom,message:ya.message,promise:ya.promise,dismiss:ya.dismiss,loading:ya.loading},{getHistory:()=>ya.toasts,getToasts:()=>ya.getActiveToasts()}),ca(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Sa(e){return e.label!==void 0}var Ca=3,wa=`24px`,Ta=`16px`,Ea=4e3,Da=356,Oa=14,ka=45,Aa=200;function ja(...e){return e.filter(Boolean).join(` `)}function Ma(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Na=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=z.useState(null),[O,ee]=z.useState(null),[k,A]=z.useState(!1),[j,M]=z.useState(!1),[N,te]=z.useState(!1),[P,ne]=z.useState(!1),[re,ie]=z.useState(!1),[F,I]=z.useState(0),[ae,oe]=z.useState(0),L=z.useRef(n.duration||y||Ea),R=z.useRef(null),se=z.useRef(null),ce=c===0,le=c+1<=o,ue=n.type,de=n.dismissible!==!1,fe=n.className||``,pe=n.descriptionClassName||``,me=z.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),he=z.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ge=z.useMemo(()=>n.duration||y||Ea,[n.duration,y]),_e=z.useRef(0),ve=z.useRef(0),ye=z.useRef(0),be=z.useRef(null),[xe,Se]=b.split(`-`),Ce=z.useMemo(()=>s.reduce((e,t,n)=>n>=me?e:e+t.height,0),[s,me]),we=_a(),Te=n.invert||t,Ee=ue===`loading`;ve.current=z.useMemo(()=>me*x+Ce,[me,Ce]),z.useEffect(()=>{L.current=ge},[ge]),z.useEffect(()=>{A(!0)},[]),z.useEffect(()=>{let e=se.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),z.useLayoutEffect(()=>{if(!k)return;let e=se.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[k,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let De=z.useCallback(()=>{M(!0),I(ve.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Aa)},[n,d,a,ve]);z.useEffect(()=>{if(n.promise&&ue===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||we?(()=>{if(ye.current<_e.current){let e=new Date().getTime()-_e.current;L.current-=e}ye.current=new Date().getTime()})():L.current!==1/0&&(_e.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),De()},L.current)),()=>clearTimeout(e)},[u,i,n,ue,we,De]),z.useEffect(()=>{n.delete&&(De(),n.onDismiss==null||n.onDismiss.call(n,n))},[De,n.delete]);function Oe(){return w?.loading?z.createElement(`div`,{className:ja(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ue===`loading`},w.loading):z.createElement(da,{className:ja(C?.loader,n?.classNames?.loader),visible:ue===`loading`})}let ke=n.icon||w?.[ue]||la(ue);return z.createElement(`li`,{tabIndex:0,ref:se,className:ja(_,fe,C?.toast,n?.classNames?.toast,C?.default,C?.[ue],n?.classNames?.[ue]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":k,"data-promise":!!n.promise,"data-swiped":re,"data-removed":j,"data-visible":le,"data-y-position":xe,"data-x-position":Se,"data-index":c,"data-front":ce,"data-swiping":N,"data-dismissible":de,"data-type":ue,"data-invert":Te,"data-swipe-out":P,"data-swipe-direction":O,"data-expanded":!!(u||S&&k),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${j?F:ve.current}px`,"--initial-height":S?`auto`:`${ae}px`,...m,...n.style},onDragEnd:()=>{te(!1),D(null),be.current=null},onPointerDown:e=>{e.button!==2&&(Ee||!de||(R.current=new Date,I(ve.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(te(!0),be.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(P||!de)return;be.current=null;let e=Number(se.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(se.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-R.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=ka||a>.11){I(ve.current),n.onDismiss==null||n.onDismiss.call(n,n),ee(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),De(),ne(!0);return}else{var o,s;(o=se.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=se.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}ie(!1),te(!1),D(null)},onPointerMove:t=>{var n,r;if(!be.current||!de||window.getSelection()?.toString().length>0)return;let i=t.clientY-be.current.y,a=t.clientX-be.current.x,o=e.swipeDirections??Ma(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ie(!0),(n=se.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=se.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},he&&!n.jsx&&ue!==`loading`?z.createElement(`button`,{"aria-label":T,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!de?()=>{}:()=>{De(),n.onDismiss==null||n.onDismiss.call(n,n)},className:ja(C?.closeButton,n?.classNames?.closeButton)},w?.close??ga):null,(ue||n.icon||n.promise)&&n.icon!==null&&(w?.[ue]!==null||n.icon)?z.createElement(`div`,{"data-icon":``,className:ja(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Oe():null,n.type===`loading`?null:ke):null,z.createElement(`div`,{"data-content":``,className:ja(C?.content,n?.classNames?.content)},z.createElement(`div`,{"data-title":``,className:ja(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?z.createElement(`div`,{"data-description":``,className:ja(v,pe,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),z.isValidElement(n.cancel)?n.cancel:n.cancel&&Sa(n.cancel)?z.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Sa(n.cancel)&&de&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),De())},className:ja(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,z.isValidElement(n.action)?n.action:n.action&&Sa(n.action)?z.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Sa(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&De())},className:ja(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Pa(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Fa(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Ta:wa;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Ia=z.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Ca,toastOptions:g,dir:_=Pa(),gap:v=Oa,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=z.useState([]),C=z.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=z.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=z.useState([]),[D,O]=z.useState(!1),[ee,k]=z.useState(!1),[A,j]=z.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),M=z.useRef(null),N=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),te=z.useRef(null),P=z.useRef(!1),ne=z.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||ya.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return z.useEffect(()=>ya.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{xi.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),z.useEffect(()=>{if(d!==`system`){j(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?j(`dark`):j(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{j(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{j(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),z.useEffect(()=>{x.length<=1&&O(!1)},[x]),z.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=M.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===M.current||M.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),z.useEffect(()=>{if(M.current)return()=>{te.current&&(te.current.focus({preventScroll:!0}),te.current=null,P.current=!1)}},[M.current]),z.createElement(`section`,{ref:t,"aria-label":`${b} ${N}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?z.createElement(`ol`,{key:t,dir:_===`auto`?Pa():_,tabIndex:-1,ref:M,className:c,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${Da}px`,"--gap":`${v}px`,...m,...Fa(l,u)},onBlur:e=>{P.current&&!e.currentTarget.contains(e.relatedTarget)&&(P.current=!1,te.current&&=(te.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||P.current||(P.current=!0,te.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{ee||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||k(!0)},onPointerUp:()=>k(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>z.createElement(Na,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:ee,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:ne,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))}),La=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Ra=(e=>e?La(e):La),za=e=>e;function Ba(e,t=za){let n=z.useSyncExternalStore(e.subscribe,z.useCallback(()=>t(e.getState()),[e,t]),z.useCallback(()=>t(e.getInitialState()),[e,t]));return z.useDebugValue(n),n}var Va=e=>{let t=Ra(e),n=e=>Ba(t,e);return Object.assign(n,t),n},Ha=(e=>e?Va(e):Va),Ua=`aiworker-theme`,Wa=new Set([`light`,`dark`,`system`]),Ga=Ha()(e=>({theme:`system`,setTheme:t=>e({theme:t})}));function Ka(e){return`${Ua}:${e}`}function qa(e){return e!==null&&Wa.has(e)}function Ja(e){let t=window.localStorage.getItem(Ka(e));return qa(t)?t:null}function Ya(){return typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}function Xa(e){return e===`system`?Ya()?`dark`:`light`:e}function Za(e){let t=document.documentElement,n=Xa(e);t.dataset.theme=n,t.dataset.themePreference=e}function Qa(e){let t=Ja(e)??`system`;Ga.setState({theme:t}),Za(t)}function $a({scope:e}){let t=Ga(e=>e.theme),n=Ga(e=>e.setTheme),r=(0,z.useRef)(!1),i=(0,z.useRef)(!0);return(0,z.useEffect)(()=>{let t=Ja(e);t&&n(t),r.current=!0},[e,n]),(0,z.useEffect)(()=>{if(Za(t),i.current?i.current=!1:r.current&&window.localStorage.setItem(Ka(e),t),t!==`system`||typeof window.matchMedia!=`function`)return;let n=window.matchMedia(`(prefers-color-scheme: dark)`),a=()=>Za(`system`);return n.addEventListener(`change`,a),()=>n.removeEventListener(`change`,a)},[e,t]),null}function eo(e){return(0,B.jsx)(Ia,{theme:Ga(e=>e.theme),className:`toaster group`,toastOptions:{classNames:{toast:`group toast group-[.toaster]:rounded-sm group-[.toaster]:border-hairline group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:shadow-popover`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:rounded-pill group-[.toast]:border group-[.toast]:border-primary group-[.toast]:bg-primary group-[.toast]:font-medium group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-soft-stone group-[.toast]:text-muted-foreground`}},...e})}var to=new Me({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),V;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(V||={});var no;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(no||={});var H=V.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),ro=e=>{switch(typeof e){case`undefined`:return H.undefined;case`string`:return H.string;case`number`:return Number.isNaN(e)?H.nan:H.number;case`boolean`:return H.boolean;case`function`:return H.function;case`bigint`:return H.bigint;case`symbol`:return H.symbol;case`object`:return Array.isArray(e)?H.array:e===null?H.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?H.promise:typeof Map<`u`&&e instanceof Map?H.map:typeof Set<`u`&&e instanceof Set?H.set:typeof Date<`u`&&e instanceof Date?H.date:H.object;default:return H.unknown}},U=V.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),io=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,V.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};io.create=e=>new io(e);var ao=(e,t)=>{let n;switch(e.code){case U.invalid_type:n=e.received===H.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case U.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,V.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:n=`Unrecognized key(s) in object: ${V.joinValues(e.keys,`, `)}`;break;case U.invalid_union:n=`Invalid input`;break;case U.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${V.joinValues(e.options)}`;break;case U.invalid_enum_value:n=`Invalid enum value. Expected ${V.joinValues(e.options)}, received '${e.received}'`;break;case U.invalid_arguments:n=`Invalid function arguments`;break;case U.invalid_return_type:n=`Invalid function return type`;break;case U.invalid_date:n=`Invalid date`;break;case U.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:V.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case U.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case U.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case U.custom:n=`Invalid input`;break;case U.invalid_intersection_types:n=`Intersection results could not be merged`;break;case U.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case U.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,V.assertNever(e)}return{message:n}},oo=ao;function so(){return oo}var co=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function W(e,t){let n=so(),r=co({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ao?void 0:ao].filter(e=>!!e)});e.common.issues.push(r)}var lo=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return G;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return G;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},G=Object.freeze({status:`aborted`}),uo=e=>({status:`dirty`,value:e}),fo=e=>({status:`valid`,value:e}),po=e=>e.status===`aborted`,mo=e=>e.status===`dirty`,ho=e=>e.status===`valid`,go=e=>typeof Promise<`u`&&e instanceof Promise,K;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(K||={});var _o=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},vo=(e,t)=>{if(ho(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new io(e.common.issues);return this._error=t,this._error}}};function q(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var yo=class{get description(){return this._def.description}_getType(e){return ro(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ro(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new lo,ctx:{common:e.parent.common,data:e.data,parsedType:ro(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(go(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ro(e)};return vo(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ro(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return ho(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>ho(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ro(e)},r=this._parse({data:e,path:n.path,parent:n});return vo(n,await(go(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:U.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new Ss({schema:this,typeName:J.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return Cs.create(this,this._def)}nullable(){return ws.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rs.create(this)}promise(){return xs.create(this,this._def)}or(e){return os.create([this,e],this._def)}and(e){return us.create(this,e,this._def)}transform(e){return new Ss({...q(this._def),schema:this,typeName:J.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Ts({...q(this._def),innerType:this,defaultValue:t,typeName:J.ZodDefault})}brand(){return new Os({typeName:J.ZodBranded,type:this,...q(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Es({...q(this._def),innerType:this,catchValue:t,typeName:J.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ks.create(this,e)}readonly(){return As.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},bo=/^c[^\s-]{8,}$/i,xo=/^[0-9a-z]+$/,So=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Co=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wo=/^[a-z0-9_-]{21}$/i,To=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Eo=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Do=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Oo=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,ko,Ao=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,jo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Mo=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,No=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Po=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Fo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Io=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Lo=RegExp(`^${Io}$`);function Ro(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function zo(e){return RegExp(`^${Ro(e)}$`)}function Bo(e){let t=`${Io}T${Ro(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Vo(e,t){return!!((t===`v4`||!t)&&Ao.test(e)||(t===`v6`||!t)&&Mo.test(e))}function Ho(e,t){if(!To.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Uo(e,t){return!!((t===`v4`||!t)&&jo.test(e)||(t===`v6`||!t)&&No.test(e))}var Wo=class e extends yo{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==H.string){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.string,received:t.parsedType}),G}let t=new lo,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?W(n,{code:U.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&W(n,{code:U.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)Do.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`email`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)ko||=new RegExp(Oo,`u`),ko.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`emoji`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Co.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`uuid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)wo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`nanoid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)bo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cuid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)xo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cuid2`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)So.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`ulid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),W(n,{validation:`url`,code:U.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`regex`,code:U.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?Bo(r).test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?Lo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?zo(r).test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Eo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`duration`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Vo(e.data,r.version)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`ip`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Ho(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`jwt`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Uo(e.data,r.version)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cidr`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Po.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`base64`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Fo.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`base64url`,code:U.invalid_string,message:r.message}),t.dirty()):V.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:U.invalid_string,...K.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...K.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...K.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...K.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...K.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...K.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...K.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...K.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...K.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...K.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...K.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...K.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...K.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...K.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...K.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...K.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...K.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...K.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...K.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...K.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...K.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...K.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...K.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...K.errToObj(t)})}nonempty(e){return this.min(1,K.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Wo.create=e=>new Wo({checks:[],typeName:J.ZodString,coerce:e?.coerce??!1,...q(e)});function Go(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Ko=class e extends yo{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==H.number){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.number,received:t.parsedType}),G}let t,n=new lo;for(let r of this._def.checks)r.kind===`int`?V.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),W(t,{code:U.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Go(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_finite,message:r.message}),n.dirty()):V.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,K.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,K.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,K.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,K.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:K.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:K.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:K.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:K.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:K.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:K.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:K.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&V.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};Ko.create=e=>new Ko({checks:[],typeName:J.ZodNumber,coerce:e?.coerce||!1,...q(e)});var qo=class e extends yo{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==H.bigint)return this._getInvalidInput(e);let t,n=new lo;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):V.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.bigint,received:t.parsedType}),G}gte(e,t){return this.setLimit(`min`,e,!0,K.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,K.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,K.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,K.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:K.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:K.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:K.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};qo.create=e=>new qo({checks:[],typeName:J.ZodBigInt,coerce:e?.coerce??!1,...q(e)});var Jo=class extends yo{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==H.boolean){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.boolean,received:t.parsedType}),G}return fo(e.data)}};Jo.create=e=>new Jo({typeName:J.ZodBoolean,coerce:e?.coerce||!1,...q(e)});var Yo=class e extends yo{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==H.date){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.date,received:t.parsedType}),G}if(Number.isNaN(e.data.getTime()))return W(this._getOrReturnCtx(e),{code:U.invalid_date}),G;let t=new lo,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):V.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:K.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:K.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};Yo.create=e=>new Yo({checks:[],coerce:e?.coerce||!1,typeName:J.ZodDate,...q(e)});var Xo=class extends yo{_parse(e){if(this._getType(e)!==H.symbol){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.symbol,received:t.parsedType}),G}return fo(e.data)}};Xo.create=e=>new Xo({typeName:J.ZodSymbol,...q(e)});var Zo=class extends yo{_parse(e){if(this._getType(e)!==H.undefined){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.undefined,received:t.parsedType}),G}return fo(e.data)}};Zo.create=e=>new Zo({typeName:J.ZodUndefined,...q(e)});var Qo=class extends yo{_parse(e){if(this._getType(e)!==H.null){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.null,received:t.parsedType}),G}return fo(e.data)}};Qo.create=e=>new Qo({typeName:J.ZodNull,...q(e)});var $o=class extends yo{constructor(){super(...arguments),this._any=!0}_parse(e){return fo(e.data)}};$o.create=e=>new $o({typeName:J.ZodAny,...q(e)});var es=class extends yo{constructor(){super(...arguments),this._unknown=!0}_parse(e){return fo(e.data)}};es.create=e=>new es({typeName:J.ZodUnknown,...q(e)});var ts=class extends yo{_parse(e){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.never,received:t.parsedType}),G}};ts.create=e=>new ts({typeName:J.ZodNever,...q(e)});var ns=class extends yo{_parse(e){if(this._getType(e)!==H.undefined){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.void,received:t.parsedType}),G}return fo(e.data)}};ns.create=e=>new ns({typeName:J.ZodVoid,...q(e)});var rs=class e extends yo{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==H.array)return W(t,{code:U.invalid_type,expected:H.array,received:t.parsedType}),G;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(W(t,{code:e?U.too_big:U.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(W(t,{code:U.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(W(t,{code:U.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new _o(t,e,t.path,n)))).then(e=>lo.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new _o(t,e,t.path,n)));return lo.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:K.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:K.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:K.toString(n)}})}nonempty(e){return this.min(1,e)}};rs.create=(e,t)=>new rs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...q(t)});function is(e){if(e instanceof as){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Cs.create(is(r))}return new as({...e._def,shape:()=>t})}else if(e instanceof rs)return new rs({...e._def,type:is(e.element)});else if(e instanceof Cs)return Cs.create(is(e.unwrap()));else if(e instanceof ws)return ws.create(is(e.unwrap()));else if(e instanceof ds)return ds.create(e.items.map(e=>is(e)));else return e}var as=class e extends yo{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=V.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==H.object){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.object,received:t.parsedType}),G}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ts&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new _o(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ts){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(W(n,{code:U.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new _o(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>lo.mergeObjectSync(t,e)):lo.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return K.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:K.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:J.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of V.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of V.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return is(this)}partial(t){let n={};for(let e of V.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of V.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Cs;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return vs(V.objectKeys(this.shape))}};as.create=(e,t)=>new as({shape:()=>e,unknownKeys:`strip`,catchall:ts.create(),typeName:J.ZodObject,...q(t)}),as.strictCreate=(e,t)=>new as({shape:()=>e,unknownKeys:`strict`,catchall:ts.create(),typeName:J.ZodObject,...q(t)}),as.lazycreate=(e,t)=>new as({shape:e,unknownKeys:`strip`,catchall:ts.create(),typeName:J.ZodObject,...q(t)});var os=class extends yo{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new io(e.ctx.common.issues));return W(t,{code:U.invalid_union,unionErrors:n}),G}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new io(e));return W(t,{code:U.invalid_union,unionErrors:i}),G}}get options(){return this._def.options}};os.create=(e,t)=>new os({options:e,typeName:J.ZodUnion,...q(t)});var ss=e=>e instanceof gs?ss(e.schema):e instanceof Ss?ss(e.innerType()):e instanceof _s?[e.value]:e instanceof ys?e.options:e instanceof bs?V.objectValues(e.enum):e instanceof Ts?ss(e._def.innerType):e instanceof Zo?[void 0]:e instanceof Qo?[null]:e instanceof Cs?[void 0,...ss(e.unwrap())]:e instanceof ws?[null,...ss(e.unwrap())]:e instanceof Os||e instanceof As?ss(e.unwrap()):e instanceof Es?ss(e._def.innerType):[],cs=class e extends yo{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.object)return W(t,{code:U.invalid_type,expected:H.object,received:t.parsedType}),G;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(W(t,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),G)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=ss(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:J.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...q(r)})}};function ls(e,t){let n=ro(e),r=ro(t);if(e===t)return{valid:!0,data:e};if(n===H.object&&r===H.object){let n=V.objectKeys(t),r=V.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=ls(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===H.array&&r===H.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ls(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===H.date&&r===H.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var us=class extends yo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(po(e)||po(r))return G;let i=ls(e.value,r.value);return i.valid?((mo(e)||mo(r))&&t.dirty(),{status:t.value,value:i.data}):(W(n,{code:U.invalid_intersection_types}),G)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};us.create=(e,t,n)=>new us({left:e,right:t,typeName:J.ZodIntersection,...q(n)});var ds=class e extends yo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.array)return W(n,{code:U.invalid_type,expected:H.array,received:n.parsedType}),G;if(n.data.length<this._def.items.length)return W(n,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),G;!this._def.rest&&n.data.length>this._def.items.length&&(W(n,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new _o(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>lo.mergeArray(t,e)):lo.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ds.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ds({items:e,typeName:J.ZodTuple,rest:null,...q(t)})};var fs=class e extends yo{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.object)return W(n,{code:U.invalid_type,expected:H.object,received:n.parsedType}),G;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new _o(n,e,n.path,e)),value:a._parse(new _o(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?lo.mergeObjectAsync(t,r):lo.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof yo?new e({keyType:t,valueType:n,typeName:J.ZodRecord,...q(r)}):new e({keyType:Wo.create(),valueType:t,typeName:J.ZodRecord,...q(n)})}},ps=class extends yo{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.map)return W(n,{code:U.invalid_type,expected:H.map,received:n.parsedType}),G;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new _o(n,e,n.path,[a,`key`])),value:i._parse(new _o(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return G;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return G;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};ps.create=(e,t,n)=>new ps({valueType:t,keyType:e,typeName:J.ZodMap,...q(n)});var ms=class e extends yo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.set)return W(n,{code:U.invalid_type,expected:H.set,received:n.parsedType}),G;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(W(n,{code:U.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(W(n,{code:U.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return G;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new _o(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:K.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:K.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ms.create=(e,t)=>new ms({valueType:e,minSize:null,maxSize:null,typeName:J.ZodSet,...q(t)});var hs=class e extends yo{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.function)return W(t,{code:U.invalid_type,expected:H.function,received:t.parsedType}),G;function n(e,n){return co({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,so(),ao].filter(e=>!!e),issueData:{code:U.invalid_arguments,argumentsError:n}})}function r(e,n){return co({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,so(),ao].filter(e=>!!e),issueData:{code:U.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof xs){let e=this;return fo(async function(...t){let o=new io([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return fo(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new io([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new io([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ds.create(t).rest(es.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||ds.create([]).rest(es.create()),returns:n||es.create(),typeName:J.ZodFunction,...q(r)})}},gs=class extends yo{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};gs.create=(e,t)=>new gs({getter:e,typeName:J.ZodLazy,...q(t)});var _s=class extends yo{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return W(t,{received:t.data,code:U.invalid_literal,expected:this._def.value}),G}return{status:`valid`,value:e.data}}get value(){return this._def.value}};_s.create=(e,t)=>new _s({value:e,typeName:J.ZodLiteral,...q(t)});function vs(e,t){return new ys({values:e,typeName:J.ZodEnum,...q(t)})}var ys=class e extends yo{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return W(t,{expected:V.joinValues(n),received:t.parsedType,code:U.invalid_type}),G}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return W(t,{received:t.data,code:U.invalid_enum_value,options:n}),G}return fo(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};ys.create=vs;var bs=class extends yo{_parse(e){let t=V.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==H.string&&n.parsedType!==H.number){let e=V.objectValues(t);return W(n,{expected:V.joinValues(e),received:n.parsedType,code:U.invalid_type}),G}if(this._cache||=new Set(V.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=V.objectValues(t);return W(n,{received:n.data,code:U.invalid_enum_value,options:e}),G}return fo(e.data)}get enum(){return this._def.values}};bs.create=(e,t)=>new bs({values:e,typeName:J.ZodNativeEnum,...q(t)});var xs=class extends yo{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==H.promise&&t.common.async===!1?(W(t,{code:U.invalid_type,expected:H.promise,received:t.parsedType}),G):fo((t.parsedType===H.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};xs.create=(e,t)=>new xs({type:e,typeName:J.ZodPromise,...q(t)});var Ss=class extends yo{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{W(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return G;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?G:r.status===`dirty`||t.value===`dirty`?uo(r.value):r});{if(t.value===`aborted`)return G;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?G:r.status===`dirty`||t.value===`dirty`?uo(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?G:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?G:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ho(e))return G;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>ho(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):G);V.assertNever(r)}};Ss.create=(e,t,n)=>new Ss({schema:e,typeName:J.ZodEffects,effect:t,...q(n)}),Ss.createWithPreprocess=(e,t,n)=>new Ss({schema:t,effect:{type:`preprocess`,transform:e},typeName:J.ZodEffects,...q(n)});var Cs=class extends yo{_parse(e){return this._getType(e)===H.undefined?fo(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Cs.create=(e,t)=>new Cs({innerType:e,typeName:J.ZodOptional,...q(t)});var ws=class extends yo{_parse(e){return this._getType(e)===H.null?fo(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ws.create=(e,t)=>new ws({innerType:e,typeName:J.ZodNullable,...q(t)});var Ts=class extends yo{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===H.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Ts.create=(e,t)=>new Ts({innerType:e,typeName:J.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...q(t)});var Es=class extends yo{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return go(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new io(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new io(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Es.create=(e,t)=>new Es({innerType:e,typeName:J.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...q(t)});var Ds=class extends yo{_parse(e){if(this._getType(e)!==H.nan){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.nan,received:t.parsedType}),G}return{status:`valid`,value:e.data}}};Ds.create=e=>new Ds({typeName:J.ZodNaN,...q(e)});var Os=class extends yo{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},ks=class e extends yo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?G:e.status===`dirty`?(t.dirty(),uo(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?G:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:J.ZodPipeline})}},As=class extends yo{_parse(e){let t=this._def.innerType._parse(e),n=e=>(ho(e)&&(e.value=Object.freeze(e.value)),e);return go(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};As.create=(e,t)=>new As({innerType:e,typeName:J.ZodReadonly,...q(t)});function js(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function Ms(e,t={},n){return e?$o.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=js(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=js(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):$o.create()}as.lazycreate;var J;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(J||={});var Y=Wo.create,Ns=Ko.create;Ds.create,qo.create;var Ps=Jo.create;Yo.create,Xo.create,Zo.create,Qo.create,$o.create;var Fs=es.create;ts.create,ns.create;var Is=rs.create,X=as.create;as.strictCreate;var Ls=os.create,Rs=cs.create;us.create,ds.create;var zs=fs.create;ps.create,ms.create,hs.create,gs.create;var Bs=_s.create,Vs=ys.create;bs.create,xs.create,Ss.create,Cs.create,ws.create,Ss.createWithPreprocess,ks.create;var Hs=/^[a-z0-9][a-z0-9._-]*$/,Us=/^[a-z][a-z0-9-]*$/,Ws=/^[a-z][a-z0-9-]*$/,Gs=Y().min(1).regex(Hs,`admission id must be lowercase alphanumeric with . _ -`),Ks=Y().min(1).regex(Us,`admission kind must be kebab-case`),qs=Vs([`low`,`medium`,`high`]),Js=Vs([`pending`,`approved`,`rejected`,`applied`,`failed`]),Ys=Vs([`approved`,`rejected`,`applied`,`failed`]),Xs=Vs([`conversation`,`message`,`tool-call`,`observation`,`artifact`,`memory`,`log`]),Zs=X({at:Y().min(1),kind:Xs,summary:Y().max(500).optional(),notes:Y().max(2e3).optional(),ref:Y().min(1)});X({confidence:Ns().min(0).max(1),createdAt:Y().min(1),evidence:Is(Zs).readonly(),id:Gs,kind:Ks,payload:zs(Y(),Fs()).optional(),risk:qs,rollback:Y().min(1),scopeId:Y().min(1).optional(),soulId:Y().min(1).regex(Ws),status:Js,summary:Y().min(1).max(2e3),target:Y().min(1),updatedAt:Y().min(1)}),X({confidence:Ns().min(0).max(1),evidence:Is(Zs).readonly().optional(),id:Gs,kind:Ks,payload:zs(Y(),Fs()).optional(),risk:qs.default(`high`),rollback:Y().min(1),scopeId:Y().min(1).optional(),soulId:Y().min(1).regex(Ws),summary:Y().min(1).max(2e3),target:Y().min(1)}),X({appliedAt:Y().min(1).optional(),decidedAt:Y().min(1),decidedBy:Y().min(1),decision:Ys,failureReason:Y().max(4e3).optional(),id:Ns().int().positive(),proposalId:Gs,reason:Y().max(2e3).optional()}),X({body:Y().min(1).max(2e4),topic:Y().min(1).regex(/^[a-z0-9][a-z0-9._-]*$/).optional(),indexEntry:Y().min(1).max(280).optional()}),X({body:Y().min(1).max(2e4),skillId:Y().min(1).regex(/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/),overwrite:Ps().optional()});var Qs=/^[a-z0-9][a-z0-9._-]*$/,$s=/^[a-z][a-z0-9-]*$/,ec=Y().min(1).regex(Qs,`artifact id must be lowercase alphanumeric with . _ -`),tc=Y().min(1).regex($s,`artifact type must be kebab-case`),nc=Vs([`public`,`internal`,`confidential`,`secret`]),rc=Vs([`active`,`archived`,`removed`]),ic=Vs([`operator`,`brain-runtime`,`executor`,`channel-import`]);X({createdAt:Y().min(1),evidenceRefs:Is(Y().min(1)).readonly(),hash:Y().regex(/^[a-f0-9]{64}$/).optional(),id:ec,metadata:zs(Y(),Fs()).optional(),ref:Y().min(1),retention:Y().min(1).optional(),scopeId:Y().min(1).optional(),sensitivity:nc,source:ic,status:rc,summary:Y().max(2e3).optional(),type:tc,updatedAt:Y().min(1)}),X({evidenceRefs:Is(Y().min(1)).readonly().optional(),hash:Y().regex(/^[a-f0-9]{64}$/).optional(),id:ec,metadata:zs(Y(),Fs()).optional(),ref:Y().min(1),retention:Y().min(1).optional(),scopeId:Y().min(1).optional(),sensitivity:nc.default(`internal`),source:ic,status:rc.default(`active`),summary:Y().max(2e3).optional(),type:tc});var ac=Y().min(1).regex(/^[a-z][a-z0-9-]*$/,`brief section id must be kebab-case`),oc=Vs([`soul-doc`,`memory-doc`,`rollup-doc`,`risk-policy`,`admission-summary`,`artifact-summary`,`scope-manifest`,`soul-skeleton`]),sc=X({body:Y().min(1),id:ac,protected:Ps(),source:oc,tokens:Ns().int().nonnegative()}),cc=X({estimatedTokens:Ns().int().nonnegative(),id:ac,reason:Y().min(1)});X({artifactRefs:Is(Fs()).transform(e=>e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(e=>e.length>0)).pipe(Is(Y().min(1)).readonly()).optional(),executor:Y().min(1).optional(),risk:qs.optional(),scopeId:Y().min(1).optional(),soulId:Y().min(1).optional(),task:Y().min(1).max(4e3),tokenBudget:Ns().int().min(200).max(5e4).optional()}),X({compiledAt:Y().min(1),droppedSections:Is(cc).readonly(),executor:Y().min(1).optional(),scopeId:Y().min(1).optional(),sections:Is(sc).readonly(),soulId:Y().min(1),task:Y().min(1),tokensBudget:Ns().int().positive(),tokensUsed:Ns().int().nonnegative(),warnings:Is(Y().min(1)).readonly()});var lc=Symbol.for(`yaml.alias`),uc=Symbol.for(`yaml.document`),dc=Symbol.for(`yaml.map`),fc=Symbol.for(`yaml.pair`),pc=Symbol.for(`yaml.scalar`),mc=Symbol.for(`yaml.seq`),hc=Symbol.for(`yaml.node.type`),gc=e=>!!e&&typeof e==`object`&&e[hc]===lc,_c=e=>!!e&&typeof e==`object`&&e[hc]===uc,vc=e=>!!e&&typeof e==`object`&&e[hc]===dc,yc=e=>!!e&&typeof e==`object`&&e[hc]===fc,bc=e=>!!e&&typeof e==`object`&&e[hc]===pc,xc=e=>!!e&&typeof e==`object`&&e[hc]===mc;function Sc(e){if(e&&typeof e==`object`)switch(e[hc]){case dc:case mc:return!0}return!1}function Cc(e){if(e&&typeof e==`object`)switch(e[hc]){case lc:case dc:case pc:case mc:return!0}return!1}var wc=e=>(bc(e)||Sc(e))&&!!e.anchor,Tc=Symbol(`break visit`),Ec=Symbol(`skip children`),Dc=Symbol(`remove node`);function Oc(e,t){let n=Mc(t);_c(e)?kc(null,e.contents,n,Object.freeze([e]))===Dc&&(e.contents=null):kc(null,e,n,Object.freeze([]))}Oc.BREAK=Tc,Oc.SKIP=Ec,Oc.REMOVE=Dc;function kc(e,t,n,r){let i=Nc(e,t,n,r);if(Cc(i)||yc(i))return Pc(e,r,i),kc(e,i,n,r);if(typeof i!=`symbol`){if(Sc(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=kc(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Tc)return Tc;else i===Dc&&(t.items.splice(e,1),--e)}}else if(yc(t)){r=Object.freeze(r.concat(t));let e=kc(`key`,t.key,n,r);if(e===Tc)return Tc;e===Dc&&(t.key=null);let i=kc(`value`,t.value,n,r);if(i===Tc)return Tc;i===Dc&&(t.value=null)}}return i}async function Ac(e,t){let n=Mc(t);_c(e)?await jc(null,e.contents,n,Object.freeze([e]))===Dc&&(e.contents=null):await jc(null,e,n,Object.freeze([]))}Ac.BREAK=Tc,Ac.SKIP=Ec,Ac.REMOVE=Dc;async function jc(e,t,n,r){let i=await Nc(e,t,n,r);if(Cc(i)||yc(i))return Pc(e,r,i),jc(e,i,n,r);if(typeof i!=`symbol`){if(Sc(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await jc(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Tc)return Tc;else i===Dc&&(t.items.splice(e,1),--e)}}else if(yc(t)){r=Object.freeze(r.concat(t));let e=await jc(`key`,t.key,n,r);if(e===Tc)return Tc;e===Dc&&(t.key=null);let i=await jc(`value`,t.value,n,r);if(i===Tc)return Tc;i===Dc&&(t.value=null)}}return i}function Mc(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Nc(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(vc(t))return n.Map?.(e,t,r);if(xc(t))return n.Seq?.(e,t,r);if(yc(t))return n.Pair?.(e,t,r);if(bc(t))return n.Scalar?.(e,t,r);if(gc(t))return n.Alias?.(e,t,r)}function Pc(e,t,n){let r=t[t.length-1];if(Sc(r))r.items[e]=n;else if(yc(r))e===`key`?r.key=n:r.value=n;else if(_c(r))r.contents=n;else{let e=gc(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var Fc={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},Ic=e=>e.replace(/[!,[\]{}]/g,e=>Fc[e]),Lc=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Ic(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&Cc(e.contents)){let t={};Oc(e.contents,(e,n)=>{Cc(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
10
10
|
`)}};Lc.defaultYaml={explicit:!1,version:`1.2`},Lc.defaultTags={"!!":`tag:yaml.org,2002:`};function Rc(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function zc(e){let t=new Set;return Oc(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Bc(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Vc(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=zc(e);let a=Bc(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(bc(t.node)||Sc(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function Hc(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=Hc(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=Hc(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=Hc(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=Hc(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function Uc(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Uc(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!wc(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Wc=class{constructor(e){Object.defineProperty(this,hc,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!_c(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=Uc(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Hc(i,{"":o},``,o):o}},Gc=class extends Wc{constructor(e){super(lc),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Oc(e,{Node:(e,t)=>{(gc(t)||wc(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(Uc(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Kc(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Rc(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Kc(e,t,n){if(gc(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Sc(t)){let r=0;for(let i of t.items){let t=Kc(e,i,n);t>r&&(r=t)}return r}else if(yc(t)){let r=Kc(e,t.key,n),i=Kc(e,t.value,n);return Math.max(r,i)}return 1}var qc=e=>!e||typeof e!=`function`&&typeof e!=`object`,Z=class extends Wc{constructor(e){super(pc),this.value=e}toJSON(e,t){return t?.keep?this.value:Uc(this.value,e,t)}toString(){return String(this.value)}};Z.BLOCK_FOLDED=`BLOCK_FOLDED`,Z.BLOCK_LITERAL=`BLOCK_LITERAL`,Z.PLAIN=`PLAIN`,Z.QUOTE_DOUBLE=`QUOTE_DOUBLE`,Z.QUOTE_SINGLE=`QUOTE_SINGLE`;var Jc=`tag:yaml.org,2002:`;function Yc(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function Xc(e,t,n){if(_c(e)&&(e=e.contents),Cc(e))return e;if(yc(e)){let t=n.schema[dc].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new Gc(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=Jc+t.slice(2));let l=Yc(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new Z(e);return c&&(c.node=t),t}l=e instanceof Map?o[dc]:Symbol.iterator in Object(e)?o[mc]:o[dc]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new Z(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Zc(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Xc(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var Qc=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,$c=class extends Wc{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>Cc(t)||yc(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Qc(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Sc(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Zc(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Sc(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&bc(i)?i.value:i:Sc(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!yc(t))return!1;let n=t.value;return n==null||e&&bc(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Sc(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(Sc(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Zc(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},el=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function tl(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var nl=(e,t,n)=>e.endsWith(`
|
|
11
11
|
`)?tl(n,t):n.includes(`
|
|
12
12
|
`)?`
|
|
@@ -112,7 +112,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
112
112
|
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
113
113
|
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey)if(!t.sep)if(Ud(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=qd(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ud(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Gd(t.key)&&!Ud(t.sep,`newline`)){let e=qd(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Ud(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!Ud(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||Ud(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=qd(Kd(t));Jd(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
|
114
114
|
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
115
|
-
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=qd(Kd(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=qd(Kd(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function Xd(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Hd||null,prettyErrors:t}}function Zd(e,t={}){let{lineCounter:n,prettyErrors:r}=Xd(t),i=new Yd(n?.addNewLine),a=new Od(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new Wu(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Ku(e,n)),o.warnings.forEach(Ku(e,n))),o}function Qd(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=Zd(e,n);if(!i)return null;if(i.warnings.forEach(e=>Cl(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}var $d=Y().min(1).regex(/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/),ef=Vs([`info`,`warning`,`error`]),tf=Vs([`pending`,`pass`,`warn`,`fail`]),nf=Vs([`draft`,`enabled`,`disabled`]),rf=X({code:Y().min(1),message:Y().min(1),path:Y().min(1).optional(),severity:ef}),af=
|
|
115
|
+
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=qd(Kd(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=qd(Kd(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function Xd(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Hd||null,prettyErrors:t}}function Zd(e,t={}){let{lineCounter:n,prettyErrors:r}=Xd(t),i=new Yd(n?.addNewLine),a=new Od(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new Wu(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Ku(e,n)),o.warnings.forEach(Ku(e,n))),o}function Qd(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=Zd(e,n);if(!i)return null;if(i.warnings.forEach(e=>Cl(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}var $d=Y().min(1).regex(/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/),ef=Vs([`info`,`warning`,`error`]),tf=Vs([`pending`,`pass`,`warn`,`fail`]),nf=Vs([`draft`,`enabled`,`disabled`]),rf=X({code:Y().min(1),message:Y().min(1),path:Y().min(1).optional(),severity:ef}),af=X({checkedAt:Y().min(1).optional(),issues:Is(rf),status:tf}),of=X({id:$d,status:nf,validation:af}),sf=Vs([`auto`,`ask`,`deny`]),cf=X({action:sf,pattern:Y().min(1),reason:Y().min(1).optional()});X({outOfScope:X({default:Y().min(1).optional(),strategy:Y().min(1).optional()}).passthrough().refine(e=>typeof e.default==`string`||typeof e.strategy==`string`,`outOfScope requires either default or strategy`),risk:X({highRiskRequiresApproval:Ps(),policy:Y().min(1).optional()}).passthrough(),schemaVersion:Bs(1),soul:X({label:Y().min(1).optional(),preset:$d,source:Y().min(1).optional()}).passthrough().optional(),status:nf,toolPolicy:X({default:sf,rules:Is(cf)}).passthrough().optional()});var lf=X({description:Y().min(1).optional(),risk:Vs([`low`,`medium`,`high`]).optional(),tools:Is(Y().min(1)).optional()}).passthrough(),uf=X({secretRef:Y().min(1)}),df=X({description:Y().min(1).optional(),inputSchema:zs(Fs()).optional(),name:Y().min(1)}).passthrough(),ff=X({args:Is(Y()).optional(),command:Y().min(1).optional(),description:Y().min(1).optional(),disabled:Ps().optional(),env:zs(Fs()).optional(),headers:zs(Fs()).optional(),tools:Is(df).optional(),transport:Vs([`stdio`,`streamable-http`,`sse`]).optional(),url:Y().min(1).optional()}).passthrough(),pf=X({schemaVersion:Bs(1).optional(),servers:zs(ff)});X({defaultToolsets:Is($d),mcp:pf,packs:Is(of),schemaVersion:Bs(1),soul:$d.optional(),status:nf,toolsets:zs(lf).optional(),validation:af.optional()});var mf=Vs([`filesystem-read`,`filesystem-write`,`shell`,`network`,`browser`,`mcp`]),hf=X({capabilities:Is(Y().min(1)).optional(),description:Y().min(1),name:Y().min(1),permissions:Is(mf).optional(),version:Y().min(1).optional()}).passthrough(),gf=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/,_f=hf.extend({id:Y().min(1)}),vf=X({expectedId:Y().min(1),skillMd:Y().min(1),sourcePath:Y().min(1)});function yf(e,t){let n=gf.exec(e);if(!n)throw Error(`Brain skill pack ${t} is missing YAML frontmatter`);let r;try{r=Qd(n[1]??``)}catch(e){throw Error(`Brain skill pack ${t} has invalid YAML frontmatter: ${e instanceof Error?e.message:String(e)}`)}try{return _f.parse(r)}catch(e){throw e instanceof io?Error(`Brain skill pack ${t} does not satisfy SkillMetadata: ${e.issues.map(e=>e.message).join(`; `)}`):e}}function bf(e){let t=vf.parse(e),n=yf(t.skillMd,t.sourcePath);if(n.id!==t.expectedId)throw Error(`Brain skill pack ${t.sourcePath} declares id "${n.id}" but expected "${t.expectedId}"`);return{id:n.id,installPath:`${n.id}/SKILL.md`,metadata:n,skillMd:t.skillMd.trimEnd(),sourcePath:t.sourcePath}}var xf=`---
|
|
116
116
|
id: developer.codebase-orientation
|
|
117
117
|
name: Codebase Orientation
|
|
118
118
|
description: Build codebase context before editing, with narrow search, impact tracing, and focused verification.
|
|
@@ -142,7 +142,7 @@ Use this before implementing code changes.
|
|
|
142
142
|
- Do not rewrite unrelated code.
|
|
143
143
|
- Do not use destructive git operations.
|
|
144
144
|
- Keep secrets out of source, logs, and Brain memory.
|
|
145
|
-
`,
|
|
145
|
+
`,Sf=`---
|
|
146
146
|
id: devops-sre.incident-triage
|
|
147
147
|
name: Incident Triage
|
|
148
148
|
description: Triage operational incidents with timeline, blast radius, evidence, rollback, and escalation.
|
|
@@ -171,7 +171,7 @@ Use this for alerts, outages, degraded service, deployment failures, or reliabil
|
|
|
171
171
|
|
|
172
172
|
- Do not restart, scale, deploy, or change production state without explicit approval.
|
|
173
173
|
- Redact tokens, host secrets, and customer data in summaries.
|
|
174
|
-
`,
|
|
174
|
+
`,Cf=`---
|
|
175
175
|
id: finance-ops.financial-evidence-review
|
|
176
176
|
name: Financial Evidence Review
|
|
177
177
|
description: Review finance artifacts with source tracking, reconciliation questions, and escalation boundaries.
|
|
@@ -198,7 +198,7 @@ Use this for invoices, expenses, reconciliation notes, payment questions, and fi
|
|
|
198
198
|
|
|
199
199
|
- Do not infer sensitive account details that are not in evidence.
|
|
200
200
|
- Do not store personal or payment data in Brain memory without admission and redaction.
|
|
201
|
-
`,
|
|
201
|
+
`,wf=`---
|
|
202
202
|
id: general-assistant.general-task-framing
|
|
203
203
|
name: General Task Framing
|
|
204
204
|
description: Turn broad requests into scoped, evidence-backed next actions without overreaching.
|
|
@@ -225,7 +225,7 @@ Use this when the user asks for help but the domain, evidence, or desired output
|
|
|
225
225
|
|
|
226
226
|
- Do not silently convert a general request into code, finance, HR, legal, or production operations.
|
|
227
227
|
- Do not expand filesystem or network access without a clear reason.
|
|
228
|
-
`,
|
|
228
|
+
`,Tf=`---
|
|
229
229
|
id: hr-recruiting.candidate-screening
|
|
230
230
|
name: Candidate Screening
|
|
231
231
|
description: Screen recruiting evidence against role criteria with bias-aware, source-backed notes.
|
|
@@ -252,7 +252,7 @@ Use this for resumes, candidate notes, role requirements, interview packets, and
|
|
|
252
252
|
|
|
253
253
|
- Avoid protected-class inference and unsupported personal judgments.
|
|
254
254
|
- Treat candidate data as sensitive; durable memory requires admission and redaction.
|
|
255
|
-
`,
|
|
255
|
+
`,Ef=`---
|
|
256
256
|
id: product-designer.design-critique
|
|
257
257
|
name: Design Critique
|
|
258
258
|
description: Critique product design evidence against user goals, interaction clarity, and visual system fit.
|
|
@@ -279,7 +279,7 @@ Use this for product UI, flows, prototypes, screenshots, specs, or visual direct
|
|
|
279
279
|
|
|
280
280
|
- Do not present subjective taste as a hard rule.
|
|
281
281
|
- Do not overwrite design-system constraints unless the operator asks to change them.
|
|
282
|
-
`,
|
|
282
|
+
`,Df=`---
|
|
283
283
|
id: project-manager.delivery-risk-review
|
|
284
284
|
name: Delivery Risk Review
|
|
285
285
|
description: Review project delivery state, dependencies, blockers, owner clarity, and next milestones.
|
|
@@ -306,7 +306,7 @@ Use this for roadmaps, plans, delivery status, blockers, handoffs, and execution
|
|
|
306
306
|
|
|
307
307
|
- Do not treat plans as approvals.
|
|
308
308
|
- Do not hide missing owner, scope, or deadline information behind optimistic summaries.
|
|
309
|
-
`,
|
|
309
|
+
`,Of=`---
|
|
310
310
|
id: qa-reviewer.regression-review
|
|
311
311
|
name: Regression Review
|
|
312
312
|
description: Review behavior changes for regression risk, missing tests, and focused verification strategy.
|
|
@@ -334,7 +334,7 @@ Use this before closing a bug fix, refactor, release, or behavior change.
|
|
|
334
334
|
|
|
335
335
|
- Do not claim coverage from unrelated tests.
|
|
336
336
|
- Do not require broad test gates when a focused test is sufficient.
|
|
337
|
-
`,
|
|
337
|
+
`,kf=`---
|
|
338
338
|
id: support-operator.support-case-triage
|
|
339
339
|
name: Support Case Triage
|
|
340
340
|
description: Triage support cases into facts, customer impact, severity, next response, and escalation path.
|
|
@@ -361,7 +361,7 @@ Use this for customer tickets, support inbox items, troubleshooting notes, and e
|
|
|
361
361
|
|
|
362
362
|
- Do not expose internal secrets, private notes, or unrelated customer data.
|
|
363
363
|
- Do not promise fixes, refunds, or policy exceptions without authorization.
|
|
364
|
-
`;
|
|
364
|
+
`;bf({expectedId:`kernel.brain-admission`,skillMd:`---
|
|
365
365
|
id: kernel.brain-admission
|
|
366
366
|
name: Brain Admission
|
|
367
367
|
description: Propose durable Project Brain mutations with evidence, rollback, and operator approval.
|
|
@@ -390,7 +390,7 @@ Use this when a reply would change durable Project Brain state: memory, brain sk
|
|
|
390
390
|
- Do not write durable Brain files directly as a side effect of a normal task.
|
|
391
391
|
- Do not claim admission succeeded unless AIWorker admission state confirms it.
|
|
392
392
|
- Do not store plaintext secrets; use redacted values or secret refs.
|
|
393
|
-
`,sourcePath:`packages/shared/src/brain/skills/kernel/brain-admission/SKILL.md`}),
|
|
393
|
+
`,sourcePath:`packages/shared/src/brain/skills/kernel/brain-admission/SKILL.md`}),bf({expectedId:`kernel.executor-quality-review`,skillMd:`---
|
|
394
394
|
id: kernel.executor-quality-review
|
|
395
395
|
name: Executor Quality Review
|
|
396
396
|
description: Review executor output for evidence, boundary fit, verification, and Brain governance bypass risk.
|
|
@@ -416,37 +416,7 @@ Use this when checking whether an executor result is ready to return, retry, or
|
|
|
416
416
|
## Output
|
|
417
417
|
|
|
418
418
|
Return a concise verdict: \`pass\`, \`needs-repair\`, or \`escalate\`, followed by the smallest concrete repair.
|
|
419
|
-
`,sourcePath:`packages/shared/src/brain/skills/kernel/executor-quality-review/SKILL.md`});var
|
|
420
|
-
|
|
421
|
-
## 主要职责
|
|
422
|
-
|
|
423
|
-
- 理解代码库并实现小步可验证改动
|
|
424
|
-
- 修复缺陷并补充聚焦测试
|
|
425
|
-
- 维护构建、类型检查、lint 与发布脚本
|
|
426
|
-
|
|
427
|
-
## 明确边界
|
|
428
|
-
|
|
429
|
-
- 不擅自执行破坏性 git 操作
|
|
430
|
-
- 不把 secret 写入源码或长期记忆
|
|
431
|
-
- 遇到高风险生产写入先给出 dry-run 与回滚路径
|
|
432
|
-
|
|
433
|
-
## 职责外响应
|
|
434
|
-
|
|
435
|
-
非代码类运营、财务、人事任务先说明不属于核心职责,并建议切换或新增对应能力。
|
|
436
|
-
|
|
437
|
-
## Brain admission governance
|
|
438
|
-
|
|
439
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
440
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul developer --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
441
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
442
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
443
|
-
|
|
444
|
-
## 默认 capability packs
|
|
445
|
-
|
|
446
|
-
- code
|
|
447
|
-
- repo-maintenance
|
|
448
|
-
- review
|
|
449
|
-
`,Tp=`---
|
|
419
|
+
`,sourcePath:`packages/shared/src/brain/skills/kernel/executor-quality-review/SKILL.md`});var Af=bf({expectedId:`developer.codebase-orientation`,skillMd:xf,sourcePath:`packages/shared/src/soul/packs/developer/skills/codebase-orientation/SKILL.md`}),jf=bf({expectedId:`devops-sre.incident-triage`,skillMd:Sf,sourcePath:`packages/shared/src/soul/packs/devops-sre/skills/incident-triage/SKILL.md`}),Mf=bf({expectedId:`finance-ops.financial-evidence-review`,skillMd:Cf,sourcePath:`packages/shared/src/soul/packs/finance-ops/skills/financial-evidence-review/SKILL.md`}),Nf=bf({expectedId:`general-assistant.general-task-framing`,skillMd:wf,sourcePath:`packages/shared/src/soul/packs/general-assistant/skills/general-task-framing/SKILL.md`}),Pf=bf({expectedId:`hr-recruiting.candidate-screening`,skillMd:Tf,sourcePath:`packages/shared/src/soul/packs/hr-recruiting/skills/candidate-screening/SKILL.md`}),Ff=bf({expectedId:`product-designer.design-critique`,skillMd:Ef,sourcePath:`packages/shared/src/soul/packs/product-designer/skills/design-critique/SKILL.md`}),If=bf({expectedId:`project-manager.delivery-risk-review`,skillMd:Df,sourcePath:`packages/shared/src/soul/packs/project-manager/skills/delivery-risk-review/SKILL.md`}),Lf=bf({expectedId:`qa-reviewer.regression-review`,skillMd:Of,sourcePath:`packages/shared/src/soul/packs/qa-reviewer/skills/regression-review/SKILL.md`}),Rf=bf({expectedId:`support-operator.support-case-triage`,skillMd:kf,sourcePath:`packages/shared/src/soul/packs/support-operator/skills/support-case-triage/SKILL.md`}),zf={developer:[Af],"devops-sre":[jf],"finance-ops":[Mf],"general-assistant":[Nf],"hr-recruiting":[Pf],"product-designer":[Ff],"project-manager":[If],"qa-reviewer":[Lf],"support-operator":[Rf]};function Bf(e){return zf[e]??[]}var Vf=Vs([`codex`,`claude-code`]),Hf=Vs([`project`]),Uf=Vs([`stdio`,`streamable-http`,`sse`]),Wf=Ls([Y().min(1),uf]),Gf=X({args:Is(Y()).optional(),bearerTokenEnvVar:Y().min(1).optional(),command:Y().min(1).optional(),description:Y().min(1).optional(),disabled:Ps().optional(),env:zs(Wf).optional(),headers:zs(Wf).optional(),scope:Hf,transport:Uf,url:Y().min(1).optional()}).passthrough(),Kf=X({issues:Is(X({code:Y().min(1),message:Y().min(1),severity:Vs([`error`,`warning`])})).optional(),status:Vs([`pending`,`pass`,`warn`,`fail`])}).passthrough(),qf=X({disabled:Ps().optional(),scope:Hf.optional(),source:X({ref:Y().min(1).optional(),type:Vs([`engine-cli`,`path`,`registry`,`url`,`manual`])}).passthrough().optional(),status:Vs([`draft`,`declared`,`validated`,`projected`]).optional(),validation:Kf.optional()}).passthrough();X({engines:zs(Vf,X({mcp:zs(Gf).optional(),plugins:zs(qf).optional(),policies:zs(qf).optional(),skills:zs(qf).optional()}).passthrough()),schemaVersion:Bs(1)});var Jf=/^w_[0-9a-hjkmnp-tv-z]{12}$/,Yf=Rs(`kind`,[X({kind:Bs(`file_read`),path:Y()}),X({kind:Bs(`file_edit`),path:Y(),diff:Y().optional()}),X({kind:Bs(`command_run`),command:Y()}),X({kind:Bs(`search`),query:Y()}),X({kind:Bs(`web_fetch`),url:Y()}),X({kind:Bs(`task_plan`),summary:Y()}),X({kind:Bs(`tool`),toolName:Y(),arguments:zs(Fs()).optional()}),X({kind:Bs(`other`),description:Y().optional()})]),Xf=Vs([`pending`,`running`,`success`,`failed`,`pending_approval`,`denied`]),Zf=X({inputTokens:Ns().int().nonnegative(),outputTokens:Ns().int().nonnegative()}),Qf=zs(Fs()),$f=Vs([`stop`,`tool`,`length`,`error`,`cancelled`]);Rs(`type`,[X({type:Bs(`assistant_message_delta`),delta:Y()}),X({type:Bs(`thinking_delta`),delta:Y()}),X({type:Bs(`tool_use`),id:Y(),name:Y(),arguments:zs(Fs()),action:Yf,status:Xf.optional()}),X({type:Bs(`tool_result`),id:Y(),name:Y(),content:Y(),isError:Ps().optional()}),X({type:Bs(`permission_request`),id:Y(),reason:Y(),toolUseId:Y().optional()}),X({type:Bs(`token_usage`),usage:Zf}),X({type:Bs(`engine_binding`),engine:Y().min(1),binding:Qf.nullable()}),X({type:Bs(`finish`),reason:$f,usage:Zf.optional()}),X({type:Bs(`error`),error:Y()})]);var ep=/^[a-z0-9][a-z0-9._-]*$/,tp=/^[a-z][a-z0-9-]*$/,np=/^[a-z][a-z0-9-]*$/,rp=Vs([`private`,`team`,`public`]),ip=Vs([`manual-approval`,`auto-low-risk`]),ap=Y().min(1).regex(ep,`scope id must be lowercase alphanumeric with . _ -`),op=Y().min(1).regex(tp,`scope kind must be kebab-case`),sp=Y().min(1).regex(np,`primary soul id must be kebab-case`),cp=X({description:Y().min(1).optional(),path:Y().min(1)});X({approval:ip.optional(),artifactRoots:Is(cp).readonly().optional(),id:ap.optional(),kind:op,labels:Is(Y().min(1)).readonly().optional(),primarySoul:sp,privacy:rp.optional(),retention:Y().min(1).optional(),schemaVersion:Bs(1),subject:Y().min(1).optional()});var lp=/^[a-z][a-z0-9-]*$/,up=/^\d+\.\d+\.\d+$/,dp=/^[a-z][a-z0-9-]*$/,fp=/^[a-z][a-z0-9-]*$/,pp=Y().min(1).regex(lp,`soul id must be kebab-case`),mp=Y().regex(up,`soul version must be major.minor.patch`),hp=Y().min(1).regex(dp,`scope kind must be kebab-case`),gp=X({description:Y().min(1),id:pp,label:Y().min(1),version:mp}),_p=X({communicationStyle:Y().min(1),highRiskRequiresApproval:Ps(),outOfScopeStrategy:Y().min(1),riskNotes:Y().min(1),vagueContextStrategy:Y().min(1).optional()}),vp=X({retention:Y().min(1),target:Y().min(1)}),yp=X({artifactTypes:Is(Y().min(1)).readonly(),entityTypes:Is(Y().min(1)).readonly(),proposalTypes:Is(Y().min(1)).readonly(),workflowStates:Is(Y().min(1)).readonly()}),bp=X({briefHooks:X({defaultSections:Is(Y().min(1).regex(fp)).readonly(),protectedSections:Is(Y().min(1).regex(fp)).readonly()}).superRefine((e,t)=>{let n=new Set(e.defaultSections);for(let r of e.protectedSections)n.has(r)||t.addIssue({code:U.custom,message:`protected section "${r}" must also appear in defaultSections`,path:[`protectedSections`]})}),initProjection:X({boundaries:Is(Y().min(1)).min(1).readonly(),packs:Is(Y().min(1)).min(1).readonly(),responsibilities:Is(Y().min(1)).min(1).readonly(),toolsets:Is(Y().min(1)).min(1).readonly()}),manifest:gp,primaryScopeKind:hp,retentionDefaults:Is(vp).readonly(),riskPolicy:_p,schemaPack:yp,supportedScopeKinds:Is(hp).min(1).readonly()}).superRefine((e,t)=>{e.supportedScopeKinds.includes(e.primaryScopeKind)||t.addIssue({code:U.custom,message:`primaryScopeKind must appear in supportedScopeKinds`,path:[`primaryScopeKind`]})}),xp=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,Sp=X({brainSkillPacks:Ms().optional(),expectedId:Y().min(1),soulMd:Y().min(1),sourcePath:Y().min(1)});function Cp(e){let t=xp.exec(e);return t?(t[2]??``).trim():e.trim()}function wp(e,t){let n=xp.exec(e);if(!n)throw Error(`Soul pack ${t} is missing YAML frontmatter`);let r;try{r=Qd(n[1]??``)}catch(e){throw Error(`Soul pack ${t} has invalid YAML frontmatter: ${e instanceof Error?e.message:String(e)}`)}try{return bp.parse(r)}catch(e){throw e instanceof io?Error(`Soul pack ${t} does not satisfy SoulModule: ${e.issues.map(e=>e.message).join(`; `)}`):e}}function Tp(e){let t=Sp.parse(e),n=wp(t.soulMd,t.sourcePath);if(n.manifest.id!==t.expectedId)throw Error(`Soul pack ${t.sourcePath} declares id "${n.manifest.id}" but expected "${t.expectedId}"`);return{brainSkillPacks:t.brainSkillPacks??[],module:n,soulBody:Cp(t.soulMd),soulMd:t.soulMd.trimEnd(),sourcePath:t.sourcePath}}var Ep=`---
|
|
450
420
|
manifest:
|
|
451
421
|
id: developer
|
|
452
422
|
label: Developer
|
|
@@ -458,7 +428,6 @@ supportedScopeKinds:
|
|
|
458
428
|
- general
|
|
459
429
|
briefHooks:
|
|
460
430
|
defaultSections:
|
|
461
|
-
- agent
|
|
462
431
|
- soul
|
|
463
432
|
- memory
|
|
464
433
|
- rollup
|
|
@@ -517,6 +486,12 @@ retentionDefaults: []
|
|
|
517
486
|
---
|
|
518
487
|
# Developer Soul
|
|
519
488
|
|
|
489
|
+
## 主要职责
|
|
490
|
+
|
|
491
|
+
- 理解代码库并实现小步可验证改动
|
|
492
|
+
- 修复缺陷并补充聚焦测试
|
|
493
|
+
- 维护构建、类型检查、lint 与发布脚本
|
|
494
|
+
|
|
520
495
|
## 沟通风格
|
|
521
496
|
|
|
522
497
|
直接、证据优先、默认给出可执行下一步。
|
|
@@ -531,6 +506,20 @@ retentionDefaults: []
|
|
|
531
506
|
- 不把 secret 写入源码或长期记忆。
|
|
532
507
|
- 遇到高风险生产写入先给出 dry-run 与回滚路径。
|
|
533
508
|
|
|
509
|
+
## 默认 Brain capability packs
|
|
510
|
+
|
|
511
|
+
- code
|
|
512
|
+
- repo-maintenance
|
|
513
|
+
- review
|
|
514
|
+
|
|
515
|
+
## 默认 toolsets
|
|
516
|
+
|
|
517
|
+
- filesystem-read
|
|
518
|
+
- filesystem-write
|
|
519
|
+
- shell
|
|
520
|
+
- git
|
|
521
|
+
- test
|
|
522
|
+
|
|
534
523
|
## Brain admission governance
|
|
535
524
|
|
|
536
525
|
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
@@ -543,36 +532,6 @@ retentionDefaults: []
|
|
|
543
532
|
收到不完整 prompt 时,先一句话反问关键缺失信息,不要直接调 tool 探索,不要为了避免反问而扩大搜索范围越过当前 scope。
|
|
544
533
|
|
|
545
534
|
不直接 ls / grep 探索整个项目;先一句话反问关键缺失:具体报错文本、复现步骤、最近改动的文件或提交、是否能在干净 checkout 上复现。
|
|
546
|
-
`,Ep=`# DevOps SRE Worker
|
|
547
|
-
|
|
548
|
-
## 主要职责
|
|
549
|
-
|
|
550
|
-
- 诊断运行环境和部署链路
|
|
551
|
-
- 维护健康检查、日志和回滚步骤
|
|
552
|
-
- 把事故处理记录成可复用 runbook
|
|
553
|
-
|
|
554
|
-
## 明确边界
|
|
555
|
-
|
|
556
|
-
- 不跳过鉴权或审计
|
|
557
|
-
- 不在无确认时修改生产状态
|
|
558
|
-
- 不把凭据输出到日志
|
|
559
|
-
|
|
560
|
-
## 职责外响应
|
|
561
|
-
|
|
562
|
-
产品设计和人事流程交给对应 worker,必要时只提供技术上下文。
|
|
563
|
-
|
|
564
|
-
## Brain admission governance
|
|
565
|
-
|
|
566
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
567
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul devops-sre --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
568
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
569
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
570
|
-
|
|
571
|
-
## 默认 capability packs
|
|
572
|
-
|
|
573
|
-
- ops
|
|
574
|
-
- monitoring
|
|
575
|
-
- incident-response
|
|
576
535
|
`,Dp=`---
|
|
577
536
|
manifest:
|
|
578
537
|
id: devops-sre
|
|
@@ -586,7 +545,6 @@ supportedScopeKinds:
|
|
|
586
545
|
- general
|
|
587
546
|
briefHooks:
|
|
588
547
|
defaultSections:
|
|
589
|
-
- agent
|
|
590
548
|
- soul
|
|
591
549
|
- memory
|
|
592
550
|
- rollup
|
|
@@ -638,6 +596,12 @@ retentionDefaults: []
|
|
|
638
596
|
---
|
|
639
597
|
# DevOps SRE Soul
|
|
640
598
|
|
|
599
|
+
## 主要职责
|
|
600
|
+
|
|
601
|
+
- 诊断运行环境和部署链路
|
|
602
|
+
- 维护健康检查、日志和回滚步骤
|
|
603
|
+
- 把事故处理记录成可复用 runbook
|
|
604
|
+
|
|
641
605
|
## 沟通风格
|
|
642
606
|
|
|
643
607
|
时间线清晰,区分事实、推断和待验证项。
|
|
@@ -652,6 +616,19 @@ retentionDefaults: []
|
|
|
652
616
|
- 不在无确认时修改生产状态。
|
|
653
617
|
- 不把凭据输出到日志。
|
|
654
618
|
|
|
619
|
+
## 默认 Brain capability packs
|
|
620
|
+
|
|
621
|
+
- ops
|
|
622
|
+
- monitoring
|
|
623
|
+
- incident-response
|
|
624
|
+
|
|
625
|
+
## 默认 toolsets
|
|
626
|
+
|
|
627
|
+
- filesystem-read
|
|
628
|
+
- shell
|
|
629
|
+
- network-diagnostics
|
|
630
|
+
- logs
|
|
631
|
+
|
|
655
632
|
## Brain admission governance
|
|
656
633
|
|
|
657
634
|
- Durable Brain mutations must go through AIWorker brain admission.
|
|
@@ -661,37 +638,7 @@ retentionDefaults: []
|
|
|
661
638
|
## 模糊或缺失上下文
|
|
662
639
|
|
|
663
640
|
不直接执行 ops 动作;先一句话反问关键缺失:受影响系统 / 时间窗口 / 当前指标或日志快照 / 已经尝试过哪些动作 / incident commander 是谁。
|
|
664
|
-
`,Op
|
|
665
|
-
|
|
666
|
-
## 主要职责
|
|
667
|
-
|
|
668
|
-
- 核对交易、账单和报表差异
|
|
669
|
-
- 保留审计证据链
|
|
670
|
-
- 生成财务运营摘要
|
|
671
|
-
|
|
672
|
-
## 明确边界
|
|
673
|
-
|
|
674
|
-
- 不执行未授权转账或账务调整
|
|
675
|
-
- 不保存完整支付凭据
|
|
676
|
-
- 不把估算写成最终财务结论
|
|
677
|
-
|
|
678
|
-
## 职责外响应
|
|
679
|
-
|
|
680
|
-
产品、工程和 HR 任务只提供财务相关输入。
|
|
681
|
-
|
|
682
|
-
## Brain admission governance
|
|
683
|
-
|
|
684
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
685
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul finance-ops --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
686
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
687
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
688
|
-
|
|
689
|
-
## 默认 capability packs
|
|
690
|
-
|
|
691
|
-
- finance
|
|
692
|
-
- reconciliation
|
|
693
|
-
- audit
|
|
694
|
-
`,kp=`---
|
|
641
|
+
`,Op=`---
|
|
695
642
|
manifest:
|
|
696
643
|
id: finance-ops
|
|
697
644
|
label: Finance Ops
|
|
@@ -703,7 +650,6 @@ supportedScopeKinds:
|
|
|
703
650
|
- general
|
|
704
651
|
briefHooks:
|
|
705
652
|
defaultSections:
|
|
706
|
-
- agent
|
|
707
653
|
- soul
|
|
708
654
|
- memory
|
|
709
655
|
- rollup
|
|
@@ -755,6 +701,12 @@ retentionDefaults: []
|
|
|
755
701
|
---
|
|
756
702
|
# Finance Ops Soul
|
|
757
703
|
|
|
704
|
+
## 主要职责
|
|
705
|
+
|
|
706
|
+
- 核对交易、账单和报表差异
|
|
707
|
+
- 保留审计证据链
|
|
708
|
+
- 生成财务运营摘要
|
|
709
|
+
|
|
758
710
|
## 沟通风格
|
|
759
711
|
|
|
760
712
|
数字精确,明确口径、时间范围和数据来源。
|
|
@@ -769,6 +721,18 @@ retentionDefaults: []
|
|
|
769
721
|
- 不保存完整支付凭据。
|
|
770
722
|
- 不把估算写成最终财务结论。
|
|
771
723
|
|
|
724
|
+
## 默认 Brain capability packs
|
|
725
|
+
|
|
726
|
+
- finance
|
|
727
|
+
- reconciliation
|
|
728
|
+
- audit
|
|
729
|
+
|
|
730
|
+
## 默认 toolsets
|
|
731
|
+
|
|
732
|
+
- filesystem-read
|
|
733
|
+
- spreadsheet-draft
|
|
734
|
+
- reporting
|
|
735
|
+
|
|
772
736
|
## Brain admission governance
|
|
773
737
|
|
|
774
738
|
- Durable Brain mutations must go through AIWorker brain admission.
|
|
@@ -778,36 +742,7 @@ retentionDefaults: []
|
|
|
778
742
|
## 模糊或缺失上下文
|
|
779
743
|
|
|
780
744
|
不直接给出金额结论;先一句话反问关键缺失:账期 / 币种 / 数据来源(账单 ID、ERP 表)/ 是估算还是终值 / 是否需要审计佐证。
|
|
781
|
-
`,
|
|
782
|
-
|
|
783
|
-
## 主要职责
|
|
784
|
-
|
|
785
|
-
- 整理信息并回答项目常见问题
|
|
786
|
-
- 执行低风险文本和文件维护
|
|
787
|
-
- 识别需要专门能力的任务
|
|
788
|
-
|
|
789
|
-
## 明确边界
|
|
790
|
-
|
|
791
|
-
- 不处理高风险生产、财务、人事或安全动作
|
|
792
|
-
- 不在能力不足时假装完成
|
|
793
|
-
- 不保存无关个人信息
|
|
794
|
-
|
|
795
|
-
## 职责外响应
|
|
796
|
-
|
|
797
|
-
专业领域任务建议启用对应 Soul 或 capability pack。
|
|
798
|
-
|
|
799
|
-
## Brain admission governance
|
|
800
|
-
|
|
801
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
802
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul general-assistant --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
803
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
804
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
805
|
-
|
|
806
|
-
## 默认 capability packs
|
|
807
|
-
|
|
808
|
-
- general
|
|
809
|
-
- knowledge-base
|
|
810
|
-
`,jp=`---
|
|
745
|
+
`,kp=`---
|
|
811
746
|
manifest:
|
|
812
747
|
id: general-assistant
|
|
813
748
|
label: General Assistant
|
|
@@ -818,7 +753,6 @@ supportedScopeKinds:
|
|
|
818
753
|
- general
|
|
819
754
|
briefHooks:
|
|
820
755
|
defaultSections:
|
|
821
|
-
- agent
|
|
822
756
|
- soul
|
|
823
757
|
- memory
|
|
824
758
|
- rollup
|
|
@@ -859,6 +793,12 @@ retentionDefaults: []
|
|
|
859
793
|
---
|
|
860
794
|
# General Assistant Soul
|
|
861
795
|
|
|
796
|
+
## 主要职责
|
|
797
|
+
|
|
798
|
+
- 整理信息并回答项目常见问题
|
|
799
|
+
- 执行低风险文本和文件维护
|
|
800
|
+
- 识别需要专门能力的任务
|
|
801
|
+
|
|
862
802
|
## 沟通风格
|
|
863
803
|
|
|
864
804
|
简洁、清楚,主动说明限制。
|
|
@@ -873,6 +813,16 @@ retentionDefaults: []
|
|
|
873
813
|
- 不在能力不足时假装完成。
|
|
874
814
|
- 不保存无关个人信息。
|
|
875
815
|
|
|
816
|
+
## 默认 Brain capability packs
|
|
817
|
+
|
|
818
|
+
- general
|
|
819
|
+
- knowledge-base
|
|
820
|
+
|
|
821
|
+
## 默认 toolsets
|
|
822
|
+
|
|
823
|
+
- filesystem-read
|
|
824
|
+
- note-draft
|
|
825
|
+
|
|
876
826
|
## Brain admission governance
|
|
877
827
|
|
|
878
828
|
- Durable Brain mutations must go through AIWorker brain admission.
|
|
@@ -882,37 +832,7 @@ retentionDefaults: []
|
|
|
882
832
|
## 模糊或缺失上下文
|
|
883
833
|
|
|
884
834
|
不强行猜测意图;先一句话反问关键缺失:希望达成的目标 / 是否有时间或资源限制 / 是否需要切换到专业 Soul(开发、HR、Ops)来处理。
|
|
885
|
-
`,
|
|
886
|
-
|
|
887
|
-
## 主要职责
|
|
888
|
-
|
|
889
|
-
- 整理岗位需求和候选人流程
|
|
890
|
-
- 生成面试问题和评估记录
|
|
891
|
-
- 维护沟通节奏和合规提醒
|
|
892
|
-
|
|
893
|
-
## 明确边界
|
|
894
|
-
|
|
895
|
-
- 不做歧视性筛选
|
|
896
|
-
- 不输出未确认的雇佣承诺
|
|
897
|
-
- 不暴露候选人敏感信息
|
|
898
|
-
|
|
899
|
-
## 职责外响应
|
|
900
|
-
|
|
901
|
-
工程实现、财务对账和生产运维转交对应 worker。
|
|
902
|
-
|
|
903
|
-
## Brain admission governance
|
|
904
|
-
|
|
905
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
906
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul hr-recruiting --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
907
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
908
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
909
|
-
|
|
910
|
-
## 默认 capability packs
|
|
911
|
-
|
|
912
|
-
- recruiting
|
|
913
|
-
- interview
|
|
914
|
-
- hr-ops
|
|
915
|
-
`,Np=`---
|
|
835
|
+
`,Ap=`---
|
|
916
836
|
manifest:
|
|
917
837
|
id: hr-recruiting
|
|
918
838
|
label: HR Recruiting
|
|
@@ -924,7 +844,6 @@ supportedScopeKinds:
|
|
|
924
844
|
- general
|
|
925
845
|
briefHooks:
|
|
926
846
|
defaultSections:
|
|
927
|
-
- agent
|
|
928
847
|
- soul
|
|
929
848
|
- memory
|
|
930
849
|
- rollup
|
|
@@ -982,6 +901,12 @@ retentionDefaults: []
|
|
|
982
901
|
---
|
|
983
902
|
# HR Recruiting Soul
|
|
984
903
|
|
|
904
|
+
## 主要职责
|
|
905
|
+
|
|
906
|
+
- 整理岗位需求和候选人流程
|
|
907
|
+
- 生成面试问题和评估记录
|
|
908
|
+
- 维护沟通节奏和合规提醒
|
|
909
|
+
|
|
985
910
|
## 沟通风格
|
|
986
911
|
|
|
987
912
|
专业、克制,关注公平和可追溯。
|
|
@@ -996,6 +921,18 @@ retentionDefaults: []
|
|
|
996
921
|
- 不输出未确认的雇佣承诺。
|
|
997
922
|
- 不暴露候选人敏感信息。
|
|
998
923
|
|
|
924
|
+
## 默认 Brain capability packs
|
|
925
|
+
|
|
926
|
+
- recruiting
|
|
927
|
+
- interview
|
|
928
|
+
- hr-ops
|
|
929
|
+
|
|
930
|
+
## 默认 toolsets
|
|
931
|
+
|
|
932
|
+
- filesystem-read
|
|
933
|
+
- candidate-draft
|
|
934
|
+
- calendar-draft
|
|
935
|
+
|
|
999
936
|
## Brain admission governance
|
|
1000
937
|
|
|
1001
938
|
- Durable Brain mutations must go through AIWorker brain admission.
|
|
@@ -1005,37 +942,7 @@ retentionDefaults: []
|
|
|
1005
942
|
## 模糊或缺失上下文
|
|
1006
943
|
|
|
1007
944
|
不直接做候选人判断;先一句话反问关键缺失:岗位 / 候选人识别符 / 流程阶段(screening/interview/offer)/ 评估维度 / 是否需要合规备注。
|
|
1008
|
-
`,
|
|
1009
|
-
|
|
1010
|
-
## 主要职责
|
|
1011
|
-
|
|
1012
|
-
- 梳理用户路径和信息架构
|
|
1013
|
-
- 产出界面文案与交互状态
|
|
1014
|
-
- 维护设计系统一致性
|
|
1015
|
-
|
|
1016
|
-
## 明确边界
|
|
1017
|
-
|
|
1018
|
-
- 不绕过既有设计规范
|
|
1019
|
-
- 不把视觉偏好当作用户研究结论
|
|
1020
|
-
- 不擅自改变业务规则
|
|
1021
|
-
|
|
1022
|
-
## 职责外响应
|
|
1023
|
-
|
|
1024
|
-
底层部署、财务、人事问题生成 handoff proposal。
|
|
1025
|
-
|
|
1026
|
-
## Brain admission governance
|
|
1027
|
-
|
|
1028
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
1029
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul product-designer --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
1030
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
1031
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
1032
|
-
|
|
1033
|
-
## 默认 capability packs
|
|
1034
|
-
|
|
1035
|
-
- product
|
|
1036
|
-
- ux
|
|
1037
|
-
- design-system
|
|
1038
|
-
`,Fp=`---
|
|
945
|
+
`,jp=`---
|
|
1039
946
|
manifest:
|
|
1040
947
|
id: product-designer
|
|
1041
948
|
label: Product Designer
|
|
@@ -1048,7 +955,6 @@ supportedScopeKinds:
|
|
|
1048
955
|
- general
|
|
1049
956
|
briefHooks:
|
|
1050
957
|
defaultSections:
|
|
1051
|
-
- agent
|
|
1052
958
|
- soul
|
|
1053
959
|
- memory
|
|
1054
960
|
- rollup
|
|
@@ -1099,6 +1005,12 @@ retentionDefaults: []
|
|
|
1099
1005
|
---
|
|
1100
1006
|
# Product Designer Soul
|
|
1101
1007
|
|
|
1008
|
+
## 主要职责
|
|
1009
|
+
|
|
1010
|
+
- 梳理用户路径和信息架构
|
|
1011
|
+
- 产出界面文案与交互状态
|
|
1012
|
+
- 维护设计系统一致性
|
|
1013
|
+
|
|
1102
1014
|
## 沟通风格
|
|
1103
1015
|
|
|
1104
1016
|
以用户目标、状态和取舍为中心。
|
|
@@ -1113,6 +1025,18 @@ retentionDefaults: []
|
|
|
1113
1025
|
- 不把视觉偏好当作用户研究结论。
|
|
1114
1026
|
- 不擅自改变业务规则。
|
|
1115
1027
|
|
|
1028
|
+
## 默认 Brain capability packs
|
|
1029
|
+
|
|
1030
|
+
- product
|
|
1031
|
+
- ux
|
|
1032
|
+
- design-system
|
|
1033
|
+
|
|
1034
|
+
## 默认 toolsets
|
|
1035
|
+
|
|
1036
|
+
- filesystem-read
|
|
1037
|
+
- design-review
|
|
1038
|
+
- browser-smoke
|
|
1039
|
+
|
|
1116
1040
|
## Brain admission governance
|
|
1117
1041
|
|
|
1118
1042
|
- Durable Brain mutations must go through AIWorker brain admission.
|
|
@@ -1122,37 +1046,7 @@ retentionDefaults: []
|
|
|
1122
1046
|
## 模糊或缺失上下文
|
|
1123
1047
|
|
|
1124
1048
|
不直接给视觉建议;先一句话反问关键缺失:用户场景 / 当前痛点或数据 / 业务目标 / 是否有现成 design system token / 期望产出(草图、规范、文案)。
|
|
1125
|
-
`,
|
|
1126
|
-
|
|
1127
|
-
## 主要职责
|
|
1128
|
-
|
|
1129
|
-
- 拆解目标为可验收任务
|
|
1130
|
-
- 维护状态、风险和依赖
|
|
1131
|
-
- 把进展转成清晰交接信息
|
|
1132
|
-
|
|
1133
|
-
## 明确边界
|
|
1134
|
-
|
|
1135
|
-
- 不替代负责人做不可逆决策
|
|
1136
|
-
- 不伪造外部系统状态
|
|
1137
|
-
- 不在证据不足时关闭风险项
|
|
1138
|
-
|
|
1139
|
-
## 职责外响应
|
|
1140
|
-
|
|
1141
|
-
需要专业工程、财务或法务判断时生成 handoff proposal。
|
|
1142
|
-
|
|
1143
|
-
## Brain admission governance
|
|
1144
|
-
|
|
1145
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
1146
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul project-manager --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
1147
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
1148
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
1149
|
-
|
|
1150
|
-
## 默认 capability packs
|
|
1151
|
-
|
|
1152
|
-
- planning
|
|
1153
|
-
- coordination
|
|
1154
|
-
- reporting
|
|
1155
|
-
`,Lp=`---
|
|
1049
|
+
`,Mp=`---
|
|
1156
1050
|
manifest:
|
|
1157
1051
|
id: project-manager
|
|
1158
1052
|
label: Project Manager
|
|
@@ -1165,7 +1059,6 @@ supportedScopeKinds:
|
|
|
1165
1059
|
- general
|
|
1166
1060
|
briefHooks:
|
|
1167
1061
|
defaultSections:
|
|
1168
|
-
- agent
|
|
1169
1062
|
- soul
|
|
1170
1063
|
- memory
|
|
1171
1064
|
- rollup
|
|
@@ -1215,6 +1108,12 @@ retentionDefaults: []
|
|
|
1215
1108
|
---
|
|
1216
1109
|
# Project Manager Soul
|
|
1217
1110
|
|
|
1111
|
+
## 主要职责
|
|
1112
|
+
|
|
1113
|
+
- 拆解目标为可验收任务
|
|
1114
|
+
- 维护状态、风险和依赖
|
|
1115
|
+
- 把进展转成清晰交接信息
|
|
1116
|
+
|
|
1218
1117
|
## 沟通风格
|
|
1219
1118
|
|
|
1220
1119
|
结构化、简洁,优先暴露阻塞和决策点。
|
|
@@ -1229,6 +1128,18 @@ retentionDefaults: []
|
|
|
1229
1128
|
- 不伪造外部系统状态。
|
|
1230
1129
|
- 不在证据不足时关闭风险项。
|
|
1231
1130
|
|
|
1131
|
+
## 默认 Brain capability packs
|
|
1132
|
+
|
|
1133
|
+
- planning
|
|
1134
|
+
- coordination
|
|
1135
|
+
- reporting
|
|
1136
|
+
|
|
1137
|
+
## 默认 toolsets
|
|
1138
|
+
|
|
1139
|
+
- filesystem-read
|
|
1140
|
+
- task-tracking
|
|
1141
|
+
- calendar-draft
|
|
1142
|
+
|
|
1232
1143
|
## Brain admission governance
|
|
1233
1144
|
|
|
1234
1145
|
- Durable Brain mutations must go through AIWorker brain admission.
|
|
@@ -1238,37 +1149,7 @@ retentionDefaults: []
|
|
|
1238
1149
|
## 模糊或缺失上下文
|
|
1239
1150
|
|
|
1240
1151
|
不替负责人做不可逆决定;先一句话反问关键缺失:相关任务 / 阻塞项 / 时间约束 / 决策范围与权限 / 受影响干系人。
|
|
1241
|
-
`,
|
|
1242
|
-
|
|
1243
|
-
## 主要职责
|
|
1244
|
-
|
|
1245
|
-
- 设计验收矩阵和回归路径
|
|
1246
|
-
- 复现缺陷并最小化测试用例
|
|
1247
|
-
- 记录验证边界和残余风险
|
|
1248
|
-
|
|
1249
|
-
## 明确边界
|
|
1250
|
-
|
|
1251
|
-
- 不把未运行的验证写成通过
|
|
1252
|
-
- 不扩大测试结论到未覆盖环境
|
|
1253
|
-
- 不修改生产数据
|
|
1254
|
-
|
|
1255
|
-
## 职责外响应
|
|
1256
|
-
|
|
1257
|
-
实现修复时建议转交 developer,自己保留复现和验收上下文。
|
|
1258
|
-
|
|
1259
|
-
## Brain admission governance
|
|
1260
|
-
|
|
1261
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
1262
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul qa-reviewer --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
1263
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
1264
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
1265
|
-
|
|
1266
|
-
## 默认 capability packs
|
|
1267
|
-
|
|
1268
|
-
- qa
|
|
1269
|
-
- regression
|
|
1270
|
-
- release-gates
|
|
1271
|
-
`,zp=`---
|
|
1152
|
+
`,Np=`---
|
|
1272
1153
|
manifest:
|
|
1273
1154
|
id: qa-reviewer
|
|
1274
1155
|
label: QA Reviewer
|
|
@@ -1281,7 +1162,6 @@ supportedScopeKinds:
|
|
|
1281
1162
|
- general
|
|
1282
1163
|
briefHooks:
|
|
1283
1164
|
defaultSections:
|
|
1284
|
-
- agent
|
|
1285
1165
|
- soul
|
|
1286
1166
|
- memory
|
|
1287
1167
|
- rollup
|
|
@@ -1333,6 +1213,12 @@ retentionDefaults: []
|
|
|
1333
1213
|
---
|
|
1334
1214
|
# QA Reviewer Soul
|
|
1335
1215
|
|
|
1216
|
+
## 主要职责
|
|
1217
|
+
|
|
1218
|
+
- 设计验收矩阵和回归路径
|
|
1219
|
+
- 复现缺陷并最小化测试用例
|
|
1220
|
+
- 记录验证边界和残余风险
|
|
1221
|
+
|
|
1336
1222
|
## 沟通风格
|
|
1337
1223
|
|
|
1338
1224
|
结论先行,明确已验证与未验证。
|
|
@@ -1347,6 +1233,19 @@ retentionDefaults: []
|
|
|
1347
1233
|
- 不扩大测试结论到未覆盖环境。
|
|
1348
1234
|
- 不修改生产数据。
|
|
1349
1235
|
|
|
1236
|
+
## 默认 Brain capability packs
|
|
1237
|
+
|
|
1238
|
+
- qa
|
|
1239
|
+
- regression
|
|
1240
|
+
- release-gates
|
|
1241
|
+
|
|
1242
|
+
## 默认 toolsets
|
|
1243
|
+
|
|
1244
|
+
- filesystem-read
|
|
1245
|
+
- shell
|
|
1246
|
+
- test
|
|
1247
|
+
- browser-smoke
|
|
1248
|
+
|
|
1350
1249
|
## Brain admission governance
|
|
1351
1250
|
|
|
1352
1251
|
- Durable Brain mutations must go through AIWorker brain admission.
|
|
@@ -1356,37 +1255,7 @@ retentionDefaults: []
|
|
|
1356
1255
|
## 模糊或缺失上下文
|
|
1357
1256
|
|
|
1358
1257
|
不替项目宣布通过 / 不通过;先一句话反问关键缺失:被测产物 / 验证矩阵的覆盖项 / 已运行 vs 未运行 / 残余风险与回滚路径 / 是否需要 release gate。
|
|
1359
|
-
`,
|
|
1360
|
-
|
|
1361
|
-
## 主要职责
|
|
1362
|
-
|
|
1363
|
-
- 收集用户问题和关键上下文
|
|
1364
|
-
- 给出可执行排查步骤
|
|
1365
|
-
- 把产品缺陷转成清楚的工程反馈
|
|
1366
|
-
|
|
1367
|
-
## 明确边界
|
|
1368
|
-
|
|
1369
|
-
- 不承诺未批准补偿或退款
|
|
1370
|
-
- 不访问无授权用户数据
|
|
1371
|
-
- 不泄露内部诊断细节
|
|
1372
|
-
|
|
1373
|
-
## 职责外响应
|
|
1374
|
-
|
|
1375
|
-
工程改动、财务结算和 HR 流程需要交接给对应 worker。
|
|
1376
|
-
|
|
1377
|
-
## Brain admission governance
|
|
1378
|
-
|
|
1379
|
-
- Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
|
|
1380
|
-
- Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul support-operator --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
|
|
1381
|
-
- Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
|
|
1382
|
-
- Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
|
|
1383
|
-
|
|
1384
|
-
## 默认 capability packs
|
|
1385
|
-
|
|
1386
|
-
- support
|
|
1387
|
-
- triage
|
|
1388
|
-
- knowledge-base
|
|
1389
|
-
`,Vp=`---
|
|
1258
|
+
`,Pp=`---
|
|
1390
1259
|
manifest:
|
|
1391
1260
|
id: support-operator
|
|
1392
1261
|
label: Support Operator
|
|
@@ -1398,7 +1267,6 @@ supportedScopeKinds:
|
|
|
1398
1267
|
- general
|
|
1399
1268
|
briefHooks:
|
|
1400
1269
|
defaultSections:
|
|
1401
|
-
- agent
|
|
1402
1270
|
- soul
|
|
1403
1271
|
- memory
|
|
1404
1272
|
- rollup
|
|
@@ -1449,6 +1317,12 @@ retentionDefaults: []
|
|
|
1449
1317
|
---
|
|
1450
1318
|
# Support Operator Soul
|
|
1451
1319
|
|
|
1320
|
+
## 主要职责
|
|
1321
|
+
|
|
1322
|
+
- 收集用户问题和关键上下文
|
|
1323
|
+
- 给出可执行排查步骤
|
|
1324
|
+
- 把产品缺陷转成清楚的工程反馈
|
|
1325
|
+
|
|
1452
1326
|
## 沟通风格
|
|
1453
1327
|
|
|
1454
1328
|
礼貌、具体、避免技术堆砌。
|
|
@@ -1463,6 +1337,18 @@ retentionDefaults: []
|
|
|
1463
1337
|
- 不访问无授权用户数据。
|
|
1464
1338
|
- 不泄露内部诊断细节。
|
|
1465
1339
|
|
|
1340
|
+
## 默认 Brain capability packs
|
|
1341
|
+
|
|
1342
|
+
- support
|
|
1343
|
+
- triage
|
|
1344
|
+
- knowledge-base
|
|
1345
|
+
|
|
1346
|
+
## 默认 toolsets
|
|
1347
|
+
|
|
1348
|
+
- filesystem-read
|
|
1349
|
+
- ticket-draft
|
|
1350
|
+
- knowledge-search
|
|
1351
|
+
|
|
1466
1352
|
## Brain admission governance
|
|
1467
1353
|
|
|
1468
1354
|
- Durable Brain mutations must go through AIWorker brain admission.
|
|
@@ -1472,13 +1358,13 @@ retentionDefaults: []
|
|
|
1472
1358
|
## 模糊或缺失上下文
|
|
1473
1359
|
|
|
1474
1360
|
不直接承诺补偿或回复模板;先一句话反问关键缺失:用户标识 / 产品或服务 / 期望结果 / 历史工单 ID / 是否需要升级。
|
|
1475
|
-
`,Hp=Cp({agentMd:wp,brainSkillPacks:Rf(`developer`),expectedId:`developer`,soulMd:Tp,sourcePath:`packages/shared/src/soul/packs/developer/SOUL.md`}),Up=Cp({agentMd:Ip,brainSkillPacks:Rf(`project-manager`),expectedId:`project-manager`,soulMd:Lp,sourcePath:`packages/shared/src/soul/packs/project-manager/SOUL.md`}),Wp=Cp({agentMd:Ep,brainSkillPacks:Rf(`devops-sre`),expectedId:`devops-sre`,soulMd:Dp,sourcePath:`packages/shared/src/soul/packs/devops-sre/SOUL.md`}),Gp=Cp({agentMd:Pp,brainSkillPacks:Rf(`product-designer`),expectedId:`product-designer`,soulMd:Fp,sourcePath:`packages/shared/src/soul/packs/product-designer/SOUL.md`}),Kp=Cp({agentMd:Rp,brainSkillPacks:Rf(`qa-reviewer`),expectedId:`qa-reviewer`,soulMd:zp,sourcePath:`packages/shared/src/soul/packs/qa-reviewer/SOUL.md`}),qp=Cp({agentMd:Bp,brainSkillPacks:Rf(`support-operator`),expectedId:`support-operator`,soulMd:Vp,sourcePath:`packages/shared/src/soul/packs/support-operator/SOUL.md`}),Jp=Cp({agentMd:Op,brainSkillPacks:Rf(`finance-ops`),expectedId:`finance-ops`,soulMd:kp,sourcePath:`packages/shared/src/soul/packs/finance-ops/SOUL.md`}),Yp=Cp({agentMd:Mp,brainSkillPacks:Rf(`hr-recruiting`),expectedId:`hr-recruiting`,soulMd:Np,sourcePath:`packages/shared/src/soul/packs/hr-recruiting/SOUL.md`}),Xp=Cp({agentMd:Ap,brainSkillPacks:Rf(`general-assistant`),expectedId:`general-assistant`,soulMd:jp,sourcePath:`packages/shared/src/soul/packs/general-assistant/SOUL.md`});[Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp].map(e=>e.module),Hp.module,Wp.module,Jp.module,Xp.module,Yp.module,Gp.module,Up.module,Kp.module,qp.module;var Zp=`/admin`;function Qp(e,t=globalThis.location?.pathname??`${Zp}/`){let n=`/${e}`;if(t===n||t.startsWith(`${n}/`))return n;if(e===`worker`){let e=/^\/w\/([^/]+)(?:\/|$)/.exec(t);if(e&&Kf.test(e[1]))return`/w/${e[1]}`}return Zp}var $p=`aiworker.worker.bearer`,em=`#token=`,tm;function nm(){try{return globalThis.sessionStorage?.getItem($p)??null}catch{return null}}function rm(e){try{e===null?globalThis.sessionStorage?.removeItem($p):globalThis.sessionStorage?.setItem($p,e)}catch{}}function im(){if(typeof window>`u`)return;let{location:e,history:t}=window;if(!e?.hash?.startsWith(em))return;let n=am(e.hash.slice(7));om(e,t),!(!n||n.length===0)&&(rm(n),tm=n)}function am(e){try{return decodeURIComponent(e)}catch{return null}}function om(e,t){try{t.replaceState(null,``,e.pathname+e.search)}catch{}}function sm(){return tm===void 0&&(tm=nm()),tm}function cm(e){tm=e,rm(e)}var lm=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),um=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),dm=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),fm=e=>{let t=dm(e);return t.charAt(0).toUpperCase()+t.slice(1)},pm={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`},mm=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},hm=(0,z.createContext)({}),gm=()=>(0,z.useContext)(hm),_m=(0,z.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=gm()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,z.createElement)(`svg`,{ref:c,...pm,width:t??l??pm.width,height:t??l??pm.height,stroke:e??f,strokeWidth:m,className:lm(`lucide`,p,i),...!a&&!mm(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,z.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),vm=(e,t)=>{let n=(0,z.forwardRef)(({className:n,...r},i)=>(0,z.createElement)(_m,{ref:i,iconNode:t,className:lm(`lucide-${um(fm(e))}`,`lucide-${e}`,n),...r}));return n.displayName=fm(e),n},ym=vm(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),bm=vm(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),xm=vm(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Sm=vm(`clipboard-list`,[[`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`}]]),Cm=vm(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),wm=vm(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Tm=vm(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Em=vm(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Dm=vm(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Om=vm(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),km=vm(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),Am=vm(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),jm=vm(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Mm=vm(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Nm=vm(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Pm=vm(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Fm=vm(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Im=vm(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Lm=vm(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Rm=vm(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),zm=vm(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Bm=vm(`shield-alert`,[[`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:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Vm=vm(`shield-check`,[[`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`}]]),Hm=vm(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Um=vm(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Wm=vm(`timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),Gm=vm(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Km=vm(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),qm=vm(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Jm=vm(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Ym(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ym(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Xm(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ym(e))&&(r&&(r+=` `),r+=t);return r}var Zm=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Qm=(e,t)=>({classGroupId:e,validator:t}),$m=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),eh=`-`,th=[],nh=`arbitrary..`,rh=e=>{let t=oh(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ah(e);let n=e.split(eh);return ih(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Zm(i,t):t:i||th}return n[e]||th}}},ih=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=ih(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(eh):e.slice(t).join(eh),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ah=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?nh+r:void 0})(),oh=e=>{let{theme:t,classGroups:n}=e;return sh(n,t)},sh=(e,t)=>{let n=$m();for(let r in e){let i=e[r];ch(i,n,r,t)}return n},ch=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];lh(i,t,n,r)}},lh=(e,t,n,r)=>{if(typeof e==`string`){uh(e,t,n);return}if(typeof e==`function`){dh(e,t,n,r);return}fh(e,t,n,r)},uh=(e,t,n)=>{let r=e===``?t:ph(t,e);r.classGroupId=n},dh=(e,t,n,r)=>{if(mh(e)){ch(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Qm(n,e))},fh=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];ch(o,ph(t,a),n,r)}},ph=(e,t)=>{let n=e,r=t.split(eh),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=$m(),n.nextPart.set(t,i)),n=i}return n},mh=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,hh=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},gh=`!`,_h=`:`,vh=[],yh=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),bh=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===_h){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(gh)?(c=s.slice(0,-1),l=!0):s.startsWith(gh)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return yh(t,l,c,u)};if(t){let e=t+_h,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):yh(vh,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},xh=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Sh=e=>({cache:hh(e.cacheSize),parseClassName:bh(e),sortModifiers:xh(e),...rh(e)}),Ch=/\s+/,wh=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(Ch),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+gh:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},Th=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Eh(n))&&(i&&(i+=` `),i+=r);return i},Eh=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Eh(e[r]))&&(n&&(n+=` `),n+=t);return n},Dh=(e,...t)=>{let n,r,i,a,o=o=>(n=Sh(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=wh(e,n);return i(e,a),a};return a=o,(...e)=>a(Th(...e))},Oh=[],kh=e=>{let t=t=>t[e]||Oh;return t.isThemeGetter=!0,t},Ah=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,jh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Mh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Nh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ph=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ih=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Lh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rh=e=>Mh.test(e),zh=e=>!!e&&!Number.isNaN(Number(e)),Bh=e=>!!e&&Number.isInteger(Number(e)),Vh=e=>e.endsWith(`%`)&&zh(e.slice(0,-1)),Hh=e=>Nh.test(e),Uh=()=>!0,Wh=e=>Ph.test(e)&&!Fh.test(e),Gh=()=>!1,Kh=e=>Ih.test(e),qh=e=>Lh.test(e),Jh=e=>!Q(e)&&!$(e),Yh=e=>ug(e,mg,Gh),Q=e=>Ah.test(e),Xh=e=>ug(e,hg,Wh),Zh=e=>ug(e,gg,zh),Qh=e=>ug(e,vg,Uh),$h=e=>ug(e,_g,Gh),eg=e=>ug(e,fg,Gh),tg=e=>ug(e,pg,qh),ng=e=>ug(e,yg,Kh),$=e=>jh.test(e),rg=e=>dg(e,hg),ig=e=>dg(e,_g),ag=e=>dg(e,fg),og=e=>dg(e,mg),sg=e=>dg(e,pg),cg=e=>dg(e,yg,!0),lg=e=>dg(e,vg,!0),ug=(e,t,n)=>{let r=Ah.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},dg=(e,t,n=!1)=>{let r=jh.exec(e);return r?r[1]?t(r[1]):n:!1},fg=e=>e===`position`||e===`percentage`,pg=e=>e===`image`||e===`url`,mg=e=>e===`length`||e===`size`||e===`bg-size`,hg=e=>e===`length`,gg=e=>e===`number`,_g=e=>e===`family-name`,vg=e=>e===`number`||e===`weight`,yg=e=>e===`shadow`,bg=Dh(()=>{let e=kh(`color`),t=kh(`font`),n=kh(`text`),r=kh(`font-weight`),i=kh(`tracking`),a=kh(`leading`),o=kh(`breakpoint`),s=kh(`container`),c=kh(`spacing`),l=kh(`radius`),u=kh(`shadow`),d=kh(`inset-shadow`),f=kh(`text-shadow`),p=kh(`drop-shadow`),m=kh(`blur`),h=kh(`perspective`),g=kh(`aspect`),_=kh(`ease`),v=kh(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),$,Q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[$,Q,c],T=()=>[Rh,`full`,`auto`,...w()],E=()=>[Bh,`none`,`subgrid`,$,Q],D=()=>[`auto`,{span:[`full`,Bh,$,Q]},Bh,$,Q],O=()=>[Bh,`auto`,$,Q],ee=()=>[`auto`,`min`,`max`,`fr`,$,Q],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[Rh,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[Rh,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],te=()=>[Rh,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,$,Q],ne=()=>[...b(),ag,eg,{position:[$,Q]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,og,Yh,{size:[$,Q]}],F=()=>[Vh,rg,Xh],I=()=>[``,`none`,`full`,l,$,Q],ae=()=>[``,zh,rg,Xh],oe=()=>[`solid`,`dashed`,`dotted`,`double`],L=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[zh,Vh,ag,eg],se=()=>[``,`none`,m,$,Q],ce=()=>[`none`,zh,$,Q],le=()=>[`none`,zh,$,Q],ue=()=>[zh,$,Q],de=()=>[Rh,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Hh],breakpoint:[Hh],color:[Uh],container:[Hh],"drop-shadow":[Hh],ease:[`in`,`out`,`in-out`],font:[Jh],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Hh],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Hh],shadow:[Hh],spacing:[`px`,zh],text:[Hh],"text-shadow":[Hh],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Rh,Q,$,g]}],container:[`container`],columns:[{columns:[zh,Q,$,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Bh,`auto`,$,Q]}],basis:[{basis:[Rh,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[zh,Rh,`auto`,`initial`,`none`,Q]}],grow:[{grow:[``,zh,$,Q]}],shrink:[{shrink:[``,zh,$,Q]}],order:[{order:[Bh,`first`,`last`,`none`,$,Q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...N()]}],"min-inline-size":[{"min-inline":[`auto`,...N()]}],"max-inline-size":[{"max-inline":[`none`,...N()]}],"block-size":[{block:[`auto`,...te()]}],"min-block-size":[{"min-block":[`auto`,...te()]}],"max-block-size":[{"max-block":[`none`,...te()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,...M()]}],"font-size":[{text:[`base`,n,rg,Xh]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,lg,Qh]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Vh,Q]}],"font-family":[{font:[ig,$h,t]}],"font-features":[{"font-features":[Q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,$,Q]}],"line-clamp":[{"line-clamp":[zh,`none`,$,Zh]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,$,Q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,$,Q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...oe(),`wavy`]}],"text-decoration-thickness":[{decoration:[zh,`from-font`,`auto`,$,Xh]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[zh,`auto`,$,Q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$,Q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,$,Q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Bh,$,Q],radial:[``,$,Q],conic:[Bh,$,Q]},sg,tg]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...oe(),`hidden`,`none`]}],"divide-style":[{divide:[...oe(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...oe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[zh,$,Q]}],"outline-w":[{outline:[``,zh,rg,Xh]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,cg,ng]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,cg,ng]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:ae()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[zh,Xh]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,cg,ng]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[zh,$,Q]}],"mix-blend":[{"mix-blend":[...L(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":L()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[zh]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[$,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[zh]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,$,Q]}],filter:[{filter:[``,`none`,$,Q]}],blur:[{blur:se()}],brightness:[{brightness:[zh,$,Q]}],contrast:[{contrast:[zh,$,Q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,cg,ng]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,zh,$,Q]}],"hue-rotate":[{"hue-rotate":[zh,$,Q]}],invert:[{invert:[``,zh,$,Q]}],saturate:[{saturate:[zh,$,Q]}],sepia:[{sepia:[``,zh,$,Q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,$,Q]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[zh,$,Q]}],"backdrop-contrast":[{"backdrop-contrast":[zh,$,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,zh,$,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[zh,$,Q]}],"backdrop-invert":[{"backdrop-invert":[``,zh,$,Q]}],"backdrop-opacity":[{"backdrop-opacity":[zh,$,Q]}],"backdrop-saturate":[{"backdrop-saturate":[zh,$,Q]}],"backdrop-sepia":[{"backdrop-sepia":[``,zh,$,Q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,$,Q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[zh,`initial`,$,Q]}],ease:[{ease:[`linear`,`initial`,_,$,Q]}],delay:[{delay:[zh,$,Q]}],animate:[{animate:[`none`,v,$,Q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,$,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":[`scale-3d`],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[$,Q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":[`translate-none`],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,$,Q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,$,Q]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[zh,rg,Xh,Zh]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function xg(...e){return bg(Xm(e))}var Sg=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Cg=Xm,wg=(e,t)=>n=>{if(t?.variants==null)return Cg(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Sg(t)||Sg(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Cg(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Tg=wg(`inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium leading-[1.7] ring-offset-background transition-[background-color,border-color,color] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`rounded-pill border border-primary bg-primary text-primary-foreground hover:bg-ink active:bg-cohere-black`,secondary:`!min-h-0 rounded-xs border border-transparent bg-transparent !px-0 !py-0 text-foreground underline decoration-hairline underline-offset-4 hover:text-action-blue hover:decoration-action-blue`,destructive:`rounded-pill border border-destructive bg-transparent text-destructive hover:bg-destructive hover:text-destructive-foreground`,outline:`rounded-xl border border-primary bg-transparent text-primary hover:bg-soft-stone`,ghost:`rounded-sm border border-transparent bg-transparent text-foreground hover:border-hairline hover:bg-soft-stone hover:text-foreground`,link:`!min-h-0 h-auto rounded-xs border-0 !px-0 !py-0 text-foreground underline decoration-hairline underline-offset-4 hover:text-action-blue hover:decoration-action-blue`},size:{default:`min-h-11 px-6 py-2.5`,sm:`min-h-9 px-4 py-1.5 text-sm`,lg:`min-h-12 px-7 py-3 text-base`,icon:`size-10 p-0`}},defaultVariants:{variant:`default`,size:`default`}});function Eg({className:e,variant:t,size:n,type:r,...i}){return(0,B.jsx)(`button`,{type:r??`button`,className:xg(Tg({variant:t,size:n}),e),...i})}var Dg=typeof document<`u`?z.useLayoutEffect:()=>{};function Og(e,...t){let n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Base UI error #${e}; visit ${n} for the full message.`}var kg=z.createContext(void 0);function Ag(e){let t=z.useContext(kg);if(t===void 0&&!e)throw Error(Og(72));return t}var jg={};function Mg(e,t){let n=z.useRef(jg);return n.current===jg&&(n.current=e(t)),n}var Ng=[];function Pg(e){z.useEffect(e,Ng)}var Fg=0,Ig=class e{static create(){return new e}currentId=Fg;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Fg,t()},e)}isStarted(){return this.currentId!==Fg}clear=()=>{this.currentId!==Fg&&(clearTimeout(this.currentId),this.currentId=Fg)};disposeEffect=()=>this.clear};function Lg(){let e=Mg(Ig.create).current;return Pg(e.disposeEffect),e}function Rg(){return typeof window<`u`}function zg(e){return Hg(e)?(e.nodeName||``).toLowerCase():`#document`}function Bg(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vg(e){return((Hg(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Hg(e){return Rg()?e instanceof Node||e instanceof Bg(e).Node:!1}function Ug(e){return Rg()?e instanceof Element||e instanceof Bg(e).Element:!1}function Wg(e){return Rg()?e instanceof HTMLElement||e instanceof Bg(e).HTMLElement:!1}function Gg(e){return!Rg()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Bg(e).ShadowRoot}function Kg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=r_(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function qg(e){return/^(table|td|th)$/.test(zg(e))}function Jg(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Yg=/transform|translate|scale|rotate|perspective|filter/,Xg=/paint|layout|strict|content/,Zg=e=>!!e&&e!==`none`,Qg;function $g(e){let t=Ug(e)?r_(e):e;return Zg(t.transform)||Zg(t.translate)||Zg(t.scale)||Zg(t.rotate)||Zg(t.perspective)||!t_()&&(Zg(t.backdropFilter)||Zg(t.filter))||Yg.test(t.willChange||``)||Xg.test(t.contain||``)}function e_(e){let t=a_(e);for(;Wg(t)&&!n_(t);){if($g(t))return t;if(Jg(t))return null;t=a_(t)}return null}function t_(){return Qg??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Qg}function n_(e){return/^(html|body|#document)$/.test(zg(e))}function r_(e){return Bg(e).getComputedStyle(e)}function i_(e){return Ug(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function a_(e){if(zg(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Gg(e)&&e.host||Vg(e);return Gg(t)?t.host:t}function o_(e){let t=a_(e);return n_(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wg(t)&&Kg(t)?t:o_(t)}function s_(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=o_(e),i=r===e.ownerDocument?.body,a=Bg(r);if(i){let e=c_(a);return t.concat(a,a.visualViewport||[],Kg(r)?r:[],e&&n?s_(e):[])}else return t.concat(r,s_(r,[],n))}function c_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function l_(e){let t=Mg(u_,e).current;return t.next=e,Dg(t.effect),t}function u_(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var d_=z[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],f_=d_&&d_!==z.useLayoutEffect?d_:e=>e();function p_(e){let t=Mg(m_).current;return t.next=e,f_(t.effect),t.trampoline}function m_(){let e={next:void 0,callback:h_,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function h_(){}var g_=typeof navigator<`u`,__=E_(),v_=O_(),y_=D_(),b_=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),x_=__.platform===`MacIntel`&&__.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(__.platform);g_&&/firefox/i.test(y_);var S_=g_&&/apple/i.test(navigator.vendor);g_&&/Edg/i.test(y_);var C_=g_&&/android/i.test(v_)||/android/i.test(y_),w_=g_&&v_.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,T_=y_.includes(`jsdom/`);function E_(){if(!g_)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function D_(){if(!g_)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function O_(){if(!g_)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var k_=`data-base-ui-focusable`,A_=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function j_(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function M_(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Gg(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function N_(e){return`composedPath`in e?e.composedPath()[0]:e.target}function P_(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function F_(e){return e.matches(`html,body`)}function I_(e){return e?.ownerDocument||document}function L_(e){return Wg(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function R_(e){return e?e.getAttribute(`role`)===`combobox`&&L_(e):!1}function z_(e){if(!e||T_)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function B_(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function V_(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...V_(e,t.id,n)])}function H_(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function U_(e){e.preventDefault(),e.stopPropagation()}function W_(e){return`nativeEvent`in e}function G_(e){return e.mozInputSource===0&&e.isTrusted?!0:C_&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function K_(e){return T_?!1:!C_&&e.width===0&&e.height===0||C_&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function q_(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function J_(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Y_=[`top`,`right`,`bottom`,`left`],X_=Math.min,Z_=Math.max,Q_=Math.round,$_=Math.floor,ev=e=>({x:e,y:e}),tv={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function nv(e,t,n){return Z_(e,X_(t,n))}function rv(e,t){return typeof e==`function`?e(t):e}function iv(e){return e.split(`-`)[0]}function av(e){return e.split(`-`)[1]}function ov(e){return e===`x`?`y`:`x`}function sv(e){return e===`y`?`height`:`width`}function cv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function lv(e){return ov(cv(e))}function uv(e,t,n){n===void 0&&(n=!1);let r=av(e),i=lv(e),a=sv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=yv(o)),[o,yv(o)]}function dv(e){let t=yv(e);return[fv(e),t,fv(t)]}function fv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var pv=[`left`,`right`],mv=[`right`,`left`],hv=[`top`,`bottom`],gv=[`bottom`,`top`];function _v(e,t,n){switch(e){case`top`:case`bottom`:return n?t?mv:pv:t?pv:mv;case`left`:case`right`:return t?hv:gv;default:return[]}}function vv(e,t,n,r){let i=av(e),a=_v(iv(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(fv)))),a}function yv(e){let t=iv(e);return tv[t]+e.slice(t.length)}function bv(e){return{top:0,right:0,bottom:0,left:0,...e}}function xv(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:bv(e)}function Sv(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var Cv=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),wv=typeof Element>`u`,Tv=wv?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ev=!wv&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Dv=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):Dv(e.parentNode))},Ov=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},kv=function(e,t,n){if(Dv(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Cv));return t&&Tv.call(e,Cv)&&r.unshift(e),r=r.filter(n),r},Av=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!Dv(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=Av(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{Tv.call(a,Cv)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!Dv(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=Av(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},jv=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Mv=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Ov(e))&&!jv(e)?0:e.tabIndex},Nv=function(e,t){var n=Mv(e);return n<0&&t&&!jv(e)?0:n},Pv=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Fv=function(e){return e.tagName===`INPUT`},Iv=function(e){return Fv(e)&&e.type===`hidden`},Lv=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Rv=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},zv=function(e){if(!e.name)return!0;var t=e.form||Ev(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Rv(r,e.form);return!i||i===e},Bv=function(e){return Fv(e)&&e.type===`radio`},Vv=function(e){return Bv(e)&&!zv(e)},Hv=function(e){var t=e&&Ev(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Ev(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Uv=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Wv=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=Tv.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Tv.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=Ev(e);if(o&&!o.shadowRoot&&r(o)===!0)return Uv(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Hv(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Uv(e);return!1},Gv=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Tv.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Kv=function(e,t){return!(t.disabled||Iv(t)||Wv(t,e)||Lv(t)||Gv(t))},qv=function(e,t){return!(Vv(t)||Mv(t)<0||!Kv(e,t))},Jv=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Yv=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Nv(a,i),s=i?Yv(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Pv).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Xv=function(e,t){return t||={},Yv(t.getShadowRoot?Av([e],t.includeContainer,{filter:qv.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Jv}):kv(e,t.includeContainer,qv.bind(null,t)))},Zv=function(e,t){return t||={},t.getShadowRoot?Av([e],t.includeContainer,{filter:Kv.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):kv(e,t.includeContainer,Kv.bind(null,t))},Qv=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Tv.call(e,Cv)===!1?!1:qv(t,e)},$v=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function ey(e,t){let n=Xv(e,$v()),r=n.length;if(r===0)return;let i=j_(I_(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function ty(e){return ey(I_(e).body,1)||e}function ny(e){return ey(I_(e).body,-1)||e}function ry(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!M_(n,r)}function iy(e){Xv(e,$v()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ay(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var oy={...z},sy=0;function cy(e,t=`mui`){let[n,r]=z.useState(e),i=e||n;return z.useEffect(()=>{n??(sy+=1,r(`${t}-${sy}`))},[n,t]),i}var ly=oy.useId;function uy(e,t){if(ly!==void 0){let n=ly();return e??(t?`${t}-${n}`:n)}return cy(e,t)}function dy(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var fy=z.createContext(null),py=z.createContext(null),my=()=>z.useContext(fy)?.id||null,hy=e=>{let t=z.useContext(py);return e??t};function gy(){}Object.freeze([]);var _y=Object.freeze({}),vy={style:{transition:`none`}},yy={fallbackAxisSide:`end`},by={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},xy=`none`,Sy=`trigger-hover`,Cy=`trigger-focus`,wy=`outside-press`,Ty=`close-press`,Ey=`focus-out`,Dy=`escape-key`,Oy=`disabled`,ky=`imperative-action`;function Ay(e,t,n,r){let i=!1,a=!1,o=r??_y;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function jy(e){return`data-base-ui-${e}`}jy(`safe-polygon`),`${A_}`;function My(e,t,n){if(n&&!q_(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}var Ny=z.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ig,currentIdRef:{current:null},currentContextRef:{current:null}});function Py(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=z.useRef(n),a=z.useRef(n),o=z.useRef(null),s=z.useRef(null),c=Lg();return(0,B.jsx)(Ny.Provider,{value:z.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Fy(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{enabled:i=!0,open:a}=t,{currentIdRef:o,delayRef:s,timeoutMs:c,initialDelayRef:l,currentContextRef:u,hasProvider:d,timeout:f}=z.useContext(Ny),[p,m]=z.useState(!1);return Dg(()=>{function e(){m(!1),u.current?.setIsInstantPhase(!1),o.current=null,u.current=null,s.current=l.current}if(i&&o.current&&!a&&o.current===r){if(m(!1),c)return f.start(c,e),()=>{f.clear()};e()}},[i,a,r,o,s,c,l,u,f]),Dg(()=>{if(!i||!a)return;let e=u.current,t=o.current;u.current={onOpenChange:n.setOpen,setIsInstantPhase:m},o.current=r,s.current={open:0,close:My(l.current,`close`)},t!==null&&t!==r?(f.clear(),m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Ay(xy))):(m(!1),e?.setIsInstantPhase(!1))},[i,a,r,n,o,s,c,l,u,f]),Dg(()=>()=>{u.current=null},[u]),z.useMemo(()=>({hasProvider:d,delayRef:s,isInstantPhase:p}),[d,s,p])}function Iy(e,t,n,r){let i=Mg(Ry).current;return zy(i,e,t,n,r)&&Vy(i,[e,t,n,r]),i.callback}function Ly(e){let t=Mg(Ry).current;return By(t,e)&&Vy(t,e),t.callback}function Ry(){return{callback:null,cleanup:null,refs:[]}}function zy(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function By(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Vy(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var Hy={clip:`rect(0 0 0 0)`,overflow:`hidden`,whiteSpace:`nowrap`,position:`fixed`,top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},Uy=null;globalThis.requestAnimationFrame;var Wy=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Gy=class e{static create(){return new e}static request(e){return Wy.request(e)}static cancel(e){return Wy.cancel(e)}currentId=Uy;request(e){this.cancel(),this.currentId=Wy.request(()=>{this.currentId=Uy,e()})}cancel=()=>{this.currentId!==Uy&&(Wy.cancel(this.currentId),this.currentId=Uy)};disposeEffect=()=>this.cancel};function Ky(){let e=Mg(Gy.create).current;return Pg(e.disposeEffect),e}function qy(e){return e?.ownerDocument||document}var Jy=z.forwardRef(function(e,t){let[n,r]=z.useState();Dg(()=>{S_&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,B.jsx)(`span`,{...e,ref:t,style:Hy,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})}),Yy=0;function Xy(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Yy);let a=()=>e?.focus({preventScroll:n});i?a():Yy=requestAnimationFrame(a)}var Zy={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Qy(e){return e===`inert`?Zy.inert:e===`aria-hidden`?Zy[`aria-hidden`]:Zy.none}var $y=new WeakSet,eb={},tb=0,nb=e=>e&&(e.host||nb(e.parentNode)),rb=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=nb(t);return e.contains(n)?n:null}).filter(e=>e!=null);function ib(e,t,n,r){let i=`data-base-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=rb(t,e),s=new Set,c=new Set(o),l=[];eb[i]||(eb[i]=new WeakMap);let u=eb[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(zg(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Qy(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&$y.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return tb+=1,()=>{l.forEach(e=>{let t=Qy(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!$y.has(e)&&a&&e.removeAttribute(a),$y.delete(e)),r||e.removeAttribute(i)}),--tb,tb||(Zy.inert=new WeakMap,Zy[`aria-hidden`]=new WeakMap,Zy.none=new WeakMap,$y=new WeakSet,eb={})}}function ab(e,t=!1,n=!1){let r=I_(e[0]).body;return ib(e.concat(Array.from(r.querySelectorAll(`[aria-live]`))),r,t,n)}var ob=19;function sb(e){return ob>=e}function cb(e){if(!z.isValidElement(e))return null;let t=e,n=t.props;return(sb(19)?n?.ref:t.ref)??null}function lb(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function ub(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function db(e,t){return typeof e==`function`?e(t):e}function fb(e,t){return typeof e==`function`?e(t):e}var pb={};function mb(e,t,n,r,i){let a={...bb(e,pb)};return t&&(a=gb(a,t)),n&&(a=gb(a,n)),r&&(a=gb(a,r)),i&&(a=gb(a,i)),a}function hb(e){if(e.length===0)return pb;if(e.length===1)return bb(e[0],pb);let t={...bb(e[0],pb)};for(let n=1;n<e.length;n+=1)t=gb(t,e[n]);return t}function gb(e,t){return yb(t)?t(e):_b(e,t)}function _b(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=lb(e.style,r);break;case`className`:e[n]=Cb(e.className,r);break;default:vb(n,r)?e[n]=xb(e[n],r):e[n]=r}}return e}function vb(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function yb(e){return typeof e==`function`}function bb(e,t){return yb(e)?e(t):e??pb}function xb(e,t){return t?e?n=>{if(wb(n)){let r=n;Sb(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function Sb(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Cb(e,t){return t?e?t+` `+e:t:e}function wb(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Tb(e,t,n={}){let r=t.render,i=Eb(t,n);return n.enabled===!1?null:Db(e,r,i,n.state??_y)}function Eb(e,t={}){let{className:n,style:r,render:i}=e,{state:a=_y,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?db(n,a):void 0,d=l?fb(r,a):void 0,f=l?ub(a,c):_y,p=l?lb(f,Array.isArray(s)?hb(s):s)??_y:_y;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=Ly([p.ref,cb(i),...o]):p.ref=Iy(p.ref,cb(i),o):Iy(null,null)),l?(u!==void 0&&(p.className=Cb(p.className,u)),d!==void 0&&(p.style=lb(p.style,d)),p):_y}function Db(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=mb(n,t.props);return e.ref=n.ref,z.cloneElement(t,e)}if(e&&typeof e==`string`)return Ob(e,n);throw Error(Og(8))}function Ob(e,t){return e===`button`?(0,z.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,z.createElement)(`img`,{alt:``,...t,key:t.key}):z.createElement(e,t)}var kb=z.createContext(null),Ab=()=>z.useContext(kb),jb=jy(`portal`);function Mb(e={}){let{ref:t,container:n,componentProps:r=_y,elementProps:i,elementState:a}=e,o=uy(),s=Ab()?.portalNode,[c,l]=z.useState(null),[u,d]=z.useState(null),f=z.useRef(null);Dg(()=>{if(n===null){f.current&&(f.current=null,d(null),l(null));return}if(o==null)return;let e=(n&&(Hg(n)?n:n.current))??s??document.body;if(e==null){f.current&&(f.current=null,d(null),l(null));return}f.current!==e&&(f.current=e,d(null),l(e))},[n,s,o]);let p=Tb(`div`,r,{ref:[t,d],state:a,props:[{id:o,[jb]:``},i]});return{portalNode:u,portalSubtree:c&&p?xi.createPortal(p,c):null}}var Nb=z.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,...s}=e,{portalNode:c,portalSubtree:l}=Mb({container:r,ref:t,componentProps:e,elementProps:s}),u=z.useRef(null),d=z.useRef(null),f=z.useRef(null),p=z.useRef(null),[m,h]=z.useState(null),g=m?.modal,_=m?.open,v=typeof o==`boolean`?o:!!m&&!m.modal&&m.open&&!!c;z.useEffect(()=>{if(!c||g)return;function e(e){c&&ry(e)&&(e.type===`focusin`?ay:iy)(c)}return c.addEventListener(`focusin`,e,!0),c.addEventListener(`focusout`,e,!0),()=>{c.removeEventListener(`focusin`,e,!0),c.removeEventListener(`focusout`,e,!0)}},[c,g]),z.useEffect(()=>{!c||_||ay(c)},[_,c]);let y=z.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:c,setFocusManagerState:h}),[c]);return(0,B.jsxs)(z.Fragment,{children:[l,(0,B.jsxs)(kb.Provider,{value:y,children:[v&&c&&(0,B.jsx)(Jy,{"data-type":`outside`,ref:u,onFocus:e=>{ry(e,c)?f.current?.focus():ny(m?m.domReference:null)?.focus()}}),v&&c&&(0,B.jsx)(`span`,{"aria-owns":c.id,style:by}),c&&xi.createPortal(n,c),v&&c&&(0,B.jsx)(Jy,{"data-type":`outside`,ref:d,onFocus:e=>{ry(e,c)?p.current?.focus():(ty(m?m.domReference:null)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,Ay(`focus-out`,e.nativeEvent)))}})]})]})});function Pb(e){return e==null?e:`current`in e?e.current:e}function Fb(e,t){let n=Bg(e.target);return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Ib=20,Lb=[];function Rb(){Lb=Lb.filter(e=>e.isConnected)}function zb(e){Rb(),e&&zg(e)!==`body`&&(Lb.push(e),Lb.length>Ib&&(Lb=Lb.slice(-Ib)))}function Bb(){return Rb(),Lb[Lb.length-1]}function Vb(e){if(!e)return null;let t=$v();return Qv(e,t)?e:Xv(e,t)[0]||e}function Hb(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():r_(e).display!==`none`}function Ub(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=$v(),r=Zv(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Qv(e,n)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),i=e.getAttribute(`tabindex`);t.current.includes(`floating`)||r.length===0?i!==`0`&&e.setAttribute(`tabindex`,`0`):(i!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Wb(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,getInsideElements:d=()=>[],nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h}=e,g=`rootStore`in t?t.rootStore:t,_=g.useState(`open`),v=g.useState(`domReferenceElement`),y=g.useState(`floatingElement`),{events:b,dataRef:x}=g.context,S=p_(()=>x.current.floatingContext?.nodeId),C=p_(d),w=a===!1,T=R_(v)&&w,E=l_(i),D=l_(a),O=l_(o),ee=l_(u),k=hy(h),A=Ab(),j=z.useRef(null),M=z.useRef(null),N=z.useRef(!1),te=z.useRef(!1),P=z.useRef(!1),ne=z.useRef(-1),re=z.useRef(``),ie=z.useRef(``),F=Lg(),I=Lg(),ae=Ky(),oe=A!=null,L=B_(y),R=p_((e=L)=>e?Xv(e,$v()):[]),se=p_(e=>{let t=R(e);return E.current.map(()=>t).filter(Boolean).flat()});z.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&M_(L,j_(I_(L)))&&R().length===0&&!T&&U_(e)}let t=I_(L);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,v,L,c,E,T,R,se]),z.useEffect(()=>{if(r||!y)return;function e(e){let t=N_(e),n=R().indexOf(t);n!==-1&&(ne.current=n)}return y.addEventListener(`focusin`,e),()=>{y.removeEventListener(`focusin`,e)}},[r,y,R]),z.useEffect(()=>{if(r||!_)return;let e=I_(L);function t(){P.current=!1}function n(e){let t=N_(e);P.current=!(M_(y,t)||M_(v,t)||M_(A?.portalNode,t)),ie.current=e.pointerType||`keyboard`}function i(){ie.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,i,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,i,!0)}},[r,y,v,L,_,A]),z.useEffect(()=>{if(r||!l)return;function e(){te.current=!0,I.start(0,()=>{te.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=N_(e);queueMicrotask(()=>{let i=S(),a=g.context.triggerElements,o=!(M_(v,t)||M_(y,t)||M_(t,y)||M_(A?.portalNode,t)||t!=null&&a.hasElement(t)||a.hasMatchingElement(e=>M_(e,t))||t?.hasAttribute(jy(`focus-guard`))||k&&(V_(k.nodesRef.current,i).find(e=>M_(e.context?.elements.floating,t)||M_(e.context?.elements.domReference,t))||H_(k.nodesRef.current,i).find(e=>[e.context?.elements.floating,B_(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===v&&L&&Ub(L,E),s&&n!==v&&!Hb(r)&&j_(I_(L))===I_(L).body){if(Wg(L)&&(L.focus(),s===`popup`)){ae.request(()=>{L.focus()});return}let e=ne.current,t=R(),n=t[e]||t[t.length-1]||L;Wg(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(T||!c)&&t&&o&&!te.current&&(T||t!==Bb())&&(N.current=!0,g.setOpen(!1,Ay(Ey,e)))})}function n(){P.current||(x.current.insideReactTree=!0,F.start(0,()=>{x.current.insideReactTree=!1}))}let i=Wg(v)?v:null,a=[];if(!(!y&&!i))return i&&(i.addEventListener(`focusout`,t),i.addEventListener(`pointerdown`,e),a.push(()=>{i.removeEventListener(`focusout`,t),i.removeEventListener(`pointerdown`,e)})),y&&(y.addEventListener(`focusout`,t),A&&(y.addEventListener(`focusout`,n,!0),a.push(()=>{y.removeEventListener(`focusout`,n,!0)})),a.push(()=>{y.removeEventListener(`focusout`,t)})),()=>{a.forEach(e=>{e()})}},[r,v,y,L,c,k,A,g,l,s,R,T,S,E,x,F,I,ae]);let ce=z.useRef(null),le=z.useRef(null),ue=Iy(ce,m,A?.beforeInsideRef),de=Iy(le,A?.afterInsideRef);z.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${jy(`portal`)}]`)||[]),t=ab([y,(k?H_(k.nodesRef.current,S()):[]).find(e=>R_(e.context?.elements.domReference||null))?.context?.elements.domReference,...e,...C(),j.current,M.current,ce.current,le.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Pb(p),Pb(f),T?v:null].filter(e=>e!=null),c||T);return()=>{t()}},[_,r,v,y,c,E,A,T,k,S,C,f,p]),Dg(()=>{if(!_||r||!Wg(L))return;let e=j_(I_(L));queueMicrotask(()=>{let t=se(L),n=D.current,r=typeof n==`function`?n(ee.current||``):n;if(r===void 0||r===!1)return;let i;i=r===!0||r===null?t[0]||L:Pb(r),i=i||t[0]||L,!M_(L,e)&&Xy(i,{preventScroll:i===L})})},[r,_,L,w,se,D,ee]),Dg(()=>{if(r||!L)return;let e=I_(L);zb(j_(e));function t(e){if(e.open||(re.current=Fb(e.nativeEvent,ie.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(N.current=!0),e.reason===`outside-press`)if(e.nested)N.current=!1;else if(G_(e.nativeEvent)||K_(e.nativeEvent))N.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}b.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,Hy),oe&&v&&v.insertAdjacentElement(`afterend`,n);function i(){let e=O.current,t=typeof e==`function`?e(re.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=v||Bb();return e&&e.isConnected?e:n}let r=v||Bb()||n;return Pb(t)||r}return()=>{b.off(`openchange`,t);let r=j_(e),a=M_(y,r)||k&&V_(k.nodesRef.current,S(),!1).some(e=>M_(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=Vb(o),i=typeof O.current!=`boolean`;O.current&&!N.current&&Wg(t)&&(!(!i&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,y,L,O,x,b,k,oe,v,S]),z.useEffect(()=>{queueMicrotask(()=>{N.current=!1})},[r]),z.useEffect(()=>{if(r||!_)return;function e(e){N_(e)?.closest(`[data-base-ui-click-trigger]`)&&(te.current=!0)}let t=I_(L);return t.addEventListener(`pointerdown`,e,!0),()=>{t.removeEventListener(`pointerdown`,e,!0)}},[r,_,L]),Dg(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:g.setOpen,domReference:v}),()=>{A.setFocusManagerState(null)}},[r,A,c,_,g,l,v]),Dg(()=>{if(!(r||!L))return Ub(L,E),()=>{queueMicrotask(Rb)}},[r,L,E]);let fe=!r&&(c?!T:!0)&&(oe||c);return(0,B.jsxs)(z.Fragment,{children:[fe&&(0,B.jsx)(Jy,{"data-type":`inside`,ref:ue,onFocus:e=>{if(c){let e=se();Xy(e[e.length-1])}else A?.portalNode&&(N.current=!1,ry(e,A.portalNode)?ty(v)?.focus():Pb(p??A.beforeOutsideRef)?.focus())}}),n,fe&&(0,B.jsx)(Jy,{"data-type":`inside`,ref:de,onFocus:e=>{c?Xy(se()[0]):A?.portalNode&&(l&&(N.current=!0),ry(e,A.portalNode)?ny(v)?.focus():Pb(f??A.afterOutsideRef)?.focus())}})]})}function Gb(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Kb(e){return e!=null&&e.clientX!=null}function qb(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`,x:l=null,y:u=null}=t,d=z.useRef(!1),f=z.useRef(null),[p,m]=z.useState(),[h,g]=z.useState([]),_=p_((e,t)=>{d.current||o.current.openEvent&&!Kb(o.current.openEvent)||n.set(`positionReference`,Gb(a,{x:e,y:t,axis:c,dataRef:o,pointerType:p}))}),v=p_(e=>{l!=null||u!=null||(r?f.current||g([]):_(e.clientX,e.clientY))}),y=q_(p)?i:r,b=z.useCallback(()=>{if(!y||!s||l!=null||u!=null)return;let e=Bg(i);function t(n){M_(i,N_(n))?(e.removeEventListener(`mousemove`,t),f.current=null):_(n.clientX,n.clientY)}if(!o.current.openEvent||Kb(o.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),f.current=null};return f.current=n,n}n.set(`positionReference`,a)},[y,s,l,u,i,o,a,n,_]);z.useEffect(()=>b(),[b,h]),z.useEffect(()=>{s&&!i&&(d.current=!1)},[s,i]),z.useEffect(()=>{!s&&r&&(d.current=!0)},[s,r]),Dg(()=>{s&&(l!=null||u!=null)&&(d.current=!1,_(l,u))},[s,l,u,_]);let x=z.useMemo(()=>{function e(e){m(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return z.useMemo(()=>s?{reference:x}:{},[s,x])}function Jb(e,t,n){let{reference:r,floating:i}=e,a=cv(t),o=lv(t),s=sv(o),c=iv(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(av(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Yb(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=rv(t,e),p=xv(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Sv(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Sv(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Xb=50,Zb=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Yb},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Jb(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Xb&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Jb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Qb=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=rv(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=iv(r),_=cv(o),v=iv(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[yv(o)]:dv(o)),x=p!==`none`;!d&&x&&b.push(...vv(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=uv(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==cv(t))||T.every(e=>cv(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=cv(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function $b(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ex(e){return Y_.some(t=>e[t]>=0)}var tx=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=rv(e,t);switch(i){case`referenceHidden`:{let e=$b(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ex(e)}}}case`escaped`:{let e=$b(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ex(e)}}}default:return{}}}}},nx=new Set([`left`,`top`]);async function rx(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=iv(n),s=av(n),c=cv(n)===`y`,l=nx.has(o)?-1:1,u=a&&c?-1:1,d=rv(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ix=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await rx(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ax=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=rv(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=cv(iv(i)),p=ov(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=nv(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=nv(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},ox=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=rv(e,t),u={x:n,y:r},d=cv(i),f=ov(d),p=u[f],m=u[d],h=rv(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=nx.has(iv(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},sx=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=rv(e,t),u=await o.detectOverflow(t,l),d=iv(i),f=av(i),p=cv(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=X_(h-u[g],v),x=X_(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Z_(u.left,0),t=Z_(u.right,0),n=Z_(u.top,0),r=Z_(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Z_(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Z_(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function cx(e){let t=r_(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Wg(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Q_(n)!==a||Q_(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function lx(e){return Ug(e)?e:e.contextElement}function ux(e){let t=lx(e);if(!Wg(t))return ev(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=cx(t),o=(a?Q_(n.width):n.width)/r,s=(a?Q_(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var dx=ev(0);function fx(e){let t=Bg(e);return!t_()||!t.visualViewport?dx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function px(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bg(e)?!1:t}function mx(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=lx(e),o=ev(1);t&&(r?Ug(r)&&(o=ux(r)):o=ux(e));let s=px(a,n,r)?fx(a):ev(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Bg(a),t=r&&Ug(r)?Bg(r):r,n=e,i=c_(n);for(;i&&r&&t!==n;){let e=ux(i),t=i.getBoundingClientRect(),r=r_(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Bg(i),i=c_(n)}}return Sv({width:u,height:d,x:c,y:l})}function hx(e,t){let n=i_(e).scrollLeft;return t?t.left+n:mx(Vg(e)).left+n}function gx(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-hx(e,n),y:n.top+t.scrollTop}}function _x(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Vg(r),s=t?Jg(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ev(1),u=ev(0),d=Wg(r);if((d||!d&&!a)&&((zg(r)!==`body`||Kg(o))&&(c=i_(r)),d)){let e=mx(r);l=ux(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?gx(o,c):ev(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function vx(e){return Array.from(e.getClientRects())}function yx(e){let t=Vg(e),n=i_(e),r=e.ownerDocument.body,i=Z_(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Z_(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+hx(e),s=-n.scrollTop;return r_(r).direction===`rtl`&&(o+=Z_(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var bx=25;function xx(e,t){let n=Bg(e),r=Vg(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=t_();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=hx(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=bx&&(a-=o)}else l<=bx&&(a+=l);return{width:a,height:o,x:s,y:c}}function Sx(e,t){let n=mx(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Wg(e)?ux(e):ev(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Cx(e,t,n){let r;if(t===`viewport`)r=xx(e,n);else if(t===`document`)r=yx(Vg(e));else if(Ug(t))r=Sx(t,n);else{let n=fx(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Sv(r)}function wx(e,t){let n=a_(e);return n===t||!Ug(n)||n_(n)?!1:r_(n).position===`fixed`||wx(n,t)}function Tx(e,t){let n=t.get(e);if(n)return n;let r=s_(e,[],!1).filter(e=>Ug(e)&&zg(e)!==`body`),i=null,a=r_(e).position===`fixed`,o=a?a_(e):e;for(;Ug(o)&&!n_(o);){let t=r_(o),n=$g(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Kg(o)&&!n&&wx(e,o))?r=r.filter(e=>e!==o):i=t,o=a_(o)}return t.set(e,r),r}function Ex(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Jg(t)?[]:Tx(t,this._c):[].concat(n),r],o=Cx(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Cx(t,a[e],i);s=Z_(n.top,s),c=X_(n.right,c),l=X_(n.bottom,l),u=Z_(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Dx(e){let{width:t,height:n}=cx(e);return{width:t,height:n}}function Ox(e,t,n){let r=Wg(t),i=Vg(t),a=n===`fixed`,o=mx(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ev(0);function l(){c.x=hx(i)}if(r||!r&&!a)if((zg(t)!==`body`||Kg(i))&&(s=i_(t)),r){let e=mx(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?gx(i,s):ev(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function kx(e){return r_(e).position===`static`}function Ax(e,t){if(!Wg(e)||r_(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Vg(e)===n&&(n=n.ownerDocument.body),n}function jx(e,t){let n=Bg(e);if(Jg(e))return n;if(!Wg(e)){let t=a_(e);for(;t&&!n_(t);){if(Ug(t)&&!kx(t))return t;t=a_(t)}return n}let r=Ax(e,t);for(;r&&qg(r)&&kx(r);)r=Ax(r,t);return r&&n_(r)&&kx(r)&&!$g(r)?n:r||e_(e)||n}var Mx=async function(e){let t=this.getOffsetParent||jx,n=this.getDimensions,r=await n(e.floating);return{reference:Ox(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nx(e){return r_(e).direction===`rtl`}var Px={convertOffsetParentRelativeRectToViewportRelativeRect:_x,getDocumentElement:Vg,getClippingRect:Ex,getOffsetParent:jx,getElementRects:Mx,getClientRects:vx,getDimensions:Dx,getScale:ux,isElement:Ug,isRTL:Nx};function Fx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ix(e,t){let n=null,r,i=Vg(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=$_(d),h=$_(i.clientWidth-(u+f)),g=$_(i.clientHeight-(d+p)),_=$_(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Z_(0,X_(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Fx(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Lx(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=lx(e),u=i||a?[...l?s_(l):[],...t?s_(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ix(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?mx(e):null;c&&g();function g(){let t=mx(e);h&&!Fx(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Rx=ix,zx=ax,Bx=Qb,Vx=sx,Hx=tx,Ux=ox,Wx=(e,t,n)=>{let r=new Map,i={platform:Px,...n},a={...i.platform,_c:r};return Zb(e,t,{...i,platform:a})},Gx=typeof document<`u`?z.useLayoutEffect:function(){};function Kx(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Kx(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Kx(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function qx(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jx(e,t){let n=qx(e);return Math.round(t*n)/n}function Yx(e){let t=z.useRef(e);return Gx(()=>{t.current=e}),t}function Xx(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=z.useState(r);Kx(f,r)||p(r);let[m,h]=z.useState(null),[g,_]=z.useState(null),v=z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=z.useRef(null),C=z.useRef(null),w=z.useRef(u),T=c!=null,E=Yx(c),D=Yx(i),O=Yx(l),ee=z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Wx(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};k.current&&!Kx(w.current,t)&&(w.current=t,xi.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Gx(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=z.useRef(!1);Gx(()=>(k.current=!0,()=>{k.current=!1}),[]),Gx(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,ee);ee()}},[b,x,ee,E,T]);let A=z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=z.useMemo(()=>({reference:b,floating:x}),[b,x]),M=z.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=Jx(j.floating,u.x),r=Jx(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...qx(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return z.useMemo(()=>({...u,update:ee,refs:A,elements:j,floatingStyles:M}),[u,ee,A,j,M])}var Zx=(e,t)=>{let n=Rx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qx=(e,t)=>{let n=zx(e);return{name:n.name,fn:n.fn,options:[e,t]}},$x=(e,t)=>({fn:Ux(e).fn,options:[e,t]}),eS=(e,t)=>{let n=Bx(e);return{name:n.name,fn:n.fn,options:[e,t]}},tS=(e,t)=>{let n=Vx(e);return{name:n.name,fn:n.fn,options:[e,t]}},nS=(e,t)=>{let n=Hx(e);return{name:n.name,fn:n.fn,options:[e,t]}},rS={intentional:`onClick`,sloppy:`onPointerDown`};function iS(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function aS(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`referenceElement`),o=n.useState(`domReferenceElement`),{onOpenChange:s,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:f=`sloppy`,referencePress:p=!1,referencePressEvent:m=`sloppy`,ancestorScroll:h=!1,bubbles:g,externalTree:_}=t,v=hy(_),y=p_(typeof d==`function`?d:()=>!1),b=typeof d==`function`?y:d,x=z.useRef(!1),{escapeKey:S,outsidePress:C}=iS(g),w=z.useRef(null),T=Lg(),E=Lg(),D=p_(()=>{E.clear(),c.current.insideReactTree=!1}),O=z.useRef(!1),ee=z.useRef(``),k=p_(e=>{ee.current=e.pointerType}),A=p_(()=>{let e=ee.current,t=e===`pen`||!e?`mouse`:e,n=typeof f==`function`?f():f;return typeof n==`string`?n:n[t]}),j=p_(e=>{if(!r||!l||!u||e.key!==`Escape`||O.current)return;let t=c.current.floatingContext?.nodeId,i=v?V_(v.nodesRef.current,t):[];if(!S&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=Ay(Dy,W_(e)?e.nativeEvent:e);n.setOpen(!1,a),!S&&!a.isPropagationAllowed&&e.stopPropagation()}),M=p_(e=>{let t=A();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}),N=p_(()=>{c.current.insideReactTree=!0,E.start(0,D)}),te=p_((e,t=!1)=>{if(M(e)){D();return}if(c.current.insideReactTree){D();return}if(A()===`intentional`&&t||typeof b==`function`&&!b(e))return;let r=N_(e),i=`[${jy(`inert`)}]`,a=I_(n.select(`floatingElement`)).querySelectorAll(i),o=n.context.triggerElements;if(r&&(o.hasElement(r)||o.hasMatchingElement(e=>M_(e,r))))return;let s=Ug(r)?r:null;for(;s&&!n_(s);){let e=a_(s);if(n_(e)||!Ug(e))break;s=e}if(a.length&&Ug(r)&&!F_(r)&&!M_(r,n.select(`floatingElement`))&&Array.from(a).every(e=>!M_(s,e)))return;if(Wg(r)&&!(`touches`in e)){let t=n_(r),n=r_(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}let l=c.current.floatingContext?.nodeId,u=v&&V_(v.nodesRef.current,l).some(t=>P_(e,t.context?.elements.floating));if(P_(e,n.select(`floatingElement`))||P_(e,n.select(`domReferenceElement`))||u)return;let d=v?V_(v.nodesRef.current,l):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Ay(wy,e)),D()}),P=p_(e=>{A()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!l||P_(e,n.select(`floatingElement`))||P_(e,n.select(`domReferenceElement`))||te(e)}),ne=p_(e=>{if(A()!==`sloppy`||!n.select(`open`)||!l||P_(e,n.select(`floatingElement`))||P_(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(w.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{w.current&&(w.current.dismissOnTouchEnd=!1,w.current.dismissOnMouseDown=!1)}))}),re=p_(e=>{let t=N_(e);function n(){ne(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),ie=p_(e=>{let t=x.current;if(x.current=!1,T.clear(),e.type===`mousedown`&&w.current&&!w.current.dismissOnMouseDown)return;let n=N_(e);function r(){e.type===`pointerdown`?P(e):te(e,t),n?.removeEventListener(e.type,r)}n?.addEventListener(e.type,r)}),F=p_(e=>{if(A()!==`sloppy`||!w.current||P_(e,n.select(`floatingElement`))||P_(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-w.current.startX),i=Math.abs(t.clientY-w.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(w.current.dismissOnTouchEnd=!0),a>10&&(te(e),T.clear(),w.current=null)}),I=p_(e=>{let t=N_(e);function n(){F(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),ae=p_(e=>{A()!==`sloppy`||!w.current||P_(e,n.select(`floatingElement`))||P_(e,n.select(`domReferenceElement`))||(w.current.dismissOnTouchEnd&&te(e),T.clear(),w.current=null)}),oe=p_(e=>{let t=N_(e);function n(){ae(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)});z.useEffect(()=>{if(!r||!l)return;c.current.__escapeKeyBubbles=S,c.current.__outsidePressBubbles=C;let e=new Ig;function t(e){n.setOpen(!1,Ay(xy,e))}function s(){e.clear(),O.current=!0}function d(){e.start(t_()?5:0,()=>{O.current=!1})}let f=I_(i);f.addEventListener(`pointerdown`,k,!0),u&&(f.addEventListener(`keydown`,j),f.addEventListener(`compositionstart`,s),f.addEventListener(`compositionend`,d)),b&&(f.addEventListener(`click`,ie,!0),f.addEventListener(`pointerdown`,ie,!0),f.addEventListener(`touchstart`,re,!0),f.addEventListener(`touchmove`,I,!0),f.addEventListener(`touchend`,oe,!0),f.addEventListener(`mousedown`,ie,!0));let p=[];return h&&(Ug(o)&&(p=s_(o)),Ug(i)&&(p=p.concat(s_(i))),!Ug(a)&&a&&a.contextElement&&(p=p.concat(s_(a.contextElement)))),p=p.filter(e=>e!==f.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{f.removeEventListener(`pointerdown`,k,!0),u&&(f.removeEventListener(`keydown`,j),f.removeEventListener(`compositionstart`,s),f.removeEventListener(`compositionend`,d)),b&&(f.removeEventListener(`click`,ie,!0),f.removeEventListener(`pointerdown`,ie,!0),f.removeEventListener(`touchstart`,re,!0),f.removeEventListener(`touchmove`,I,!0),f.removeEventListener(`touchend`,oe,!0),f.removeEventListener(`mousedown`,ie,!0)),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),e.clear()}},[c,i,a,o,u,b,r,s,h,l,S,C,j,te,ie,P,re,I,oe,k,n]),z.useEffect(D,[b,D]);let L=z.useMemo(()=>({onKeyDown:j,...p&&{[rS[m]]:e=>{n.setOpen(!1,Ay(`trigger-press`,e.nativeEvent))},...m!==`intentional`&&{onClick(e){n.setOpen(!1,Ay(`trigger-press`,e.nativeEvent))}}}}),[j,n,p,m]),R=p_(e=>{let t=N_(e.nativeEvent);!M_(n.select(`floatingElement`),t)||e.button!==0||(x.current=!0)}),se=z.useMemo(()=>({onKeyDown:j,onPointerDown:R,onMouseDown:R,onMouseUp:R,onClickCapture:N,onMouseDownCapture:N,onPointerDownCapture:N,onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[j,R,N]);return z.useMemo(()=>l?{reference:L,floating:se,trigger:L}:{},[l,L,se])}var oS=Symbol(`NOT_FOUND`);function sS(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function cS(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function lS(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var uS=e=>Array.isArray(e)?e:[e];function dS(e){let t=Array.isArray(e[0])?e[0]:e;return lS(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function fS(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function pS(e){let t;return{get(n){return t&&e(t.key,n)?t.value:oS},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function mS(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return oS}function i(t,i){r(t)===oS&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var hS=(e,t)=>e===t;function gS(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function _S(e,t){let{equalityCheck:n=hS,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=gS(n),o=0,s=r<=1?pS(a):mS(r,a);function c(){let t=s.get(arguments);if(t===oS){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var vS=class{constructor(e){this.value=e}deref(){return this.value}},yS=typeof WeakRef<`u`?WeakRef:vS,bS=0,xS=1;function SS(){return{s:bS,v:void 0,o:null,p:null}}function CS(e,t={}){let n=SS(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=SS(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=SS(),e.set(n,t)):t=r}}let s=t,c;if(t.s===xS)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new yS(c):c}return s.s=xS,s.v=c,c}return o.clearCache=()=>{n=SS(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function wS(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),sS(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=CS,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=uS(c),p=uS(u),m=dS(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=fS(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var TS=wS(CS),ES=Object.assign((e,t=TS)=>{cS(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>ES});wS({memoize:_S,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});var DS=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(Og(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},OS=oi(),kS=sb(19)?jS:MS;function AS(e,t,n,r,i){return kS(e,t,n,r,i)}function jS(e,t,n,r,i){let a=z.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,OS.useSyncExternalStore)(e.subscribe,a,a)}function MS(e,t,n,r,i){return(0,ci.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var NS=class e{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(t){for(let n in t)if(!Object.is(this.state[n],t[n])){e.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||e.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){let t={...this.state};e.prototype.setState.call(this,t)}},PS=class extends NS{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}controlledValues=new Map;useSyncedValue(e,t){z.useDebugValue(e),Dg(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){Dg(()=>(this.state[e]!==t&&this.set(e,t),()=>{this.set(e,void 0)}),[e,t])}useSyncedValues(e){Dg(()=>{this.update(e)},Object.values(e))}useControlledProp(e,t,n){z.useDebugValue(e);let r=t!==void 0;this.controlledValues.has(e)||(this.controlledValues.set(e,r),!r&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})),Dg(()=>{r&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n,r])}set(e,t){this.controlledValues.get(e)!==!0&&super.set(e,t)}update(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.update(t)}setState(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.setState({...this.state,...t})}select=(e,t,n,r)=>{let i=this.selectors[e];return i(this.state,t,n,r)};useState=(e,t,n,r)=>{z.useDebugValue(e);let i=this.selectors[e];return AS(this,i,t,n,r)};useContextCallback(e,t){z.useDebugValue(e);let n=p_(t??gy);this.context[e]=n}useStateSetter(e){let t=z.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},FS={open:DS(e=>e.open),domReferenceElement:DS(e=>e.domReferenceElement),referenceElement:DS(e=>e.positionReference??e.referenceElement),floatingElement:DS(e=>e.floatingElement),floatingId:DS(e=>e.floatingId)},IS=class extends PS{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:dy(),nested:t,noEmit:n,triggerElements:i},FS)}setOpen=(e,t)=>{if((!e||!this.state.open||J_(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function LS(e,t=!1,n=!1){let[r,i]=z.useState(e&&t?`idle`:void 0),[a,o]=z.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Dg(()=>{if(!e&&a&&r!==`ending`&&n){let e=Gy.request(()=>{i(`ending`)});return()=>{Gy.cancel(e)}}},[e,a,r,n]),Dg(()=>{if(!e||t)return;let n=Gy.request(()=>{xi.flushSync(()=>{i(void 0)})});return()=>{Gy.cancel(n)}},[t,e]),Dg(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Gy.request(()=>{i(`idle`)});return()=>{Gy.cancel(n)}},[t,e,a,i,r]),z.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}function RS(e,t=!1,n=!0){let r=Ky();return p_((i,a=null)=>{r.cancel();let o=Pb(e);o!=null&&(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED?i():r.request(()=>{function e(){o&&Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{a!=null&&a.aborted||xi.flushSync(i)}).catch(()=>{if(n){if(a!=null&&a.aborted)return;xi.flushSync(i)}else o.getAnimations().length>0&&o.getAnimations().some(e=>e.pending||e.playState!==`finished`)&&e()})}t?r.request(e):e()}))})}function zS(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=l_(n),o=p_(i),s=RS(r,n);z.useEffect(()=>{t&&s(()=>{n===a.current&&o()})},[t,n,o,s,a])}function BS(e,t){let n=z.useRef(null);return z.useCallback(r=>{if(e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),r!==null))return n.current=e,t.context.triggerElements.add(e,r),()=>{n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null)}},[t,e])}function VS(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=BS(e,n),o=p_(t=>{let i=a(t);return t!==null&&n.select(`open`)&&n.select(`activeTriggerId`)==null&&n.update({activeTriggerId:e,activeTriggerElement:t,...r}),i});return Dg(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function HS(e){let t=e.useState(`open`);Dg(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function US(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=LS(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=p_(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return zS({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var WS=class{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elements.delete(n),this.elements.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(let t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}};function GS(){return new IS({open:!1,floatingElement:null,referenceElement:null,triggerElements:new WS,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function KS(){return{open:!1,mounted:!1,transitionStatus:`idle`,floatingRootContext:GS(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:_y,inactiveTriggerProps:_y,popupProps:_y}}var qS={open:DS(e=>e.open),mounted:DS(e=>e.mounted),transitionStatus:DS(e=>e.transitionStatus),floatingRootContext:DS(e=>e.floatingRootContext),preventUnmountingOnClose:DS(e=>e.preventUnmountingOnClose),payload:DS(e=>e.payload),activeTriggerId:DS(e=>e.activeTriggerId),activeTriggerElement:DS(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:DS((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:DS((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:DS((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:DS((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:DS(e=>e.popupProps),popupElement:DS(e=>e.popupElement),positionerElement:DS(e=>e.positionerElement)};function JS(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=uy(),a=my()!=null,o=Mg(()=>new IS({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new WS,floatingId:i,nested:a,noEmit:e.noEmit||!1})).current;return Dg(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Ug(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o.context.noEmit=e.noEmit||!1,o}function YS(e={}){let{nodeId:t,externalTree:n}=e,r=JS(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=z.useState(null),c=z.useRef(null),l=hy(n);Dg(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=Xx({...e,elements:{...a,...o&&{reference:o}}}),d=z.useCallback(e=>{let t=Ug(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=z.useState(null),[m,h]=z.useState(null);i.useSyncedValue(`referenceElement`,f),i.useSyncedValue(`domReferenceElement`,Ug(f)?f:null),i.useSyncedValue(`floatingElement`,m);let g=z.useCallback(e=>{(Ug(e)||e===null)&&(c.current=e,p(e)),(Ug(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!Ug(e))&&u.refs.setReference(e)},[u.refs,p]),_=z.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),v=z.useMemo(()=>({...u.refs,setReference:g,setFloating:_,setPositionReference:d,domReference:c}),[u.refs,g,_,d]),y=z.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),b=i.useState(`open`),x=i.useState(`floatingId`),S=z.useMemo(()=>({...u,dataRef:i.context.dataRef,open:b,onOpenChange:i.setOpen,events:i.context.events,floatingId:x,refs:v,elements:y,nodeId:t,rootStore:i}),[u,v,y,t,i,b,x]);return Dg(()=>{i.context.dataRef.current.floatingContext=S;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),z.useMemo(()=>({...u,context:S,refs:v,elements:y,rootStore:i}),[u,v,y,S,i])}function XS(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=uy(),o=my()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=Mg(()=>new IS({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return Dg(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};Ug(c)&&(e.domReferenceElement=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var ZS=w_&&S_;function QS(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,visibleOnly:o=!0}=t,s=z.useRef(!1),c=Lg(),l=z.useRef(!0);z.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=Bg(e);function r(){!n.select(`open`)&&Wg(e)&&e===j_(I_(e))&&(s.current=!0)}function i(){l.current=!0}function o(){l.current=!1}return t.addEventListener(`blur`,r),ZS&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,o,!0)),()=>{t.removeEventListener(`blur`,r),ZS&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,o,!0))}},[n,a]),z.useEffect(()=>{if(!a)return;function e(e){(e.reason===`trigger-press`||e.reason===`escape-key`)&&(s.current=!0)}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a]);let u=z.useMemo(()=>({onMouseLeave(){s.current=!1},onFocus(e){if(s.current)return;let t=N_(e.nativeEvent);if(o&&Ug(t)){if(ZS&&!e.relatedTarget){if(!l.current&&!L_(t))return}else if(!z_(t))return}n.setOpen(!0,Ay(Cy,e.nativeEvent,e.currentTarget))},onBlur(e){s.current=!1;let t=e.relatedTarget,r=e.nativeEvent,a=Ug(t)&&t.hasAttribute(jy(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;c.start(0,()=>{let o=n.select(`domReferenceElement`),s=j_(o?o.ownerDocument:document);!t&&s===o||M_(i.current.floatingContext?.refs.floating.current,s)||M_(o,s)||a||n.context.triggerElements.hasElement(e.relatedTarget)||n.setOpen(!1,Ay(Cy,r))})}}),[i,n,o,c]);return z.useMemo(()=>a?{reference:u,trigger:u}:{},[a,u])}var $S=jy(`safe-polygon`),eC=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${A_}`;function tC(e){return e?!!e.closest(eC):!1}function nC(e){let t=z.useRef(void 0),n=z.useRef(!1),r=z.useRef(void 0),i=z.useRef(!0),a=z.useRef(!1),o=z.useRef(()=>{}),s=z.useRef(!1),c=Lg(),l=Lg(),u=z.useRef(void 0);return z.useMemo(()=>{let d=e.context.dataRef.current;return d.hoverInteractionState||={pointerTypeRef:t,interactedInsideRef:n,handlerRef:r,blockMouseMoveRef:i,performedPointerEventsMutationRef:a,unbindMouseMoveRef:o,restTimeoutPendingRef:s,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u},d.hoverInteractionState},[e,t,n,r,i,a,o,s,c,l,u])}var rC=new Set([`click`,`mousedown`]);function iC(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:d,handlerRef:f,performedPointerEventsMutationRef:p,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:g,handleCloseOptionsRef:_}=nC(n),v=hy(l),y=my(),b=p_(()=>d.current?!0:o.current.openEvent?rC.has(o.current.openEvent.type):!1),x=p_(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),S=z.useCallback((e,t=!0)=>{let r=aC(c,u.current);r&&!f.current?g.start(r,()=>n.setOpen(!1,Ay(Sy,e))):t&&(g.clear(),n.setOpen(!1,Ay(Sy,e)))},[c,f,n,u,g]),C=p_(()=>{m.current(),f.current=void 0}),w=p_(()=>{if(p.current){let e=I_(i).body;e.style.pointerEvents=``,e.removeAttribute($S),p.current=!1}}),T=p_(e=>{if(!tC(N_(e))){d.current=!1;return}d.current=!0});Dg(()=>{r||(u.current=void 0,h.current=!1,d.current=!1,C(),w())},[r,u,h,d,C,w]),z.useEffect(()=>()=>{C()},[C]),z.useEffect(()=>w,[w]),Dg(()=>{if(s&&r&&_.current?.blockPointerEvents&&x()&&Ug(a)&&i){p.current=!0;let e=I_(i).body;e.setAttribute($S,``);let t=a,n=i,r=v?.nodesRef.current.find(e=>e.id===y)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),e.style.pointerEvents=`none`,t.style.pointerEvents=`auto`,n.style.pointerEvents=`auto`,()=>{e.style.pointerEvents=``,t.style.pointerEvents=``,n.style.pointerEvents=``}}},[s,r,a,i,_,x,v,y,p]),z.useEffect(()=>{if(!s)return;function e(e){if(b()||!o.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||(w(),C(),b()||S(e))}function t(e){g.clear(),w(),f.current?.(e),C()}function r(e){b()||S(e,!1)}let a=i;return a&&(a.addEventListener(`mouseleave`,e),a.addEventListener(`mouseenter`,t),a.addEventListener(`mouseleave`,r),a.addEventListener(`pointerdown`,T,!0)),()=>{a&&(a.removeEventListener(`mouseleave`,e),a.removeEventListener(`mouseenter`,t),a.removeEventListener(`mouseleave`,r),a.removeEventListener(`pointerdown`,T,!0))}})}function aC(e,t){return t&&!q_(t)?0:typeof e==`function`?e():e}function oC(e){return typeof e==`function`?e():e}var sC={current:null};function cC(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=sC,externalTree:f,isActiveTrigger:p=!0}=t,m=hy(f),{pointerTypeRef:h,interactedInsideRef:g,handlerRef:_,blockMouseMoveRef:v,performedPointerEventsMutationRef:y,unbindMouseMoveRef:b,restTimeoutPendingRef:x,openChangeTimeout:S,restTimeout:C,handleCloseOptionsRef:w}=nC(n),T=l_(s),E=l_(o),D=l_(l);p&&(w.current=T.current?.__options);let O=p_(()=>g.current?!0:r.current.openEvent?[`click`,`mousedown`].includes(r.current.openEvent.type):!1),ee=z.useCallback((e,t=!0)=>{let r=My(E.current,`close`,h.current);r&&!_.current?S.start(r,()=>n.setOpen(!1,Ay(Sy,e))):t&&(S.clear(),n.setOpen(!1,Ay(Sy,e)))},[E,_,n,h,S]),k=p_(()=>{b.current(),_.current=void 0}),A=p_(()=>{if(y.current){let e=I_(n.select(`domReferenceElement`)).body;e.style.pointerEvents=``,e.removeAttribute($S),y.current=!1}});z.useEffect(()=>{if(!a)return;function e(e){e.open||(S.clear(),C.clear(),v.current=!0,x.current=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,S,C,v,x]);let j=p_(e=>{if(O()||!r.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||T.current?.({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){A(),k(),O()||ee(e)}})(e)});return z.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!Ug(e))return;function t(e){if(S.clear(),v.current=!1,c&&!q_(h.current)||oC(D.current)>0&&!My(E.current,`open`))return;let t=My(E.current,`open`,h.current),r=n.select(`domReferenceElement`),i=n.context.triggerElements,a=(i.hasElement(e.target)||i.hasMatchingElement(t=>M_(t,e.target)))&&(!r||!M_(r,e.target)),o=e.currentTarget??null;t?S.start(t,()=>{n.select(`open`)||n.setOpen(!0,Ay(Sy,e,o))}):(!n.select(`open`)||a)&&n.setOpen(!0,Ay(Sy,e,o))}function i(e){if(O()){A();return}b.current();let t=I_(n.select(`domReferenceElement`));C.clear(),x.current=!1;let i=n.context.triggerElements;if(!(e.relatedTarget&&i.hasElement(e.relatedTarget))){if(T.current&&r.current.floatingContext){n.select(`open`)||S.clear(),_.current=T.current({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){A(),k(),O()||ee(e,!0)}});let i=_.current;i(e),t.addEventListener(`mousemove`,i),b.current=()=>{t.removeEventListener(`mousemove`,i)};return}(h.current!==`touch`||!M_(n.select(`floatingElement`),e.relatedTarget))&&ee(e)}}function o(e){j(e)}return n.select(`open`)&&e.addEventListener(`mouseleave`,o),u&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,i),()=>{e.removeEventListener(`mouseleave`,o),u&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,i)}},[k,A,v,r,E,ee,n,a,T,j,p,O,c,u,h,D,C,x,S,d,m,b,_]),z.useMemo(()=>{function e(e){h.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.context.triggerElements,o=n.select(`open`),s=(a.hasElement(e.target)||a.hasMatchingElement(t=>M_(t,e.target)))&&(!i||!M_(i,e.target));if(c&&!q_(h.current)||o&&!s||oC(D.current)===0||!s&&x.current&&e.movementX**2+e.movementY**2<2)return;C.clear();function l(){!v.current&&(!o||s)&&n.setOpen(!0,Ay(Sy,t,r))}h.current===`touch`?xi.flushSync(()=>{l()}):s&&o?l():(x.current=!0,C.start(oC(D.current),l))}}},[v,c,n,h,D,C,x])}function lC(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=z.useCallback(t=>uC(t,e,`reference`),t),o=z.useCallback(t=>uC(t,e,`floating`),n),s=z.useCallback(t=>uC(t,e,`item`),r),c=z.useCallback(t=>uC(t,e,`trigger`),i);return z.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function uC(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[k_]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&dC(a,s,i,r)}return dC(a,e,i,r),a}function dC(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var fC=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function pC(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{enabled:s=!0,role:c=`dialog`}=t,l=uy(),u=a?.id||l,d=z.useMemo(()=>B_(o)?.id||i,[o,i]),f=fC.get(c)??c,p=my()!=null,m=z.useMemo(()=>f===`tooltip`||c===`label`?_y:{"aria-haspopup":f===`alertdialog`?`dialog`:f,"aria-expanded":`false`,...f===`listbox`&&{role:`combobox`},...f===`menu`&&p&&{role:`menuitem`},...c===`select`&&{"aria-autocomplete":`none`},...c===`combobox`&&{"aria-autocomplete":`list`}},[f,p,c]),h=z.useMemo(()=>f===`tooltip`||c===`label`?{[`aria-${c===`label`?`labelledby`:`describedby`}`]:r?d:void 0}:{...m,"aria-expanded":r?`true`:`false`,"aria-controls":r?d:void 0,...f===`menu`&&{id:u}},[f,d,r,u,c,m]),g=z.useMemo(()=>{let e={id:d,...f&&{role:f}};return f===`tooltip`||c===`label`?e:{...e,...f===`menu`&&{"aria-labelledby":u}}},[f,d,u,c]),_=z.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${d}-fui-option`}};switch(c){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[d,c]);return z.useMemo(()=>s?{reference:h,floating:g,item:_,trigger:m}:{},[s,h,g,m,_])}function mC(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function hC(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function gC(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new Ig,a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=({x:e,y:n,placement:o,elements:s,onClose:c,nodeId:u,tree:d})=>function(f){function p(){i.clear(),c()}if(i.clear(),!s.domReference||!s.floating||o==null||e==null||n==null)return;let{clientX:m,clientY:h}=f,g=[m,h],_=N_(f),v=f.type===`mouseleave`,y=M_(s.floating,_),b=M_(s.domReference,_),x=s.domReference.getBoundingClientRect(),S=s.floating.getBoundingClientRect(),C=o.split(`-`)[0],w=e>S.right-S.width/2,T=n>S.bottom-S.height/2,E=hC(g,x),D=S.width>x.width,O=S.height>x.height,ee=(D?x:S).left,k=(D?x:S).right,A=(O?x:S).top,j=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&Ug(f.relatedTarget)&&M_(s.floating,f.relatedTarget)||d&&V_(d.nodesRef.current,u).some(({context:e})=>e?.open))return;if(C===`top`&&n>=x.bottom-1||C===`bottom`&&n<=x.top+1||C===`left`&&e>=x.right-1||C===`right`&&e<=x.left+1)return p();let M=[];switch(C){case`top`:M=[[ee,x.top+1],[ee,S.bottom-1],[k,S.bottom-1],[k,x.top+1]];break;case`bottom`:M=[[ee,S.top+1],[ee,x.bottom-1],[k,x.bottom-1],[k,S.top+1]];break;case`left`:M=[[S.right-1,j],[S.right-1,A],[x.left+1,A],[x.left+1,j]];break;case`right`:M=[[x.right-1,j],[x.right-1,A],[S.left+1,A],[S.left+1,j]];break;default:}function N([e,n]){switch(C){case`top`:return[[D?e+t/2:w?e+t*4:e-t*4,n+t+1],[D?e-t/2:w?e+t*4:e-t*4,n+t+1],...[[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]]];case`bottom`:return[[D?e+t/2:w?e+t*4:e-t*4,n-t],[D?e-t/2:w?e+t*4:e-t*4,n-t],...[[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]]];case`left`:{let r=[e+t+1,O?n+t/2:T?n+t*4:n-t*4],i=[e+t+1,O?n-t/2:T?n+t*4:n-t*4];return[...[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom]],r,i]}case`right`:return[[e-t,O?n+t/2:T?n+t*4:n-t*4],[e-t,O?n-t/2:T?n+t*4:n-t*4],...[[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]];default:return[]}}if(!mC([m,h],M)){if(a&&!E)return p();if(!v&&r){let e=l(f.clientX,f.clientY);if(e!==null&&e<.1)return p()}mC([m,h],N([e,n]))?!a&&r&&i.start(40,p):p()}};return u.__options={blockPointerEvents:n},u}var _C={...qS,disabled:DS(e=>e.disabled),instantType:DS(e=>e.instantType),isInstantPhase:DS(e=>e.isInstantPhase),trackCursorAxis:DS(e=>e.trackCursorAxis),disableHoverablePopup:DS(e=>e.disableHoverablePopup),lastOpenChangeReason:DS(e=>e.openChangeReason),closeDelay:DS(e=>e.closeDelay)},vC=class e extends PS{constructor(e){super({...yC(),...e},{popupRef:z.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new WS},_C)}setOpen=(e,t)=>{let n=t.reason,r=n===Sy,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?xi.flushSync(o):o()};static useStore(t,n){let r=Mg(()=>t??new e(n)).current,i=XS({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}};function yC(){return{...KS(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function bC(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=vC.useStore(l?.store,{open:r??n,activeTriggerId:u===void 0?d:u});p.useControlledProp(`open`,r,n),p.useControlledProp(`activeTriggerId`,u,d),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=p.useState(`activeTriggerId`),g=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i});let _=!t&&m;Dg(()=>{m&&t&&p.setOpen(!1,Ay(Oy))},[m,t,p]),p.useSyncedValue(`disabled`,t),HS(p);let{forceUnmount:v,transitionStatus:y}=US(_,p),b=p.useState(`isInstantPhase`),x=p.useState(`instantType`),S=p.useState(`lastOpenChangeReason`),C=z.useRef(null);Dg(()=>{y===`ending`&&S===`none`||y!==`ending`&&b?(x!==`delay`&&(C.current=x),p.set(`instantType`,`delay`)):C.current!==null&&(p.set(`instantType`,C.current),C.current=null)},[y,b,S,x,p]),Dg(()=>{_&&(h??p.set(`payload`,void 0))},[p,h,_]);let w=z.useCallback(()=>{p.setOpen(!1,xC(p,ky))},[p]);z.useImperativeHandle(o,()=>({unmount:v,close:w}),[v,w]);let T=p.useState(`floatingRootContext`),{getReferenceProps:E,getFloatingProps:D,getTriggerProps:O}=lC([QS(T,{enabled:!t}),aS(T,{enabled:!t,referencePress:!0}),qb(T,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),ee=z.useMemo(()=>E(),[E]),k=z.useMemo(()=>O(),[O]),A=z.useMemo(()=>D(),[D]);return p.useSyncedValues({floatingRootContext:T,activeTriggerProps:ee,inactiveTriggerProps:k,popupProps:A}),(0,B.jsx)(kg.Provider,{value:p,children:typeof f==`function`?f({payload:g}):f})}function xC(e,t){let n=Ay(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}var SC=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),CC={[SC.startingStyle]:``},wC={[SC.endingStyle]:``},TC={transitionStatus(e){return e===`starting`?CC:e===`ending`?wC:null}},EC=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=SC.startingStyle]=`startingStyle`,e[e.endingStyle=SC.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e}({}),DC=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),OC={[DC.popupOpen]:``};DC.popupOpen,DC.pressed;var kC={[EC.open]:``},AC={[EC.closed]:``},jC={[EC.anchorHidden]:``},MC={open(e){return e?OC:null}},NC={open(e){return e?kC:AC},anchorHidden(e){return e?jC:null}};function PC(e){return uy(e,`base-ui`)}var FC=z.createContext(void 0);function IC(){return z.useContext(FC)}var LC=z.forwardRef(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeDelay:c,id:l,...u}=e,d=Ag(!0),f=i?.store??d;if(!f)throw Error(Og(82));let p=PC(l),m=f.useState(`isTriggerActive`,p),h=f.useState(`floatingRootContext`),g=f.useState(`isOpenedByTrigger`,p),_=z.useRef(null),v=s??600,y=c??0,{registerTrigger:b,isMountedByThisTrigger:x}=VS(p,_,f,{payload:a,closeDelay:y}),S=IC(),{delayRef:C,isInstantPhase:w,hasProvider:T}=Fy(h,{open:g});f.useSyncedValue(`isInstantPhase`,w);let E=f.useState(`disabled`),D=o??E,O=f.useState(`trackCursorAxis`),ee=f.useState(`disableHoverablePopup`),k=cC(h,{enabled:!D,mouseOnly:!0,move:!1,handleClose:!ee&&O!==`both`?gC():null,restMs(){let e=S?.delay,t=typeof C.current==`object`?C.current.open:void 0,n=v;return T&&(n=t===0?0:s??e??v),n},delay(){let e=typeof C.current==`object`?C.current.close:void 0,t=y;return c==null&&T&&(t=e),{close:t}},triggerElementRef:_,isActiveTrigger:m}),A=z.useMemo(()=>({open:g}),[g]),j=f.useState(`triggerProps`,x);return Tb(`button`,e,{state:A,ref:[t,b,_],props:[k,j,{id:p},u],stateAttributesMapping:MC})}),RC=z.createContext(void 0);function zC(){let e=z.useContext(RC);if(e===void 0)throw Error(Og(70));return e}var BC=z.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,...o}=e,{portalNode:s,portalSubtree:c}=Mb({container:r,ref:t,componentProps:e,elementProps:o});return!c&&!s?null:(0,B.jsxs)(z.Fragment,{children:[c,s&&xi.createPortal(n,s)]})}),VC=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Ag().useState(`mounted`)||n?(0,B.jsx)(RC.Provider,{value:n,children:(0,B.jsx)(BC,{ref:t,...r})}):null}),HC=z.createContext(void 0);function UC(){let e=z.useContext(HC);if(e===void 0)throw Error(Og(71));return e}var WC=z.createContext(void 0);function GC(){return z.useContext(WC)?.direction??`ltr`}var KC=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=rv(e,t)||{};if(l==null)return{};let f=xv(u),p={x:n,y:r},m=lv(i),h=sv(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),ee=D,k=w-g[h]-O,A=w/2-g[h]/2+T,j=nv(ee,A,k),M=!c.arrow&&av(i)!=null&&A!==j&&a.reference[h]/2-(A<ee?D:O)-g[h]/2<0,N=M?A<ee?A-ee:A-k:0;return{[m]:p[m]+N,data:{[m]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),qC=(e,t)=>({...KC(e),options:[e,t]}),JC={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await nS().fn(e)).data?.referenceHidden||a}}}},YC={sideX:`left`,sideY:`top`},XC={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=Bg(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:YC};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=qy(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=iv(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:YC.sideX,g=f===`top`?`bottom`:YC.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function ZC(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function QC(e,t,n){let{rects:r,placement:i}=e;return{side:ZC(t,iv(i),n),align:av(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function $C(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:b}=e,[x,S]=z.useState(null);!m&&x!==null&&S(null);let C=h.side||`flip`,w=h.align||`flip`,T=h.fallbackAxisSide||`end`,E=typeof t==`function`?t:void 0,D=p_(E),O=E?D:t,ee=l_(t),k=GC()===`rtl`,A=x||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":k?`left`:`right`,"inline-start":k?`right`:`left`}[r],j=a===`center`?A:`${A}-${a}`,M=c,N=+(r===`bottom`),te=+(r===`top`),P=+(r===`right`),ne=+(r===`left`);typeof M==`number`?M={top:M+N,right:M+ne,bottom:M+te,left:M+P}:M&&={top:(M.top||0)+N,right:(M.right||0)+ne,bottom:(M.bottom||0)+te,left:(M.left||0)+P};let re={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:M},ie=z.useRef(null),F=l_(i),I=l_(o),ae=[Zx(e=>{let t=QC(e,r,k),n=typeof F.current==`function`?F.current(t):F.current,i=typeof I.current==`function`?I.current(t):I.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,k,r])],oe=w===`none`&&C!==`shift`,L=!oe&&(l||g||C===`shift`),R=C===`none`?null:eS({...re,padding:{top:M.top+1,right:M.right+1,bottom:M.bottom+1,left:M.left+1},mainAxis:!g&&C===`flip`,crossAxis:w===`flip`?`alignment`:!1,fallbackAxisSideDirection:T}),se=oe?null:Qx(e=>{let t=qy(e.elements.floating).documentElement;return{...re,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:w!==`none`,crossAxis:L,limiter:l||g?void 0:$x(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=cv(iv(e.placement)),i=r===`y`?t:n,a=r===`y`?M.left+M.right:M.top+M.bottom;return{offset:i/2+a/2}})}},[re,l,g,M,w]);C===`shift`||w===`shift`||a===`center`?ae.push(se,R):ae.push(R,se),ae.push(tS({...re,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){Object.entries({"--available-width":`${n}px`,"--available-height":`${r}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,n])=>{e.style.setProperty(t,n)})}}),qC(()=>({element:ie.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=iv(a),l=cv(c),u=ie.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(QC(e,r,k)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,L&&l===`y`&&b?S:x),{}}},JC,v),Dg(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);let ce=z.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:le,elements:ue,x:de,y:fe,middlewareData:pe,update:me,placement:he,context:ge,isPositioned:_e,floatingStyles:ve}=YS({rootContext:p,placement:j,middleware:ae,strategy:n,whileElementsMounted:f?void 0:(...e)=>Lx(...e,ce),nodeId:_,externalTree:b}),{sideX:ye,sideY:be}=pe.adaptiveOrigin||YC,xe=_e?n:`fixed`,Se=z.useMemo(()=>v?{position:xe,[ye]:de,[be]:fe}:{position:xe,...ve},[v,xe,ye,de,be,fe,ve]),Ce=z.useRef(null);Dg(()=>{if(!m)return;let e=ee.current,t=typeof e==`function`?e():e,n=(ew(t)?t.current:t)||null;n!==Ce.current&&(le.setPositionReference(n),Ce.current=n)},[m,le,O,ee]),z.useEffect(()=>{if(!m)return;let e=ee.current;typeof e!=`function`&&ew(e)&&e.current!==Ce.current&&(le.setPositionReference(e.current),Ce.current=e.current)},[m,le,O,ee]),z.useEffect(()=>{if(f&&m&&ue.domReference&&ue.floating)return Lx(ue.domReference,ue.floating,me,ce)},[f,m,ue,me,ce]);let we=iv(he),Te=ZC(r,we,k),Ee=av(he)||`center`,De=!!pe.hide?.referenceHidden;Dg(()=>{y&&m&&_e&&S(we)},[y,m,_e,we]);let Oe=z.useMemo(()=>({position:`absolute`,top:pe.arrow?.y,left:pe.arrow?.x}),[pe.arrow]),ke=pe.arrow?.centerOffset!==0;return z.useMemo(()=>({positionerStyles:Se,arrowStyles:Oe,arrowRef:ie,arrowUncentered:ke,side:Te,align:Ee,physicalSide:we,anchorHidden:De,refs:le,context:ge,isPositioned:_e,update:me}),[Se,Oe,ie,ke,Te,Ee,we,De,le,ge,_e,me])}function ew(e){return e!=null&&`current`in e}function tw(e){return e===`starting`?vy:_y}var nw=z.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=yy,...g}=e,_=Ag(),v=zC(),y=_.useState(`open`),b=_.useState(`mounted`),x=_.useState(`trackCursorAxis`),S=_.useState(`disableHoverablePopup`),C=_.useState(`floatingRootContext`),w=_.useState(`instantType`),T=_.useState(`transitionStatus`),E=$C({anchor:i,positionMethod:a,floatingRootContext:C,mounted:b,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:v,collisionAvoidance:h,adaptiveOrigin:XC}),D=z.useMemo(()=>{let e={};return(!y||x===`both`||S)&&(e.pointerEvents=`none`),{role:`presentation`,hidden:!b,style:{...E.positionerStyles,...e}}},[y,x,S,b,E.positionerStyles]),O=z.useMemo(()=>({open:y,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:x===`none`?w:`tracking-cursor`}),[y,E.side,E.align,E.anchorHidden,x,w]),ee=z.useMemo(()=>({...O,arrowRef:E.arrowRef,arrowStyles:E.arrowStyles,arrowUncentered:E.arrowUncentered}),[O,E.arrowRef,E.arrowStyles,E.arrowUncentered]),k=Tb(`div`,e,{state:O,props:[D,tw(T),g],ref:[t,_.useStateSetter(`positionerElement`)],stateAttributesMapping:NC});return(0,B.jsx)(HC.Provider,{value:ee,children:k})});function rw(e){let t=r_(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Wg(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(Q_(n)!==a||Q_(r)!==o)&&(n=a,r=o),{width:n,height:r}}var iw=typeof ResizeObserver<`u`,aw=()=>!0;function ow(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=aw,onMeasureLayout:o,onMeasureLayoutComplete:s,side:c,direction:l}=e,u=z.useRef(!0),d=RS(t,!0,!1),f=Ky(),p=z.useRef(null),m=p_(o),h=p_(s),g=z.useMemo(()=>{let e=c===`top`,t=c===`left`;return l===`rtl`?(e||=c===`inline-end`,t||=c===`inline-end`):(e||=c===`inline-start`,t||=c===`inline-start`),e?{position:`absolute`,[c===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:_y},[c,l]);Dg(()=>{if(!i||!a()||!iw){u.current=!0,p.current=null;return}if(!t||!n)return;Object.entries(g).forEach(([e,n])=>{t.style.setProperty(e,n)});let e=new ResizeObserver(e=>{let t=e[0];t&&(p.current===null?p.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)}:(p.current.width=Math.ceil(t.borderBoxSize[0].inlineSize),p.current.height=Math.ceil(t.borderBoxSize[0].blockSize)))});e.observe(t),t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`);let r=sw(t,`position`,`static`),o=sw(t,`transform`,`none`),s=sw(t,`scale`,`1`),c=sw(n,`--available-width`,`max-content`),l=sw(n,`--available-height`,`max-content`);if(m?.(),u.current||p.current===null){n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let i=rw(t);return n.style.setProperty(`--positioner-width`,`${i.width}px`),n.style.setProperty(`--positioner-height`,`${i.height}px`),r(),o(),s(),c(),l(),h?.(null,i),u.current=!1,()=>{e.disconnect()}}t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`),n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let _=rw(t);t.style.setProperty(`--popup-width`,`${p.current.width}px`),t.style.setProperty(`--popup-height`,`${p.current.height}px`),r(),o(),c(),l(),h?.(p.current,_),n.style.setProperty(`--positioner-width`,`${_.width}px`),n.style.setProperty(`--positioner-height`,`${_.height}px`);let v=new AbortController;return f.request(()=>{t.style.setProperty(`--popup-width`,`${_.width}px`),t.style.setProperty(`--popup-height`,`${_.height}px`),d(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},v.signal)}),()=>{e.disconnect(),v.abort(),f.cancel()}},[r,t,n,d,f,a,i,m,h,g])}function sw(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}var cw={...NC,...TC},lw=z.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=Ag(),{side:o,align:s}=UC(),c=a.useState(`open`),l=a.useState(`mounted`),u=a.useState(`instantType`),d=a.useState(`transitionStatus`),f=a.useState(`popupProps`),p=a.useState(`payload`),m=a.useState(`popupElement`),h=a.useState(`positionerElement`),g=a.useState(`floatingRootContext`),_=GC();zS({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}});function v(){g.context.events.emit(`measure-layout`)}function y(e,t){g.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}ow({popupElement:m,positionerElement:h,mounted:l,content:p,enabled:()=>a.context.triggerElements.size>1,onMeasureLayout:v,onMeasureLayoutComplete:y,side:o,direction:_});let b=a.useState(`disabled`),x=a.useState(`closeDelay`);return iC(g,{enabled:!b,closeDelay:x}),Tb(`div`,e,{state:z.useMemo(()=>({open:c,side:o,align:s,instant:u,transitionStatus:d}),[c,o,s,u,d]),ref:[t,a.context.popupRef,a.useStateSetter(`popupElement`)],props:[f,tw(d),i],stateAttributesMapping:cw})}),uw=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=z.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=z.useMemo(()=>({open:t,close:n}),[t,n]);return(0,B.jsx)(FC.Provider,{value:i,children:(0,B.jsx)(Py,{delay:a,timeoutMs:r,children:e.children})})};function dw(e){return sb(19)?e:e?`true`:void 0}var fw=uw,pw=bC,mw=LC;function hw({className:e,children:t,...n}){return(0,B.jsx)(VC,{children:(0,B.jsx)(nw,{sideOffset:6,children:(0,B.jsx)(lw,{className:xg(`z-50 overflow-hidden rounded-sm border border-hairline bg-popover px-3 py-1.5 text-xs font-normal text-popover-foreground shadow-popover`,e),...n,children:t})})})}var gw=[`system`,`light`,`dark`],_w={dark:`Dark`,light:`Light`,system:`System`},vw={dark:Mm,light:Um,system:jm};function yw(e){return gw[(gw.indexOf(e)+1)%gw.length]??`system`}function bw({className:e}){let t=Ga(e=>e.theme),n=Ga(e=>e.setTheme),r=vw[t],i=_w[t];return(0,B.jsxs)(pw,{children:[(0,B.jsx)(mw,{render:(0,B.jsx)(Eg,{"aria-label":`Theme: ${i}`,size:`icon`,variant:`ghost`,className:e,onClick:()=>n(yw(t)),children:(0,B.jsx)(r,{className:`size-4`})})}),(0,B.jsxs)(hw,{children:[`Theme:`,` `,i]})]})}function xw({className:e,type:t,...n}){return(0,B.jsx)(`input`,{type:t,className:xg(`flex min-h-11 w-full rounded-xs border border-input bg-background px-4 py-2 text-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-form-focus focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,e),...n})}function Sw({className:e,...t}){return(0,B.jsx)(`label`,{className:xg(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,e),...t})}function Cw({className:e,orientation:t=`horizontal`,...n}){return(0,B.jsx)(`div`,{role:`separator`,"aria-orientation":t,className:xg(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...n})}var ww=class extends Error{code;details;constructor(e,t,n){super(t),this.name=`WebApiError`,this.code=e,this.details=n}};async function Tw(e,t){let n;try{n=await fetch(e,t)}catch(e){throw new ww(`network`,e instanceof Error?e.message:String(e))}if(!n.ok){let e=await n.text().catch(()=>``);throw new ww(`http_${n.status}`,e||n.statusText)}return await n.json()}var Ew=`/api/worker`;function Dw(e=globalThis.location?.pathname??`/admin/`){let t=Aw(e);return t?`/w/${t}${Ew}`:Ew}function Ow(e=globalThis.location?.pathname??`/admin/`){return Aw(e)!==null}function kw(e){let t=e.startsWith(`/`)?e:`/${e}`;return t===Ew||t.startsWith(`${Ew}/`)?`${Dw()}${t.slice(11)}`:`${Dw()}${t}`}function Aw(e){let t=/^\/w\/([^/]+)(?:\/|$)/.exec(e);if(!t)return null;let n=t[1];return Kf.test(n)?n:null}var jw=class extends Error{code;status;details;expectedVersion;actualVersion;constructor(e,t,n={}){super(t),this.name=`WorkerApiError`,this.code=e,this.status=n.status,this.details=n.details,this.expectedVersion=n.expected,this.actualVersion=n.actual}};async function Mw(e,t={}){let n=new Headers(t.headers),r=sm();r&&!n.has(`Authorization`)&&n.set(`Authorization`,`Bearer ${r}`);let i;try{i=await fetch(kw(e),{...t,headers:n})}catch(e){throw new jw(`network`,e instanceof Error?e.message:String(e))}let a=await i.text(),o=null;if(a.length>0)try{o=JSON.parse(a)}catch{o=a}if(!i.ok){if(o&&typeof o==`object`&&`error`in o){let e=o.error;if(typeof e==`string`)throw new jw(Nw(i.status),e,{status:i.status});if(e&&typeof e==`object`){let t=e;throw new jw(typeof t.code==`string`?Pw(t.code):Nw(i.status),typeof t.message==`string`?t.message:i.statusText,{status:i.status,details:t.details,...typeof t.expected==`number`?{expected:t.expected}:{},...typeof t.actual==`number`?{actual:t.actual}:{}})}}if(o&&typeof o==`object`){let e=o;if(typeof e.message==`string`||typeof e.code==`string`)throw new jw(typeof e.code==`string`?Pw(e.code):Nw(i.status),typeof e.message==`string`?e.message:i.statusText,{status:i.status,details:e.details})}throw new jw(Nw(i.status),a||i.statusText,{status:i.status})}return o}function Nw(e){return e===401||e===403?`auth-required`:e===404?`not-found`:e===409?`version-conflict`:e>=400&&e<500?`invalid-body`:`http-error`}function Pw(e){return e===`auth-failed`||e===`auth_failed`||e===`auth_required`?`auth-required`:[`auth-required`,`invalid-body`,`invalid-config`,`invalid-cron`,`invalid-key`,`version-conflict`,`invalid-if-match`,`not-found`].includes(e)?e:`unknown`}async function Fw(){if(Ow()){let e=await Iw();return{mode:`worker`,workerId:e.workerId,status:`ok`,configVersion:e.configVersion,startedAt:e.startedAt,checkedAt:new Date().toISOString(),brain:e.brains[0]?{status:e.brains[0].status}:null,executor:e.executor?{status:e.executor.status}:null}}return await Tw(`/health`)}function Iw(){return Mw(`/api/worker/info`)}function Lw(){return Mw(`/api/worker/config`)}async function Rw(e,t){return await Mw(`/api/worker/config`,{method:`PUT`,headers:{"Content-Type":`application/json`,"If-Match":String(t)},body:JSON.stringify(e)})}function zw(e={}){return Mw(`/api/worker/engines${e.refresh?`?refresh=1`:``}`)}function Bw(){return Mw(`/api/worker/secrets`)}async function Vw(e,t){await Mw(`/api/worker/secrets/${encodeURIComponent(e)}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({value:t})})}async function Hw(e){await Mw(`/api/worker/secrets/${encodeURIComponent(e)}`,{method:`DELETE`})}function Uw(){return Mw(`/api/worker/brain/test`,{method:`POST`,headers:{"Content-Type":`application/json`},body:`{}`})}var Ww=12e3;async function Gw(e={},t={}){let n=t.timeoutMs??Ww,r=new AbortController,i=!1,a=setTimeout(()=>{i=!0,r.abort()},n);try{return await Mw(`/api/worker/executor/test`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e),signal:r.signal})}catch(e){throw i?new jw(`network`,`executor test timed out after ${n}ms`):e}finally{clearTimeout(a)}}function Kw(e,t={}){return Mw(`/api/worker/channels/${e}/test`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})}function qw(){return Mw(`/api/worker/cron`)}async function Jw(e){return(await Mw(`/api/worker/cron`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).job}async function Yw(e,t){return(await Mw(`/api/worker/cron/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})).job}async function Xw(e){await Mw(`/api/worker/cron/${encodeURIComponent(e)}`,{method:`DELETE`})}function Zw(){return Mw(`/api/worker/approvals`)}async function Qw(e,t,n){return await Mw(`/api/worker/approvals/${encodeURIComponent(e)}/${encodeURIComponent(t)}/grant`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({decision:n})})}async function $w(e){return(await Mw(`/api/worker/orchestrator/tasks`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:e})})).task}async function eT(e,t){return(await Mw(`/api/worker/orchestrator/conversations/${encodeURIComponent(e)}/messages`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:t})})).task}function tT(){return Mw(`/api/worker/orchestrator/conversations`)}function nT(e){return Mw(`/api/worker/orchestrator/conversations/${encodeURIComponent(e)}/messages`)}async function rT(e,t){let n=new Headers({Accept:`text/event-stream`}),r=sm();r&&n.set(`Authorization`,`Bearer ${r}`);let i=await fetch(kw(`/events/stream`),{headers:n,signal:e});if(!i.ok||!i.body)throw new jw(Nw(i.status),`events stream HTTP ${i.status}`,{status:i.status});let a=i.body.getReader(),o=new TextDecoder,s=``;try{for(;!e.aborted;){let{value:e,done:n}=await a.read();if(n)return;s+=o.decode(e,{stream:!0});let r=s.indexOf(`
|
|
1361
|
+
`,Fp=Tp({brainSkillPacks:Bf(`developer`),expectedId:`developer`,soulMd:Ep,sourcePath:`packages/shared/src/soul/packs/developer/SOUL.md`}),Ip=Tp({brainSkillPacks:Bf(`project-manager`),expectedId:`project-manager`,soulMd:Mp,sourcePath:`packages/shared/src/soul/packs/project-manager/SOUL.md`}),Lp=Tp({brainSkillPacks:Bf(`devops-sre`),expectedId:`devops-sre`,soulMd:Dp,sourcePath:`packages/shared/src/soul/packs/devops-sre/SOUL.md`}),Rp=Tp({brainSkillPacks:Bf(`product-designer`),expectedId:`product-designer`,soulMd:jp,sourcePath:`packages/shared/src/soul/packs/product-designer/SOUL.md`}),zp=Tp({brainSkillPacks:Bf(`qa-reviewer`),expectedId:`qa-reviewer`,soulMd:Np,sourcePath:`packages/shared/src/soul/packs/qa-reviewer/SOUL.md`}),Bp=Tp({brainSkillPacks:Bf(`support-operator`),expectedId:`support-operator`,soulMd:Pp,sourcePath:`packages/shared/src/soul/packs/support-operator/SOUL.md`}),Vp=Tp({brainSkillPacks:Bf(`finance-ops`),expectedId:`finance-ops`,soulMd:Op,sourcePath:`packages/shared/src/soul/packs/finance-ops/SOUL.md`}),Hp=Tp({brainSkillPacks:Bf(`hr-recruiting`),expectedId:`hr-recruiting`,soulMd:Ap,sourcePath:`packages/shared/src/soul/packs/hr-recruiting/SOUL.md`}),Up=Tp({brainSkillPacks:Bf(`general-assistant`),expectedId:`general-assistant`,soulMd:kp,sourcePath:`packages/shared/src/soul/packs/general-assistant/SOUL.md`});[Fp,Ip,Lp,Rp,zp,Bp,Vp,Hp,Up].map(e=>e.module),Fp.module,Lp.module,Vp.module,Up.module,Hp.module,Rp.module,Ip.module,zp.module,Bp.module;var Wp=`/admin`;function Gp(e,t=globalThis.location?.pathname??`${Wp}/`){let n=`/${e}`;if(t===n||t.startsWith(`${n}/`))return n;if(e===`worker`){let e=/^\/w\/([^/]+)(?:\/|$)/.exec(t);if(e&&Jf.test(e[1]))return`/w/${e[1]}`}return Wp}var Kp=`aiworker.worker.bearer`,qp=`#token=`,Jp;function Yp(){try{return globalThis.sessionStorage?.getItem(Kp)??null}catch{return null}}function Xp(e){try{e===null?globalThis.sessionStorage?.removeItem(Kp):globalThis.sessionStorage?.setItem(Kp,e)}catch{}}function Zp(){if(typeof window>`u`)return;let{location:e,history:t}=window;if(!e?.hash?.startsWith(qp))return;let n=Qp(e.hash.slice(7));$p(e,t),!(!n||n.length===0)&&(Xp(n),Jp=n)}function Qp(e){try{return decodeURIComponent(e)}catch{return null}}function $p(e,t){try{t.replaceState(null,``,e.pathname+e.search)}catch{}}function em(){return Jp===void 0&&(Jp=Yp()),Jp}function tm(e){Jp=e,Xp(e)}var nm=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),rm=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),im=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),am=e=>{let t=im(e);return t.charAt(0).toUpperCase()+t.slice(1)},om={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`},sm=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},cm=(0,z.createContext)({}),lm=()=>(0,z.useContext)(cm),um=(0,z.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=lm()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,z.createElement)(`svg`,{ref:c,...om,width:t??l??om.width,height:t??l??om.height,stroke:e??f,strokeWidth:m,className:nm(`lucide`,p,i),...!a&&!sm(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,z.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),dm=(e,t)=>{let n=(0,z.forwardRef)(({className:n,...r},i)=>(0,z.createElement)(um,{ref:i,iconNode:t,className:nm(`lucide-${rm(am(e))}`,`lucide-${e}`,n),...r}));return n.displayName=am(e),n},fm=dm(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),pm=dm(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),mm=dm(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),hm=dm(`clipboard-list`,[[`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`}]]),gm=dm(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),_m=dm(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),vm=dm(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ym=dm(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),bm=dm(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),xm=dm(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Sm=dm(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),Cm=dm(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),wm=dm(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Tm=dm(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Em=dm(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Dm=dm(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Om=dm(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),km=dm(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Am=dm(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),jm=dm(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Mm=dm(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Nm=dm(`shield-alert`,[[`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:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Pm=dm(`shield-check`,[[`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`}]]),Fm=dm(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Im=dm(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Lm=dm(`timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),Rm=dm(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),zm=dm(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Bm=dm(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Vm=dm(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Hm(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Hm(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Um(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Hm(e))&&(r&&(r+=` `),r+=t);return r}var Wm=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Gm=(e,t)=>({classGroupId:e,validator:t}),Km=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),qm=`-`,Jm=[],Ym=`arbitrary..`,Xm=e=>{let t=$m(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Qm(e);let n=e.split(qm);return Zm(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Wm(i,t):t:i||Jm}return n[e]||Jm}}},Zm=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Zm(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(qm):e.slice(t).join(qm),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Qm=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ym+r:void 0})(),$m=e=>{let{theme:t,classGroups:n}=e;return eh(n,t)},eh=(e,t)=>{let n=Km();for(let r in e){let i=e[r];th(i,n,r,t)}return n},th=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];nh(i,t,n,r)}},nh=(e,t,n,r)=>{if(typeof e==`string`){rh(e,t,n);return}if(typeof e==`function`){ih(e,t,n,r);return}ah(e,t,n,r)},rh=(e,t,n)=>{let r=e===``?t:oh(t,e);r.classGroupId=n},ih=(e,t,n,r)=>{if(sh(e)){th(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Gm(n,e))},ah=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];th(o,oh(t,a),n,r)}},oh=(e,t)=>{let n=e,r=t.split(qm),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Km(),n.nextPart.set(t,i)),n=i}return n},sh=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ch=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},lh=`!`,uh=`:`,dh=[],fh=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ph=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===uh){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(lh)?(c=s.slice(0,-1),l=!0):s.startsWith(lh)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return fh(t,l,c,u)};if(t){let e=t+uh,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):fh(dh,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},mh=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},hh=e=>({cache:ch(e.cacheSize),parseClassName:ph(e),sortModifiers:mh(e),...Xm(e)}),gh=/\s+/,_h=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(gh),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+lh:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},vh=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=yh(n))&&(i&&(i+=` `),i+=r);return i},yh=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=yh(e[r]))&&(n&&(n+=` `),n+=t);return n},bh=(e,...t)=>{let n,r,i,a,o=o=>(n=hh(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=_h(e,n);return i(e,a),a};return a=o,(...e)=>a(vh(...e))},xh=[],Sh=e=>{let t=t=>t[e]||xh;return t.isThemeGetter=!0,t},Ch=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,wh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Th=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Eh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Oh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ah=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jh=e=>Th.test(e),Mh=e=>!!e&&!Number.isNaN(Number(e)),Nh=e=>!!e&&Number.isInteger(Number(e)),Ph=e=>e.endsWith(`%`)&&Mh(e.slice(0,-1)),Fh=e=>Eh.test(e),Ih=()=>!0,Lh=e=>Dh.test(e)&&!Oh.test(e),Rh=()=>!1,zh=e=>kh.test(e),Bh=e=>Ah.test(e),Vh=e=>!Q(e)&&!$(e),Hh=e=>rg(e,sg,Rh),Q=e=>Ch.test(e),Uh=e=>rg(e,cg,Lh),Wh=e=>rg(e,lg,Mh),Gh=e=>rg(e,dg,Ih),Kh=e=>rg(e,ug,Rh),qh=e=>rg(e,ag,Rh),Jh=e=>rg(e,og,Bh),Yh=e=>rg(e,fg,zh),$=e=>wh.test(e),Xh=e=>ig(e,cg),Zh=e=>ig(e,ug),Qh=e=>ig(e,ag),$h=e=>ig(e,sg),eg=e=>ig(e,og),tg=e=>ig(e,fg,!0),ng=e=>ig(e,dg,!0),rg=(e,t,n)=>{let r=Ch.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ig=(e,t,n=!1)=>{let r=wh.exec(e);return r?r[1]?t(r[1]):n:!1},ag=e=>e===`position`||e===`percentage`,og=e=>e===`image`||e===`url`,sg=e=>e===`length`||e===`size`||e===`bg-size`,cg=e=>e===`length`,lg=e=>e===`number`,ug=e=>e===`family-name`,dg=e=>e===`number`||e===`weight`,fg=e=>e===`shadow`,pg=bh(()=>{let e=Sh(`color`),t=Sh(`font`),n=Sh(`text`),r=Sh(`font-weight`),i=Sh(`tracking`),a=Sh(`leading`),o=Sh(`breakpoint`),s=Sh(`container`),c=Sh(`spacing`),l=Sh(`radius`),u=Sh(`shadow`),d=Sh(`inset-shadow`),f=Sh(`text-shadow`),p=Sh(`drop-shadow`),m=Sh(`blur`),h=Sh(`perspective`),g=Sh(`aspect`),_=Sh(`ease`),v=Sh(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),$,Q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[$,Q,c],T=()=>[jh,`full`,`auto`,...w()],E=()=>[Nh,`none`,`subgrid`,$,Q],D=()=>[`auto`,{span:[`full`,Nh,$,Q]},Nh,$,Q],O=()=>[Nh,`auto`,$,Q],ee=()=>[`auto`,`min`,`max`,`fr`,$,Q],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[jh,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[jh,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],te=()=>[jh,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,$,Q],ne=()=>[...b(),Qh,qh,{position:[$,Q]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,$h,Hh,{size:[$,Q]}],F=()=>[Ph,Xh,Uh],I=()=>[``,`none`,`full`,l,$,Q],ae=()=>[``,Mh,Xh,Uh],oe=()=>[`solid`,`dashed`,`dotted`,`double`],L=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[Mh,Ph,Qh,qh],se=()=>[``,`none`,m,$,Q],ce=()=>[`none`,Mh,$,Q],le=()=>[`none`,Mh,$,Q],ue=()=>[Mh,$,Q],de=()=>[jh,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Fh],breakpoint:[Fh],color:[Ih],container:[Fh],"drop-shadow":[Fh],ease:[`in`,`out`,`in-out`],font:[Vh],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Fh],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Fh],shadow:[Fh],spacing:[`px`,Mh],text:[Fh],"text-shadow":[Fh],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,jh,Q,$,g]}],container:[`container`],columns:[{columns:[Mh,Q,$,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Nh,`auto`,$,Q]}],basis:[{basis:[jh,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Mh,jh,`auto`,`initial`,`none`,Q]}],grow:[{grow:[``,Mh,$,Q]}],shrink:[{shrink:[``,Mh,$,Q]}],order:[{order:[Nh,`first`,`last`,`none`,$,Q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...N()]}],"min-inline-size":[{"min-inline":[`auto`,...N()]}],"max-inline-size":[{"max-inline":[`none`,...N()]}],"block-size":[{block:[`auto`,...te()]}],"min-block-size":[{"min-block":[`auto`,...te()]}],"max-block-size":[{"max-block":[`none`,...te()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,...M()]}],"font-size":[{text:[`base`,n,Xh,Uh]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ng,Gh]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Ph,Q]}],"font-family":[{font:[Zh,Kh,t]}],"font-features":[{"font-features":[Q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,$,Q]}],"line-clamp":[{"line-clamp":[Mh,`none`,$,Wh]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,$,Q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,$,Q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...oe(),`wavy`]}],"text-decoration-thickness":[{decoration:[Mh,`from-font`,`auto`,$,Uh]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Mh,`auto`,$,Q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$,Q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,$,Q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Nh,$,Q],radial:[``,$,Q],conic:[Nh,$,Q]},eg,Jh]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...oe(),`hidden`,`none`]}],"divide-style":[{divide:[...oe(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...oe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Mh,$,Q]}],"outline-w":[{outline:[``,Mh,Xh,Uh]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,tg,Yh]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,tg,Yh]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:ae()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Mh,Uh]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,tg,Yh]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Mh,$,Q]}],"mix-blend":[{"mix-blend":[...L(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":L()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Mh]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[$,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Mh]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,$,Q]}],filter:[{filter:[``,`none`,$,Q]}],blur:[{blur:se()}],brightness:[{brightness:[Mh,$,Q]}],contrast:[{contrast:[Mh,$,Q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,tg,Yh]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,Mh,$,Q]}],"hue-rotate":[{"hue-rotate":[Mh,$,Q]}],invert:[{invert:[``,Mh,$,Q]}],saturate:[{saturate:[Mh,$,Q]}],sepia:[{sepia:[``,Mh,$,Q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,$,Q]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[Mh,$,Q]}],"backdrop-contrast":[{"backdrop-contrast":[Mh,$,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Mh,$,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Mh,$,Q]}],"backdrop-invert":[{"backdrop-invert":[``,Mh,$,Q]}],"backdrop-opacity":[{"backdrop-opacity":[Mh,$,Q]}],"backdrop-saturate":[{"backdrop-saturate":[Mh,$,Q]}],"backdrop-sepia":[{"backdrop-sepia":[``,Mh,$,Q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,$,Q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Mh,`initial`,$,Q]}],ease:[{ease:[`linear`,`initial`,_,$,Q]}],delay:[{delay:[Mh,$,Q]}],animate:[{animate:[`none`,v,$,Q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,$,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":[`scale-3d`],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[$,Q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":[`translate-none`],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,$,Q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,$,Q]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[Mh,Xh,Uh,Wh]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function mg(...e){return pg(Um(e))}var hg=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,gg=Um,_g=(e,t)=>n=>{if(t?.variants==null)return gg(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=hg(t)||hg(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return gg(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},vg=_g(`inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium leading-[1.7] ring-offset-background transition-[background-color,border-color,color] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`rounded-pill border border-primary bg-primary text-primary-foreground hover:bg-ink active:bg-cohere-black`,secondary:`!min-h-0 rounded-xs border border-transparent bg-transparent !px-0 !py-0 text-foreground underline decoration-hairline underline-offset-4 hover:text-action-blue hover:decoration-action-blue`,destructive:`rounded-pill border border-destructive bg-transparent text-destructive hover:bg-destructive hover:text-destructive-foreground`,outline:`rounded-xl border border-primary bg-transparent text-primary hover:bg-soft-stone`,ghost:`rounded-sm border border-transparent bg-transparent text-foreground hover:border-hairline hover:bg-soft-stone hover:text-foreground`,link:`!min-h-0 h-auto rounded-xs border-0 !px-0 !py-0 text-foreground underline decoration-hairline underline-offset-4 hover:text-action-blue hover:decoration-action-blue`},size:{default:`min-h-11 px-6 py-2.5`,sm:`min-h-9 px-4 py-1.5 text-sm`,lg:`min-h-12 px-7 py-3 text-base`,icon:`size-10 p-0`}},defaultVariants:{variant:`default`,size:`default`}});function yg({className:e,variant:t,size:n,type:r,...i}){return(0,B.jsx)(`button`,{type:r??`button`,className:mg(vg({variant:t,size:n}),e),...i})}var bg=typeof document<`u`?z.useLayoutEffect:()=>{};function xg(e,...t){let n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Base UI error #${e}; visit ${n} for the full message.`}var Sg=z.createContext(void 0);function Cg(e){let t=z.useContext(Sg);if(t===void 0&&!e)throw Error(xg(72));return t}var wg={};function Tg(e,t){let n=z.useRef(wg);return n.current===wg&&(n.current=e(t)),n}var Eg=[];function Dg(e){z.useEffect(e,Eg)}var Og=0,kg=class e{static create(){return new e}currentId=Og;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Og,t()},e)}isStarted(){return this.currentId!==Og}clear=()=>{this.currentId!==Og&&(clearTimeout(this.currentId),this.currentId=Og)};disposeEffect=()=>this.clear};function Ag(){let e=Tg(kg.create).current;return Dg(e.disposeEffect),e}function jg(){return typeof window<`u`}function Mg(e){return Fg(e)?(e.nodeName||``).toLowerCase():`#document`}function Ng(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pg(e){return((Fg(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Fg(e){return jg()?e instanceof Node||e instanceof Ng(e).Node:!1}function Ig(e){return jg()?e instanceof Element||e instanceof Ng(e).Element:!1}function Lg(e){return jg()?e instanceof HTMLElement||e instanceof Ng(e).HTMLElement:!1}function Rg(e){return!jg()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ng(e).ShadowRoot}function zg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Xg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Bg(e){return/^(table|td|th)$/.test(Mg(e))}function Vg(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Hg=/transform|translate|scale|rotate|perspective|filter/,Ug=/paint|layout|strict|content/,Wg=e=>!!e&&e!==`none`,Gg;function Kg(e){let t=Ig(e)?Xg(e):e;return Wg(t.transform)||Wg(t.translate)||Wg(t.scale)||Wg(t.rotate)||Wg(t.perspective)||!Jg()&&(Wg(t.backdropFilter)||Wg(t.filter))||Hg.test(t.willChange||``)||Ug.test(t.contain||``)}function qg(e){let t=Qg(e);for(;Lg(t)&&!Yg(t);){if(Kg(t))return t;if(Vg(t))return null;t=Qg(t)}return null}function Jg(){return Gg??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Gg}function Yg(e){return/^(html|body|#document)$/.test(Mg(e))}function Xg(e){return Ng(e).getComputedStyle(e)}function Zg(e){return Ig(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qg(e){if(Mg(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Rg(e)&&e.host||Pg(e);return Rg(t)?t.host:t}function $g(e){let t=Qg(e);return Yg(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lg(t)&&zg(t)?t:$g(t)}function e_(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=$g(e),i=r===e.ownerDocument?.body,a=Ng(r);if(i){let e=t_(a);return t.concat(a,a.visualViewport||[],zg(r)?r:[],e&&n?e_(e):[])}else return t.concat(r,e_(r,[],n))}function t_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function n_(e){let t=Tg(r_,e).current;return t.next=e,bg(t.effect),t}function r_(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var i_=z[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],a_=i_&&i_!==z.useLayoutEffect?i_:e=>e();function o_(e){let t=Tg(s_).current;return t.next=e,a_(t.effect),t.trampoline}function s_(){let e={next:void 0,callback:c_,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function c_(){}var l_=typeof navigator<`u`,u_=y_(),d_=x_(),f_=b_(),p_=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),m_=u_.platform===`MacIntel`&&u_.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(u_.platform);l_&&/firefox/i.test(f_);var h_=l_&&/apple/i.test(navigator.vendor);l_&&/Edg/i.test(f_);var g_=l_&&/android/i.test(d_)||/android/i.test(f_),__=l_&&d_.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,v_=f_.includes(`jsdom/`);function y_(){if(!l_)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function b_(){if(!l_)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function x_(){if(!l_)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var S_=`data-base-ui-focusable`,C_=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function w_(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function T_(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Rg(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function E_(e){return`composedPath`in e?e.composedPath()[0]:e.target}function D_(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function O_(e){return e.matches(`html,body`)}function k_(e){return e?.ownerDocument||document}function A_(e){return Lg(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function j_(e){return e?e.getAttribute(`role`)===`combobox`&&A_(e):!1}function M_(e){if(!e||v_)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function N_(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function P_(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...P_(e,t.id,n)])}function F_(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function I_(e){e.preventDefault(),e.stopPropagation()}function L_(e){return`nativeEvent`in e}function R_(e){return e.mozInputSource===0&&e.isTrusted?!0:g_&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function z_(e){return v_?!1:!g_&&e.width===0&&e.height===0||g_&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function B_(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function V_(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var H_=[`top`,`right`,`bottom`,`left`],U_=Math.min,W_=Math.max,G_=Math.round,K_=Math.floor,q_=e=>({x:e,y:e}),J_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Y_(e,t,n){return W_(e,U_(t,n))}function X_(e,t){return typeof e==`function`?e(t):e}function Z_(e){return e.split(`-`)[0]}function Q_(e){return e.split(`-`)[1]}function $_(e){return e===`x`?`y`:`x`}function ev(e){return e===`y`?`height`:`width`}function tv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function nv(e){return $_(tv(e))}function rv(e,t,n){n===void 0&&(n=!1);let r=Q_(e),i=nv(e),a=ev(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=fv(o)),[o,fv(o)]}function iv(e){let t=fv(e);return[av(e),t,av(t)]}function av(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ov=[`left`,`right`],sv=[`right`,`left`],cv=[`top`,`bottom`],lv=[`bottom`,`top`];function uv(e,t,n){switch(e){case`top`:case`bottom`:return n?t?sv:ov:t?ov:sv;case`left`:case`right`:return t?cv:lv;default:return[]}}function dv(e,t,n,r){let i=Q_(e),a=uv(Z_(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(av)))),a}function fv(e){let t=Z_(e);return J_[t]+e.slice(t.length)}function pv(e){return{top:0,right:0,bottom:0,left:0,...e}}function mv(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:pv(e)}function hv(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var gv=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),_v=typeof Element>`u`,vv=_v?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,yv=!_v&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},bv=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):bv(e.parentNode))},xv=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Sv=function(e,t,n){if(bv(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(gv));return t&&vv.call(e,gv)&&r.unshift(e),r=r.filter(n),r},Cv=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!bv(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=Cv(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{vv.call(a,gv)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!bv(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=Cv(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},wv=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Tv=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||xv(e))&&!wv(e)?0:e.tabIndex},Ev=function(e,t){var n=Tv(e);return n<0&&t&&!wv(e)?0:n},Dv=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ov=function(e){return e.tagName===`INPUT`},kv=function(e){return Ov(e)&&e.type===`hidden`},Av=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},jv=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Mv=function(e){if(!e.name)return!0;var t=e.form||yv(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=jv(r,e.form);return!i||i===e},Nv=function(e){return Ov(e)&&e.type===`radio`},Pv=function(e){return Nv(e)&&!Mv(e)},Fv=function(e){var t=e&&yv(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=yv(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Iv=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Lv=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=vv.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(vv.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=yv(e);if(o&&!o.shadowRoot&&r(o)===!0)return Iv(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Fv(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Iv(e);return!1},Rv=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return vv.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},zv=function(e,t){return!(t.disabled||kv(t)||Lv(t,e)||Av(t)||Rv(t))},Bv=function(e,t){return!(Pv(t)||Tv(t)<0||!zv(e,t))},Vv=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Hv=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Ev(a,i),s=i?Hv(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Dv).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Uv=function(e,t){return t||={},Hv(t.getShadowRoot?Cv([e],t.includeContainer,{filter:Bv.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Vv}):Sv(e,t.includeContainer,Bv.bind(null,t)))},Wv=function(e,t){return t||={},t.getShadowRoot?Cv([e],t.includeContainer,{filter:zv.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Sv(e,t.includeContainer,zv.bind(null,t))},Gv=function(e,t){if(t||={},!e)throw Error(`No node provided`);return vv.call(e,gv)===!1?!1:Bv(t,e)},Kv=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function qv(e,t){let n=Uv(e,Kv()),r=n.length;if(r===0)return;let i=w_(k_(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Jv(e){return qv(k_(e).body,1)||e}function Yv(e){return qv(k_(e).body,-1)||e}function Xv(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!T_(n,r)}function Zv(e){Uv(e,Kv()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Qv(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var $v={...z},ey=0;function ty(e,t=`mui`){let[n,r]=z.useState(e),i=e||n;return z.useEffect(()=>{n??(ey+=1,r(`${t}-${ey}`))},[n,t]),i}var ny=$v.useId;function ry(e,t){if(ny!==void 0){let n=ny();return e??(t?`${t}-${n}`:n)}return ty(e,t)}function iy(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var ay=z.createContext(null),oy=z.createContext(null),sy=()=>z.useContext(ay)?.id||null,cy=e=>{let t=z.useContext(oy);return e??t};function ly(){}Object.freeze([]);var uy=Object.freeze({}),dy={style:{transition:`none`}},fy={fallbackAxisSide:`end`},py={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},my=`none`,hy=`trigger-hover`,gy=`trigger-focus`,_y=`outside-press`,vy=`close-press`,yy=`focus-out`,by=`escape-key`,xy=`disabled`,Sy=`imperative-action`;function Cy(e,t,n,r){let i=!1,a=!1,o=r??uy;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function wy(e){return`data-base-ui-${e}`}wy(`safe-polygon`),`${C_}`;function Ty(e,t,n){if(n&&!B_(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}var Ey=z.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new kg,currentIdRef:{current:null},currentContextRef:{current:null}});function Dy(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=z.useRef(n),a=z.useRef(n),o=z.useRef(null),s=z.useRef(null),c=Ag();return(0,B.jsx)(Ey.Provider,{value:z.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Oy(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{enabled:i=!0,open:a}=t,{currentIdRef:o,delayRef:s,timeoutMs:c,initialDelayRef:l,currentContextRef:u,hasProvider:d,timeout:f}=z.useContext(Ey),[p,m]=z.useState(!1);return bg(()=>{function e(){m(!1),u.current?.setIsInstantPhase(!1),o.current=null,u.current=null,s.current=l.current}if(i&&o.current&&!a&&o.current===r){if(m(!1),c)return f.start(c,e),()=>{f.clear()};e()}},[i,a,r,o,s,c,l,u,f]),bg(()=>{if(!i||!a)return;let e=u.current,t=o.current;u.current={onOpenChange:n.setOpen,setIsInstantPhase:m},o.current=r,s.current={open:0,close:Ty(l.current,`close`)},t!==null&&t!==r?(f.clear(),m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Cy(my))):(m(!1),e?.setIsInstantPhase(!1))},[i,a,r,n,o,s,c,l,u,f]),bg(()=>()=>{u.current=null},[u]),z.useMemo(()=>({hasProvider:d,delayRef:s,isInstantPhase:p}),[d,s,p])}function ky(e,t,n,r){let i=Tg(jy).current;return My(i,e,t,n,r)&&Py(i,[e,t,n,r]),i.callback}function Ay(e){let t=Tg(jy).current;return Ny(t,e)&&Py(t,e),t.callback}function jy(){return{callback:null,cleanup:null,refs:[]}}function My(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Ny(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Py(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var Fy={clip:`rect(0 0 0 0)`,overflow:`hidden`,whiteSpace:`nowrap`,position:`fixed`,top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},Iy=null;globalThis.requestAnimationFrame;var Ly=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Ry=class e{static create(){return new e}static request(e){return Ly.request(e)}static cancel(e){return Ly.cancel(e)}currentId=Iy;request(e){this.cancel(),this.currentId=Ly.request(()=>{this.currentId=Iy,e()})}cancel=()=>{this.currentId!==Iy&&(Ly.cancel(this.currentId),this.currentId=Iy)};disposeEffect=()=>this.cancel};function zy(){let e=Tg(Ry.create).current;return Dg(e.disposeEffect),e}function By(e){return e?.ownerDocument||document}var Vy=z.forwardRef(function(e,t){let[n,r]=z.useState();bg(()=>{h_&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,B.jsx)(`span`,{...e,ref:t,style:Fy,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})}),Hy=0;function Uy(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Hy);let a=()=>e?.focus({preventScroll:n});i?a():Hy=requestAnimationFrame(a)}var Wy={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Gy(e){return e===`inert`?Wy.inert:e===`aria-hidden`?Wy[`aria-hidden`]:Wy.none}var Ky=new WeakSet,qy={},Jy=0,Yy=e=>e&&(e.host||Yy(e.parentNode)),Xy=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Yy(t);return e.contains(n)?n:null}).filter(e=>e!=null);function Zy(e,t,n,r){let i=`data-base-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=Xy(t,e),s=new Set,c=new Set(o),l=[];qy[i]||(qy[i]=new WeakMap);let u=qy[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(Mg(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Gy(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&Ky.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return Jy+=1,()=>{l.forEach(e=>{let t=Gy(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!Ky.has(e)&&a&&e.removeAttribute(a),Ky.delete(e)),r||e.removeAttribute(i)}),--Jy,Jy||(Wy.inert=new WeakMap,Wy[`aria-hidden`]=new WeakMap,Wy.none=new WeakMap,Ky=new WeakSet,qy={})}}function Qy(e,t=!1,n=!1){let r=k_(e[0]).body;return Zy(e.concat(Array.from(r.querySelectorAll(`[aria-live]`))),r,t,n)}var $y=19;function eb(e){return $y>=e}function tb(e){if(!z.isValidElement(e))return null;let t=e,n=t.props;return(eb(19)?n?.ref:t.ref)??null}function nb(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function rb(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function ib(e,t){return typeof e==`function`?e(t):e}function ab(e,t){return typeof e==`function`?e(t):e}var ob={};function sb(e,t,n,r,i){let a={...pb(e,ob)};return t&&(a=lb(a,t)),n&&(a=lb(a,n)),r&&(a=lb(a,r)),i&&(a=lb(a,i)),a}function cb(e){if(e.length===0)return ob;if(e.length===1)return pb(e[0],ob);let t={...pb(e[0],ob)};for(let n=1;n<e.length;n+=1)t=lb(t,e[n]);return t}function lb(e,t){return fb(t)?t(e):ub(e,t)}function ub(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=nb(e.style,r);break;case`className`:e[n]=gb(e.className,r);break;default:db(n,r)?e[n]=mb(e[n],r):e[n]=r}}return e}function db(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function fb(e){return typeof e==`function`}function pb(e,t){return fb(e)?e(t):e??ob}function mb(e,t){return t?e?n=>{if(_b(n)){let r=n;hb(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function hb(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function gb(e,t){return t?e?t+` `+e:t:e}function _b(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function vb(e,t,n={}){let r=t.render,i=yb(t,n);return n.enabled===!1?null:bb(e,r,i,n.state??uy)}function yb(e,t={}){let{className:n,style:r,render:i}=e,{state:a=uy,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?ib(n,a):void 0,d=l?ab(r,a):void 0,f=l?rb(a,c):uy,p=l?nb(f,Array.isArray(s)?cb(s):s)??uy:uy;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=Ay([p.ref,tb(i),...o]):p.ref=ky(p.ref,tb(i),o):ky(null,null)),l?(u!==void 0&&(p.className=gb(p.className,u)),d!==void 0&&(p.style=nb(p.style,d)),p):uy}function bb(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=sb(n,t.props);return e.ref=n.ref,z.cloneElement(t,e)}if(e&&typeof e==`string`)return xb(e,n);throw Error(xg(8))}function xb(e,t){return e===`button`?(0,z.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,z.createElement)(`img`,{alt:``,...t,key:t.key}):z.createElement(e,t)}var Sb=z.createContext(null),Cb=()=>z.useContext(Sb),wb=wy(`portal`);function Tb(e={}){let{ref:t,container:n,componentProps:r=uy,elementProps:i,elementState:a}=e,o=ry(),s=Cb()?.portalNode,[c,l]=z.useState(null),[u,d]=z.useState(null),f=z.useRef(null);bg(()=>{if(n===null){f.current&&(f.current=null,d(null),l(null));return}if(o==null)return;let e=(n&&(Fg(n)?n:n.current))??s??document.body;if(e==null){f.current&&(f.current=null,d(null),l(null));return}f.current!==e&&(f.current=e,d(null),l(e))},[n,s,o]);let p=vb(`div`,r,{ref:[t,d],state:a,props:[{id:o,[wb]:``},i]});return{portalNode:u,portalSubtree:c&&p?xi.createPortal(p,c):null}}var Eb=z.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,...s}=e,{portalNode:c,portalSubtree:l}=Tb({container:r,ref:t,componentProps:e,elementProps:s}),u=z.useRef(null),d=z.useRef(null),f=z.useRef(null),p=z.useRef(null),[m,h]=z.useState(null),g=m?.modal,_=m?.open,v=typeof o==`boolean`?o:!!m&&!m.modal&&m.open&&!!c;z.useEffect(()=>{if(!c||g)return;function e(e){c&&Xv(e)&&(e.type===`focusin`?Qv:Zv)(c)}return c.addEventListener(`focusin`,e,!0),c.addEventListener(`focusout`,e,!0),()=>{c.removeEventListener(`focusin`,e,!0),c.removeEventListener(`focusout`,e,!0)}},[c,g]),z.useEffect(()=>{!c||_||Qv(c)},[_,c]);let y=z.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:c,setFocusManagerState:h}),[c]);return(0,B.jsxs)(z.Fragment,{children:[l,(0,B.jsxs)(Sb.Provider,{value:y,children:[v&&c&&(0,B.jsx)(Vy,{"data-type":`outside`,ref:u,onFocus:e=>{Xv(e,c)?f.current?.focus():Yv(m?m.domReference:null)?.focus()}}),v&&c&&(0,B.jsx)(`span`,{"aria-owns":c.id,style:py}),c&&xi.createPortal(n,c),v&&c&&(0,B.jsx)(Vy,{"data-type":`outside`,ref:d,onFocus:e=>{Xv(e,c)?p.current?.focus():(Jv(m?m.domReference:null)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,Cy(`focus-out`,e.nativeEvent)))}})]})]})});function Db(e){return e==null?e:`current`in e?e.current:e}function Ob(e,t){let n=Ng(e.target);return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var kb=20,Ab=[];function jb(){Ab=Ab.filter(e=>e.isConnected)}function Mb(e){jb(),e&&Mg(e)!==`body`&&(Ab.push(e),Ab.length>kb&&(Ab=Ab.slice(-kb)))}function Nb(){return jb(),Ab[Ab.length-1]}function Pb(e){if(!e)return null;let t=Kv();return Gv(e,t)?e:Uv(e,t)[0]||e}function Fb(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():Xg(e).display!==`none`}function Ib(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=Kv(),r=Wv(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Gv(e,n)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),i=e.getAttribute(`tabindex`);t.current.includes(`floating`)||r.length===0?i!==`0`&&e.setAttribute(`tabindex`,`0`):(i!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Lb(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,getInsideElements:d=()=>[],nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h}=e,g=`rootStore`in t?t.rootStore:t,_=g.useState(`open`),v=g.useState(`domReferenceElement`),y=g.useState(`floatingElement`),{events:b,dataRef:x}=g.context,S=o_(()=>x.current.floatingContext?.nodeId),C=o_(d),w=a===!1,T=j_(v)&&w,E=n_(i),D=n_(a),O=n_(o),ee=n_(u),k=cy(h),A=Cb(),j=z.useRef(null),M=z.useRef(null),N=z.useRef(!1),te=z.useRef(!1),P=z.useRef(!1),ne=z.useRef(-1),re=z.useRef(``),ie=z.useRef(``),F=Ag(),I=Ag(),ae=zy(),oe=A!=null,L=N_(y),R=o_((e=L)=>e?Uv(e,Kv()):[]),se=o_(e=>{let t=R(e);return E.current.map(()=>t).filter(Boolean).flat()});z.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&T_(L,w_(k_(L)))&&R().length===0&&!T&&I_(e)}let t=k_(L);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,v,L,c,E,T,R,se]),z.useEffect(()=>{if(r||!y)return;function e(e){let t=E_(e),n=R().indexOf(t);n!==-1&&(ne.current=n)}return y.addEventListener(`focusin`,e),()=>{y.removeEventListener(`focusin`,e)}},[r,y,R]),z.useEffect(()=>{if(r||!_)return;let e=k_(L);function t(){P.current=!1}function n(e){let t=E_(e);P.current=!(T_(y,t)||T_(v,t)||T_(A?.portalNode,t)),ie.current=e.pointerType||`keyboard`}function i(){ie.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,i,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,i,!0)}},[r,y,v,L,_,A]),z.useEffect(()=>{if(r||!l)return;function e(){te.current=!0,I.start(0,()=>{te.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=E_(e);queueMicrotask(()=>{let i=S(),a=g.context.triggerElements,o=!(T_(v,t)||T_(y,t)||T_(t,y)||T_(A?.portalNode,t)||t!=null&&a.hasElement(t)||a.hasMatchingElement(e=>T_(e,t))||t?.hasAttribute(wy(`focus-guard`))||k&&(P_(k.nodesRef.current,i).find(e=>T_(e.context?.elements.floating,t)||T_(e.context?.elements.domReference,t))||F_(k.nodesRef.current,i).find(e=>[e.context?.elements.floating,N_(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===v&&L&&Ib(L,E),s&&n!==v&&!Fb(r)&&w_(k_(L))===k_(L).body){if(Lg(L)&&(L.focus(),s===`popup`)){ae.request(()=>{L.focus()});return}let e=ne.current,t=R(),n=t[e]||t[t.length-1]||L;Lg(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(T||!c)&&t&&o&&!te.current&&(T||t!==Nb())&&(N.current=!0,g.setOpen(!1,Cy(yy,e)))})}function n(){P.current||(x.current.insideReactTree=!0,F.start(0,()=>{x.current.insideReactTree=!1}))}let i=Lg(v)?v:null,a=[];if(!(!y&&!i))return i&&(i.addEventListener(`focusout`,t),i.addEventListener(`pointerdown`,e),a.push(()=>{i.removeEventListener(`focusout`,t),i.removeEventListener(`pointerdown`,e)})),y&&(y.addEventListener(`focusout`,t),A&&(y.addEventListener(`focusout`,n,!0),a.push(()=>{y.removeEventListener(`focusout`,n,!0)})),a.push(()=>{y.removeEventListener(`focusout`,t)})),()=>{a.forEach(e=>{e()})}},[r,v,y,L,c,k,A,g,l,s,R,T,S,E,x,F,I,ae]);let ce=z.useRef(null),le=z.useRef(null),ue=ky(ce,m,A?.beforeInsideRef),de=ky(le,A?.afterInsideRef);z.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${wy(`portal`)}]`)||[]),t=Qy([y,(k?F_(k.nodesRef.current,S()):[]).find(e=>j_(e.context?.elements.domReference||null))?.context?.elements.domReference,...e,...C(),j.current,M.current,ce.current,le.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Db(p),Db(f),T?v:null].filter(e=>e!=null),c||T);return()=>{t()}},[_,r,v,y,c,E,A,T,k,S,C,f,p]),bg(()=>{if(!_||r||!Lg(L))return;let e=w_(k_(L));queueMicrotask(()=>{let t=se(L),n=D.current,r=typeof n==`function`?n(ee.current||``):n;if(r===void 0||r===!1)return;let i;i=r===!0||r===null?t[0]||L:Db(r),i=i||t[0]||L,!T_(L,e)&&Uy(i,{preventScroll:i===L})})},[r,_,L,w,se,D,ee]),bg(()=>{if(r||!L)return;let e=k_(L);Mb(w_(e));function t(e){if(e.open||(re.current=Ob(e.nativeEvent,ie.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(N.current=!0),e.reason===`outside-press`)if(e.nested)N.current=!1;else if(R_(e.nativeEvent)||z_(e.nativeEvent))N.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}b.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,Fy),oe&&v&&v.insertAdjacentElement(`afterend`,n);function i(){let e=O.current,t=typeof e==`function`?e(re.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=v||Nb();return e&&e.isConnected?e:n}let r=v||Nb()||n;return Db(t)||r}return()=>{b.off(`openchange`,t);let r=w_(e),a=T_(y,r)||k&&P_(k.nodesRef.current,S(),!1).some(e=>T_(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=Pb(o),i=typeof O.current!=`boolean`;O.current&&!N.current&&Lg(t)&&(!(!i&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,y,L,O,x,b,k,oe,v,S]),z.useEffect(()=>{queueMicrotask(()=>{N.current=!1})},[r]),z.useEffect(()=>{if(r||!_)return;function e(e){E_(e)?.closest(`[data-base-ui-click-trigger]`)&&(te.current=!0)}let t=k_(L);return t.addEventListener(`pointerdown`,e,!0),()=>{t.removeEventListener(`pointerdown`,e,!0)}},[r,_,L]),bg(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:g.setOpen,domReference:v}),()=>{A.setFocusManagerState(null)}},[r,A,c,_,g,l,v]),bg(()=>{if(!(r||!L))return Ib(L,E),()=>{queueMicrotask(jb)}},[r,L,E]);let fe=!r&&(c?!T:!0)&&(oe||c);return(0,B.jsxs)(z.Fragment,{children:[fe&&(0,B.jsx)(Vy,{"data-type":`inside`,ref:ue,onFocus:e=>{if(c){let e=se();Uy(e[e.length-1])}else A?.portalNode&&(N.current=!1,Xv(e,A.portalNode)?Jv(v)?.focus():Db(p??A.beforeOutsideRef)?.focus())}}),n,fe&&(0,B.jsx)(Vy,{"data-type":`inside`,ref:de,onFocus:e=>{c?Uy(se()[0]):A?.portalNode&&(l&&(N.current=!0),Xv(e,A.portalNode)?Yv(v)?.focus():Db(f??A.afterOutsideRef)?.focus())}})]})}function Rb(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function zb(e){return e!=null&&e.clientX!=null}function Bb(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`,x:l=null,y:u=null}=t,d=z.useRef(!1),f=z.useRef(null),[p,m]=z.useState(),[h,g]=z.useState([]),_=o_((e,t)=>{d.current||o.current.openEvent&&!zb(o.current.openEvent)||n.set(`positionReference`,Rb(a,{x:e,y:t,axis:c,dataRef:o,pointerType:p}))}),v=o_(e=>{l!=null||u!=null||(r?f.current||g([]):_(e.clientX,e.clientY))}),y=B_(p)?i:r,b=z.useCallback(()=>{if(!y||!s||l!=null||u!=null)return;let e=Ng(i);function t(n){T_(i,E_(n))?(e.removeEventListener(`mousemove`,t),f.current=null):_(n.clientX,n.clientY)}if(!o.current.openEvent||zb(o.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),f.current=null};return f.current=n,n}n.set(`positionReference`,a)},[y,s,l,u,i,o,a,n,_]);z.useEffect(()=>b(),[b,h]),z.useEffect(()=>{s&&!i&&(d.current=!1)},[s,i]),z.useEffect(()=>{!s&&r&&(d.current=!0)},[s,r]),bg(()=>{s&&(l!=null||u!=null)&&(d.current=!1,_(l,u))},[s,l,u,_]);let x=z.useMemo(()=>{function e(e){m(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return z.useMemo(()=>s?{reference:x}:{},[s,x])}function Vb(e,t,n){let{reference:r,floating:i}=e,a=tv(t),o=nv(t),s=ev(o),c=Z_(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Q_(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Hb(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=X_(t,e),p=mv(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=hv(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=hv(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ub=50,Wb=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Hb},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Vb(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ub&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Vb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Gb=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=X_(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Z_(r),_=tv(o),v=Z_(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[fv(o)]:iv(o)),x=p!==`none`;!d&&x&&b.push(...dv(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=rv(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==tv(t))||T.every(e=>tv(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=tv(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Kb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qb(e){return H_.some(t=>e[t]>=0)}var Jb=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=X_(e,t);switch(i){case`referenceHidden`:{let e=Kb(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:qb(e)}}}case`escaped`:{let e=Kb(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:qb(e)}}}default:return{}}}}},Yb=new Set([`left`,`top`]);async function Xb(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Z_(n),s=Q_(n),c=tv(n)===`y`,l=Yb.has(o)?-1:1,u=a&&c?-1:1,d=X_(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Zb=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Xb(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Qb=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=X_(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=tv(Z_(i)),p=$_(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Y_(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Y_(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},$b=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=X_(e,t),u={x:n,y:r},d=tv(i),f=$_(d),p=u[f],m=u[d],h=X_(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Yb.has(Z_(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ex=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=X_(e,t),u=await o.detectOverflow(t,l),d=Z_(i),f=Q_(i),p=tv(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=U_(h-u[g],v),x=U_(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=W_(u.left,0),t=W_(u.right,0),n=W_(u.top,0),r=W_(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:W_(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:W_(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function tx(e){let t=Xg(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Lg(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=G_(n)!==a||G_(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function nx(e){return Ig(e)?e:e.contextElement}function rx(e){let t=nx(e);if(!Lg(t))return q_(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=tx(t),o=(a?G_(n.width):n.width)/r,s=(a?G_(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ix=q_(0);function ax(e){let t=Ng(e);return!Jg()||!t.visualViewport?ix:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ox(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ng(e)?!1:t}function sx(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=nx(e),o=q_(1);t&&(r?Ig(r)&&(o=rx(r)):o=rx(e));let s=ox(a,n,r)?ax(a):q_(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Ng(a),t=r&&Ig(r)?Ng(r):r,n=e,i=t_(n);for(;i&&r&&t!==n;){let e=rx(i),t=i.getBoundingClientRect(),r=Xg(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Ng(i),i=t_(n)}}return hv({width:u,height:d,x:c,y:l})}function cx(e,t){let n=Zg(e).scrollLeft;return t?t.left+n:sx(Pg(e)).left+n}function lx(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-cx(e,n),y:n.top+t.scrollTop}}function ux(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Pg(r),s=t?Vg(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=q_(1),u=q_(0),d=Lg(r);if((d||!d&&!a)&&((Mg(r)!==`body`||zg(o))&&(c=Zg(r)),d)){let e=sx(r);l=rx(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?lx(o,c):q_(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function dx(e){return Array.from(e.getClientRects())}function fx(e){let t=Pg(e),n=Zg(e),r=e.ownerDocument.body,i=W_(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=W_(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+cx(e),s=-n.scrollTop;return Xg(r).direction===`rtl`&&(o+=W_(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var px=25;function mx(e,t){let n=Ng(e),r=Pg(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Jg();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=cx(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=px&&(a-=o)}else l<=px&&(a+=l);return{width:a,height:o,x:s,y:c}}function hx(e,t){let n=sx(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Lg(e)?rx(e):q_(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function gx(e,t,n){let r;if(t===`viewport`)r=mx(e,n);else if(t===`document`)r=fx(Pg(e));else if(Ig(t))r=hx(t,n);else{let n=ax(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return hv(r)}function _x(e,t){let n=Qg(e);return n===t||!Ig(n)||Yg(n)?!1:Xg(n).position===`fixed`||_x(n,t)}function vx(e,t){let n=t.get(e);if(n)return n;let r=e_(e,[],!1).filter(e=>Ig(e)&&Mg(e)!==`body`),i=null,a=Xg(e).position===`fixed`,o=a?Qg(e):e;for(;Ig(o)&&!Yg(o);){let t=Xg(o),n=Kg(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||zg(o)&&!n&&_x(e,o))?r=r.filter(e=>e!==o):i=t,o=Qg(o)}return t.set(e,r),r}function yx(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Vg(t)?[]:vx(t,this._c):[].concat(n),r],o=gx(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=gx(t,a[e],i);s=W_(n.top,s),c=U_(n.right,c),l=U_(n.bottom,l),u=W_(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function bx(e){let{width:t,height:n}=tx(e);return{width:t,height:n}}function xx(e,t,n){let r=Lg(t),i=Pg(t),a=n===`fixed`,o=sx(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=q_(0);function l(){c.x=cx(i)}if(r||!r&&!a)if((Mg(t)!==`body`||zg(i))&&(s=Zg(t)),r){let e=sx(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?lx(i,s):q_(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Sx(e){return Xg(e).position===`static`}function Cx(e,t){if(!Lg(e)||Xg(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Pg(e)===n&&(n=n.ownerDocument.body),n}function wx(e,t){let n=Ng(e);if(Vg(e))return n;if(!Lg(e)){let t=Qg(e);for(;t&&!Yg(t);){if(Ig(t)&&!Sx(t))return t;t=Qg(t)}return n}let r=Cx(e,t);for(;r&&Bg(r)&&Sx(r);)r=Cx(r,t);return r&&Yg(r)&&Sx(r)&&!Kg(r)?n:r||qg(e)||n}var Tx=async function(e){let t=this.getOffsetParent||wx,n=this.getDimensions,r=await n(e.floating);return{reference:xx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ex(e){return Xg(e).direction===`rtl`}var Dx={convertOffsetParentRelativeRectToViewportRelativeRect:ux,getDocumentElement:Pg,getClippingRect:yx,getOffsetParent:wx,getElementRects:Tx,getClientRects:dx,getDimensions:bx,getScale:rx,isElement:Ig,isRTL:Ex};function Ox(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kx(e,t){let n=null,r,i=Pg(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=K_(d),h=K_(i.clientWidth-(u+f)),g=K_(i.clientHeight-(d+p)),_=K_(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:W_(0,U_(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Ox(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ax(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=nx(e),u=i||a?[...l?e_(l):[],...t?e_(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?kx(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?sx(e):null;c&&g();function g(){let t=sx(e);h&&!Ox(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var jx=Zb,Mx=Qb,Nx=Gb,Px=ex,Fx=Jb,Ix=$b,Lx=(e,t,n)=>{let r=new Map,i={platform:Dx,...n},a={...i.platform,_c:r};return Wb(e,t,{...i,platform:a})},Rx=typeof document<`u`?z.useLayoutEffect:function(){};function zx(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!zx(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!zx(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Bx(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Vx(e,t){let n=Bx(e);return Math.round(t*n)/n}function Hx(e){let t=z.useRef(e);return Rx(()=>{t.current=e}),t}function Ux(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=z.useState(r);zx(f,r)||p(r);let[m,h]=z.useState(null),[g,_]=z.useState(null),v=z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=z.useRef(null),C=z.useRef(null),w=z.useRef(u),T=c!=null,E=Hx(c),D=Hx(i),O=Hx(l),ee=z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Lx(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};k.current&&!zx(w.current,t)&&(w.current=t,xi.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Rx(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=z.useRef(!1);Rx(()=>(k.current=!0,()=>{k.current=!1}),[]),Rx(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,ee);ee()}},[b,x,ee,E,T]);let A=z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=z.useMemo(()=>({reference:b,floating:x}),[b,x]),M=z.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=Vx(j.floating,u.x),r=Vx(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Bx(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return z.useMemo(()=>({...u,update:ee,refs:A,elements:j,floatingStyles:M}),[u,ee,A,j,M])}var Wx=(e,t)=>{let n=jx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gx=(e,t)=>{let n=Mx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kx=(e,t)=>({fn:Ix(e).fn,options:[e,t]}),qx=(e,t)=>{let n=Nx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jx=(e,t)=>{let n=Px(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yx=(e,t)=>{let n=Fx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xx={intentional:`onClick`,sloppy:`onPointerDown`};function Zx(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Qx(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`referenceElement`),o=n.useState(`domReferenceElement`),{onOpenChange:s,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:f=`sloppy`,referencePress:p=!1,referencePressEvent:m=`sloppy`,ancestorScroll:h=!1,bubbles:g,externalTree:_}=t,v=cy(_),y=o_(typeof d==`function`?d:()=>!1),b=typeof d==`function`?y:d,x=z.useRef(!1),{escapeKey:S,outsidePress:C}=Zx(g),w=z.useRef(null),T=Ag(),E=Ag(),D=o_(()=>{E.clear(),c.current.insideReactTree=!1}),O=z.useRef(!1),ee=z.useRef(``),k=o_(e=>{ee.current=e.pointerType}),A=o_(()=>{let e=ee.current,t=e===`pen`||!e?`mouse`:e,n=typeof f==`function`?f():f;return typeof n==`string`?n:n[t]}),j=o_(e=>{if(!r||!l||!u||e.key!==`Escape`||O.current)return;let t=c.current.floatingContext?.nodeId,i=v?P_(v.nodesRef.current,t):[];if(!S&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=Cy(by,L_(e)?e.nativeEvent:e);n.setOpen(!1,a),!S&&!a.isPropagationAllowed&&e.stopPropagation()}),M=o_(e=>{let t=A();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}),N=o_(()=>{c.current.insideReactTree=!0,E.start(0,D)}),te=o_((e,t=!1)=>{if(M(e)){D();return}if(c.current.insideReactTree){D();return}if(A()===`intentional`&&t||typeof b==`function`&&!b(e))return;let r=E_(e),i=`[${wy(`inert`)}]`,a=k_(n.select(`floatingElement`)).querySelectorAll(i),o=n.context.triggerElements;if(r&&(o.hasElement(r)||o.hasMatchingElement(e=>T_(e,r))))return;let s=Ig(r)?r:null;for(;s&&!Yg(s);){let e=Qg(s);if(Yg(e)||!Ig(e))break;s=e}if(a.length&&Ig(r)&&!O_(r)&&!T_(r,n.select(`floatingElement`))&&Array.from(a).every(e=>!T_(s,e)))return;if(Lg(r)&&!(`touches`in e)){let t=Yg(r),n=Xg(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}let l=c.current.floatingContext?.nodeId,u=v&&P_(v.nodesRef.current,l).some(t=>D_(e,t.context?.elements.floating));if(D_(e,n.select(`floatingElement`))||D_(e,n.select(`domReferenceElement`))||u)return;let d=v?P_(v.nodesRef.current,l):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Cy(_y,e)),D()}),P=o_(e=>{A()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!l||D_(e,n.select(`floatingElement`))||D_(e,n.select(`domReferenceElement`))||te(e)}),ne=o_(e=>{if(A()!==`sloppy`||!n.select(`open`)||!l||D_(e,n.select(`floatingElement`))||D_(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(w.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{w.current&&(w.current.dismissOnTouchEnd=!1,w.current.dismissOnMouseDown=!1)}))}),re=o_(e=>{let t=E_(e);function n(){ne(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),ie=o_(e=>{let t=x.current;if(x.current=!1,T.clear(),e.type===`mousedown`&&w.current&&!w.current.dismissOnMouseDown)return;let n=E_(e);function r(){e.type===`pointerdown`?P(e):te(e,t),n?.removeEventListener(e.type,r)}n?.addEventListener(e.type,r)}),F=o_(e=>{if(A()!==`sloppy`||!w.current||D_(e,n.select(`floatingElement`))||D_(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-w.current.startX),i=Math.abs(t.clientY-w.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(w.current.dismissOnTouchEnd=!0),a>10&&(te(e),T.clear(),w.current=null)}),I=o_(e=>{let t=E_(e);function n(){F(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),ae=o_(e=>{A()!==`sloppy`||!w.current||D_(e,n.select(`floatingElement`))||D_(e,n.select(`domReferenceElement`))||(w.current.dismissOnTouchEnd&&te(e),T.clear(),w.current=null)}),oe=o_(e=>{let t=E_(e);function n(){ae(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)});z.useEffect(()=>{if(!r||!l)return;c.current.__escapeKeyBubbles=S,c.current.__outsidePressBubbles=C;let e=new kg;function t(e){n.setOpen(!1,Cy(my,e))}function s(){e.clear(),O.current=!0}function d(){e.start(Jg()?5:0,()=>{O.current=!1})}let f=k_(i);f.addEventListener(`pointerdown`,k,!0),u&&(f.addEventListener(`keydown`,j),f.addEventListener(`compositionstart`,s),f.addEventListener(`compositionend`,d)),b&&(f.addEventListener(`click`,ie,!0),f.addEventListener(`pointerdown`,ie,!0),f.addEventListener(`touchstart`,re,!0),f.addEventListener(`touchmove`,I,!0),f.addEventListener(`touchend`,oe,!0),f.addEventListener(`mousedown`,ie,!0));let p=[];return h&&(Ig(o)&&(p=e_(o)),Ig(i)&&(p=p.concat(e_(i))),!Ig(a)&&a&&a.contextElement&&(p=p.concat(e_(a.contextElement)))),p=p.filter(e=>e!==f.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{f.removeEventListener(`pointerdown`,k,!0),u&&(f.removeEventListener(`keydown`,j),f.removeEventListener(`compositionstart`,s),f.removeEventListener(`compositionend`,d)),b&&(f.removeEventListener(`click`,ie,!0),f.removeEventListener(`pointerdown`,ie,!0),f.removeEventListener(`touchstart`,re,!0),f.removeEventListener(`touchmove`,I,!0),f.removeEventListener(`touchend`,oe,!0),f.removeEventListener(`mousedown`,ie,!0)),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),e.clear()}},[c,i,a,o,u,b,r,s,h,l,S,C,j,te,ie,P,re,I,oe,k,n]),z.useEffect(D,[b,D]);let L=z.useMemo(()=>({onKeyDown:j,...p&&{[Xx[m]]:e=>{n.setOpen(!1,Cy(`trigger-press`,e.nativeEvent))},...m!==`intentional`&&{onClick(e){n.setOpen(!1,Cy(`trigger-press`,e.nativeEvent))}}}}),[j,n,p,m]),R=o_(e=>{let t=E_(e.nativeEvent);!T_(n.select(`floatingElement`),t)||e.button!==0||(x.current=!0)}),se=z.useMemo(()=>({onKeyDown:j,onPointerDown:R,onMouseDown:R,onMouseUp:R,onClickCapture:N,onMouseDownCapture:N,onPointerDownCapture:N,onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[j,R,N]);return z.useMemo(()=>l?{reference:L,floating:se,trigger:L}:{},[l,L,se])}var $x=Symbol(`NOT_FOUND`);function eS(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function tS(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function nS(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var rS=e=>Array.isArray(e)?e:[e];function iS(e){let t=Array.isArray(e[0])?e[0]:e;return nS(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function aS(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function oS(e){let t;return{get(n){return t&&e(t.key,n)?t.value:$x},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function sS(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return $x}function i(t,i){r(t)===$x&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var cS=(e,t)=>e===t;function lS(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function uS(e,t){let{equalityCheck:n=cS,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=lS(n),o=0,s=r<=1?oS(a):sS(r,a);function c(){let t=s.get(arguments);if(t===$x){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var dS=class{constructor(e){this.value=e}deref(){return this.value}},fS=typeof WeakRef<`u`?WeakRef:dS,pS=0,mS=1;function hS(){return{s:pS,v:void 0,o:null,p:null}}function gS(e,t={}){let n=hS(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=hS(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=hS(),e.set(n,t)):t=r}}let s=t,c;if(t.s===mS)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new fS(c):c}return s.s=mS,s.v=c,c}return o.clearCache=()=>{n=hS(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function _S(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),eS(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=gS,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=rS(c),p=rS(u),m=iS(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=aS(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var vS=_S(gS),yS=Object.assign((e,t=vS)=>{tS(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>yS});_S({memoize:uS,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});var bS=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(xg(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},xS=oi(),SS=eb(19)?wS:TS;function CS(e,t,n,r,i){return SS(e,t,n,r,i)}function wS(e,t,n,r,i){let a=z.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,xS.useSyncExternalStore)(e.subscribe,a,a)}function TS(e,t,n,r,i){return(0,ci.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var ES=class e{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(t){for(let n in t)if(!Object.is(this.state[n],t[n])){e.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||e.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){let t={...this.state};e.prototype.setState.call(this,t)}},DS=class extends ES{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}controlledValues=new Map;useSyncedValue(e,t){z.useDebugValue(e),bg(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){bg(()=>(this.state[e]!==t&&this.set(e,t),()=>{this.set(e,void 0)}),[e,t])}useSyncedValues(e){bg(()=>{this.update(e)},Object.values(e))}useControlledProp(e,t,n){z.useDebugValue(e);let r=t!==void 0;this.controlledValues.has(e)||(this.controlledValues.set(e,r),!r&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})),bg(()=>{r&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n,r])}set(e,t){this.controlledValues.get(e)!==!0&&super.set(e,t)}update(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.update(t)}setState(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.setState({...this.state,...t})}select=(e,t,n,r)=>{let i=this.selectors[e];return i(this.state,t,n,r)};useState=(e,t,n,r)=>{z.useDebugValue(e);let i=this.selectors[e];return CS(this,i,t,n,r)};useContextCallback(e,t){z.useDebugValue(e);let n=o_(t??ly);this.context[e]=n}useStateSetter(e){let t=z.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},OS={open:bS(e=>e.open),domReferenceElement:bS(e=>e.domReferenceElement),referenceElement:bS(e=>e.positionReference??e.referenceElement),floatingElement:bS(e=>e.floatingElement),floatingId:bS(e=>e.floatingId)},kS=class extends DS{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:iy(),nested:t,noEmit:n,triggerElements:i},OS)}setOpen=(e,t)=>{if((!e||!this.state.open||V_(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function AS(e,t=!1,n=!1){let[r,i]=z.useState(e&&t?`idle`:void 0),[a,o]=z.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),bg(()=>{if(!e&&a&&r!==`ending`&&n){let e=Ry.request(()=>{i(`ending`)});return()=>{Ry.cancel(e)}}},[e,a,r,n]),bg(()=>{if(!e||t)return;let n=Ry.request(()=>{xi.flushSync(()=>{i(void 0)})});return()=>{Ry.cancel(n)}},[t,e]),bg(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Ry.request(()=>{i(`idle`)});return()=>{Ry.cancel(n)}},[t,e,a,i,r]),z.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}function jS(e,t=!1,n=!0){let r=zy();return o_((i,a=null)=>{r.cancel();let o=Db(e);o!=null&&(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED?i():r.request(()=>{function e(){o&&Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{a!=null&&a.aborted||xi.flushSync(i)}).catch(()=>{if(n){if(a!=null&&a.aborted)return;xi.flushSync(i)}else o.getAnimations().length>0&&o.getAnimations().some(e=>e.pending||e.playState!==`finished`)&&e()})}t?r.request(e):e()}))})}function MS(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=n_(n),o=o_(i),s=jS(r,n);z.useEffect(()=>{t&&s(()=>{n===a.current&&o()})},[t,n,o,s,a])}function NS(e,t){let n=z.useRef(null);return z.useCallback(r=>{if(e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),r!==null))return n.current=e,t.context.triggerElements.add(e,r),()=>{n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null)}},[t,e])}function PS(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=NS(e,n),o=o_(t=>{let i=a(t);return t!==null&&n.select(`open`)&&n.select(`activeTriggerId`)==null&&n.update({activeTriggerId:e,activeTriggerElement:t,...r}),i});return bg(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function FS(e){let t=e.useState(`open`);bg(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function IS(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=AS(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=o_(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return MS({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var LS=class{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elements.delete(n),this.elements.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(let t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}};function RS(){return new kS({open:!1,floatingElement:null,referenceElement:null,triggerElements:new LS,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function zS(){return{open:!1,mounted:!1,transitionStatus:`idle`,floatingRootContext:RS(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:uy,inactiveTriggerProps:uy,popupProps:uy}}var BS={open:bS(e=>e.open),mounted:bS(e=>e.mounted),transitionStatus:bS(e=>e.transitionStatus),floatingRootContext:bS(e=>e.floatingRootContext),preventUnmountingOnClose:bS(e=>e.preventUnmountingOnClose),payload:bS(e=>e.payload),activeTriggerId:bS(e=>e.activeTriggerId),activeTriggerElement:bS(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:bS((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:bS((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:bS((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:bS((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:bS(e=>e.popupProps),popupElement:bS(e=>e.popupElement),positionerElement:bS(e=>e.positionerElement)};function VS(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=ry(),a=sy()!=null,o=Tg(()=>new kS({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new LS,floatingId:i,nested:a,noEmit:e.noEmit||!1})).current;return bg(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Ig(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o.context.noEmit=e.noEmit||!1,o}function HS(e={}){let{nodeId:t,externalTree:n}=e,r=VS(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=z.useState(null),c=z.useRef(null),l=cy(n);bg(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=Ux({...e,elements:{...a,...o&&{reference:o}}}),d=z.useCallback(e=>{let t=Ig(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=z.useState(null),[m,h]=z.useState(null);i.useSyncedValue(`referenceElement`,f),i.useSyncedValue(`domReferenceElement`,Ig(f)?f:null),i.useSyncedValue(`floatingElement`,m);let g=z.useCallback(e=>{(Ig(e)||e===null)&&(c.current=e,p(e)),(Ig(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!Ig(e))&&u.refs.setReference(e)},[u.refs,p]),_=z.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),v=z.useMemo(()=>({...u.refs,setReference:g,setFloating:_,setPositionReference:d,domReference:c}),[u.refs,g,_,d]),y=z.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),b=i.useState(`open`),x=i.useState(`floatingId`),S=z.useMemo(()=>({...u,dataRef:i.context.dataRef,open:b,onOpenChange:i.setOpen,events:i.context.events,floatingId:x,refs:v,elements:y,nodeId:t,rootStore:i}),[u,v,y,t,i,b,x]);return bg(()=>{i.context.dataRef.current.floatingContext=S;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),z.useMemo(()=>({...u,context:S,refs:v,elements:y,rootStore:i}),[u,v,y,S,i])}function US(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=ry(),o=sy()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=Tg(()=>new kS({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return bg(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};Ig(c)&&(e.domReferenceElement=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var WS=__&&h_;function GS(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,visibleOnly:o=!0}=t,s=z.useRef(!1),c=Ag(),l=z.useRef(!0);z.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=Ng(e);function r(){!n.select(`open`)&&Lg(e)&&e===w_(k_(e))&&(s.current=!0)}function i(){l.current=!0}function o(){l.current=!1}return t.addEventListener(`blur`,r),WS&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,o,!0)),()=>{t.removeEventListener(`blur`,r),WS&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,o,!0))}},[n,a]),z.useEffect(()=>{if(!a)return;function e(e){(e.reason===`trigger-press`||e.reason===`escape-key`)&&(s.current=!0)}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a]);let u=z.useMemo(()=>({onMouseLeave(){s.current=!1},onFocus(e){if(s.current)return;let t=E_(e.nativeEvent);if(o&&Ig(t)){if(WS&&!e.relatedTarget){if(!l.current&&!A_(t))return}else if(!M_(t))return}n.setOpen(!0,Cy(gy,e.nativeEvent,e.currentTarget))},onBlur(e){s.current=!1;let t=e.relatedTarget,r=e.nativeEvent,a=Ig(t)&&t.hasAttribute(wy(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;c.start(0,()=>{let o=n.select(`domReferenceElement`),s=w_(o?o.ownerDocument:document);!t&&s===o||T_(i.current.floatingContext?.refs.floating.current,s)||T_(o,s)||a||n.context.triggerElements.hasElement(e.relatedTarget)||n.setOpen(!1,Cy(gy,r))})}}),[i,n,o,c]);return z.useMemo(()=>a?{reference:u,trigger:u}:{},[a,u])}var KS=wy(`safe-polygon`),qS=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${C_}`;function JS(e){return e?!!e.closest(qS):!1}function YS(e){let t=z.useRef(void 0),n=z.useRef(!1),r=z.useRef(void 0),i=z.useRef(!0),a=z.useRef(!1),o=z.useRef(()=>{}),s=z.useRef(!1),c=Ag(),l=Ag(),u=z.useRef(void 0);return z.useMemo(()=>{let d=e.context.dataRef.current;return d.hoverInteractionState||={pointerTypeRef:t,interactedInsideRef:n,handlerRef:r,blockMouseMoveRef:i,performedPointerEventsMutationRef:a,unbindMouseMoveRef:o,restTimeoutPendingRef:s,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u},d.hoverInteractionState},[e,t,n,r,i,a,o,s,c,l,u])}var XS=new Set([`click`,`mousedown`]);function ZS(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:d,handlerRef:f,performedPointerEventsMutationRef:p,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:g,handleCloseOptionsRef:_}=YS(n),v=cy(l),y=sy(),b=o_(()=>d.current?!0:o.current.openEvent?XS.has(o.current.openEvent.type):!1),x=o_(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),S=z.useCallback((e,t=!0)=>{let r=QS(c,u.current);r&&!f.current?g.start(r,()=>n.setOpen(!1,Cy(hy,e))):t&&(g.clear(),n.setOpen(!1,Cy(hy,e)))},[c,f,n,u,g]),C=o_(()=>{m.current(),f.current=void 0}),w=o_(()=>{if(p.current){let e=k_(i).body;e.style.pointerEvents=``,e.removeAttribute(KS),p.current=!1}}),T=o_(e=>{if(!JS(E_(e))){d.current=!1;return}d.current=!0});bg(()=>{r||(u.current=void 0,h.current=!1,d.current=!1,C(),w())},[r,u,h,d,C,w]),z.useEffect(()=>()=>{C()},[C]),z.useEffect(()=>w,[w]),bg(()=>{if(s&&r&&_.current?.blockPointerEvents&&x()&&Ig(a)&&i){p.current=!0;let e=k_(i).body;e.setAttribute(KS,``);let t=a,n=i,r=v?.nodesRef.current.find(e=>e.id===y)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),e.style.pointerEvents=`none`,t.style.pointerEvents=`auto`,n.style.pointerEvents=`auto`,()=>{e.style.pointerEvents=``,t.style.pointerEvents=``,n.style.pointerEvents=``}}},[s,r,a,i,_,x,v,y,p]),z.useEffect(()=>{if(!s)return;function e(e){if(b()||!o.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||(w(),C(),b()||S(e))}function t(e){g.clear(),w(),f.current?.(e),C()}function r(e){b()||S(e,!1)}let a=i;return a&&(a.addEventListener(`mouseleave`,e),a.addEventListener(`mouseenter`,t),a.addEventListener(`mouseleave`,r),a.addEventListener(`pointerdown`,T,!0)),()=>{a&&(a.removeEventListener(`mouseleave`,e),a.removeEventListener(`mouseenter`,t),a.removeEventListener(`mouseleave`,r),a.removeEventListener(`pointerdown`,T,!0))}})}function QS(e,t){return t&&!B_(t)?0:typeof e==`function`?e():e}function $S(e){return typeof e==`function`?e():e}var eC={current:null};function tC(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=eC,externalTree:f,isActiveTrigger:p=!0}=t,m=cy(f),{pointerTypeRef:h,interactedInsideRef:g,handlerRef:_,blockMouseMoveRef:v,performedPointerEventsMutationRef:y,unbindMouseMoveRef:b,restTimeoutPendingRef:x,openChangeTimeout:S,restTimeout:C,handleCloseOptionsRef:w}=YS(n),T=n_(s),E=n_(o),D=n_(l);p&&(w.current=T.current?.__options);let O=o_(()=>g.current?!0:r.current.openEvent?[`click`,`mousedown`].includes(r.current.openEvent.type):!1),ee=z.useCallback((e,t=!0)=>{let r=Ty(E.current,`close`,h.current);r&&!_.current?S.start(r,()=>n.setOpen(!1,Cy(hy,e))):t&&(S.clear(),n.setOpen(!1,Cy(hy,e)))},[E,_,n,h,S]),k=o_(()=>{b.current(),_.current=void 0}),A=o_(()=>{if(y.current){let e=k_(n.select(`domReferenceElement`)).body;e.style.pointerEvents=``,e.removeAttribute(KS),y.current=!1}});z.useEffect(()=>{if(!a)return;function e(e){e.open||(S.clear(),C.clear(),v.current=!0,x.current=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,S,C,v,x]);let j=o_(e=>{if(O()||!r.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||T.current?.({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){A(),k(),O()||ee(e)}})(e)});return z.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!Ig(e))return;function t(e){if(S.clear(),v.current=!1,c&&!B_(h.current)||$S(D.current)>0&&!Ty(E.current,`open`))return;let t=Ty(E.current,`open`,h.current),r=n.select(`domReferenceElement`),i=n.context.triggerElements,a=(i.hasElement(e.target)||i.hasMatchingElement(t=>T_(t,e.target)))&&(!r||!T_(r,e.target)),o=e.currentTarget??null;t?S.start(t,()=>{n.select(`open`)||n.setOpen(!0,Cy(hy,e,o))}):(!n.select(`open`)||a)&&n.setOpen(!0,Cy(hy,e,o))}function i(e){if(O()){A();return}b.current();let t=k_(n.select(`domReferenceElement`));C.clear(),x.current=!1;let i=n.context.triggerElements;if(!(e.relatedTarget&&i.hasElement(e.relatedTarget))){if(T.current&&r.current.floatingContext){n.select(`open`)||S.clear(),_.current=T.current({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){A(),k(),O()||ee(e,!0)}});let i=_.current;i(e),t.addEventListener(`mousemove`,i),b.current=()=>{t.removeEventListener(`mousemove`,i)};return}(h.current!==`touch`||!T_(n.select(`floatingElement`),e.relatedTarget))&&ee(e)}}function o(e){j(e)}return n.select(`open`)&&e.addEventListener(`mouseleave`,o),u&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,i),()=>{e.removeEventListener(`mouseleave`,o),u&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,i)}},[k,A,v,r,E,ee,n,a,T,j,p,O,c,u,h,D,C,x,S,d,m,b,_]),z.useMemo(()=>{function e(e){h.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.context.triggerElements,o=n.select(`open`),s=(a.hasElement(e.target)||a.hasMatchingElement(t=>T_(t,e.target)))&&(!i||!T_(i,e.target));if(c&&!B_(h.current)||o&&!s||$S(D.current)===0||!s&&x.current&&e.movementX**2+e.movementY**2<2)return;C.clear();function l(){!v.current&&(!o||s)&&n.setOpen(!0,Cy(hy,t,r))}h.current===`touch`?xi.flushSync(()=>{l()}):s&&o?l():(x.current=!0,C.start($S(D.current),l))}}},[v,c,n,h,D,C,x])}function nC(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=z.useCallback(t=>rC(t,e,`reference`),t),o=z.useCallback(t=>rC(t,e,`floating`),n),s=z.useCallback(t=>rC(t,e,`item`),r),c=z.useCallback(t=>rC(t,e,`trigger`),i);return z.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function rC(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[S_]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&iC(a,s,i,r)}return iC(a,e,i,r),a}function iC(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var aC=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function oC(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{enabled:s=!0,role:c=`dialog`}=t,l=ry(),u=a?.id||l,d=z.useMemo(()=>N_(o)?.id||i,[o,i]),f=aC.get(c)??c,p=sy()!=null,m=z.useMemo(()=>f===`tooltip`||c===`label`?uy:{"aria-haspopup":f===`alertdialog`?`dialog`:f,"aria-expanded":`false`,...f===`listbox`&&{role:`combobox`},...f===`menu`&&p&&{role:`menuitem`},...c===`select`&&{"aria-autocomplete":`none`},...c===`combobox`&&{"aria-autocomplete":`list`}},[f,p,c]),h=z.useMemo(()=>f===`tooltip`||c===`label`?{[`aria-${c===`label`?`labelledby`:`describedby`}`]:r?d:void 0}:{...m,"aria-expanded":r?`true`:`false`,"aria-controls":r?d:void 0,...f===`menu`&&{id:u}},[f,d,r,u,c,m]),g=z.useMemo(()=>{let e={id:d,...f&&{role:f}};return f===`tooltip`||c===`label`?e:{...e,...f===`menu`&&{"aria-labelledby":u}}},[f,d,u,c]),_=z.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${d}-fui-option`}};switch(c){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[d,c]);return z.useMemo(()=>s?{reference:h,floating:g,item:_,trigger:m}:{},[s,h,g,m,_])}function sC(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function cC(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function lC(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new kg,a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=({x:e,y:n,placement:o,elements:s,onClose:c,nodeId:u,tree:d})=>function(f){function p(){i.clear(),c()}if(i.clear(),!s.domReference||!s.floating||o==null||e==null||n==null)return;let{clientX:m,clientY:h}=f,g=[m,h],_=E_(f),v=f.type===`mouseleave`,y=T_(s.floating,_),b=T_(s.domReference,_),x=s.domReference.getBoundingClientRect(),S=s.floating.getBoundingClientRect(),C=o.split(`-`)[0],w=e>S.right-S.width/2,T=n>S.bottom-S.height/2,E=cC(g,x),D=S.width>x.width,O=S.height>x.height,ee=(D?x:S).left,k=(D?x:S).right,A=(O?x:S).top,j=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&Ig(f.relatedTarget)&&T_(s.floating,f.relatedTarget)||d&&P_(d.nodesRef.current,u).some(({context:e})=>e?.open))return;if(C===`top`&&n>=x.bottom-1||C===`bottom`&&n<=x.top+1||C===`left`&&e>=x.right-1||C===`right`&&e<=x.left+1)return p();let M=[];switch(C){case`top`:M=[[ee,x.top+1],[ee,S.bottom-1],[k,S.bottom-1],[k,x.top+1]];break;case`bottom`:M=[[ee,S.top+1],[ee,x.bottom-1],[k,x.bottom-1],[k,S.top+1]];break;case`left`:M=[[S.right-1,j],[S.right-1,A],[x.left+1,A],[x.left+1,j]];break;case`right`:M=[[x.right-1,j],[x.right-1,A],[S.left+1,A],[S.left+1,j]];break;default:}function N([e,n]){switch(C){case`top`:return[[D?e+t/2:w?e+t*4:e-t*4,n+t+1],[D?e-t/2:w?e+t*4:e-t*4,n+t+1],...[[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]]];case`bottom`:return[[D?e+t/2:w?e+t*4:e-t*4,n-t],[D?e-t/2:w?e+t*4:e-t*4,n-t],...[[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]]];case`left`:{let r=[e+t+1,O?n+t/2:T?n+t*4:n-t*4],i=[e+t+1,O?n-t/2:T?n+t*4:n-t*4];return[...[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom]],r,i]}case`right`:return[[e-t,O?n+t/2:T?n+t*4:n-t*4],[e-t,O?n-t/2:T?n+t*4:n-t*4],...[[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]];default:return[]}}if(!sC([m,h],M)){if(a&&!E)return p();if(!v&&r){let e=l(f.clientX,f.clientY);if(e!==null&&e<.1)return p()}sC([m,h],N([e,n]))?!a&&r&&i.start(40,p):p()}};return u.__options={blockPointerEvents:n},u}var uC={...BS,disabled:bS(e=>e.disabled),instantType:bS(e=>e.instantType),isInstantPhase:bS(e=>e.isInstantPhase),trackCursorAxis:bS(e=>e.trackCursorAxis),disableHoverablePopup:bS(e=>e.disableHoverablePopup),lastOpenChangeReason:bS(e=>e.openChangeReason),closeDelay:bS(e=>e.closeDelay)},dC=class e extends DS{constructor(e){super({...fC(),...e},{popupRef:z.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new LS},uC)}setOpen=(e,t)=>{let n=t.reason,r=n===hy,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?xi.flushSync(o):o()};static useStore(t,n){let r=Tg(()=>t??new e(n)).current,i=US({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}};function fC(){return{...zS(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function pC(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=dC.useStore(l?.store,{open:r??n,activeTriggerId:u===void 0?d:u});p.useControlledProp(`open`,r,n),p.useControlledProp(`activeTriggerId`,u,d),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=p.useState(`activeTriggerId`),g=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i});let _=!t&&m;bg(()=>{m&&t&&p.setOpen(!1,Cy(xy))},[m,t,p]),p.useSyncedValue(`disabled`,t),FS(p);let{forceUnmount:v,transitionStatus:y}=IS(_,p),b=p.useState(`isInstantPhase`),x=p.useState(`instantType`),S=p.useState(`lastOpenChangeReason`),C=z.useRef(null);bg(()=>{y===`ending`&&S===`none`||y!==`ending`&&b?(x!==`delay`&&(C.current=x),p.set(`instantType`,`delay`)):C.current!==null&&(p.set(`instantType`,C.current),C.current=null)},[y,b,S,x,p]),bg(()=>{_&&(h??p.set(`payload`,void 0))},[p,h,_]);let w=z.useCallback(()=>{p.setOpen(!1,mC(p,Sy))},[p]);z.useImperativeHandle(o,()=>({unmount:v,close:w}),[v,w]);let T=p.useState(`floatingRootContext`),{getReferenceProps:E,getFloatingProps:D,getTriggerProps:O}=nC([GS(T,{enabled:!t}),Qx(T,{enabled:!t,referencePress:!0}),Bb(T,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),ee=z.useMemo(()=>E(),[E]),k=z.useMemo(()=>O(),[O]),A=z.useMemo(()=>D(),[D]);return p.useSyncedValues({floatingRootContext:T,activeTriggerProps:ee,inactiveTriggerProps:k,popupProps:A}),(0,B.jsx)(Sg.Provider,{value:p,children:typeof f==`function`?f({payload:g}):f})}function mC(e,t){let n=Cy(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}var hC=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),gC={[hC.startingStyle]:``},_C={[hC.endingStyle]:``},vC={transitionStatus(e){return e===`starting`?gC:e===`ending`?_C:null}},yC=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=hC.startingStyle]=`startingStyle`,e[e.endingStyle=hC.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e}({}),bC=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),xC={[bC.popupOpen]:``};bC.popupOpen,bC.pressed;var SC={[yC.open]:``},CC={[yC.closed]:``},wC={[yC.anchorHidden]:``},TC={open(e){return e?xC:null}},EC={open(e){return e?SC:CC},anchorHidden(e){return e?wC:null}};function DC(e){return ry(e,`base-ui`)}var OC=z.createContext(void 0);function kC(){return z.useContext(OC)}var AC=z.forwardRef(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeDelay:c,id:l,...u}=e,d=Cg(!0),f=i?.store??d;if(!f)throw Error(xg(82));let p=DC(l),m=f.useState(`isTriggerActive`,p),h=f.useState(`floatingRootContext`),g=f.useState(`isOpenedByTrigger`,p),_=z.useRef(null),v=s??600,y=c??0,{registerTrigger:b,isMountedByThisTrigger:x}=PS(p,_,f,{payload:a,closeDelay:y}),S=kC(),{delayRef:C,isInstantPhase:w,hasProvider:T}=Oy(h,{open:g});f.useSyncedValue(`isInstantPhase`,w);let E=f.useState(`disabled`),D=o??E,O=f.useState(`trackCursorAxis`),ee=f.useState(`disableHoverablePopup`),k=tC(h,{enabled:!D,mouseOnly:!0,move:!1,handleClose:!ee&&O!==`both`?lC():null,restMs(){let e=S?.delay,t=typeof C.current==`object`?C.current.open:void 0,n=v;return T&&(n=t===0?0:s??e??v),n},delay(){let e=typeof C.current==`object`?C.current.close:void 0,t=y;return c==null&&T&&(t=e),{close:t}},triggerElementRef:_,isActiveTrigger:m}),A=z.useMemo(()=>({open:g}),[g]),j=f.useState(`triggerProps`,x);return vb(`button`,e,{state:A,ref:[t,b,_],props:[k,j,{id:p},u],stateAttributesMapping:TC})}),jC=z.createContext(void 0);function MC(){let e=z.useContext(jC);if(e===void 0)throw Error(xg(70));return e}var NC=z.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,...o}=e,{portalNode:s,portalSubtree:c}=Tb({container:r,ref:t,componentProps:e,elementProps:o});return!c&&!s?null:(0,B.jsxs)(z.Fragment,{children:[c,s&&xi.createPortal(n,s)]})}),PC=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Cg().useState(`mounted`)||n?(0,B.jsx)(jC.Provider,{value:n,children:(0,B.jsx)(NC,{ref:t,...r})}):null}),FC=z.createContext(void 0);function IC(){let e=z.useContext(FC);if(e===void 0)throw Error(xg(71));return e}var LC=z.createContext(void 0);function RC(){return z.useContext(LC)?.direction??`ltr`}var zC=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=X_(e,t)||{};if(l==null)return{};let f=mv(u),p={x:n,y:r},m=nv(i),h=ev(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),ee=D,k=w-g[h]-O,A=w/2-g[h]/2+T,j=Y_(ee,A,k),M=!c.arrow&&Q_(i)!=null&&A!==j&&a.reference[h]/2-(A<ee?D:O)-g[h]/2<0,N=M?A<ee?A-ee:A-k:0;return{[m]:p[m]+N,data:{[m]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),BC=(e,t)=>({...zC(e),options:[e,t]}),VC={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Yx().fn(e)).data?.referenceHidden||a}}}},HC={sideX:`left`,sideY:`top`},UC={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=Ng(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:HC};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=By(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Z_(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:HC.sideX,g=f===`top`?`bottom`:HC.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function WC(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function GC(e,t,n){let{rects:r,placement:i}=e;return{side:WC(t,Z_(i),n),align:Q_(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function KC(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:b}=e,[x,S]=z.useState(null);!m&&x!==null&&S(null);let C=h.side||`flip`,w=h.align||`flip`,T=h.fallbackAxisSide||`end`,E=typeof t==`function`?t:void 0,D=o_(E),O=E?D:t,ee=n_(t),k=RC()===`rtl`,A=x||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":k?`left`:`right`,"inline-start":k?`right`:`left`}[r],j=a===`center`?A:`${A}-${a}`,M=c,N=+(r===`bottom`),te=+(r===`top`),P=+(r===`right`),ne=+(r===`left`);typeof M==`number`?M={top:M+N,right:M+ne,bottom:M+te,left:M+P}:M&&={top:(M.top||0)+N,right:(M.right||0)+ne,bottom:(M.bottom||0)+te,left:(M.left||0)+P};let re={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:M},ie=z.useRef(null),F=n_(i),I=n_(o),ae=[Wx(e=>{let t=GC(e,r,k),n=typeof F.current==`function`?F.current(t):F.current,i=typeof I.current==`function`?I.current(t):I.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,k,r])],oe=w===`none`&&C!==`shift`,L=!oe&&(l||g||C===`shift`),R=C===`none`?null:qx({...re,padding:{top:M.top+1,right:M.right+1,bottom:M.bottom+1,left:M.left+1},mainAxis:!g&&C===`flip`,crossAxis:w===`flip`?`alignment`:!1,fallbackAxisSideDirection:T}),se=oe?null:Gx(e=>{let t=By(e.elements.floating).documentElement;return{...re,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:w!==`none`,crossAxis:L,limiter:l||g?void 0:Kx(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=tv(Z_(e.placement)),i=r===`y`?t:n,a=r===`y`?M.left+M.right:M.top+M.bottom;return{offset:i/2+a/2}})}},[re,l,g,M,w]);C===`shift`||w===`shift`||a===`center`?ae.push(se,R):ae.push(R,se),ae.push(Jx({...re,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){Object.entries({"--available-width":`${n}px`,"--available-height":`${r}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,n])=>{e.style.setProperty(t,n)})}}),BC(()=>({element:ie.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Z_(a),l=tv(c),u=ie.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(GC(e,r,k)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,L&&l===`y`&&b?S:x),{}}},VC,v),bg(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);let ce=z.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:le,elements:ue,x:de,y:fe,middlewareData:pe,update:me,placement:he,context:ge,isPositioned:_e,floatingStyles:ve}=HS({rootContext:p,placement:j,middleware:ae,strategy:n,whileElementsMounted:f?void 0:(...e)=>Ax(...e,ce),nodeId:_,externalTree:b}),{sideX:ye,sideY:be}=pe.adaptiveOrigin||HC,xe=_e?n:`fixed`,Se=z.useMemo(()=>v?{position:xe,[ye]:de,[be]:fe}:{position:xe,...ve},[v,xe,ye,de,be,fe,ve]),Ce=z.useRef(null);bg(()=>{if(!m)return;let e=ee.current,t=typeof e==`function`?e():e,n=(qC(t)?t.current:t)||null;n!==Ce.current&&(le.setPositionReference(n),Ce.current=n)},[m,le,O,ee]),z.useEffect(()=>{if(!m)return;let e=ee.current;typeof e!=`function`&&qC(e)&&e.current!==Ce.current&&(le.setPositionReference(e.current),Ce.current=e.current)},[m,le,O,ee]),z.useEffect(()=>{if(f&&m&&ue.domReference&&ue.floating)return Ax(ue.domReference,ue.floating,me,ce)},[f,m,ue,me,ce]);let we=Z_(he),Te=WC(r,we,k),Ee=Q_(he)||`center`,De=!!pe.hide?.referenceHidden;bg(()=>{y&&m&&_e&&S(we)},[y,m,_e,we]);let Oe=z.useMemo(()=>({position:`absolute`,top:pe.arrow?.y,left:pe.arrow?.x}),[pe.arrow]),ke=pe.arrow?.centerOffset!==0;return z.useMemo(()=>({positionerStyles:Se,arrowStyles:Oe,arrowRef:ie,arrowUncentered:ke,side:Te,align:Ee,physicalSide:we,anchorHidden:De,refs:le,context:ge,isPositioned:_e,update:me}),[Se,Oe,ie,ke,Te,Ee,we,De,le,ge,_e,me])}function qC(e){return e!=null&&`current`in e}function JC(e){return e===`starting`?dy:uy}var YC=z.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=fy,...g}=e,_=Cg(),v=MC(),y=_.useState(`open`),b=_.useState(`mounted`),x=_.useState(`trackCursorAxis`),S=_.useState(`disableHoverablePopup`),C=_.useState(`floatingRootContext`),w=_.useState(`instantType`),T=_.useState(`transitionStatus`),E=KC({anchor:i,positionMethod:a,floatingRootContext:C,mounted:b,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:v,collisionAvoidance:h,adaptiveOrigin:UC}),D=z.useMemo(()=>{let e={};return(!y||x===`both`||S)&&(e.pointerEvents=`none`),{role:`presentation`,hidden:!b,style:{...E.positionerStyles,...e}}},[y,x,S,b,E.positionerStyles]),O=z.useMemo(()=>({open:y,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:x===`none`?w:`tracking-cursor`}),[y,E.side,E.align,E.anchorHidden,x,w]),ee=z.useMemo(()=>({...O,arrowRef:E.arrowRef,arrowStyles:E.arrowStyles,arrowUncentered:E.arrowUncentered}),[O,E.arrowRef,E.arrowStyles,E.arrowUncentered]),k=vb(`div`,e,{state:O,props:[D,JC(T),g],ref:[t,_.useStateSetter(`positionerElement`)],stateAttributesMapping:EC});return(0,B.jsx)(FC.Provider,{value:ee,children:k})});function XC(e){let t=Xg(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Lg(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(G_(n)!==a||G_(r)!==o)&&(n=a,r=o),{width:n,height:r}}var ZC=typeof ResizeObserver<`u`,QC=()=>!0;function $C(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=QC,onMeasureLayout:o,onMeasureLayoutComplete:s,side:c,direction:l}=e,u=z.useRef(!0),d=jS(t,!0,!1),f=zy(),p=z.useRef(null),m=o_(o),h=o_(s),g=z.useMemo(()=>{let e=c===`top`,t=c===`left`;return l===`rtl`?(e||=c===`inline-end`,t||=c===`inline-end`):(e||=c===`inline-start`,t||=c===`inline-start`),e?{position:`absolute`,[c===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:uy},[c,l]);bg(()=>{if(!i||!a()||!ZC){u.current=!0,p.current=null;return}if(!t||!n)return;Object.entries(g).forEach(([e,n])=>{t.style.setProperty(e,n)});let e=new ResizeObserver(e=>{let t=e[0];t&&(p.current===null?p.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)}:(p.current.width=Math.ceil(t.borderBoxSize[0].inlineSize),p.current.height=Math.ceil(t.borderBoxSize[0].blockSize)))});e.observe(t),t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`);let r=ew(t,`position`,`static`),o=ew(t,`transform`,`none`),s=ew(t,`scale`,`1`),c=ew(n,`--available-width`,`max-content`),l=ew(n,`--available-height`,`max-content`);if(m?.(),u.current||p.current===null){n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let i=XC(t);return n.style.setProperty(`--positioner-width`,`${i.width}px`),n.style.setProperty(`--positioner-height`,`${i.height}px`),r(),o(),s(),c(),l(),h?.(null,i),u.current=!1,()=>{e.disconnect()}}t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`),n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let _=XC(t);t.style.setProperty(`--popup-width`,`${p.current.width}px`),t.style.setProperty(`--popup-height`,`${p.current.height}px`),r(),o(),c(),l(),h?.(p.current,_),n.style.setProperty(`--positioner-width`,`${_.width}px`),n.style.setProperty(`--positioner-height`,`${_.height}px`);let v=new AbortController;return f.request(()=>{t.style.setProperty(`--popup-width`,`${_.width}px`),t.style.setProperty(`--popup-height`,`${_.height}px`),d(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},v.signal)}),()=>{e.disconnect(),v.abort(),f.cancel()}},[r,t,n,d,f,a,i,m,h,g])}function ew(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}var tw={...EC,...vC},nw=z.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=Cg(),{side:o,align:s}=IC(),c=a.useState(`open`),l=a.useState(`mounted`),u=a.useState(`instantType`),d=a.useState(`transitionStatus`),f=a.useState(`popupProps`),p=a.useState(`payload`),m=a.useState(`popupElement`),h=a.useState(`positionerElement`),g=a.useState(`floatingRootContext`),_=RC();MS({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}});function v(){g.context.events.emit(`measure-layout`)}function y(e,t){g.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}$C({popupElement:m,positionerElement:h,mounted:l,content:p,enabled:()=>a.context.triggerElements.size>1,onMeasureLayout:v,onMeasureLayoutComplete:y,side:o,direction:_});let b=a.useState(`disabled`),x=a.useState(`closeDelay`);return ZS(g,{enabled:!b,closeDelay:x}),vb(`div`,e,{state:z.useMemo(()=>({open:c,side:o,align:s,instant:u,transitionStatus:d}),[c,o,s,u,d]),ref:[t,a.context.popupRef,a.useStateSetter(`popupElement`)],props:[f,JC(d),i],stateAttributesMapping:tw})}),rw=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=z.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=z.useMemo(()=>({open:t,close:n}),[t,n]);return(0,B.jsx)(OC.Provider,{value:i,children:(0,B.jsx)(Dy,{delay:a,timeoutMs:r,children:e.children})})};function iw(e){return eb(19)?e:e?`true`:void 0}var aw=rw,ow=pC,sw=AC;function cw({className:e,children:t,...n}){return(0,B.jsx)(PC,{children:(0,B.jsx)(YC,{sideOffset:6,children:(0,B.jsx)(nw,{className:mg(`z-50 overflow-hidden rounded-sm border border-hairline bg-popover px-3 py-1.5 text-xs font-normal text-popover-foreground shadow-popover`,e),...n,children:t})})})}var lw=[`system`,`light`,`dark`],uw={dark:`Dark`,light:`Light`,system:`System`},dw={dark:Tm,light:Im,system:wm};function fw(e){return lw[(lw.indexOf(e)+1)%lw.length]??`system`}function pw({className:e}){let t=Ga(e=>e.theme),n=Ga(e=>e.setTheme),r=dw[t],i=uw[t];return(0,B.jsxs)(ow,{children:[(0,B.jsx)(sw,{render:(0,B.jsx)(yg,{"aria-label":`Theme: ${i}`,size:`icon`,variant:`ghost`,className:e,onClick:()=>n(fw(t)),children:(0,B.jsx)(r,{className:`size-4`})})}),(0,B.jsxs)(cw,{children:[`Theme:`,` `,i]})]})}function mw({className:e,type:t,...n}){return(0,B.jsx)(`input`,{type:t,className:mg(`flex min-h-11 w-full rounded-xs border border-input bg-background px-4 py-2 text-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-form-focus focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,e),...n})}function hw({className:e,...t}){return(0,B.jsx)(`label`,{className:mg(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,e),...t})}function gw({className:e,orientation:t=`horizontal`,...n}){return(0,B.jsx)(`div`,{role:`separator`,"aria-orientation":t,className:mg(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...n})}var _w=class extends Error{code;details;constructor(e,t,n){super(t),this.name=`WebApiError`,this.code=e,this.details=n}};async function vw(e,t){let n;try{n=await fetch(e,t)}catch(e){throw new _w(`network`,e instanceof Error?e.message:String(e))}if(!n.ok){let e=await n.text().catch(()=>``);throw new _w(`http_${n.status}`,e||n.statusText)}return await n.json()}var yw=`/api/worker`;function bw(e=globalThis.location?.pathname??`/admin/`){let t=Cw(e);return t?`/w/${t}${yw}`:yw}function xw(e=globalThis.location?.pathname??`/admin/`){return Cw(e)!==null}function Sw(e){let t=e.startsWith(`/`)?e:`/${e}`;return t===yw||t.startsWith(`${yw}/`)?`${bw()}${t.slice(11)}`:`${bw()}${t}`}function Cw(e){let t=/^\/w\/([^/]+)(?:\/|$)/.exec(e);if(!t)return null;let n=t[1];return Jf.test(n)?n:null}var ww=class extends Error{code;status;details;expectedVersion;actualVersion;constructor(e,t,n={}){super(t),this.name=`WorkerApiError`,this.code=e,this.status=n.status,this.details=n.details,this.expectedVersion=n.expected,this.actualVersion=n.actual}};async function Tw(e,t={}){let n=new Headers(t.headers),r=em();r&&!n.has(`Authorization`)&&n.set(`Authorization`,`Bearer ${r}`);let i;try{i=await fetch(Sw(e),{...t,headers:n})}catch(e){throw new ww(`network`,e instanceof Error?e.message:String(e))}let a=await i.text(),o=null;if(a.length>0)try{o=JSON.parse(a)}catch{o=a}if(!i.ok){if(o&&typeof o==`object`&&`error`in o){let e=o.error;if(typeof e==`string`)throw new ww(Ew(i.status),e,{status:i.status});if(e&&typeof e==`object`){let t=e;throw new ww(typeof t.code==`string`?Dw(t.code):Ew(i.status),typeof t.message==`string`?t.message:i.statusText,{status:i.status,details:t.details,...typeof t.expected==`number`?{expected:t.expected}:{},...typeof t.actual==`number`?{actual:t.actual}:{}})}}if(o&&typeof o==`object`){let e=o;if(typeof e.message==`string`||typeof e.code==`string`)throw new ww(typeof e.code==`string`?Dw(e.code):Ew(i.status),typeof e.message==`string`?e.message:i.statusText,{status:i.status,details:e.details})}throw new ww(Ew(i.status),a||i.statusText,{status:i.status})}return o}function Ew(e){return e===401||e===403?`auth-required`:e===404?`not-found`:e===409?`version-conflict`:e>=400&&e<500?`invalid-body`:`http-error`}function Dw(e){return e===`auth-failed`||e===`auth_failed`||e===`auth_required`?`auth-required`:[`auth-required`,`invalid-body`,`invalid-config`,`invalid-cron`,`invalid-key`,`version-conflict`,`invalid-if-match`,`not-found`].includes(e)?e:`unknown`}async function Ow(){if(xw()){let e=await kw();return{mode:`worker`,workerId:e.workerId,status:`ok`,configVersion:e.configVersion,startedAt:e.startedAt,checkedAt:new Date().toISOString(),brain:e.brains[0]?{status:e.brains[0].status}:null,executor:e.executor?{status:e.executor.status}:null}}return await vw(`/health`)}function kw(){return Tw(`/api/worker/info`)}function Aw(){return Tw(`/api/worker/config`)}async function jw(e,t){return await Tw(`/api/worker/config`,{method:`PUT`,headers:{"Content-Type":`application/json`,"If-Match":String(t)},body:JSON.stringify(e)})}function Mw(e={}){return Tw(`/api/worker/engines${e.refresh?`?refresh=1`:``}`)}function Nw(){return Tw(`/api/worker/secrets`)}async function Pw(e,t){await Tw(`/api/worker/secrets/${encodeURIComponent(e)}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({value:t})})}async function Fw(e){await Tw(`/api/worker/secrets/${encodeURIComponent(e)}`,{method:`DELETE`})}function Iw(){return Tw(`/api/worker/brain/test`,{method:`POST`,headers:{"Content-Type":`application/json`},body:`{}`})}var Lw=12e3;async function Rw(e={},t={}){let n=t.timeoutMs??Lw,r=new AbortController,i=!1,a=setTimeout(()=>{i=!0,r.abort()},n);try{return await Tw(`/api/worker/executor/test`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e),signal:r.signal})}catch(e){throw i?new ww(`network`,`executor test timed out after ${n}ms`):e}finally{clearTimeout(a)}}function zw(e,t={}){return Tw(`/api/worker/channels/${e}/test`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})}function Bw(){return Tw(`/api/worker/cron`)}async function Vw(e){return(await Tw(`/api/worker/cron`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).job}async function Hw(e,t){return(await Tw(`/api/worker/cron/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})).job}async function Uw(e){await Tw(`/api/worker/cron/${encodeURIComponent(e)}`,{method:`DELETE`})}function Ww(){return Tw(`/api/worker/approvals`)}async function Gw(e,t,n){return await Tw(`/api/worker/approvals/${encodeURIComponent(e)}/${encodeURIComponent(t)}/grant`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({decision:n})})}async function Kw(e){return(await Tw(`/api/worker/orchestrator/tasks`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:e})})).task}async function qw(e,t){return(await Tw(`/api/worker/orchestrator/conversations/${encodeURIComponent(e)}/messages`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({prompt:t})})).task}function Jw(){return Tw(`/api/worker/orchestrator/conversations`)}function Yw(e){return Tw(`/api/worker/orchestrator/conversations/${encodeURIComponent(e)}/messages`)}async function Xw(e,t){let n=new Headers({Accept:`text/event-stream`}),r=em();r&&n.set(`Authorization`,`Bearer ${r}`);let i=await fetch(Sw(`/events/stream`),{headers:n,signal:e});if(!i.ok||!i.body)throw new ww(Ew(i.status),`events stream HTTP ${i.status}`,{status:i.status});let a=i.body.getReader(),o=new TextDecoder,s=``;try{for(;!e.aborted;){let{value:e,done:n}=await a.read();if(n)return;s+=o.decode(e,{stream:!0});let r=s.indexOf(`
|
|
1476
1362
|
|
|
1477
|
-
`);for(;r!==-1;){let e=s.slice(0,r);s=s.slice(r+2);let n=
|
|
1363
|
+
`);for(;r!==-1;){let e=s.slice(0,r);s=s.slice(r+2);let n=Zw(e);n&&t(n),r=s.indexOf(`
|
|
1478
1364
|
|
|
1479
|
-
`)}}}finally{try{a.cancel()}catch{}}}function
|
|
1365
|
+
`)}}}finally{try{a.cancel()}catch{}}}function Zw(e){let t=`message`,n=[];for(let r of e.split(`
|
|
1480
1366
|
`))r.startsWith(`event:`)?t=r.slice(6).trim():r.startsWith(`data:`)&&n.push(r.slice(5).trim());if(n.length===0)return null;let r=n.join(`
|
|
1481
|
-
`);try{return{type:t,data:JSON.parse(r)}}catch{return null}}function aT(){return Mw(`/api/worker/brain/summary`)}function oT(e={}){let t=new URLSearchParams;e.status!==void 0&&t.set(`status`,e.status),e.kind!==void 0&&t.set(`kind`,e.kind),e.scopeId!==void 0&&t.set(`scopeId`,e.scopeId),e.soulId!==void 0&&t.set(`soulId`,e.soulId),e.limit!==void 0&&t.set(`limit`,String(e.limit)),e.showSensitive===!0&&t.set(`showSensitive`,`true`);let n=t.toString();return n.length===0?``:`?${n}`}function sT(e={}){return Mw(`/api/worker/brain/admission${oT(e)}`)}async function cT(e,t){return Mw(`/api/worker/brain/admission/${encodeURIComponent(e)}/approve`,{body:JSON.stringify(t),headers:{"content-type":`application/json`},method:`POST`})}async function lT(e,t){return Mw(`/api/worker/brain/admission/${encodeURIComponent(e)}/reject`,{body:JSON.stringify(t),headers:{"content-type":`application/json`},method:`POST`})}async function uT(e,t){return Mw(`/api/worker/brain/admission/${encodeURIComponent(e)}/apply`,{body:JSON.stringify(t),headers:{"content-type":`application/json`},method:`POST`})}function dT(e={}){let t=new URLSearchParams;e.scopeId!==void 0&&t.set(`scopeId`,e.scopeId),e.type!==void 0&&t.set(`type`,e.type),e.status!==void 0&&t.set(`status`,e.status),e.minSensitivity!==void 0&&t.set(`minSensitivity`,e.minSensitivity),e.limit!==void 0&&t.set(`limit`,String(e.limit)),e.showSensitive===!0&&t.set(`showSensitive`,`true`);let n=t.toString();return Mw(`/api/worker/brain/artifacts${n.length===0?``:`?${n}`}`)}var fT=[`worker`,`health`],pT=[`worker`,`info`],mT=[`worker`,`config`],hT=[`worker`,`engines`],gT=[`worker`,`secrets`],_T=[`worker`,`approvals`],vT=[`worker`,`cron`],yT=[`worker`,`tasks`],bT=[`worker`,`conversations`],xT=[`worker`,`brain`,`summary`];function ST(e){return[`worker`,`conversations`,e,`messages`]}function CT(e){return[`worker`,`brain`,`admissions`,e]}function wT(e){return[`worker`,`brain`,`artifacts`,e]}function TT(){return $e({queryKey:fT,queryFn:Fw,refetchInterval:3e4,staleTime:1e4})}function ET(){return $e({queryKey:pT,queryFn:Iw,staleTime:15e3,refetchInterval:6e4})}function DT(){return $e({queryKey:mT,queryFn:Lw,staleTime:0})}function OT(){let e=Re();return et({mutationFn:({config:e,ifMatchVersion:t})=>Rw(e,t),onSuccess:t=>{e.setQueryData(mT,{config:t.config,version:t.version}),e.invalidateQueries({queryKey:pT})}})}function kT(){return $e({queryKey:hT,queryFn:()=>zw(),staleTime:10*6e4})}function AT(){let e=Re();return(0,z.useCallback)(async()=>{let t=await zw({refresh:!0});return e.setQueryData(hT,t),t},[e])}function jT(){return $e({queryKey:gT,queryFn:Bw,staleTime:1e4})}function MT(){let e=Re();return et({mutationFn:({key:e,value:t})=>Vw(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:gT})}})}function NT(){let e=Re();return et({mutationFn:e=>Hw(e),onSuccess:()=>{e.invalidateQueries({queryKey:gT})}})}function PT(){return et({mutationFn:()=>Uw()})}function FT(){return et({mutationFn:e=>Gw(e??{})})}function IT(){return et({mutationFn:({channel:e,chatId:t,text:n})=>Kw(e,{...t===void 0?{}:{chatId:t},...n===void 0?{}:{text:n}})})}function LT(){return $e({queryKey:vT,queryFn:qw,staleTime:15e3,refetchInterval:6e4})}function RT(){let e=Re();return et({mutationFn:Jw,onSuccess:()=>{e.invalidateQueries({queryKey:vT})}})}function zT(){let e=Re();return et({mutationFn:({id:e,patch:t})=>Yw(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:vT})}})}function BT(){let e=Re();return et({mutationFn:Xw,onSuccess:()=>{e.invalidateQueries({queryKey:vT})}})}function VT(){return $e({queryKey:_T,queryFn:Zw,refetchInterval:5e3,staleTime:1e3})}function HT(){let e=Re();return et({mutationFn:({taskId:e,toolCallId:t,decision:n})=>Qw(e,t,n),onSuccess:()=>{e.invalidateQueries({queryKey:_T})}})}function UT(){let e=Re();return et({mutationFn:e=>$w(e),onSuccess:()=>{e.invalidateQueries({queryKey:yT}),e.invalidateQueries({queryKey:bT})}})}function WT(){let e=Re();return et({mutationFn:({conversationId:e,prompt:t})=>eT(e,t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:yT}),e.invalidateQueries({queryKey:bT}),e.invalidateQueries({queryKey:ST(n.conversationId)})}})}function GT(){return $e({queryKey:bT,queryFn:tT,staleTime:15e3})}function KT(e){return $e({queryKey:e?ST(e):[`worker`,`conversations`,`__missing__`,`messages`],queryFn:()=>nT(e),enabled:!!e,staleTime:5e3})}function qT(){let e=Re();return(0,z.useCallback)(t=>{e.invalidateQueries({queryKey:ST(t)})},[e])}function JT(){let e=Re();return(0,z.useCallback)(()=>{e.invalidateQueries({queryKey:yT}),e.invalidateQueries({queryKey:bT})},[e])}function YT(){return $e({queryKey:xT,queryFn:aT,staleTime:15e3,refetchInterval:6e4})}function XT(e={}){return $e({queryKey:CT(e),queryFn:()=>sT(e),staleTime:1e4})}function ZT(){let e=Re();return et({mutationFn:({id:e,decidedBy:t,reason:n})=>cT(e,{decidedBy:t,...n===void 0?{}:{reason:n}}),onSuccess:()=>{e.invalidateQueries({queryKey:[`worker`,`brain`]})}})}function QT(){let e=Re();return et({mutationFn:({id:e,decidedBy:t,reason:n})=>lT(e,{decidedBy:t,...n===void 0?{}:{reason:n}}),onSuccess:()=>{e.invalidateQueries({queryKey:[`worker`,`brain`]})}})}function $T(){let e=Re();return et({mutationFn:({id:e,decidedBy:t,commit:n})=>uT(e,{decidedBy:t,...n===void 0?{}:{commit:n}}),onSuccess:()=>{e.invalidateQueries({queryKey:[`worker`,`brain`]})}})}function eE(e={}){return $e({queryKey:wT(e),queryFn:()=>dT(e),staleTime:15e3})}function tE(e){let{to:t,...n}=e;return(0,B.jsx)(Ni,{to:t,...n})}var nE=[{to:`/`,label:`概览`,exact:!0,icon:Sm},{to:`/brain`,label:`Brain`,icon:bm},{to:`/config`,label:`配置`,icon:Hm},{to:`/secrets`,label:`Secrets`,icon:Dm},{to:`/test`,label:`探测`,icon:qm},{to:`/cron`,label:`Cron`,icon:Wm},{to:`/approvals`,label:`Approvals`,icon:Vm},{to:`/chat`,label:`Chat`,icon:Am}];function rE(){let e=TT(),t=ET(),n=e.data?.workerId??t.data?.workerId??`—`,r=t.data?.configVersion??e.data?.configVersion??`—`,i=t.data?.executor,a=t.data?.brains?.length??0;return(0,B.jsxs)(`section`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-3 gap-y-3 bg-deep-green px-4 py-4 text-on-dark sm:px-6 md:grid-cols-[minmax(0,1fr)_auto] md:items-center lg:px-8`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,B.jsx)(`span`,{className:`text-micro uppercase text-on-dark/70`,children:`Worker`}),(0,B.jsx)(`code`,{className:`truncate font-mono text-sm font-medium`,children:n})]}),(0,B.jsxs)(`dl`,{className:`col-span-2 flex min-w-0 flex-wrap items-center gap-x-5 gap-y-2 text-xs md:col-span-1 md:col-start-2 md:row-start-1 md:justify-end`,children:[(0,B.jsx)(iE,{label:`config v`,value:String(r)}),(0,B.jsx)(iE,{label:`executor`,value:i?`${i.type}`:`—`,status:i?.status}),(0,B.jsx)(iE,{label:`brains`,value:String(a)}),(0,B.jsx)(iE,{label:`启动`,value:t.data?.startedAt?new Date(t.data.startedAt).toLocaleString():`—`})]})]})}function iE({label:e,value:t,status:n}){return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col border-l border-on-dark/20 pl-3`,children:[(0,B.jsx)(`dt`,{className:`text-micro uppercase text-on-dark/70`,children:e}),(0,B.jsx)(`dd`,{className:`max-w-[11rem] truncate font-mono text-xs ${n?n===`healthy`?`text-pale-green`:n===`down`?`text-coral-soft`:n===`degraded`?`text-warning-soft`:`text-on-dark/70`:`text-on-dark`}`,children:t})]})}function aE(){let[e,t]=(0,z.useState)(()=>sm());return e?(0,B.jsx)(fw,{delay:300,children:(0,B.jsxs)(`div`,{"data-testid":`worker-shell`,className:`flex h-dvh w-full flex-col overflow-hidden bg-background text-foreground`,children:[(0,B.jsxs)(`header`,{"data-testid":`worker-shell-header`,className:`grid shrink-0 gap-3 border-b border-hairline bg-background px-4 py-3 md:grid-cols-[minmax(12rem,1fr)_auto_minmax(12rem,1fr)] md:items-center md:px-8`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,B.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-sm border border-hairline bg-primary text-primary-foreground`,children:(0,B.jsx)(wm,{className:`size-4`})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`font-display text-lg leading-none text-foreground`,children:`AIWorker`}),(0,B.jsx)(`p`,{className:`text-micro text-muted-foreground`,children:`Worker`})]})]}),(0,B.jsx)(`nav`,{"data-testid":`worker-shell-nav`,className:`grid min-w-0 grid-cols-2 gap-1 sm:grid-cols-4 md:flex md:flex-wrap md:items-center md:justify-center`,children:nE.map(e=>{let t=e.icon;return(0,B.jsxs)(tE,{to:e.to,className:`flex min-w-0 items-center justify-center gap-2 rounded-xl border border-transparent px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:border-hairline hover:bg-soft-stone hover:text-foreground`,activeProps:{className:`!border-primary !bg-primary !text-primary-foreground hover:!border-primary hover:!bg-primary hover:!text-primary-foreground`},activeOptions:e.exact?{exact:!0}:void 0,children:[(0,B.jsx)(t,{className:`size-4 shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.label})]},e.to)})}),(0,B.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,B.jsx)(bw,{})})]}),(0,B.jsx)(rE,{}),(0,B.jsx)(Cw,{}),(0,B.jsx)(`main`,{className:`min-h-0 min-w-0 flex-1 overflow-auto px-4 py-6 sm:px-6 lg:px-8`,children:(0,B.jsx)(`div`,{className:`mx-auto w-full max-w-7xl`,children:(0,B.jsx)(Yi,{})})})]})}):(0,B.jsx)(oE,{onUnlock:e=>{cm(e),t(e)}})}function oE({onUnlock:e}){let[t,n]=(0,z.useState)(``),[r,i]=(0,z.useState)(null);function a(n){n.preventDefault();let r=t.trim();if(!r){i(`请输入 bearer token。`);return}i(null),e(r)}return(0,B.jsx)(`main`,{className:`flex min-h-screen w-full items-center justify-center bg-soft-stone px-4 py-8 text-foreground`,children:(0,B.jsxs)(`section`,{className:`flex w-full max-w-md flex-col gap-6 rounded-lg border border-card-border bg-card p-6 shadow-popover sm:p-8`,children:[(0,B.jsxs)(`header`,{className:`flex min-w-0 items-start gap-4`,children:[(0,B.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center rounded-sm border border-hairline bg-soft-stone`,children:(0,B.jsx)(km,{className:`size-5 text-muted-foreground`,"aria-hidden":`true`})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`text-micro uppercase text-muted-foreground`,children:`Worker Admin`}),(0,B.jsx)(`h1`,{className:`text-feature font-normal`,children:`需要 bearer token`})]})]}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`使用当前 worker token 解锁本 tab。`}),(0,B.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:a,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(Sw,{htmlFor:`worker-admin-token`,children:`Bearer token`}),(0,B.jsx)(xw,{id:`worker-admin-token`,autoComplete:`off`,value:t,onChange:e=>n(e.target.value),type:`password`})]}),r&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error`,children:r}),(0,B.jsxs)(Eg,{type:`submit`,children:[(0,B.jsx)(Dm,{"aria-hidden":`true`}),`解锁`]})]})]})})}var sE=Ri({component:aE}),cE=wg(`inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-normal leading-tight transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-primary bg-primary text-primary-foreground`,secondary:`border-hairline bg-soft-stone text-secondary-foreground`,destructive:`border-destructive bg-transparent text-destructive`,outline:`border-border bg-transparent text-foreground`,success:`border-success bg-success-soft text-success`,warning:`border-warning bg-warning-soft text-warning`}},defaultVariants:{variant:`default`}});function lE({className:e,variant:t,...n}){return(0,B.jsx)(`span`,{className:xg(cE({variant:t}),e),...n})}function uE(){let e=ET();return(0,B.jsxs)(`div`,{className:`app-page-narrow max-w-4xl`,children:[(0,B.jsxs)(`header`,{className:`app-page-header`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Test`}),(0,B.jsx)(`p`,{className:`app-page-copy`,children:`先确认 Project Brain 可用,再验证 bring-your-own executor,最后跑各 channel 的活体探测。Brain 卡片先出,executor 与 channel 紧随其后。`})]}),(0,B.jsx)(dE,{}),(0,B.jsx)(pE,{}),(0,B.jsx)(mE,{channels:e.data?.channels??[]})]})}function dE(){let e=PT();return(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Brain`}),(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`调`,` `,(0,B.jsx)(`code`,{className:`font-mono text-xs`,children:`/brain/test`}),`,对每个已配置的 brain source 探一次健康。`]})]}),(0,B.jsxs)(Eg,{type:`button`,onClick:()=>e.mutate(),disabled:e.isPending,children:[e.isPending?(0,B.jsx)(Om,{className:`size-4 animate-spin`}):(0,B.jsx)(Fm,{className:`size-4`}),`Test brain`]})]}),e.isError&&(0,B.jsx)(vE,{err:e.error}),e.data&&(0,B.jsx)(`ul`,{className:`flex flex-col gap-2 text-sm`,children:e.data.brains.map(e=>(0,B.jsxs)(`li`,{className:`flex items-start justify-between gap-2 rounded-sm border border-hairline bg-background p-3`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(`code`,{className:`font-mono text-xs`,children:e.id}),(0,B.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,e.type,`)`]}),e.writeTarget&&(0,B.jsx)(lE,{variant:`secondary`,children:`write target`}),e.readOnly&&(0,B.jsx)(lE,{variant:`outline`,children:`read only`})]}),(0,B.jsx)(`div`,{className:`min-w-0 break-words text-xs text-muted-foreground`,children:fE(e)})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(hE,{status:e.status}),e.errorMessage&&(0,B.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer`,children:`错误详情`}),(0,B.jsx)(`pre`,{className:`mt-1 max-w-xs whitespace-pre-wrap break-words rounded-sm bg-soft-stone p-2`,children:e.errorMessage})]})]})]},e.id))})]})}function fE(e){let t=[];return typeof e.priority==`number`&&t.push(`priority ${e.priority}`),e.healthScope===`aggregate`&&t.push(`aggregate health`),e.home&&t.push(e.home),e.url&&t.push(e.url),t.join(` / `)}function pE(){let[e,t]=(0,z.useState)(!1),n=FT(),r=`Tiny probe 请求已超时。可以先关闭 Tiny probe 只测 health,或检查 executor 日志后重试。`,i=gE(n.error)?r:void 0,a=_E(n.data?.executor.probeError)?r:void 0;return(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Executor`}),(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`调`,` `,(0,B.jsx)(`code`,{className:`font-mono text-xs`,children:`/executor/test`}),`。开 tiny probe 会发一次`,` `,(0,B.jsx)(`code`,{children:`ping`}),` `,`chat completion 测延迟。`]})]}),(0,B.jsxs)(`div`,{className:`flex flex-col items-end gap-2`,children:[(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),`Tiny probe`]}),(0,B.jsxs)(Eg,{type:`button`,onClick:()=>n.mutate(e?{probe:!0}:void 0),disabled:n.isPending,children:[n.isPending?(0,B.jsx)(Om,{className:`size-4 animate-spin`}):(0,B.jsx)(Fm,{className:`size-4`}),`Test executor`]})]})]}),n.isError&&(0,B.jsx)(vE,{err:n.error,hint:i}),n.data&&(0,B.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-sm border border-hairline bg-background p-3 text-sm`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`span`,{children:[`Type:`,(0,B.jsx)(`code`,{className:`ml-1 font-mono text-xs`,children:n.data.executor.type})]}),(0,B.jsx)(hE,{status:n.data.executor.status})]}),n.data.executor.tinyProbe&&(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Tiny probe:`,` `,n.data.executor.tinyProbe.ok?`ok`:`failed`,` `,`(`,n.data.executor.tinyProbe.latencyMs,` `,`ms)`,n.data.executor.tinyProbe.output&&(0,B.jsxs)(B.Fragment,{children:[` `,`— output:`,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:n.data.executor.tinyProbe.output})]})]}),n.data.executor.probeError&&(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsxs)(`details`,{className:`text-xs text-destructive`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer`,children:`probe 错误`}),(0,B.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words rounded-sm bg-soft-stone p-2 text-foreground`,children:n.data.executor.probeError})]}),a&&(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a})]})]})]})}function mE({channels:e}){let[t,n]=(0,z.useState)(``),[r,i]=(0,z.useState)(``),[a,o]=(0,z.useState)(``),s=IT(),c=t||(e[0]?.channel??``);function l(){c&&s.mutate({channel:c,...r?{chatId:r}:{},...a?{text:a}:{}})}return(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Channel`}),(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`调`,` `,(0,B.jsx)(`code`,{className:`font-mono text-xs`,children:`/channels/:ch/test`}),`。chat id + text 为空 = dry-run,仅确认 binding 是否激活。`]})]}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`Channel`}),(0,B.jsxs)(`select`,{className:`app-field h-10`,value:c,onChange:e=>n(e.target.value),"aria-label":`Channel to test`,children:[e.length===0&&(0,B.jsx)(`option`,{value:``,children:`— 尚未绑定 channel —`}),e.map(e=>(0,B.jsxs)(`option`,{value:e.channel,children:[e.channel,e.enabled?``:`(disabled)`]},e.channel))]})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`Chat id(optional)`}),(0,B.jsx)(xw,{value:r,onChange:e=>i(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`sm:col-span-2 flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`Text(optional)`}),(0,B.jsx)(xw,{value:a,onChange:e=>o(e.target.value)})]})]}),(0,B.jsx)(`div`,{children:(0,B.jsxs)(Eg,{type:`button`,onClick:l,disabled:s.isPending||!c,children:[s.isPending?(0,B.jsx)(Om,{className:`size-4 animate-spin`}):(0,B.jsx)(Fm,{className:`size-4`}),`发送测试消息`]})}),s.isError&&(0,B.jsx)(vE,{err:s.error}),s.data&&(0,B.jsxs)(`div`,{className:`rounded-sm border border-hairline bg-background p-3 text-sm`,children:[(0,B.jsxs)(`p`,{children:[`Sent:`,` `,(0,B.jsx)(lE,{variant:s.data.sent?`default`:`outline`,children:String(s.data.sent)})]}),s.data.error&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-destructive`,children:s.data.error}),s.data.platformResponse!==void 0&&(0,B.jsx)(`pre`,{className:`mt-2 overflow-x-auto rounded-sm bg-soft-stone p-2 text-micro`,children:JSON.stringify(s.data.platformResponse,null,2)})]})]})}function hE({status:e}){return(0,B.jsx)(lE,{variant:e===`healthy`?`default`:e===`down`?`destructive`:e===`degraded`?`secondary`:`outline`,children:e})}function gE(e){return e?_E(e instanceof Error?e.message:String(e)):!1}function _E(e){return e?/executor test timed out|tiny probe.*timed out|timeout/i.test(e):!1}function vE({err:e,hint:t}){let n=e instanceof Error?e.message:`测试失败。`;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsxs)(`details`,{className:`text-sm text-destructive`,children:[(0,B.jsxs)(`summary`,{className:`cursor-pointer`,children:[`错误:`,n.slice(0,80),n.length>80?`…`:``]}),(0,B.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words rounded-sm border border-hairline bg-soft-stone p-2 text-xs text-foreground`,children:n})]}),t&&(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]})}var yE=zi(`/test`)({component:uE}),bE=z.createContext(void 0);function xE(e){let t=z.useContext(bE);if(e===!1&&t===void 0)throw Error(Og(27));return t}var SE={...NC,...TC},CE=z.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=xE(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`),u=o.useState(`transitionStatus`);return Tb(`div`,e,{state:z.useMemo(()=>({open:s,transitionStatus:u}),[s,u]),ref:[o.context.backdropRef,t],stateAttributesMapping:SE,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),wE=z.createContext(void 0);function TE(e=!1){let t=z.useContext(wE);if(t===void 0&&!e)throw Error(Og(16));return t}function EE(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:z.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function DE(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=z.useRef(null),o=TE(!0)!==void 0,s=p_(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=EE({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=z.useCallback(()=>{let e=a.current;OE(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return Dg(l,[l]),{getButtonProps:z.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return mb({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Sb(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(Sb(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:p_(e=>{a.current=e,l()})}}function OE(e){return Wg(e)&&e.tagName===`BUTTON`}var kE=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{store:s}=xE(),c=s.useState(`open`);function l(e){c&&s.setOpen(!1,Ay(Ty,e.nativeEvent))}let{getButtonProps:u,buttonRef:d}=DE({disabled:i,native:a});return Tb(`button`,e,{state:z.useMemo(()=>({disabled:i}),[i]),ref:[t,d],props:[{onClick:l},o,u]})}),AE=z.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=xE(),s=PC(i);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),Tb(`p`,e,{ref:t,props:[{id:s},a]})}),jE=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),ME=function(e){return e[e.open=EC.open]=`open`,e[e.closed=EC.closed]=`closed`,e[e.startingStyle=EC.startingStyle]=`startingStyle`,e[e.endingStyle=EC.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),NE=z.createContext(void 0);function PE(){let e=z.useContext(NE);if(e===void 0)throw Error(Og(26));return e}var FE=`ArrowUp`,IE=`ArrowDown`,LE=`ArrowLeft`,RE=`ArrowRight`,zE=`Home`,BE=new Set([LE,RE]),VE=new Set([FE,IE]),HE=new Set([...BE,...VE]);new Set([...HE,zE,`End`]);var UE=new Set([FE,IE,LE,RE,zE,`End`]),WE={...NC,...TC,nestedDialogOpen(e){return e?{[ME.nestedDialogOpen]:``}:null}},GE=z.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=xE(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);PE(),zS({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e===`touch`?s.context.popupRef.current:!0}let S=i===void 0?x:i,C=h>0,w=Tb(`div`,e,{state:z.useMemo(()=>({open:g,nested:m,transitionStatus:y,nestedDialogOpen:C}),[g,m,y,C]),props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){UE.has(e.key)&&e.stopPropagation()},style:{[jE.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:WE});return(0,B.jsx)(Wb,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:w})}),KE=z.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
|
|
1367
|
+
`);try{return{type:t,data:JSON.parse(r)}}catch{return null}}function Qw(){return Tw(`/api/worker/brain/summary`)}function $w(e={}){let t=new URLSearchParams;e.status!==void 0&&t.set(`status`,e.status),e.kind!==void 0&&t.set(`kind`,e.kind),e.scopeId!==void 0&&t.set(`scopeId`,e.scopeId),e.soulId!==void 0&&t.set(`soulId`,e.soulId),e.limit!==void 0&&t.set(`limit`,String(e.limit)),e.showSensitive===!0&&t.set(`showSensitive`,`true`);let n=t.toString();return n.length===0?``:`?${n}`}function eT(e={}){return Tw(`/api/worker/brain/admission${$w(e)}`)}async function tT(e,t){return Tw(`/api/worker/brain/admission/${encodeURIComponent(e)}/approve`,{body:JSON.stringify(t),headers:{"content-type":`application/json`},method:`POST`})}async function nT(e,t){return Tw(`/api/worker/brain/admission/${encodeURIComponent(e)}/reject`,{body:JSON.stringify(t),headers:{"content-type":`application/json`},method:`POST`})}async function rT(e,t){return Tw(`/api/worker/brain/admission/${encodeURIComponent(e)}/apply`,{body:JSON.stringify(t),headers:{"content-type":`application/json`},method:`POST`})}function iT(e={}){let t=new URLSearchParams;e.scopeId!==void 0&&t.set(`scopeId`,e.scopeId),e.type!==void 0&&t.set(`type`,e.type),e.status!==void 0&&t.set(`status`,e.status),e.minSensitivity!==void 0&&t.set(`minSensitivity`,e.minSensitivity),e.limit!==void 0&&t.set(`limit`,String(e.limit)),e.showSensitive===!0&&t.set(`showSensitive`,`true`);let n=t.toString();return Tw(`/api/worker/brain/artifacts${n.length===0?``:`?${n}`}`)}var aT=[`worker`,`health`],oT=[`worker`,`info`],sT=[`worker`,`config`],cT=[`worker`,`engines`],lT=[`worker`,`secrets`],uT=[`worker`,`approvals`],dT=[`worker`,`cron`],fT=[`worker`,`tasks`],pT=[`worker`,`conversations`],mT=[`worker`,`brain`,`summary`];function hT(e){return[`worker`,`conversations`,e,`messages`]}function gT(e){return[`worker`,`brain`,`admissions`,e]}function _T(e){return[`worker`,`brain`,`artifacts`,e]}function vT(){return $e({queryKey:aT,queryFn:Ow,refetchInterval:3e4,staleTime:1e4})}function yT(){return $e({queryKey:oT,queryFn:kw,staleTime:15e3,refetchInterval:6e4})}function bT(){return $e({queryKey:sT,queryFn:Aw,staleTime:0})}function xT(){let e=Re();return et({mutationFn:({config:e,ifMatchVersion:t})=>jw(e,t),onSuccess:t=>{e.setQueryData(sT,{config:t.config,version:t.version}),e.invalidateQueries({queryKey:oT})}})}function ST(){return $e({queryKey:cT,queryFn:()=>Mw(),staleTime:10*6e4})}function CT(){let e=Re();return(0,z.useCallback)(async()=>{let t=await Mw({refresh:!0});return e.setQueryData(cT,t),t},[e])}function wT(){return $e({queryKey:lT,queryFn:Nw,staleTime:1e4})}function TT(){let e=Re();return et({mutationFn:({key:e,value:t})=>Pw(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:lT})}})}function ET(){let e=Re();return et({mutationFn:e=>Fw(e),onSuccess:()=>{e.invalidateQueries({queryKey:lT})}})}function DT(){return et({mutationFn:()=>Iw()})}function OT(){return et({mutationFn:e=>Rw(e??{})})}function kT(){return et({mutationFn:({channel:e,chatId:t,text:n})=>zw(e,{...t===void 0?{}:{chatId:t},...n===void 0?{}:{text:n}})})}function AT(){return $e({queryKey:dT,queryFn:Bw,staleTime:15e3,refetchInterval:6e4})}function jT(){let e=Re();return et({mutationFn:Vw,onSuccess:()=>{e.invalidateQueries({queryKey:dT})}})}function MT(){let e=Re();return et({mutationFn:({id:e,patch:t})=>Hw(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:dT})}})}function NT(){let e=Re();return et({mutationFn:Uw,onSuccess:()=>{e.invalidateQueries({queryKey:dT})}})}function PT(){return $e({queryKey:uT,queryFn:Ww,refetchInterval:5e3,staleTime:1e3})}function FT(){let e=Re();return et({mutationFn:({taskId:e,toolCallId:t,decision:n})=>Gw(e,t,n),onSuccess:()=>{e.invalidateQueries({queryKey:uT})}})}function IT(){let e=Re();return et({mutationFn:e=>Kw(e),onSuccess:()=>{e.invalidateQueries({queryKey:fT}),e.invalidateQueries({queryKey:pT})}})}function LT(){let e=Re();return et({mutationFn:({conversationId:e,prompt:t})=>qw(e,t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:fT}),e.invalidateQueries({queryKey:pT}),e.invalidateQueries({queryKey:hT(n.conversationId)})}})}function RT(){return $e({queryKey:pT,queryFn:Jw,staleTime:15e3})}function zT(e){return $e({queryKey:e?hT(e):[`worker`,`conversations`,`__missing__`,`messages`],queryFn:()=>Yw(e),enabled:!!e,staleTime:5e3})}function BT(){let e=Re();return(0,z.useCallback)(t=>{e.invalidateQueries({queryKey:hT(t)})},[e])}function VT(){let e=Re();return(0,z.useCallback)(()=>{e.invalidateQueries({queryKey:fT}),e.invalidateQueries({queryKey:pT})},[e])}function HT(){return $e({queryKey:mT,queryFn:Qw,staleTime:15e3,refetchInterval:6e4})}function UT(e={}){return $e({queryKey:gT(e),queryFn:()=>eT(e),staleTime:1e4})}function WT(){let e=Re();return et({mutationFn:({id:e,decidedBy:t,reason:n})=>tT(e,{decidedBy:t,...n===void 0?{}:{reason:n}}),onSuccess:()=>{e.invalidateQueries({queryKey:[`worker`,`brain`]})}})}function GT(){let e=Re();return et({mutationFn:({id:e,decidedBy:t,reason:n})=>nT(e,{decidedBy:t,...n===void 0?{}:{reason:n}}),onSuccess:()=>{e.invalidateQueries({queryKey:[`worker`,`brain`]})}})}function KT(){let e=Re();return et({mutationFn:({id:e,decidedBy:t,commit:n})=>rT(e,{decidedBy:t,...n===void 0?{}:{commit:n}}),onSuccess:()=>{e.invalidateQueries({queryKey:[`worker`,`brain`]})}})}function qT(e={}){return $e({queryKey:_T(e),queryFn:()=>iT(e),staleTime:15e3})}function JT(e){let{to:t,...n}=e;return(0,B.jsx)(Ni,{to:t,...n})}var YT=[{to:`/`,label:`概览`,exact:!0,icon:hm},{to:`/brain`,label:`Brain`,icon:pm},{to:`/config`,label:`配置`,icon:Fm},{to:`/secrets`,label:`Secrets`,icon:bm},{to:`/test`,label:`探测`,icon:Bm},{to:`/cron`,label:`Cron`,icon:Lm},{to:`/approvals`,label:`Approvals`,icon:Pm},{to:`/chat`,label:`Chat`,icon:Cm}];function XT(){let e=vT(),t=yT(),n=e.data?.workerId??t.data?.workerId??`—`,r=t.data?.configVersion??e.data?.configVersion??`—`,i=t.data?.executor,a=t.data?.brains?.length??0;return(0,B.jsxs)(`section`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-3 gap-y-3 bg-deep-green px-4 py-4 text-on-dark sm:px-6 md:grid-cols-[minmax(0,1fr)_auto] md:items-center lg:px-8`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,B.jsx)(`span`,{className:`text-micro uppercase text-on-dark/70`,children:`Worker`}),(0,B.jsx)(`code`,{className:`truncate font-mono text-sm font-medium`,children:n})]}),(0,B.jsxs)(`dl`,{className:`col-span-2 flex min-w-0 flex-wrap items-center gap-x-5 gap-y-2 text-xs md:col-span-1 md:col-start-2 md:row-start-1 md:justify-end`,children:[(0,B.jsx)(ZT,{label:`config v`,value:String(r)}),(0,B.jsx)(ZT,{label:`executor`,value:i?`${i.type}`:`—`,status:i?.status}),(0,B.jsx)(ZT,{label:`brains`,value:String(a)}),(0,B.jsx)(ZT,{label:`启动`,value:t.data?.startedAt?new Date(t.data.startedAt).toLocaleString():`—`})]})]})}function ZT({label:e,value:t,status:n}){return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col border-l border-on-dark/20 pl-3`,children:[(0,B.jsx)(`dt`,{className:`text-micro uppercase text-on-dark/70`,children:e}),(0,B.jsx)(`dd`,{className:`max-w-[11rem] truncate font-mono text-xs ${n?n===`healthy`?`text-pale-green`:n===`down`?`text-coral-soft`:n===`degraded`?`text-warning-soft`:`text-on-dark/70`:`text-on-dark`}`,children:t})]})}function QT(){let[e,t]=(0,z.useState)(()=>em());return e?(0,B.jsx)(aw,{delay:300,children:(0,B.jsxs)(`div`,{"data-testid":`worker-shell`,className:`flex h-dvh w-full flex-col overflow-hidden bg-background text-foreground`,children:[(0,B.jsxs)(`header`,{"data-testid":`worker-shell-header`,className:`grid shrink-0 gap-3 border-b border-hairline bg-background px-4 py-3 md:grid-cols-[minmax(12rem,1fr)_auto_minmax(12rem,1fr)] md:items-center md:px-8`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,B.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-sm border border-hairline bg-primary text-primary-foreground`,children:(0,B.jsx)(_m,{className:`size-4`})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`font-display text-lg leading-none text-foreground`,children:`AIWorker`}),(0,B.jsx)(`p`,{className:`text-micro text-muted-foreground`,children:`Worker`})]})]}),(0,B.jsx)(`nav`,{"data-testid":`worker-shell-nav`,className:`grid min-w-0 grid-cols-2 gap-1 sm:grid-cols-4 md:flex md:flex-wrap md:items-center md:justify-center`,children:YT.map(e=>{let t=e.icon;return(0,B.jsxs)(JT,{to:e.to,className:`flex min-w-0 items-center justify-center gap-2 rounded-xl border border-transparent px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:border-hairline hover:bg-soft-stone hover:text-foreground`,activeProps:{className:`!border-primary !bg-primary !text-primary-foreground hover:!border-primary hover:!bg-primary hover:!text-primary-foreground`},activeOptions:e.exact?{exact:!0}:void 0,children:[(0,B.jsx)(t,{className:`size-4 shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.label})]},e.to)})}),(0,B.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,B.jsx)(pw,{})})]}),(0,B.jsx)(XT,{}),(0,B.jsx)(gw,{}),(0,B.jsx)(`main`,{className:`min-h-0 min-w-0 flex-1 overflow-auto px-4 py-6 sm:px-6 lg:px-8`,children:(0,B.jsx)(`div`,{className:`mx-auto w-full max-w-7xl`,children:(0,B.jsx)(Yi,{})})})]})}):(0,B.jsx)($T,{onUnlock:e=>{tm(e),t(e)}})}function $T({onUnlock:e}){let[t,n]=(0,z.useState)(``),[r,i]=(0,z.useState)(null);function a(n){n.preventDefault();let r=t.trim();if(!r){i(`请输入 bearer token。`);return}i(null),e(r)}return(0,B.jsx)(`main`,{className:`flex min-h-screen w-full items-center justify-center bg-soft-stone px-4 py-8 text-foreground`,children:(0,B.jsxs)(`section`,{className:`flex w-full max-w-md flex-col gap-6 rounded-lg border border-card-border bg-card p-6 shadow-popover sm:p-8`,children:[(0,B.jsxs)(`header`,{className:`flex min-w-0 items-start gap-4`,children:[(0,B.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center rounded-sm border border-hairline bg-soft-stone`,children:(0,B.jsx)(Sm,{className:`size-5 text-muted-foreground`,"aria-hidden":`true`})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`text-micro uppercase text-muted-foreground`,children:`Worker Admin`}),(0,B.jsx)(`h1`,{className:`text-feature font-normal`,children:`需要 bearer token`})]})]}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`使用当前 worker token 解锁本 tab。`}),(0,B.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:a,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(hw,{htmlFor:`worker-admin-token`,children:`Bearer token`}),(0,B.jsx)(mw,{id:`worker-admin-token`,autoComplete:`off`,value:t,onChange:e=>n(e.target.value),type:`password`})]}),r&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error`,children:r}),(0,B.jsxs)(yg,{type:`submit`,children:[(0,B.jsx)(bm,{"aria-hidden":`true`}),`解锁`]})]})]})})}var eE=Ri({component:QT}),tE=_g(`inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-normal leading-tight transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-primary bg-primary text-primary-foreground`,secondary:`border-hairline bg-soft-stone text-secondary-foreground`,destructive:`border-destructive bg-transparent text-destructive`,outline:`border-border bg-transparent text-foreground`,success:`border-success bg-success-soft text-success`,warning:`border-warning bg-warning-soft text-warning`}},defaultVariants:{variant:`default`}});function nE({className:e,variant:t,...n}){return(0,B.jsx)(`span`,{className:mg(tE({variant:t}),e),...n})}function rE(){let e=yT();return(0,B.jsxs)(`div`,{className:`app-page-narrow max-w-4xl`,children:[(0,B.jsxs)(`header`,{className:`app-page-header`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Test`}),(0,B.jsx)(`p`,{className:`app-page-copy`,children:`先确认 Project Brain 可用,再验证 bring-your-own executor,最后跑各 channel 的活体探测。Brain 卡片先出,executor 与 channel 紧随其后。`})]}),(0,B.jsx)(iE,{}),(0,B.jsx)(oE,{}),(0,B.jsx)(sE,{channels:e.data?.channels??[]})]})}function iE(){let e=DT();return(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Brain`}),(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`调`,` `,(0,B.jsx)(`code`,{className:`font-mono text-xs`,children:`/brain/test`}),`,对每个已配置的 brain source 探一次健康。`]})]}),(0,B.jsxs)(yg,{type:`button`,onClick:()=>e.mutate(),disabled:e.isPending,children:[e.isPending?(0,B.jsx)(xm,{className:`size-4 animate-spin`}):(0,B.jsx)(Om,{className:`size-4`}),`Test brain`]})]}),e.isError&&(0,B.jsx)(dE,{err:e.error}),e.data&&(0,B.jsx)(`ul`,{className:`flex flex-col gap-2 text-sm`,children:e.data.brains.map(e=>(0,B.jsxs)(`li`,{className:`flex items-start justify-between gap-2 rounded-sm border border-hairline bg-background p-3`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(`code`,{className:`font-mono text-xs`,children:e.id}),(0,B.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,e.type,`)`]}),e.writeTarget&&(0,B.jsx)(nE,{variant:`secondary`,children:`write target`}),e.readOnly&&(0,B.jsx)(nE,{variant:`outline`,children:`read only`})]}),(0,B.jsx)(`div`,{className:`min-w-0 break-words text-xs text-muted-foreground`,children:aE(e)})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(cE,{status:e.status}),e.errorMessage&&(0,B.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer`,children:`错误详情`}),(0,B.jsx)(`pre`,{className:`mt-1 max-w-xs whitespace-pre-wrap break-words rounded-sm bg-soft-stone p-2`,children:e.errorMessage})]})]})]},e.id))})]})}function aE(e){let t=[];return typeof e.priority==`number`&&t.push(`priority ${e.priority}`),e.healthScope===`aggregate`&&t.push(`aggregate health`),e.home&&t.push(e.home),e.url&&t.push(e.url),t.join(` / `)}function oE(){let[e,t]=(0,z.useState)(!1),n=OT(),r=`Tiny probe 请求已超时。可以先关闭 Tiny probe 只测 health,或检查 executor 日志后重试。`,i=lE(n.error)?r:void 0,a=uE(n.data?.executor.probeError)?r:void 0;return(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Executor`}),(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`调`,` `,(0,B.jsx)(`code`,{className:`font-mono text-xs`,children:`/executor/test`}),`。开 tiny probe 会发一次`,` `,(0,B.jsx)(`code`,{children:`ping`}),` `,`chat completion 测延迟。`]})]}),(0,B.jsxs)(`div`,{className:`flex flex-col items-end gap-2`,children:[(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),`Tiny probe`]}),(0,B.jsxs)(yg,{type:`button`,onClick:()=>n.mutate(e?{probe:!0}:void 0),disabled:n.isPending,children:[n.isPending?(0,B.jsx)(xm,{className:`size-4 animate-spin`}):(0,B.jsx)(Om,{className:`size-4`}),`Test executor`]})]})]}),n.isError&&(0,B.jsx)(dE,{err:n.error,hint:i}),n.data&&(0,B.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-sm border border-hairline bg-background p-3 text-sm`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`span`,{children:[`Type:`,(0,B.jsx)(`code`,{className:`ml-1 font-mono text-xs`,children:n.data.executor.type})]}),(0,B.jsx)(cE,{status:n.data.executor.status})]}),n.data.executor.tinyProbe&&(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Tiny probe:`,` `,n.data.executor.tinyProbe.ok?`ok`:`failed`,` `,`(`,n.data.executor.tinyProbe.latencyMs,` `,`ms)`,n.data.executor.tinyProbe.output&&(0,B.jsxs)(B.Fragment,{children:[` `,`— output:`,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:n.data.executor.tinyProbe.output})]})]}),n.data.executor.probeError&&(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsxs)(`details`,{className:`text-xs text-destructive`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer`,children:`probe 错误`}),(0,B.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words rounded-sm bg-soft-stone p-2 text-foreground`,children:n.data.executor.probeError})]}),a&&(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a})]})]})]})}function sE({channels:e}){let[t,n]=(0,z.useState)(``),[r,i]=(0,z.useState)(``),[a,o]=(0,z.useState)(``),s=kT(),c=t||(e[0]?.channel??``);function l(){c&&s.mutate({channel:c,...r?{chatId:r}:{},...a?{text:a}:{}})}return(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Channel`}),(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`调`,` `,(0,B.jsx)(`code`,{className:`font-mono text-xs`,children:`/channels/:ch/test`}),`。chat id + text 为空 = dry-run,仅确认 binding 是否激活。`]})]}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`Channel`}),(0,B.jsxs)(`select`,{className:`app-field h-10`,value:c,onChange:e=>n(e.target.value),"aria-label":`Channel to test`,children:[e.length===0&&(0,B.jsx)(`option`,{value:``,children:`— 尚未绑定 channel —`}),e.map(e=>(0,B.jsxs)(`option`,{value:e.channel,children:[e.channel,e.enabled?``:`(disabled)`]},e.channel))]})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`Chat id(optional)`}),(0,B.jsx)(mw,{value:r,onChange:e=>i(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`sm:col-span-2 flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`Text(optional)`}),(0,B.jsx)(mw,{value:a,onChange:e=>o(e.target.value)})]})]}),(0,B.jsx)(`div`,{children:(0,B.jsxs)(yg,{type:`button`,onClick:l,disabled:s.isPending||!c,children:[s.isPending?(0,B.jsx)(xm,{className:`size-4 animate-spin`}):(0,B.jsx)(Om,{className:`size-4`}),`发送测试消息`]})}),s.isError&&(0,B.jsx)(dE,{err:s.error}),s.data&&(0,B.jsxs)(`div`,{className:`rounded-sm border border-hairline bg-background p-3 text-sm`,children:[(0,B.jsxs)(`p`,{children:[`Sent:`,` `,(0,B.jsx)(nE,{variant:s.data.sent?`default`:`outline`,children:String(s.data.sent)})]}),s.data.error&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-destructive`,children:s.data.error}),s.data.platformResponse!==void 0&&(0,B.jsx)(`pre`,{className:`mt-2 overflow-x-auto rounded-sm bg-soft-stone p-2 text-micro`,children:JSON.stringify(s.data.platformResponse,null,2)})]})]})}function cE({status:e}){return(0,B.jsx)(nE,{variant:e===`healthy`?`default`:e===`down`?`destructive`:e===`degraded`?`secondary`:`outline`,children:e})}function lE(e){return e?uE(e instanceof Error?e.message:String(e)):!1}function uE(e){return e?/executor test timed out|tiny probe.*timed out|timeout/i.test(e):!1}function dE({err:e,hint:t}){let n=e instanceof Error?e.message:`测试失败。`;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsxs)(`details`,{className:`text-sm text-destructive`,children:[(0,B.jsxs)(`summary`,{className:`cursor-pointer`,children:[`错误:`,n.slice(0,80),n.length>80?`…`:``]}),(0,B.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words rounded-sm border border-hairline bg-soft-stone p-2 text-xs text-foreground`,children:n})]}),t&&(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]})}var fE=zi(`/test`)({component:rE}),pE=z.createContext(void 0);function mE(e){let t=z.useContext(pE);if(e===!1&&t===void 0)throw Error(xg(27));return t}var hE={...EC,...vC},gE=z.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=mE(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`),u=o.useState(`transitionStatus`);return vb(`div`,e,{state:z.useMemo(()=>({open:s,transitionStatus:u}),[s,u]),ref:[o.context.backdropRef,t],stateAttributesMapping:hE,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),_E=z.createContext(void 0);function vE(e=!1){let t=z.useContext(_E);if(t===void 0&&!e)throw Error(xg(16));return t}function yE(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:z.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function bE(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=z.useRef(null),o=vE(!0)!==void 0,s=o_(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=yE({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=z.useCallback(()=>{let e=a.current;xE(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return bg(l,[l]),{getButtonProps:z.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return sb({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(hb(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(hb(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:o_(e=>{a.current=e,l()})}}function xE(e){return Lg(e)&&e.tagName===`BUTTON`}var SE=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{store:s}=mE(),c=s.useState(`open`);function l(e){c&&s.setOpen(!1,Cy(vy,e.nativeEvent))}let{getButtonProps:u,buttonRef:d}=bE({disabled:i,native:a});return vb(`button`,e,{state:z.useMemo(()=>({disabled:i}),[i]),ref:[t,d],props:[{onClick:l},o,u]})}),CE=z.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=mE(),s=DC(i);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),vb(`p`,e,{ref:t,props:[{id:s},a]})}),wE=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),TE=function(e){return e[e.open=yC.open]=`open`,e[e.closed=yC.closed]=`closed`,e[e.startingStyle=yC.startingStyle]=`startingStyle`,e[e.endingStyle=yC.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),EE=z.createContext(void 0);function DE(){let e=z.useContext(EE);if(e===void 0)throw Error(xg(26));return e}var OE=`ArrowUp`,kE=`ArrowDown`,AE=`ArrowLeft`,jE=`ArrowRight`,ME=`Home`,NE=new Set([AE,jE]),PE=new Set([OE,kE]),FE=new Set([...NE,...PE]);new Set([...FE,ME,`End`]);var IE=new Set([OE,kE,AE,jE,ME,`End`]),LE={...EC,...vC,nestedDialogOpen(e){return e?{[TE.nestedDialogOpen]:``}:null}},RE=z.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=mE(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);DE(),MS({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e===`touch`?s.context.popupRef.current:!0}let S=i===void 0?x:i,C=h>0,w=vb(`div`,e,{state:z.useMemo(()=>({open:g,nested:m,transitionStatus:y,nestedDialogOpen:C}),[g,m,y,C]),props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){IE.has(e.key)&&e.stopPropagation()},style:{[wE.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:LE});return(0,B.jsx)(Lb,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:w})}),zE=z.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
|
|
1482
1368
|
0% 0%,
|
|
1483
1369
|
100% 0%,
|
|
1484
1370
|
100% 100%,
|
|
@@ -1489,8 +1375,8 @@ retentionDefaults: []
|
|
|
1489
1375
|
${e.right}px ${e.bottom}px,
|
|
1490
1376
|
${e.right}px ${e.top}px,
|
|
1491
1377
|
${e.left}px ${e.top}px
|
|
1492
|
-
)`}return(0,B.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),qE=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=xE(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,B.jsx)(NE.Provider,{value:n,children:(0,B.jsxs)(Nb,{ref:t,...r,children:[a&&o===!0&&(0,B.jsx)(KE,{ref:i.context.internalBackdropRef,inert:dw(!open)}),e.children]})}):null}),JE={},YE={},XE=``;function ZE(e){if(typeof document>`u`)return!1;let t=qy(e);return Bg(t).innerWidth-t.documentElement.clientWidth>0}function QE(e){let t=qy(e),n=t.documentElement,r=t.body,i=Kg(n)?n:r,a=i.style.overflow;return i.style.overflow=`hidden`,()=>{i.style.overflow=a}}function $E(e){let t=qy(e),n=t.documentElement,r=t.body,i=Bg(n),a=0,o=0,s=Gy.create(),c=typeof CSS<`u`&&CSS.supports?.(`scrollbar-gutter`,`stable`);if(b_&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let e=i.getComputedStyle(n),t=i.getComputedStyle(r),s=(e.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,JE={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},XE=n.style.scrollBehavior,YE={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let l=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,d=e.overflowY===`scroll`||t.overflowY===`scroll`,f=e.overflowX===`scroll`||t.overflowX===`scroll`,p=Math.max(0,i.innerWidth-n.clientWidth),m=Math.max(0,i.innerHeight-n.clientHeight),h=parseFloat(t.marginTop)+parseFloat(t.marginBottom),g=parseFloat(t.marginLeft)+parseFloat(t.marginRight),_=Kg(n)?n:r;if(c){n.style.scrollbarGutter=s,_.style.overflowY=`hidden`,_.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:s,overflowY:`hidden`,overflowX:`hidden`}),(l||d)&&(n.style.overflowY=`scroll`),(u||f)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:h||m?`calc(100dvh - ${h+m}px)`:`100dvh`,width:g||p?`calc(100vw - ${g+p}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,JE),Object.assign(r.style,YE),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=XE)}function d(){u(),s.request(l)}return l(),i.addEventListener(`resize`,d),()=>{s.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var eD=new class{lockCount=0;restore=null;timeoutLock=Ig.create();timeoutUnlock=Ig.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=qy(e).documentElement,n=Bg(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=gy;return}let r=x_||!ZE(e);this.restore=r?QE(e):$E(e)}};function tD(e=!0,t=null){Dg(()=>{if(e)return eD.acquire(t)},[e,t])}function nD(e){let t=z.useRef(``),n=z.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:z.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n&&e(n,n.pointerType),e(n,t.current),t.current=``},[e]),onPointerDown:n}}function rD(e){let[t,n]=z.useState(null),r=p_((t,r)=>{e||n(r)}),i=z.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:o}=nD(r);return z.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:o}}),[t,i,a,o])}function iD(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l,reset:u}=rD(i);HS(t);let{forceUnmount:d}=US(i,t,()=>{u()}),f=p_(e=>{let n=Ay(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=z.useCallback(()=>{t.setOpen(!1,f(ky))},[t,f]);z.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=XS({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=z.useState(0),_=h===0,v=pC(m),y=aS(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=N_(e);if(_&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||M_(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});tD(i&&o===!0,s);let{getReferenceProps:b,getFloatingProps:x,getTriggerProps:S}=lC([v,y]);t.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),z.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);let C=z.useMemo(()=>b(l),[b,l]),w=z.useMemo(()=>S(l),[S,l]),T=z.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:h})}var aD={...qS,modal:DS(e=>e.modal),nested:DS(e=>e.nested),nestedOpenDialogCount:DS(e=>e.nestedOpenDialogCount),disablePointerDismissal:DS(e=>e.disablePointerDismissal),openMethod:DS(e=>e.openMethod),descriptionElementId:DS(e=>e.descriptionElementId),titleElementId:DS(e=>e.titleElementId),viewportElement:DS(e=>e.viewportElement),role:DS(e=>e.role)},oD=class extends PS{constructor(e){super(sD(e),{popupRef:z.createRef(),backdropRef:z.createRef(),internalBackdropRef:z.createRef(),triggerElements:new WS,onOpenChange:void 0,onOpenChangeComplete:void 0},aD)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function sD(e={}){return{...KS(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function cD(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=xE(!0),p=!!f,m=Mg(()=>l?.store??new oD({open:n??r,activeTriggerId:u===void 0?d:u,modal:s,disablePointerDismissal:o,nested:p})).current;m.useControlledProp(`open`,n,r),m.useControlledProp(`activeTriggerId`,u,d),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);iD({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=z.useMemo(()=>({store:m}),[m]);return(0,B.jsx)(bE.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}var lD=z.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=xE(),s=PC(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),Tb(`h2`,e,{ref:t,props:[{id:s},a]})}),uD=cD,dD=kE,fD=qE;function pD({className:e,...t}){return(0,B.jsx)(CE,{className:xg(`fixed inset-0 z-50 bg-cohere-black/70 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 transition-opacity duration-150`,e),...t})}function mD({className:e,children:t,showCloseButton:n=!0,...r}){return(0,B.jsxs)(fD,{children:[(0,B.jsx)(pD,{}),(0,B.jsxs)(GE,{className:xg(`fixed left-1/2 top-1/2 z-50 grid w-[calc(100vw-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-5 rounded-lg border border-card-border bg-background p-6 shadow-popover outline-none sm:p-8`,`data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[starting-style]:scale-95 transition-[opacity,transform] duration-150`,e),...r,children:[t,n&&(0,B.jsx)(dD,{className:`absolute right-4 top-4 rounded-full p-1 opacity-70 ring-offset-background transition-opacity hover:bg-soft-stone hover:text-primary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,"aria-label":`Close dialog`,children:(0,B.jsx)(Jm,{className:`size-4`})})]})]})}function hD({className:e,...t}){return(0,B.jsx)(`div`,{className:xg(`flex flex-col space-y-1.5 text-left`,e),...t})}function gD({className:e,...t}){return(0,B.jsx)(`div`,{className:xg(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function _D({className:e,...t}){return(0,B.jsx)(lD,{className:xg(`text-card-heading font-normal leading-tight`,e),...t})}function vD({className:e,...t}){return(0,B.jsx)(AE,{className:xg(`text-sm text-muted-foreground`,e),...t})}function yD({className:e,...t}){return(0,B.jsx)(`div`,{className:xg(`animate-pulse rounded-sm bg-soft-stone`,e),...t})}function bD(){let e=jT(),t=MT(),n=NT(),[r,i]=(0,z.useState)(null),[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(null);async function l(){if(a){c(null);try{await n.mutateAsync(a),o(null)}catch(e){c(e instanceof jw?e.message:`删除失败。`)}}}return(0,B.jsxs)(`div`,{className:`app-page-narrow max-w-4xl`,children:[(0,B.jsxs)(`header`,{className:`app-page-header sm:flex-row sm:items-end sm:justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Secrets`}),(0,B.jsx)(`p`,{className:`app-page-copy`,children:`常规 secret 通过配置编辑器管理;这里用于 out-of-band 轮换 / 应急处置。`})]}),(0,B.jsxs)(Eg,{onClick:()=>i({kind:`add`}),children:[(0,B.jsx)(Im,{className:`size-4`}),`添加 secret`]})]}),e.isLoading?(0,B.jsx)(yD,{className:`h-40`}):e.isError?(0,B.jsxs)(`p`,{role:`alert`,className:`app-alert-error`,children:[`加载 secrets 失败:`,e.error instanceof Error?e.error.message:`未知错误`]}):e.data?.keys.length===0?(0,B.jsx)(`p`,{className:`app-empty`,children:`尚无 secret。`}):(0,B.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.data?.keys.map(e=>(0,B.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-sm border border-hairline bg-card px-4 py-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(Dm,{className:`size-4 text-muted-foreground`}),(0,B.jsx)(`code`,{className:`font-mono text-sm`,children:e})]}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(Eg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i({kind:`replace`,key:e}),children:`替换`}),(0,B.jsx)(Eg,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Delete secret ${e}`,onClick:()=>o(e),children:(0,B.jsx)(Gm,{className:`size-4`})})]})]},e))}),s&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error`,children:s}),r&&(0,B.jsx)(xD,{existingKeys:e.data?.keys??[],mode:r,submitting:t.isPending,onClose:()=>i(null),onSubmit:async({key:e,value:n})=>{c(null);try{await t.mutateAsync({key:e,value:n}),i(null)}catch(e){c(e instanceof jw?e.message:`保存失败。`)}}},r.kind===`add`?`__add`:`__replace_${r.key}`),(0,B.jsx)(uD,{open:a!==null,onOpenChange:e=>!e&&o(null),children:(0,B.jsxs)(mD,{className:`sm:max-w-md`,children:[(0,B.jsxs)(hD,{children:[(0,B.jsx)(_D,{children:`删除该 secret?`}),(0,B.jsxs)(vD,{children:[`将从 worker vault 移除`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:a}),`;config 里引用它的字段在替换前会加载失败。`]})]}),(0,B.jsxs)(gD,{children:[(0,B.jsx)(Eg,{variant:`outline`,onClick:()=>o(null),children:`取消`}),(0,B.jsx)(Eg,{variant:`destructive`,onClick:l,disabled:n.isPending,children:n.isPending?`删除中…`:`删除`})]})]})})]})}function xD({mode:e,existingKeys:t,submitting:n,onClose:r,onSubmit:i}){let a=(0,z.useId)(),o=(0,z.useId)(),[s,c]=(0,z.useState)(e.kind===`replace`?e.key:``),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(!1),[p,m]=(0,z.useState)(null);async function h(n){n.preventDefault(),m(null);let r=s.trim();if(r.length===0){m(`key 必填。`);return}if(l.length===0){m(`value 必填。`);return}if(e.kind===`add`&&t.includes(r)){m(`该 key 已存在;改用「替换」。`);return}await i({key:r,value:l}),u(``)}return(0,B.jsx)(uD,{open:!0,onOpenChange:e=>!e&&r(),children:(0,B.jsx)(mD,{className:`sm:max-w-md`,children:(0,B.jsxs)(`form`,{onSubmit:h,children:[(0,B.jsxs)(hD,{children:[(0,B.jsx)(_D,{children:e.kind===`add`?`添加 secret`:`替换 ${e.key}`}),(0,B.jsx)(vD,{children:`value 加密存入 worker vault,之后绝不再回传 UI。`})]}),(0,B.jsxs)(`div`,{className:`grid gap-4 py-4`,children:[(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(Sw,{htmlFor:a,children:`Key`}),(0,B.jsx)(xw,{id:a,value:s,onChange:e=>c(e.target.value),disabled:e.kind===`replace`,autoFocus:e.kind===`add`,spellCheck:!1})]}),(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(Sw,{htmlFor:o,children:`Value`}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(xw,{id:o,type:d?`text`:`password`,value:l,onChange:e=>u(e.target.value),autoComplete:`off`,spellCheck:!1,autoFocus:e.kind===`replace`}),(0,B.jsx)(Eg,{type:`button`,variant:`outline`,size:`icon`,"aria-label":d?`Hide value`:`Show value`,onClick:()=>f(e=>!e),children:d?(0,B.jsx)(Tm,{className:`size-4`}):(0,B.jsx)(Em,{className:`size-4`})})]})]}),p&&(0,B.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:p})]}),(0,B.jsxs)(gD,{children:[(0,B.jsx)(Eg,{type:`button`,variant:`outline`,onClick:r,children:`取消`}),(0,B.jsxs)(Eg,{type:`submit`,disabled:n,children:[n?(0,B.jsx)(Om,{className:`size-4 animate-spin`}):null,n?`保存中…`:`保存`]})]})]})})})}var SD=zi(`/secrets`)({component:bD}),CD=[`web`,`line`,`telegram`,`lark`,`whatsapp`];function wD(){let e=LT(),t=RT(),n=zT(),r=BT(),[i,a]=(0,z.useState)(null),[o,s]=(0,z.useState)(null),[c,l]=(0,z.useState)(null);async function u(e){l(null);try{await n.mutateAsync({id:e.id,patch:{enabled:!e.enabled}})}catch(e){l(e instanceof jw?e.message:`更新失败。`)}}async function d(){if(o){l(null);try{await r.mutateAsync(o.id),s(null)}catch(e){l(e instanceof jw?e.message:`删除失败。`)}}}let f=e.data?.jobs??[];return(0,B.jsxs)(`div`,{className:`app-page-narrow max-w-5xl`,children:[(0,B.jsxs)(`header`,{className:`app-page-header sm:flex-row sm:items-end sm:justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Cron`}),(0,B.jsx)(`p`,{className:`app-page-copy`,children:`按 cron 表达式定期触发的 prompt 任务。结果通过指定 channel 发出。`})]}),(0,B.jsxs)(Eg,{onClick:()=>a({kind:`add`}),children:[(0,B.jsx)(Im,{className:`size-4`}),`添加`]})]}),c&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error`,children:c}),e.isLoading?(0,B.jsx)(yD,{className:`h-40`}):e.isError?(0,B.jsxs)(`p`,{role:`alert`,className:`app-alert-error`,children:[`加载 cron 列表失败:`,e.error instanceof Error?e.error.message:`未知错误`]}):f.length===0?(0,B.jsx)(`p`,{className:`app-empty`,children:`尚无 cron。`}):(0,B.jsx)(`ul`,{className:`flex flex-col gap-3`,children:f.map(e=>(0,B.jsx)(`li`,{className:`flex flex-col gap-3 rounded-sm border border-hairline bg-card p-4`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`code`,{className:`font-mono text-sm`,children:e.expression}),(0,B.jsx)(`span`,{className:`rounded-full bg-soft-stone px-2 py-1 text-micro uppercase text-muted-foreground`,children:e.channel}),!e.enabled&&(0,B.jsx)(`span`,{className:`rounded-full bg-warning-soft px-2 py-1 text-micro font-medium text-warning`,children:`disabled`})]}),(0,B.jsx)(`p`,{className:`mt-1 truncate text-sm text-muted-foreground`,title:e.prompt,children:e.prompt}),(0,B.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`chatId`,(0,B.jsx)(`code`,{className:`ml-1 font-mono`,children:e.chatId}),(0,B.jsx)(`span`,{className:`mx-2`,children:`·`}),`account`,(0,B.jsx)(`code`,{className:`ml-1 font-mono`,children:e.accountId}),(0,B.jsx)(`span`,{className:`mx-2`,children:`·`}),`next`,(0,B.jsx)(`code`,{className:`ml-1 font-mono`,children:e.nextRunAt??`—`}),(0,B.jsx)(`span`,{className:`mx-2`,children:`·`}),`last`,(0,B.jsx)(`code`,{className:`ml-1 font-mono`,children:e.lastRunAt??`—`})]})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,B.jsx)(Eg,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":e.enabled?`暂停`:`启用`,onClick:()=>void u(e),disabled:n.isPending,children:e.enabled?(0,B.jsx)(Nm,{className:`size-4`}):(0,B.jsx)(Fm,{className:`size-4`})}),(0,B.jsx)(Eg,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`编辑`,onClick:()=>a({kind:`edit`,job:e}),children:(0,B.jsx)(Pm,{className:`size-4`})}),(0,B.jsx)(Eg,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`删除`,onClick:()=>s(e),children:(0,B.jsx)(Gm,{className:`size-4`})})]})]})},e.id))}),i&&(0,B.jsx)(TD,{mode:i,submitting:t.isPending||n.isPending,onClose:()=>a(null),onSubmit:async e=>{l(null);try{i.kind===`add`?await t.mutateAsync(e):await n.mutateAsync({id:i.job.id,patch:e}),a(null)}catch(e){l(e instanceof jw?e.message:`保存失败。`)}}},i.kind===`add`?`__add`:`__edit_${i.job.id}`),(0,B.jsx)(uD,{open:o!==null,onOpenChange:e=>!e&&s(null),children:(0,B.jsxs)(mD,{className:`sm:max-w-md`,children:[(0,B.jsxs)(hD,{children:[(0,B.jsx)(_D,{children:`删除该 cron?`}),(0,B.jsxs)(vD,{children:[`将立即停止`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:o?.id}),` `,`的调度。`]})]}),(0,B.jsxs)(gD,{children:[(0,B.jsx)(Eg,{variant:`outline`,onClick:()=>s(null),children:`取消`}),(0,B.jsx)(Eg,{variant:`destructive`,onClick:d,disabled:r.isPending,children:r.isPending?`删除中…`:`删除`})]})]})})]})}function TD({mode:e,submitting:t,onClose:n,onSubmit:r}){let i=(0,z.useId)(),a=(0,z.useId)(),o=(0,z.useId)(),s=(0,z.useId)(),[c,l]=(0,z.useState)((0,z.useMemo)(()=>e.kind===`edit`?{expression:e.job.expression,prompt:e.job.prompt,channel:e.job.channel,chatId:e.job.chatId,accountId:e.job.accountId,enabled:e.job.enabled}:{expression:`0 9 * * *`,prompt:``,channel:`web`,chatId:``,accountId:``,enabled:!0},[e])),[u,d]=(0,z.useState)(null);function f(e,t){l(n=>({...n,[e]:t}))}async function p(e){if(e.preventDefault(),d(null),!c.expression.trim()||!c.prompt.trim()||!c.chatId.trim()){d(`expression / prompt / chatId 必填。`);return}let t={expression:c.expression.trim(),prompt:c.prompt.trim(),channel:c.channel,chatId:c.chatId.trim(),enabled:c.enabled};c.accountId.trim().length>0&&(t.accountId=c.accountId.trim()),await r(t)}return(0,B.jsx)(uD,{open:!0,onOpenChange:e=>!e&&n(),children:(0,B.jsx)(mD,{className:`sm:max-w-lg`,children:(0,B.jsxs)(`form`,{onSubmit:p,children:[(0,B.jsxs)(hD,{children:[(0,B.jsx)(_D,{children:e.kind===`add`?`添加 cron`:`编辑 ${e.job.id}`}),(0,B.jsx)(vD,{children:`cron 表达式遵循 5 字段标准(分 时 日 月 周)。`})]}),(0,B.jsxs)(`div`,{className:`grid gap-3 py-4`,children:[(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(Sw,{htmlFor:i,children:`Expression`}),(0,B.jsx)(xw,{id:i,value:c.expression,onChange:e=>f(`expression`,e.target.value),className:`font-mono`})]}),(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(Sw,{htmlFor:a,children:`Prompt`}),(0,B.jsx)(`textarea`,{id:a,className:`app-field min-h-[80px]`,value:c.prompt,onChange:e=>f(`prompt`,e.target.value)})]}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(Sw,{children:`Channel`}),(0,B.jsx)(`select`,{className:`app-field h-10`,value:c.channel,onChange:e=>f(`channel`,e.target.value),children:CD.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))})]}),(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(Sw,{htmlFor:o,children:`chatId`}),(0,B.jsx)(xw,{id:o,value:c.chatId,onChange:e=>f(`chatId`,e.target.value)})]}),(0,B.jsxs)(`div`,{className:`grid gap-1.5 sm:col-span-2`,children:[(0,B.jsx)(Sw,{htmlFor:s,children:"accountId(留空 = `sys:cron`)"}),(0,B.jsx)(xw,{id:s,value:c.accountId,onChange:e=>f(`accountId`,e.target.value)})]}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-sm sm:col-span-2`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:c.enabled,onChange:e=>f(`enabled`,e.target.checked)}),`启用`]})]}),u&&(0,B.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:u})]}),(0,B.jsxs)(gD,{children:[(0,B.jsx)(Eg,{type:`button`,variant:`outline`,onClick:n,children:`取消`}),(0,B.jsxs)(Eg,{type:`submit`,disabled:t,children:[t?(0,B.jsx)(Om,{className:`size-4 animate-spin`}):null,t?`保存中…`:`保存`]})]})]})})})}var ED=zi(`/cron`)({component:wD});function DD(e){return{id:`brain-${e}`,type:`filesystem`,priority:100,readOnly:!1,config:{}}}function OD(e){return{id:`brain-${e}`,type:`cloud-gateway`,priority:100,readOnly:!1,config:{url:``,token:``}}}function kD({brains:e,brainWriteTarget:t,brainRetrieval:n,onChange:r}){function i(t,n){let i=e.slice();i[t]=n,r({brains:i})}function a(n){let i=e[n],a=e.filter((e,t)=>t!==n),o={brains:a};i&&t===i.id&&(o.brainWriteTarget=a[0]?.id??``),r(o)}function o(t){let n=t===`filesystem`?DD(e.length+1):OD(e.length+1);r({brains:[...e,n]})}return(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-5`,children:[(0,B.jsxs)(`header`,{className:`flex items-start justify-between gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Brain sources`}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`知识与记忆后端。Secret 字段留空表示沿用旧值。`})]}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsxs)(Eg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>o(`filesystem`),children:[(0,B.jsx)(Im,{className:`size-3.5`}),`Filesystem`]}),(0,B.jsxs)(Eg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>o(`cloud-gateway`),children:[(0,B.jsx)(Im,{className:`size-3.5`}),`Cloud gateway`]})]})]}),e.length===0&&(0,B.jsx)(`p`,{className:`app-empty p-5 sm:p-5`,children:`尚未配置 brain source。至少加一个才能启用 retrieval。`}),(0,B.jsx)(`ul`,{className:`flex flex-col gap-3`,children:e.map((e,t)=>(0,B.jsx)(AD,{source:e,onChange:e=>i(t,e),onRemove:()=>a(t)},e.id))}),e.length>0&&(0,B.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`Write target`}),(0,B.jsxs)(`select`,{className:`app-field h-10`,value:t,onChange:e=>r({brainWriteTarget:e.target.value}),children:[(0,B.jsx)(`option`,{value:``,children:`— none —`}),e.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.id},e.id))]}),(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`接收`,` `,(0,B.jsx)(`code`,{className:`font-mono text-micro`,children:`writeMemory`}),` `,`调用的 source。`]})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`Retrieval mode`}),(0,B.jsxs)(`select`,{className:`app-field h-10`,value:n,onChange:e=>r({brainRetrieval:e.target.value}),children:[(0,B.jsx)(`option`,{value:`merge-by-priority`,children:`merge-by-priority`}),(0,B.jsx)(`option`,{value:`first-match`,children:`first-match`})]})]})]})]})}function AD({source:e,onChange:t,onRemove:n}){function r(n){t({...e,...n})}function i(n){n!==e.type&&t(n===`filesystem`?{id:e.id,type:`filesystem`,priority:e.priority,readOnly:e.readOnly,config:{}}:{id:e.id,type:`cloud-gateway`,priority:e.priority,readOnly:e.readOnly,config:{url:``,token:``}})}return(0,B.jsxs)(`li`,{className:`flex flex-col gap-4 rounded-sm border border-hairline bg-background p-4`,children:[(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,160px)_minmax(0,120px)_auto]`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`Id`}),(0,B.jsx)(xw,{value:e.id,onChange:e=>r({id:e.target.value}),"aria-label":`Brain source id`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`Type`}),(0,B.jsxs)(`select`,{className:`app-field h-10`,value:e.type,onChange:e=>i(e.target.value),"aria-label":`Brain source type`,children:[(0,B.jsx)(`option`,{value:`filesystem`,children:`filesystem`}),(0,B.jsx)(`option`,{value:`cloud-gateway`,children:`cloud-gateway`})]})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`Priority`}),(0,B.jsx)(xw,{type:`number`,value:e.priority,onChange:e=>r({priority:Number.parseInt(e.target.value,10)||0})})]}),(0,B.jsxs)(`div`,{className:`flex flex-col items-end gap-2`,children:[(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e.readOnly,onChange:e=>r({readOnly:e.target.checked})}),`read-only`]}),(0,B.jsx)(Eg,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Remove brain source`,onClick:n,children:(0,B.jsx)(Gm,{className:`size-4`})})]})]}),e.type===`filesystem`?(0,B.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:(0,B.jsx)(jD,{label:`home (optional — 默认 ~/.aiworker/workers/<id>/brain)`,children:(0,B.jsx)(xw,{value:e.config.home??``,onChange:n=>t({...e,config:{...e.config,home:n.target.value||void 0}})})})}):(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsx)(jD,{label:`url`,children:(0,B.jsx)(xw,{value:e.config.url,onChange:n=>t({...e,config:{...e.config,url:n.target.value}})})}),(0,B.jsx)(MD,{label:`token`,value:e.config.token,onChange:n=>t({...e,config:{...e.config,token:n}})}),(0,B.jsx)(jD,{label:`defaultCategory (optional)`,children:(0,B.jsx)(xw,{value:e.config.defaultCategory??``,onChange:n=>t({...e,config:{...e.config,defaultCategory:n.target.value}})})}),(0,B.jsx)(jD,{label:`defaultTypeId (optional)`,children:(0,B.jsx)(xw,{value:e.config.defaultTypeId??``,onChange:n=>t({...e,config:{...e.config,defaultTypeId:n.target.value}})})})]})]})}function jD({label:e,children:t}){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:e}),t]})}function MD({label:e,value:t,onChange:n,placeholder:r=`(unchanged)`}){let[i,a]=(0,z.useState)(!1);return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:e}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(xw,{type:i?`text`:`password`,value:t,onChange:e=>n(e.target.value),placeholder:r,autoComplete:`off`,spellCheck:!1}),(0,B.jsx)(Eg,{type:`button`,variant:`outline`,size:`icon`,"aria-label":i?`Hide ${e}`:`Show ${e}`,onClick:()=>a(e=>!e),children:i?(0,B.jsx)(Tm,{className:`size-4`}):(0,B.jsx)(Em,{className:`size-4`})})]}),(0,B.jsx)(`p`,{className:`text-micro text-muted-foreground`,children:`留空保留 vault 里旧值。`})]})}var ND=[`web`,`line`,`telegram`,`lark`,`whatsapp`];function PD(){let e=new Uint8Array(24);crypto.getRandomValues(e);let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function FD(e){switch(e){case`web`:return{channel:`web`,inboundToken:``};case`line`:return{channel:`line`,channelSecret:``,channelAccessToken:``};case`telegram`:return{channel:`telegram`,botToken:``};case`lark`:return{channel:`lark`,appId:``,appSecret:``,encryptKey:``,verificationToken:``};case`whatsapp`:return{channel:`whatsapp`,phoneNumberId:``,accessToken:``,appSecret:``,verifyToken:``}}}function ID(e){return{channel:e,enabled:!1,credentials:FD(e)}}function LD(e,t,n){let r=0;for(let i=0;i<n;i+=1)t[i]?.channel===e&&(r+=1);return r===0?e:`${e}#${r}`}function RD({channels:e,info:t,onChange:n}){function r(t,r){let i=e.slice();i[t]=r,n(i)}function i(t){n(e.filter((e,n)=>n!==t))}function a(t){n([...e,ID(t)])}return(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-5`,children:[(0,B.jsxs)(`header`,{className:`flex items-start justify-between gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Channels`}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`入站消息源。把卡片里的 webhook URL 粘到对应平台后台。`})]}),(0,B.jsx)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:ND.map(e=>(0,B.jsxs)(Eg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>a(e),children:[(0,B.jsx)(Im,{className:`size-3.5`}),e]},e))})]}),e.length===0&&(0,B.jsx)(`p`,{className:`app-empty p-5 sm:p-5`,children:`尚未绑定 channel。`}),(0,B.jsx)(`ul`,{className:`flex flex-col gap-3`,children:e.map((n,a)=>(0,B.jsx)(zD,{binding:n,webhookUrl:t?.channels.find(e=>e.channel===n.channel)?.webhookUrl,onChange:e=>r(a,e),onRemove:()=>i(a)},LD(n.channel,e,a)))})]})}function zD({binding:e,webhookUrl:t,onChange:n,onRemove:r}){function i(t){n({...e,credentials:t})}function a(t){t!==e.channel&&n({channel:t,enabled:e.enabled,credentials:FD(t)})}return(0,B.jsxs)(`li`,{className:`flex flex-col gap-4 rounded-sm border border-hairline bg-background p-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`select`,{className:`app-field h-10`,value:e.channel,onChange:e=>a(e.target.value),"aria-label":`Channel type`,children:ND.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e.enabled,onChange:t=>n({...e,enabled:t.target.checked})}),`enabled`]})]}),(0,B.jsx)(Eg,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Remove ${e.channel} channel`,onClick:r,children:(0,B.jsx)(Gm,{className:`size-4`})})]}),t&&(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(Sw,{children:`Webhook URL(只读,粘进平台后台即可)`}),(0,B.jsx)(xw,{value:t,readOnly:!0,className:`font-mono text-xs`})]}),(0,B.jsx)(BD,{credentials:e.credentials,onChange:i})]})}function BD({credentials:e,onChange:t}){switch(e.channel){case`web`:return(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end`,children:[(0,B.jsx)(MD,{label:`inboundToken`,value:e.inboundToken??``,onChange:n=>t({...e,inboundToken:n}),placeholder:`(unchanged — 留空沿用旧 token)`}),(0,B.jsx)(Eg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>t({...e,inboundToken:PD()}),children:`Generate`})]}),(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`必填:调用`,` `,(0,B.jsx)(`code`,{className:`font-mono text-micro`,children:`POST /web/webhook`}),` `,`的客户端必须发`,` `,(0,B.jsx)(`code`,{className:`font-mono text-micro`,children:`Authorization: Bearer <inboundToken>`}),`。空 token = 拒绝所有入站(fail-closed)。`]})]});case`line`:return(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsx)(MD,{label:`channelSecret`,value:e.channelSecret,onChange:n=>t({...e,channelSecret:n})}),(0,B.jsx)(MD,{label:`channelAccessToken`,value:e.channelAccessToken,onChange:n=>t({...e,channelAccessToken:n})})]});case`telegram`:return(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsx)(MD,{label:`botToken`,value:e.botToken,onChange:n=>t({...e,botToken:n})}),(0,B.jsx)(MD,{label:`webhookSecretToken (optional)`,value:e.webhookSecretToken??``,onChange:n=>t({...e,webhookSecretToken:n||void 0})})]});case`lark`:return(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`appId`}),(0,B.jsx)(xw,{value:e.appId,onChange:n=>t({...e,appId:n.target.value})})]}),(0,B.jsx)(MD,{label:`appSecret`,value:e.appSecret,onChange:n=>t({...e,appSecret:n})}),(0,B.jsx)(MD,{label:`encryptKey`,value:e.encryptKey,onChange:n=>t({...e,encryptKey:n})}),(0,B.jsx)(MD,{label:`verificationToken`,value:e.verificationToken,onChange:n=>t({...e,verificationToken:n})})]});case`whatsapp`:return(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`phoneNumberId`}),(0,B.jsx)(xw,{value:e.phoneNumberId,onChange:n=>t({...e,phoneNumberId:n.target.value})})]}),(0,B.jsx)(MD,{label:`accessToken`,value:e.accessToken,onChange:n=>t({...e,accessToken:n})}),(0,B.jsx)(MD,{label:`appSecret`,value:e.appSecret,onChange:n=>t({...e,appSecret:n})}),(0,B.jsx)(MD,{label:`verifyToken`,value:e.verifyToken,onChange:n=>t({...e,verifyToken:n})})]})}}function VD(e){let t=new Map;if(!e)return t;for(let n of e){let e=n.agent?`${n.kind}:${n.agent}`:n.kind;t.set(e,n)}return t}function HD(e,t){let n=e.get(t);if(n)return n.status;let r=[...e.values()].filter(e=>e.kind===t);if(r.length!==0)return r.some(e=>e.status===`ready`)?`ready`:r.every(e=>e.status===`not-found`)?`not-found`:`login-required`}var UD=`__custom__`,WD=[],GD={};function KD({schema:e,value:t,secretFields:n=WD,fieldHints:r=GD,onChange:i}){let a=e.shape,o=new Set(n);function s(e,n){let r={...t};n===void 0?delete r[e]:r[e]=n,i(r)}return(0,B.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:Object.entries(a).map(([e,n])=>(0,B.jsx)(JD,{name:e,schema:n,value:t[e],isSecret:o.has(e),hintValues:r[e],onChange:t=>s(e,t)},e))})}function qD(e){return e instanceof Cs||e instanceof ws?{inner:e._def.innerType,optional:!0}:{inner:e,optional:!1}}function JD({name:e,schema:t,value:n,isSecret:r,hintValues:i,onChange:a}){let{inner:o,optional:s}=qD(t),c=s?` (optional)`:``;if(o instanceof Wo){let t=typeof n==`string`?n:``;return r?(0,B.jsx)(MD,{label:`${e}${c}`,value:t,onChange:e=>a(e||(s?void 0:``))}):i&&i.length>0?(0,B.jsx)(QD,{name:`${e}${c}`,fieldName:e,presets:i,optional:s,value:t,onChange:a}):(0,B.jsx)(ZD,{label:`${e}${c}`,value:t,onChange:e=>a(e||(s?void 0:``))})}if(o instanceof Ko){let t=typeof n==`number`?n:0;return(0,B.jsx)($D,{label:`${e}${c}`,value:t,onChange:e=>a(e)})}if(o instanceof Jo)return(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:n===!0,onChange:e=>a(e.target.checked)}),e]});if(o instanceof ys){let t=o._def.values??o.options??[],r=typeof n==`string`?n:s?``:t[0]??``;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`${e}${c}`}),(0,B.jsxs)(`select`,{className:`app-field h-10`,value:r,onChange:e=>a(e.target.value||(s?void 0:t[0])),children:[s&&(0,B.jsx)(`option`,{value:``,children:`— unset —`}),t.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]})]})}if(o instanceof rs){let t=Array.isArray(n)?n.filter(e=>typeof e==`string`):[];return(0,B.jsx)(ZD,{label:`${e}${c} (空白或 , 分隔)`,value:t.join(` `),onChange:e=>{let t=e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean);t.length===0?a(s?void 0:[]):a(t)}})}if(o instanceof fs){let t=typeof n==`object`&&n?Object.fromEntries(Object.entries(n).filter(([,e])=>typeof e==`string`)):{},r=Object.entries(t).map(([e,t])=>`${e}=${t}`).join(`
|
|
1493
|
-
`);return(0,B.jsxs)(`div`,{className:`sm:col-span-2 flex flex-col gap-1.5`,children:[(0,B.jsx)(
|
|
1494
|
-
`)){let e=n.indexOf(`=`);if(e<=0)continue;let r=n.slice(0,e).trim(),i=n.slice(e+1);r.length>0&&t.push([r,i])}t.length===0?a(s?void 0:{}):a(Object.fromEntries(t))}})]})}return(0,B.jsxs)(`div`,{className:`sm:col-span-2 flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`${e}${c} (JSON)`}),(0,B.jsx)(XD,{value:n,onChange:a,optional:s})]})}function YD(e){if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return``}}function XD({value:e,onChange:t,optional:n}){return(0,B.jsx)(`textarea`,{className:`app-field min-h-[80px] font-mono`,defaultValue:YD(e),onBlur:e=>{let r=e.target.value.trim();if(r.length===0){t(n?void 0:null);return}try{t(JSON.parse(r))}catch{}}})}function ZD({label:e,value:t,onChange:n}){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:e}),(0,B.jsx)(xw,{value:t,onChange:e=>n(e.target.value)})]})}function QD({name:e,fieldName:t,presets:n,optional:r,value:i,onChange:a}){let o=i.length>0&&n.includes(i),[s,c]=(0,z.useState)(()=>i.length===0||o?`preset`:`custom`);function l(e){e.length===0?a(r?void 0:``):a(e)}function u(e){if(e===UD){c(`custom`);return}c(`preset`),l(e)}if(s===`custom`)return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(Sw,{children:e}),(0,B.jsx)(`button`,{type:`button`,className:`text-xs text-muted-foreground underline decoration-dotted underline-offset-2 hover:text-foreground`,onClick:()=>{c(`preset`),n.includes(i)||l(``)},children:`选预设…`})]}),(0,B.jsx)(xw,{"data-testid":`field-${t}-input`,placeholder:n[0]??``,value:i,onChange:e=>l(e.target.value)})]});let d=o?i:``;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{htmlFor:`field-${t}-select`,children:e}),(0,B.jsxs)(`select`,{id:`field-${t}-select`,"data-testid":`field-${t}-select`,className:`app-field h-10`,value:d,onChange:e=>u(e.target.value),children:[r&&(0,B.jsx)(`option`,{value:``,children:`— unset —`}),!r&&d===``&&(0,B.jsx)(`option`,{value:``,disabled:!0,children:`— 选 model —`}),n.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e)),(0,B.jsx)(`option`,{value:UD,children:`Custom…`})]})]})}function $D({label:e,value:t,onChange:n}){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:e}),(0,B.jsx)(xw,{type:`number`,value:t,onChange:e=>{let t=Number.parseInt(e.target.value,10);n(Number.isNaN(t)?0:t)}})]})}var eO=X({baseUrl:Y(),apiKey:Y(),model:Y(),timeoutMs:Ns().int().positive()}),tO={secretFields:[`apiKey`]},nO=X({url:Y(),token:Y(),defaultModel:Y().optional(),tools:Is(Y()).optional(),timeoutMs:Ns().int().positive().optional()}),rO=X({command:Y(),args:Is(Y()),cwd:Y().optional(),env:zs(Y()).optional(),timeoutMs:Ns().int().positive().optional(),sandbox:Ps().optional()}),iO=X({model:Y().optional(),cliVersion:Y().optional(),extraArgs:Is(Y()).optional(),env:zs(Y()).optional(),workspaceRoot:Y().optional(),timeoutMs:Ns().int().positive().optional(),permissionPolicy:Vs([`auto`,`supervised`,`plan`]).optional()}),aO=X({agent:Vs([`gemini`,`qwen`]),model:Y().optional(),cliVersion:Y().optional(),extraArgs:Is(Y()).optional(),env:zs(Y()).optional(),timeoutMs:Ns().int().positive().optional()}),oO=X({model:Y().optional(),timeoutMs:Ns().int().positive().optional()}),sO=X({model:Y().optional(),timeoutMs:Ns().int().positive().optional()}),cO=[`gpt-4o-mini`,`gpt-4o`,`gpt-5`,`gpt-5-mini`,`o3-mini`],lO=[`gemini-2.5-flash`,`gemini-2.5-pro`,`gemini-2.0-flash`],uO=[`deepseek-chat`,`deepseek-reasoner`],dO=[`Qwen/Qwen2.5-7B-Instruct`,`Qwen/Qwen2.5-72B-Instruct`,`deepseek-ai/DeepSeek-V3`],fO=[`anthropic/claude-sonnet-4.5`,`openai/gpt-5`,`openai/gpt-4o-mini`,`google/gemini-2.5-flash`],pO=[`sonnet`,`opus`,`haiku`],mO=[`gemini-2.5-pro`,`gemini-2.5-flash`,`gemini-2.0-flash`],hO=[`qwen3-coder-plus`,`qwen3-max`,`qwen3-72b`],gO=[`gpt-5.5`,`gpt-5.4`,`gpt-5.4-mini`,`gpt-5.3-codex`,`gpt-5.2`],_O=[`auto`,`claude-sonnet-4.5`,`gpt-5`,`gemini-2.5-pro`],vO={http:{label:`HTTP (OpenAI-compatible)`,description:`Generic chat-completions endpoint that speaks the OpenAI wire format.`,variants:{default:{label:`Default`,description:`Empty preset — fill in baseUrl, apiKey, model.`,schema:eO,...tO,fieldHints:{model:cO}},"gemini-openai-compat":{label:`Gemini (OpenAI-compat)`,description:`generativelanguage.googleapis.com OpenAI compatibility endpoint.`,schema:eO,...tO,fieldHints:{model:lO}},deepseek:{label:`DeepSeek`,description:`api.deepseek.com — model defaults to deepseek-chat.`,schema:eO,...tO,fieldHints:{model:uO}},siliconflow:{label:`SiliconFlow`,description:`api.siliconflow.cn/v1 — Chinese OpenAI-compatible aggregator.`,schema:eO,...tO,fieldHints:{model:dO}},openrouter:{label:`OpenRouter`,description:`openrouter.ai/api/v1 — fanout to 100+ provider models.`,schema:eO,...tO,fieldHints:{model:fO}}}},mcp:{label:`MCP (tool source)`,description:`Model Context Protocol streamable-http server. Exposes tools, not chat.`,variants:{default:{label:`Default`,description:`MCP server with bearer auth.`,schema:nO,secretFields:[`token`]}}},cli:{label:`Generic CLI`,description:`Spawn an arbitrary CLI per turn. Reserved for stub / debug use.`,variants:{default:{label:`Default`,description:`Manual command + args.`,schema:rO}}},"claude-code":{label:`Claude Code`,description:`Anthropic Claude Code CLI in stream-json mode (FEAT-012).`,variants:{default:{label:`Default`,description:`Auto-approve, CLI default model, 120s turn timeout.`,schema:iO,fieldHints:{model:pO}},"opus-plan":{label:`Opus + Plan policy`,description:`Opus model with plan-mode permission policy, 180s turn timeout.`,schema:iO,fieldHints:{model:pO}}}},acp:{label:`ACP (Gemini / Qwen)`,description:`Agent Client Protocol harness — variant key selects the CLI agent.`,variants:{gemini:{label:`Gemini CLI`,description:`google-gemini/gemini-cli with --experimental-acp + --yolo.`,schema:aO,fieldHints:{model:mO}},qwen:{label:`Qwen Code`,description:`qwenlm/qwen-code with --acp + --yolo.`,schema:aO,fieldHints:{model:hO}}}},codex:{label:`Codex`,description:`OpenAI @openai/codex app-server via JSON-RPC over stdio (FEAT-016).`,variants:{default:{label:`Default (gpt-5.5)`,description:`Codex app-server, 120s turn timeout.`,schema:oO,fieldHints:{model:gO}}}},cursor:{label:`Cursor Agent`,description:`Cursor CLI in stream-json mode — no npm fallback (install cursor-agent) (FEAT-016).`,variants:{default:{label:`Default (auto model)`,description:`cursor-agent -p --output-format=stream-json, 120s turn timeout.`,schema:sO,fieldHints:{model:_O}}}}};function yO(){return Object.keys(vO)}function bO(e){return Object.keys(vO[e].variants)}function xO(e){let t=bO(e);return{engine:e,variant:t.includes(`default`)?`default`:t[0]}}var SO={ready:`ready`,"login-required":`login required`,"not-found":`not installed`},CO={ready:`bg-success`,"login-required":`bg-warning`,"not-found":`bg-muted-foreground/40`},wO={ready:`text-success`,"login-required":`text-warning`,"not-found":`text-muted-foreground`};function TO({status:e,label:t,testId:n}){return e?(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs ${wO[e]}`,"data-testid":n,"data-status":e,children:[(0,B.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full ${CO[e]}`}),t??SO[e]]}):(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,"data-testid":n,children:[(0,B.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-muted-foreground/30`}),`unknown`]})}function EO({executor:e,onChange:t}){let n=vO[e.engine],r=n.variants[e.variant],[i,a]=(0,z.useState)(!1),o=kT(),s=VD(o.data?.engines),c=AT(),[l,u]=(0,z.useState)(!1);async function d(){u(!0);try{await c()}finally{u(!1)}}function f(n){if(n===e.engine)return;let r=bO(n).includes(e.variant)?e.variant:void 0;t(r?{engine:n,variant:r}:xO(n))}function p(n){n!==e.variant&&t({engine:e.engine,variant:n})}function m(n){if(!n||Object.keys(n).length===0){let{overrides:n,...r}=e;t(r);return}t({...e,overrides:n})}function h(t){let n=e.overrides?.cmd,r={...t};n&&Object.keys(n).length>0&&(r.cmd=n),m(r)}function g(t){let{cmd:n,...r}=e.overrides??{};if(!t||Object.keys(t).length===0){m(r);return}m({...r,cmd:t})}function _(n){let r={...e};n.modelId===void 0||n.modelId===``?delete r.modelId:r.modelId=n.modelId,n.reasoningId===void 0||n.reasoningId===``?delete r.reasoningId:r.reasoningId=n.reasoningId,n.permissionPolicy===void 0?delete r.permissionPolicy:r.permissionPolicy=n.permissionPolicy,t(r)}let{cmd:v,...y}=e.overrides??{},b=HD(s,e.engine),x=e.engine===`acp`?s.get(`acp:${e.variant}`):s.get(e.engine);return(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-5`,children:[(0,B.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Executor`}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`选 engine + variant,仅 override 想改的字段。`})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:d,disabled:l||o.isFetching,"aria-label":`Refresh engine availability`,"data-testid":`refresh-engines-btn`,className:`inline-flex items-center gap-1 rounded-sm border border-hairline px-2 py-1 text-xs text-muted-foreground hover:bg-soft-stone disabled:opacity-60`,children:[(0,B.jsx)(Lm,{className:`size-3.5 ${l?`animate-spin`:``}`}),`Refresh`]})]}),s.size>0&&(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-sm border border-hairline bg-soft-stone p-2 text-xs`,children:yO().map(e=>{let t=HD(s,e);return(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-2 rounded-full border border-hairline bg-background px-2.5 py-1`,"data-testid":`engine-availability-${e}`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:vO[e].label}),(0,B.jsx)(TO,{status:t,testId:`engine-availability-badge-${e}`})]},e)})}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(Sw,{htmlFor:`executor-engine`,children:`Engine`}),(0,B.jsx)(TO,{status:b,testId:`engine-selected-badge`})]}),(0,B.jsx)(`select`,{id:`executor-engine`,className:`app-field h-10`,value:e.engine,onChange:e=>f(e.target.value),children:yO().map(e=>{let t=HD(s,e),n=t?` — ${SO[t]}`:``;return(0,B.jsxs)(`option`,{value:e,children:[vO[e].label,n]},e)})}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.description})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(Sw,{htmlFor:`executor-variant`,children:`Variant`}),e.engine===`acp`&&(0,B.jsx)(TO,{status:x?.status,testId:`variant-selected-badge`})]}),(0,B.jsx)(`select`,{id:`executor-variant`,className:`app-field h-10`,value:e.variant,onChange:e=>p(e.target.value),children:bO(e.engine).map(t=>{let r=e.engine===`acp`?s.get(`acp:${t}`)?.status:void 0,i=r?` — ${SO[r]}`:``;return(0,B.jsxs)(`option`,{value:t,children:[n.variants[t].label,i]},t)})}),r?.description&&(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r.description})]})]}),b===`not-found`&&(0,B.jsx)(DO,{engine:e.engine}),b===`login-required`&&(0,B.jsx)(OO,{engine:e.engine}),r&&(0,B.jsx)(KD,{schema:r.schema,value:y,secretFields:r.secretFields,fieldHints:r.fieldHints,onChange:h}),(0,B.jsxs)(`div`,{className:`border-t pt-4`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`text-sm font-medium text-muted-foreground hover:text-foreground`,onClick:()=>a(e=>!e),"aria-expanded":i,children:[i?`▾`:`▸`,` `,`Advanced (per-request + cmd overrides)`]}),i&&(0,B.jsxs)(`div`,{className:`mt-3 flex flex-col gap-4`,children:[(0,B.jsx)(AO,{modelId:e.modelId,reasoningId:e.reasoningId,permissionPolicy:e.permissionPolicy,onChange:_}),(0,B.jsx)(jO,{cmd:v,onChange:g})]})]})]})}function DO({engine:e}){let t=kO(e);return(0,B.jsxs)(`div`,{role:`alert`,"data-testid":`engine-install-callout`,className:`app-alert-warning`,children:[(0,B.jsx)(`p`,{className:`font-medium`,children:`本 worker 没有该 engine 对应的 CLI。`}),(0,B.jsxs)(`p`,{className:`mt-1 text-muted-foreground`,children:[`进 worker 容器装 / 登录后点 Refresh。具体步骤见`,` `,(0,B.jsxs)(`a`,{className:`underline decoration-dotted underline-offset-2 hover:text-foreground`,href:`/docs/executor-engines.md${t}`,target:`_blank`,rel:`noreferrer`,children:[`docs/executor-engines.md`,t]}),`。`]})]})}function OO({engine:e}){let t=kO(e);return(0,B.jsxs)(`div`,{role:`status`,"data-testid":`engine-login-callout`,className:`app-alert-warning`,children:[(0,B.jsx)(`p`,{className:`font-medium`,children:`CLI 已装但缺登录态。`}),(0,B.jsxs)(`p`,{className:`mt-1 text-muted-foreground`,children:[`在 worker 容器跑对应 CLI 的 login 命令(见`,` `,(0,B.jsxs)(`a`,{className:`underline decoration-dotted underline-offset-2 hover:text-foreground`,href:`/docs/executor-engines.md${t}`,target:`_blank`,rel:`noreferrer`,children:[`docs/executor-engines.md`,t]}),`)后 Refresh。`]})]})}function kO(e){switch(e){case`claude-code`:return`#claude-code`;case`acp`:return`#acp`;case`codex`:return`#codex`;case`cursor`:return`#cursor`;default:return``}}function AO({modelId:e,reasoningId:t,permissionPolicy:n,onChange:r}){return(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`modelId (per-request override)`}),(0,B.jsx)(xw,{value:e??``,onChange:e=>r({modelId:e.target.value,reasoningId:t,permissionPolicy:n})})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`reasoningId`}),(0,B.jsx)(xw,{value:t??``,onChange:t=>r({modelId:e,reasoningId:t.target.value,permissionPolicy:n})})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(Sw,{children:`permissionPolicy`}),(0,B.jsxs)(`select`,{className:`app-field h-10`,value:n??``,onChange:n=>{let i=n.target.value;r({modelId:e,reasoningId:t,...i?{permissionPolicy:i}:{}})},children:[(0,B.jsx)(`option`,{value:``,children:`— unset —`}),(0,B.jsx)(`option`,{value:`auto`,children:`auto`}),(0,B.jsx)(`option`,{value:`supervised`,children:`supervised`}),(0,B.jsx)(`option`,{value:`plan`,children:`plan`})]})]})]})}function jO({cmd:e,onChange:t}){function n(e){let n={};e.binary&&e.binary.length>0&&(n.binary=e.binary),e.extraArgs&&e.extraArgs.length>0&&(n.extraArgs=e.extraArgs),e.env&&Object.keys(e.env).length>0&&(n.env=e.env),e.cliVersion&&e.cliVersion.length>0&&(n.cliVersion=e.cliVersion),t(Object.keys(n).length>0?n:void 0)}let r=(e?.extraArgs??[]).join(` `),i=Object.entries(e?.env??{}).map(([e,t])=>`${e}=${t}`).join(`
|
|
1495
|
-
`);return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-sm border border-hairline bg-soft-stone p-3`,children:[(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`cmd overrides 仅对 spawn 二进制的 engine(cli / claude-code / acp)生效。`}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(
|
|
1496
|
-
`)){let t=e.indexOf(`=`);if(t<=0)continue;let n=e.slice(0,t).trim(),i=e.slice(t+1);n.length>0&&r.push([n,i])}n({...e,env:Object.fromEntries(r)})}})]})]})]})}function MO(){let e=DT(),t=ET(),[n,r]=(0,z.useState)(0);return e.isLoading?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(yD,{className:`h-8 w-48`}),(0,B.jsx)(yD,{className:`h-40`}),(0,B.jsx)(yD,{className:`h-40`})]}):e.isError||!e.data?(0,B.jsxs)(`div`,{className:`app-alert-error`,children:[`加载 worker config 失败:`,` `,e.error instanceof Error?e.error.message:`未知错误`,` `,(0,B.jsx)(Eg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void e.refetch(),children:`重试`})]}):(0,B.jsx)(NO,{initial:e.data.config,initialVersion:e.data.version,info:t.data,onReload:()=>{r(e=>e+1),e.refetch()}},n)}function NO({initial:e,initialVersion:t,info:n,onReload:r}){let[i,a]=(0,z.useState)(e),[o,s]=(0,z.useState)(t),[c,l]=(0,z.useState)(null),[u,d]=(0,z.useState)(null),[f,p]=(0,z.useState)(null),m=OT();function h(e){a(t=>({...t,...e}))}function g(e){a(t=>({...t,executor:e}))}function _(e){a(t=>({...t,channels:e}))}function v(e){a(t=>({...t,evolution:e}))}function y(){if(i.brains.length>0&&i.brainWriteTarget.length===0)return`配置了 brain source 后必须选 write target,或者删光所有 brain。`;if(i.brains.length>0&&!i.brains.some(e=>e.id===i.brainWriteTarget))return`brainWriteTarget "${i.brainWriteTarget}" 不在已配置的 brain id 列表里。`;let e=new Set;for(let t of i.brains){if(t.id.length===0)return`每个 brain source 必须有 id。`;if(e.has(t.id))return`重复的 brain id:${t.id}`;e.add(t.id)}return null}async function b(){l(null),d(null);let e=y();if(e){l(e);return}try{let e=await m.mutateAsync({config:i,ifMatchVersion:o});p(e.runtimeReload===`ok`?`已保存(version ${e.version})。`:`已保存(version ${e.version}),但 runtime reload 失败——重启 worker 才能让新 config 真正生效。`),a(e.config),s(e.version)}catch(e){if(e instanceof jw&&e.code===`version-conflict`){d({expected:e.expectedVersion,actual:e.actualVersion});return}if(e instanceof jw&&e.code===`invalid-config`){l(`worker 拒绝了 config:${e.message}`);return}l(e instanceof Error?e.message:`保存失败。`)}}return(0,B.jsxs)(`form`,{className:`app-page`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,B.jsxs)(`div`,{className:`app-page-header`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Configuration`}),(0,B.jsxs)(`p`,{className:`app-page-copy`,children:[`Version`,` `,(0,B.jsx)(`span`,{className:`font-mono`,children:o}),`。Secret 字段渲染为占位,留空保留旧值。`]})]}),u&&(0,B.jsxs)(`div`,{role:`alert`,className:`app-alert-warning flex items-start gap-3`,children:[(0,B.jsx)(Km,{className:`mt-0.5 size-4 text-warning`}),(0,B.jsxs)(`div`,{className:`flex-1`,children:[(0,B.jsx)(`p`,{className:`font-medium`,children:`Version 冲突`}),(0,B.jsxs)(`p`,{className:`text-muted-foreground`,children:[`你基于 version`,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:u.expected??o}),` `,`做了改动,但当前 stored version 是`,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:u.actual??`?`}),`。期间另一方已经保存了新版本。`]})]}),(0,B.jsx)(Eg,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:`Reload 重新编辑`})]}),c&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error`,children:c}),f&&(0,B.jsx)(`p`,{role:`status`,className:`app-alert-success`,children:f}),(0,B.jsx)(kD,{brains:i.brains,brainWriteTarget:i.brainWriteTarget,brainRetrieval:i.brainRetrieval,onChange:h}),(0,B.jsx)(EO,{executor:i.executor,onChange:g}),(0,B.jsx)(RD,{channels:i.channels,info:n,onChange:_}),(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-4`,children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Evolution (L3)`}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:i.evolution.enabled,onChange:e=>v({...i.evolution,enabled:e.target.checked})}),`启用 evolution observer`]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5 max-w-[240px]`,children:[(0,B.jsx)(`label`,{className:`text-sm font-medium`,children:`Observation 保留天数`}),(0,B.jsx)(`input`,{type:`number`,min:0,className:`app-field h-10`,value:i.evolution.observationRetentionDays,onChange:e=>v({...i.evolution,observationRetentionDays:Number.parseInt(e.target.value,10)||0})})]})]}),(0,B.jsxs)(`div`,{className:`app-panel flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,B.jsxs)(`p`,{className:`min-w-0 text-xs text-muted-foreground`,children:[`保存使用`,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:`If-Match: ${o}`}),`——若 stored version 已前移则返 409。`]}),(0,B.jsxs)(Eg,{type:`submit`,className:`w-full sm:w-auto`,disabled:m.isPending,children:[m.isPending?(0,B.jsx)(Om,{className:`size-4 animate-spin`}):(0,B.jsx)(Rm,{className:`size-4`}),m.isPending?`保存中…`:`保存配置`]})]})]})}var PO=zi(`/config`)({component:MO});function FO(){let e=GT(),[t,n]=(0,z.useState)(null),r=t,i=KT(r??void 0),a=UT(),o=WT(),s=qT(),c=JT(),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(null),[p,m]=(0,z.useState)(null),h=i.data?.messages??[],g=p!==null&&p.text.length>0&&!LO(p,h)?p:null,_=(0,z.useId)(),v=(0,z.useRef)(null);(0,z.useEffect)(()=>()=>{v.current?.abort()},[]);async function y(){let e=l.trim(),r=t,i=h.map(e=>e.id),d=a.isPending||o.isPending;if(!(e.length===0||d)){f(null);try{let t=r?await o.mutateAsync({conversationId:r,prompt:e}):await a.mutateAsync(e);u(``),v.current?.abort();let l=new AbortController;v.current=l,m({taskId:t.id,conversationId:r,text:``,done:!1,initialMessageIds:i}),IO(l,t.id,{onConversation:e=>{n(e),m(n=>!n||n.taskId!==t.id?n:{...n,conversationId:e})},onDelta:e=>{m(n=>!n||n.taskId!==t.id?n:{...n,text:n.text+e})},onDone:e=>{m(e=>e&&e.taskId===t.id?{...e,done:!0}:e),c(),e&&s(e)},onError:e=>{f(e),m(null)}})}catch(e){f(e instanceof jw?e.message:`提交失败。`)}}}return(0,B.jsxs)(`div`,{"data-testid":`worker-chat-panel`,className:`grid min-w-0 grid-cols-1 gap-4 lg:h-[calc(100vh-200px)] lg:min-h-[420px] lg:grid-cols-[280px_1fr]`,children:[(0,B.jsxs)(`aside`,{className:`flex max-h-56 min-h-0 min-w-0 flex-col gap-3 overflow-y-auto rounded-sm border border-hairline bg-card p-3 lg:max-h-none`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,B.jsx)(`h2`,{className:`px-1 text-feature font-normal`,children:`Conversations`}),(0,B.jsxs)(Eg,{type:`button`,variant:t===null?`secondary`:`outline`,size:`sm`,className:`min-h-8 px-2 py-1 text-xs`,onClick:()=>n(null),children:[(0,B.jsx)(Im,{className:`size-3.5`}),`新会话`]})]}),e.isLoading?(0,B.jsx)(yD,{className:`h-20`}):(e.data?.conversations??[]).length===0?(0,B.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:`尚无会话。`}):(0,B.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.data?.conversations.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:`flex w-full flex-col rounded-sm px-2 py-2 text-left text-xs transition-colors ${r===e.id?`bg-primary text-primary-foreground`:`hover:bg-soft-stone`}`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-micro`,children:[e.channel,`:`,e.chatId]}),(0,B.jsx)(`span`,{className:`truncate text-micro-label ${r===e.id?`text-primary-foreground/70`:`text-muted-foreground`}`,children:new Date(e.lastActiveAt).toLocaleString()})]})},e.id))})]}),(0,B.jsxs)(`section`,{className:`flex min-h-[420px] min-w-0 flex-col gap-3 rounded-lg border border-hairline bg-soft-stone p-3 text-foreground sm:p-4 lg:min-h-0`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 overflow-y-auto`,children:[r?i.isLoading?(0,B.jsx)(yD,{className:`h-40`}):i.isError?(0,B.jsxs)(`p`,{role:`alert`,className:`rounded-sm border border-coral-soft bg-coral/10 p-3 text-sm text-coral-soft`,children:[`加载消息失败:`,i.error instanceof Error?i.error.message:`未知错误`]}):(i.data?.messages??[]).map(e=>(0,B.jsxs)(`div`,{className:`max-w-[90%] rounded-sm p-3 text-sm sm:max-w-[80%] ${e.role===`user`?`self-end border border-hairline bg-background text-foreground`:`self-start bg-deep-green text-on-dark`}`,children:[(0,B.jsx)(`p`,{className:`whitespace-pre-wrap break-words`,children:e.content}),(0,B.jsxs)(`p`,{className:`mt-1 text-micro-label opacity-70`,children:[e.role,` · `,new Date(e.createdAt).toLocaleString()]})]},e.id)):(0,B.jsx)(`p`,{className:`rounded-sm border border-dashed border-hairline bg-background p-4 text-center text-sm text-muted-foreground sm:p-6`,children:`新会话`}),g&&(0,B.jsxs)(`div`,{className:`max-w-[90%] self-start rounded-sm bg-deep-green p-3 text-sm text-on-dark sm:max-w-[80%]`,children:[(0,B.jsx)(`p`,{className:`whitespace-pre-wrap break-words`,children:g.text}),!g.done&&(0,B.jsxs)(`p`,{className:`mt-1 text-micro-label text-on-dark/70`,children:[(0,B.jsx)(Om,{className:`inline size-3 animate-spin`}),` streaming…`]})]})]}),d&&(0,B.jsx)(`p`,{role:`alert`,className:`rounded-sm border border-coral-soft bg-coral/10 p-2 text-xs text-coral-soft`,children:d}),(0,B.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row`,onSubmit:e=>{e.preventDefault(),y()},children:[(0,B.jsx)(`label`,{htmlFor:_,className:`sr-only`,children:`Prompt`}),(0,B.jsx)(`textarea`,{id:_,className:`min-h-[60px] min-w-0 flex-1 resize-none rounded-sm border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,placeholder:`给 worker 发一条消息(Cmd/Ctrl + Enter 发送)`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),y())}}),(0,B.jsxs)(Eg,{type:`submit`,className:`w-full sm:w-auto`,disabled:a.isPending||o.isPending||l.trim().length===0,children:[a.isPending||o.isPending?(0,B.jsx)(Om,{className:`size-4 animate-spin`}):(0,B.jsx)(zm,{className:`size-4`}),`发送`]})]})]})]})}async function IO(e,t,n){let r=null,i=`task:${t}`;function a(e){r!==e&&(r=e,n.onConversation(e))}try{await rT(e.signal,o=>{let s=o.data,c=typeof s.taskId==`string`?s.taskId:null;if(o.type===`conversation.created`&&(!c||c===t)&&(s.chatId===i||c===t)&&typeof s.conversationId==`string`){a(s.conversationId);return}let l=typeof s.conversationId==`string`?s.conversationId:null;if(!(c&&c!==t)&&!(!r&&c!==t)&&!(r&&l&&l!==r)){if(!r&&l&&o.type.startsWith(`orchestrator.`)&&a(l),o.type===`orchestrator.text`){let e=typeof s.delta==`string`?s.delta:``;e.length>0&&n.onDelta(e)}else if(o.type===`orchestrator.finished`)n.onDone(r),e.abort();else if(o.type===`orchestrator.error`){let t=typeof s.error==`string`?s.error:`事件流返回执行错误。`;n.onError(t),e.abort()}}})}catch(t){if(e.signal.aborted)return;n.onError(t instanceof Error?t.message:`事件流中断。`)}}function LO(e,t){if(!e.done||e.text.length===0)return!1;let n=new Set(e.initialMessageIds);return t.some(t=>t.role===`assistant`&&t.content===e.text&&!n.has(t.id)&&(!e.conversationId||t.conversationId===e.conversationId))}var RO=zi(`/chat`)({component:FO});function zO(){return(0,B.jsxs)(`section`,{className:`app-page-narrow`,children:[(0,B.jsxs)(`header`,{className:`app-page-header min-w-0`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Brain`}),(0,B.jsxs)(`p`,{className:`app-page-copy break-words`,children:[`Project Brain 摘要 + admission 审批 + brain artifact 注册表。 Brief 是 canonical brain(`,(0,B.jsx)(`code`,{className:`app-code`,children:`.aiworker/`}),`)的投影;这里展示的内容默认 redact secret-like 字段。`]})]}),(0,B.jsx)(BO,{}),(0,B.jsx)(HO,{}),(0,B.jsx)(UO,{})]})}function BO(){let e=YT();if(e.isLoading)return(0,B.jsx)(`section`,{className:`app-panel`,children:(0,B.jsx)(yD,{className:`h-24 w-full`})});if(e.error||e.data===void 0)return(0,B.jsxs)(`section`,{className:`app-alert-error`,children:[`无法加载 brain summary:`,e.error?.message??`unknown error`]});let{brainSummary:t,checkedAt:n}=e.data;return(0,B.jsxs)(`section`,{className:`grid gap-6 rounded-lg border border-hairline bg-soft-stone p-5 sm:grid-cols-2 sm:p-6`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`mb-2 text-micro uppercase text-muted-foreground`,children:`Scope manifest`}),t.scopeManifest.status===`ok`?(0,B.jsxs)(`ul`,{className:`space-y-1 text-sm`,children:[(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{children:`kind: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.scopeManifest.kind})]}),(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{children:`primary soul: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.scopeManifest.primarySoul})]}),t.scopeManifest.privacy&&(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{children:`privacy: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.scopeManifest.privacy})]}),t.scopeManifest.approval&&(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{children:`approval: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.scopeManifest.approval})]})]}):(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:`状态:`}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.scopeManifest.status}),t.scopeManifest.error&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`br`,{}),(0,B.jsx)(`span`,{className:`text-destructive`,children:t.scopeManifest.error})]})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`mb-2 text-micro uppercase text-muted-foreground`,children:`Aggregates`}),(0,B.jsxs)(`ul`,{className:`space-y-1 text-sm`,children:[(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{children:`artifacts: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.artifacts.total}),(0,B.jsx)(`span`,{children:` total, by status: ${Object.entries(t.artifacts.byStatus).map(([e,t])=>`${e}=${t}`).join(`, `)||`<none>`}`})]}),(0,B.jsx)(`li`,{children:(0,B.jsx)(`span`,{children:`admissions by status: ${Object.entries(t.admissions.byStatus).map(([e,t])=>`${e}=${t}`).join(`, `)||`<none>`}`})}),t.admissions.lastUpdatedAt&&(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{children:`last updated: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.admissions.lastUpdatedAt})]})]}),(0,B.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:`checked at: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:n})]})]})]})}function VO(e){return e===`pending`?`secondary`:e===`approved`||e===`applied`?`default`:e===`rejected`||e===`failed`?`destructive`:`outline`}function HO(){let[e,t]=(0,z.useState)(``),n=YT(),r=XT({status:`pending`}),i=ZT(),a=QT(),o=$T(),s=e.trim().length>0,c=r.data?.proposals??[];return(0,B.jsxs)(`section`,{className:`app-panel`,children:[(0,B.jsxs)(`header`,{className:`mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,B.jsx)(`h2`,{className:`text-micro uppercase text-muted-foreground`,children:`Admission proposals (pending)`}),(0,B.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,B.jsx)(xw,{className:`h-8 w-48`,placeholder:`--decided-by name`,value:e,onChange:e=>t(e.target.value)})})]}),r.isLoading&&(0,B.jsx)(yD,{className:`h-24 w-full`}),r.error&&(0,B.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`加载失败:`,r.error.message]}),!r.isLoading&&c.length===0&&(0,B.jsxs)(`div`,{className:`space-y-2 text-sm text-muted-foreground`,children:[(0,B.jsx)(`p`,{children:`暂无 pending 的 admission proposal。`}),n.data?.brainSummary.admissions.bypassRisk.status===`suspected`&&(0,B.jsx)(`p`,{className:`text-warning`,children:`最近有回复声称已提交 admission 或已写入长期记忆,但 AIWorker admission 数据库没有新增记录;外部 executor 可能写入了自己的 native memory。`})]}),(0,B.jsx)(`ul`,{className:`space-y-3`,children:c.map(t=>(0,B.jsxs)(`li`,{className:`rounded-sm border border-hairline bg-background p-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`font-mono`,children:t.id}),(0,B.jsx)(lE,{variant:VO(t.status),children:t.status}),(0,B.jsx)(lE,{variant:`outline`,children:t.kind}),(0,B.jsxs)(lE,{variant:`outline`,children:[`soul:`,t.soulId]}),(0,B.jsxs)(lE,{variant:`outline`,children:[`risk:`,t.risk]})]}),(0,B.jsx)(`p`,{className:`mt-1 text-sm`,children:t.summary}),(0,B.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`target:`,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:t.target})]}),(0,B.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,B.jsx)(Eg,{size:`sm`,disabled:!s||i.isPending,onClick:()=>i.mutate({decidedBy:e,id:t.id}),children:`Approve`}),(0,B.jsx)(Eg,{size:`sm`,variant:`destructive`,disabled:!s||a.isPending,onClick:()=>a.mutate({decidedBy:e,id:t.id}),children:`Reject`}),(0,B.jsx)(Eg,{size:`sm`,variant:`outline`,disabled:!s||o.isPending,onClick:()=>o.mutate({decidedBy:e,id:t.id}),children:`Apply (dry-run)`}),(0,B.jsx)(Eg,{size:`sm`,variant:`outline`,disabled:!s||o.isPending,onClick:()=>o.mutate({commit:!0,decidedBy:e,id:t.id}),children:`Apply --commit`})]})]},t.id))}),(i.error||a.error||o.error)&&(0,B.jsxs)(`p`,{className:`mt-3 text-sm text-destructive`,children:[`操作失败:`,(i.error??a.error??o.error)?.message]})]})}function UO(){let e=eE({limit:50});return(0,B.jsxs)(`section`,{className:`app-panel`,children:[(0,B.jsxs)(`header`,{className:`mb-4`,children:[(0,B.jsx)(`h2`,{className:`text-micro uppercase text-muted-foreground`,children:`Brain artifacts (read-only, redacted)`}),(0,B.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Confidential / secret artifact 的 ref 与 hash 默认替换为`,(0,B.jsx)(`code`,{className:`font-mono`,children:`<redacted>`}),`。`]})]}),e.isLoading&&(0,B.jsx)(yD,{className:`h-24 w-full`}),e.error&&(0,B.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`加载失败:`,e.error.message]}),!e.isLoading&&(e.data?.artifacts.length??0)===0&&(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`暂无登记的 brain artifact。`}),(0,B.jsx)(`ul`,{className:`space-y-2`,children:(e.data?.artifacts??[]).map(e=>(0,B.jsxs)(`li`,{className:`rounded-sm border border-hairline bg-background p-3 text-sm`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`font-mono`,children:e.id}),(0,B.jsx)(lE,{variant:`outline`,children:e.type}),(0,B.jsx)(lE,{variant:`outline`,children:e.status}),(0,B.jsxs)(lE,{variant:`outline`,children:[`sensitivity:`,e.sensitivity]}),e.scopeId&&(0,B.jsxs)(lE,{variant:`outline`,children:[`scope:`,e.scopeId]})]}),e.summary&&(0,B.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:e.summary}),(0,B.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`ref:`,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:e.ref})]})]},e.id))})]})}var WO=zi(`/brain`)({component:zO});function GO(){let e=VT(),t=HT(),[n,r]=(0,z.useState)(null),i=(0,z.useMemo)(()=>e.data?.approvals??[],[e.data]);async function a(e,n){r(null);try{await t.mutateAsync({taskId:e.taskId,toolCallId:e.toolCallId,decision:n})}catch(e){r(e instanceof jw?e.message:`提交失败。`)}}return(0,B.jsxs)(`div`,{className:`app-page-narrow max-w-5xl`,children:[(0,B.jsxs)(`header`,{className:`app-page-header`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Approvals`}),(0,B.jsx)(`p`,{className:`app-page-copy`,children:"orchestrator 命中 toolPolicy `ask` 规则时挂起的工具调用。批准前 60s 内未处理视同 deny。"})]}),i.length>0&&(0,B.jsxs)(`div`,{role:`alert`,className:`app-alert-warning flex items-start gap-3`,children:[(0,B.jsx)(Bm,{className:`mt-0.5 size-4 text-warning`}),(0,B.jsxs)(`div`,{className:`flex-1`,children:[(0,B.jsxs)(`p`,{className:`font-medium`,children:[i.length,` `,`个 pending approval`]}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`超时(默认 60s)未处理 = deny。`})]})]}),n&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error`,children:n}),e.isLoading?(0,B.jsx)(yD,{className:`h-40`}):e.isError?(0,B.jsxs)(`p`,{role:`alert`,className:`app-alert-error`,children:[`加载失败:`,e.error instanceof Error?e.error.message:`未知错误`]}):i.length===0?(0,B.jsx)(`p`,{className:`app-empty`,children:`当前没有 pending approval。`}):(0,B.jsx)(`ul`,{className:`flex flex-col gap-3`,children:i.map(e=>(0,B.jsxs)(`li`,{className:`flex flex-col gap-3 rounded-sm border border-hairline bg-card p-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`code`,{className:`font-mono text-sm`,children:e.toolName}),(0,B.jsx)(KO,{at:e.expiresAt})]}),(0,B.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`task`,(0,B.jsx)(`code`,{className:`ml-1 font-mono`,children:e.taskId}),(0,B.jsx)(`span`,{className:`mx-2`,children:`·`}),`tool call`,(0,B.jsx)(`code`,{className:`ml-1 font-mono`,children:e.toolCallId})]})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,B.jsxs)(Eg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void a(e,`deny`),disabled:t.isPending,children:[(0,B.jsx)(Jm,{className:`size-4`}),`Deny`]}),(0,B.jsxs)(Eg,{type:`button`,size:`sm`,onClick:()=>void a(e,`allow`),disabled:t.isPending,children:[t.isPending?(0,B.jsx)(Om,{className:`size-4 animate-spin`}):(0,B.jsx)(xm,{className:`size-4`}),`Allow`]})]})]}),(0,B.jsxs)(`details`,{className:`text-xs`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`查看 params`}),(0,B.jsx)(`pre`,{className:`mt-1 overflow-x-auto rounded-sm bg-soft-stone p-2 text-foreground`,children:JSON.stringify(e.params,null,2)})]})]},`${e.taskId}:${e.toolCallId}`))})]})}function KO({at:e}){let t=e-Date.now();if(t<=0)return(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-micro text-destructive`,children:[(0,B.jsx)(Cm,{className:`size-3`}),`expired`]});let n=Math.max(0,Math.round(t/1e3));return(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-micro text-muted-foreground`,children:[(0,B.jsx)(Cm,{className:`size-3`}),`剩`,n,`s`]})}var qO=zi(`/approvals`)({component:GO});function JO(){let e=TT(),t=ET(),n=LT(),r=VT();return(0,B.jsxs)(`section`,{className:`app-page-narrow`,children:[(0,B.jsxs)(`header`,{className:`app-page-header min-w-0`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`概览`}),(0,B.jsxs)(`p`,{className:`app-page-copy break-words`,children:[`单 worker 自管面板。所有数据通道走当前入口的`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`/api/worker/*`}),`兼容管理 API。`]})]}),(0,B.jsxs)(`div`,{className:`grid min-w-0 gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:[(0,B.jsx)(YO,{title:`Worker 健康`,icon:ym,loading:e.isLoading,error:e.error,children:e.data&&(0,B.jsxs)(`ul`,{className:`space-y-1 text-sm`,children:[(0,B.jsx)(XO,{label:`status`,value:e.data.status}),(0,B.jsx)(XO,{label:`config`,value:`v${e.data.configVersion}`}),(0,B.jsx)(XO,{label:`brain`,value:e.data.brain?e.data.brain.status:`unknown`}),(0,B.jsx)(XO,{label:`executor`,value:e.data.executor?e.data.executor.status:`unknown`})]})}),(0,B.jsx)(YO,{title:`Brain`,icon:bm,loading:t.isLoading,error:t.error,actionTo:`/config`,actionLabel:`改配置`,children:t.data&&(0,B.jsx)(`ul`,{className:`space-y-1 text-sm`,children:t.data.brains.length===0?(0,B.jsx)(`li`,{className:`text-muted-foreground`,children:`未配置 brain。`}):t.data.brains.map(e=>(0,B.jsxs)(`li`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`code`,{className:`font-mono text-xs`,children:e.id}),(0,B.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.type,` · `,e.status]})]},e.id))})}),(0,B.jsx)(YO,{title:`Executor`,icon:wm,loading:t.isLoading,error:t.error,actionTo:`/test`,actionLabel:`探测`,children:t.data&&(0,B.jsxs)(`ul`,{className:`space-y-1 text-sm`,children:[(0,B.jsx)(XO,{label:`type`,value:t.data.executor.type}),t.data.executor.model&&(0,B.jsx)(XO,{label:`model`,value:t.data.executor.model}),(0,B.jsx)(XO,{label:`status`,value:t.data.executor.status})]})}),(0,B.jsx)(YO,{title:`Cron 调度`,icon:Wm,loading:n.isLoading,error:n.error,actionTo:`/cron`,actionLabel:`管理`,children:n.data&&(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`共`,` `,(0,B.jsx)(`span`,{className:`font-medium text-foreground`,children:n.data.jobs.length}),` `,`个;`,` `,(0,B.jsx)(`span`,{className:`font-medium text-foreground`,children:n.data.jobs.filter(e=>e.enabled).length}),` `,`启用中。`]})}),(0,B.jsx)(YO,{title:`Approvals`,icon:Vm,loading:r.isLoading,error:r.error,actionTo:`/approvals`,actionLabel:r.data?.approvals.length?`处理`:`查看`,children:r.data&&(0,B.jsx)(`p`,{className:`text-sm`,children:(0,B.jsxs)(`span`,{className:r.data.approvals.length>0?`font-medium text-warning`:`text-muted-foreground`,children:[r.data.approvals.length,` `,`pending`]})})}),(0,B.jsx)(YO,{title:`Chat`,icon:Am,loading:!1,actionTo:`/chat`,actionLabel:`打开`,children:(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`发条消息给 worker,检查 orchestrator 端到端通路。`})})]})]})}function YO({title:e,icon:t,loading:n,error:r,actionTo:i,actionLabel:a,children:o}){return(0,B.jsxs)(`article`,{className:`app-panel flex min-w-0 flex-col gap-3`,children:[(0,B.jsxs)(`header`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsx)(t,{className:`size-4 shrink-0 text-muted-foreground`}),(0,B.jsx)(`h3`,{className:`truncate text-feature font-normal`,children:e})]}),i&&(0,B.jsx)(tE,{to:i,className:`shrink-0 text-xs text-muted-foreground underline decoration-dotted underline-offset-2 hover:text-foreground`,children:a??`前往`})]}),n?(0,B.jsx)(yD,{className:`h-16`}):r?(0,B.jsx)(`p`,{className:`text-xs text-destructive`,children:r instanceof Error?r.message:`加载失败`}):o]})}function XO({label:e,value:t}){return(0,B.jsxs)(`li`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,B.jsx)(`code`,{className:`min-w-0 truncate font-mono text-xs`,children:t})]})}var ZO=zi(`/`)({component:JO}),QO=yE.update({id:`/test`,path:`/test`,getParentRoute:()=>sE}),$O=SD.update({id:`/secrets`,path:`/secrets`,getParentRoute:()=>sE}),ek=ED.update({id:`/cron`,path:`/cron`,getParentRoute:()=>sE}),tk=PO.update({id:`/config`,path:`/config`,getParentRoute:()=>sE}),nk=RO.update({id:`/chat`,path:`/chat`,getParentRoute:()=>sE}),rk=WO.update({id:`/brain`,path:`/brain`,getParentRoute:()=>sE}),ik=qO.update({id:`/approvals`,path:`/approvals`,getParentRoute:()=>sE}),ak={IndexRoute:ZO.update({id:`/`,path:`/`,getParentRoute:()=>sE}),ApprovalsRoute:ik,BrainRoute:rk,ChatRoute:nk,ConfigRoute:tk,CronRoute:ek,SecretsRoute:$O,TestRoute:QO},ok=sE._addFileChildren(ak)._addFileTypes();Qa(`worker`),im();var sk=ea({routeTree:ok,basepath:Qp(`worker`),defaultPreload:`intent`,defaultPreloadStaleTime:0,scrollRestoration:!0}),ck=document.getElementById(`root`);if(!ck)throw Error(`Root element not found`);(0,sa.createRoot)(ck).render((0,B.jsx)(z.StrictMode,{children:(0,B.jsxs)(ze,{client:to,children:[(0,B.jsx)($a,{scope:`worker`}),(0,B.jsx)(ra,{router:sk}),(0,B.jsx)(eo,{})]})}));
|
|
1378
|
+
)`}return(0,B.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),BE=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=mE(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,B.jsx)(EE.Provider,{value:n,children:(0,B.jsxs)(Eb,{ref:t,...r,children:[a&&o===!0&&(0,B.jsx)(zE,{ref:i.context.internalBackdropRef,inert:iw(!open)}),e.children]})}):null}),VE={},HE={},UE=``;function WE(e){if(typeof document>`u`)return!1;let t=By(e);return Ng(t).innerWidth-t.documentElement.clientWidth>0}function GE(e){let t=By(e),n=t.documentElement,r=t.body,i=zg(n)?n:r,a=i.style.overflow;return i.style.overflow=`hidden`,()=>{i.style.overflow=a}}function KE(e){let t=By(e),n=t.documentElement,r=t.body,i=Ng(n),a=0,o=0,s=Ry.create(),c=typeof CSS<`u`&&CSS.supports?.(`scrollbar-gutter`,`stable`);if(p_&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let e=i.getComputedStyle(n),t=i.getComputedStyle(r),s=(e.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,VE={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},UE=n.style.scrollBehavior,HE={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let l=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,d=e.overflowY===`scroll`||t.overflowY===`scroll`,f=e.overflowX===`scroll`||t.overflowX===`scroll`,p=Math.max(0,i.innerWidth-n.clientWidth),m=Math.max(0,i.innerHeight-n.clientHeight),h=parseFloat(t.marginTop)+parseFloat(t.marginBottom),g=parseFloat(t.marginLeft)+parseFloat(t.marginRight),_=zg(n)?n:r;if(c){n.style.scrollbarGutter=s,_.style.overflowY=`hidden`,_.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:s,overflowY:`hidden`,overflowX:`hidden`}),(l||d)&&(n.style.overflowY=`scroll`),(u||f)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:h||m?`calc(100dvh - ${h+m}px)`:`100dvh`,width:g||p?`calc(100vw - ${g+p}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,VE),Object.assign(r.style,HE),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=UE)}function d(){u(),s.request(l)}return l(),i.addEventListener(`resize`,d),()=>{s.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var qE=new class{lockCount=0;restore=null;timeoutLock=kg.create();timeoutUnlock=kg.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=By(e).documentElement,n=Ng(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=ly;return}let r=m_||!WE(e);this.restore=r?GE(e):KE(e)}};function JE(e=!0,t=null){bg(()=>{if(e)return qE.acquire(t)},[e,t])}function YE(e){let t=z.useRef(``),n=z.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:z.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n&&e(n,n.pointerType),e(n,t.current),t.current=``},[e]),onPointerDown:n}}function XE(e){let[t,n]=z.useState(null),r=o_((t,r)=>{e||n(r)}),i=z.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:o}=YE(r);return z.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:o}}),[t,i,a,o])}function ZE(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l,reset:u}=XE(i);FS(t);let{forceUnmount:d}=IS(i,t,()=>{u()}),f=o_(e=>{let n=Cy(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=z.useCallback(()=>{t.setOpen(!1,f(Sy))},[t,f]);z.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=US({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=z.useState(0),_=h===0,v=oC(m),y=Qx(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=E_(e);if(_&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||T_(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});JE(i&&o===!0,s);let{getReferenceProps:b,getFloatingProps:x,getTriggerProps:S}=nC([v,y]);t.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),z.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);let C=z.useMemo(()=>b(l),[b,l]),w=z.useMemo(()=>S(l),[S,l]),T=z.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:h})}var QE={...BS,modal:bS(e=>e.modal),nested:bS(e=>e.nested),nestedOpenDialogCount:bS(e=>e.nestedOpenDialogCount),disablePointerDismissal:bS(e=>e.disablePointerDismissal),openMethod:bS(e=>e.openMethod),descriptionElementId:bS(e=>e.descriptionElementId),titleElementId:bS(e=>e.titleElementId),viewportElement:bS(e=>e.viewportElement),role:bS(e=>e.role)},$E=class extends DS{constructor(e){super(eD(e),{popupRef:z.createRef(),backdropRef:z.createRef(),internalBackdropRef:z.createRef(),triggerElements:new LS,onOpenChange:void 0,onOpenChangeComplete:void 0},QE)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function eD(e={}){return{...zS(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function tD(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=mE(!0),p=!!f,m=Tg(()=>l?.store??new $E({open:n??r,activeTriggerId:u===void 0?d:u,modal:s,disablePointerDismissal:o,nested:p})).current;m.useControlledProp(`open`,n,r),m.useControlledProp(`activeTriggerId`,u,d),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);ZE({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=z.useMemo(()=>({store:m}),[m]);return(0,B.jsx)(pE.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}var nD=z.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=mE(),s=DC(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),vb(`h2`,e,{ref:t,props:[{id:s},a]})}),rD=tD,iD=SE,aD=BE;function oD({className:e,...t}){return(0,B.jsx)(gE,{className:mg(`fixed inset-0 z-50 bg-cohere-black/70 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 transition-opacity duration-150`,e),...t})}function sD({className:e,children:t,showCloseButton:n=!0,...r}){return(0,B.jsxs)(aD,{children:[(0,B.jsx)(oD,{}),(0,B.jsxs)(RE,{className:mg(`fixed left-1/2 top-1/2 z-50 grid w-[calc(100vw-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-5 rounded-lg border border-card-border bg-background p-6 shadow-popover outline-none sm:p-8`,`data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[starting-style]:scale-95 transition-[opacity,transform] duration-150`,e),...r,children:[t,n&&(0,B.jsx)(iD,{className:`absolute right-4 top-4 rounded-full p-1 opacity-70 ring-offset-background transition-opacity hover:bg-soft-stone hover:text-primary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,"aria-label":`Close dialog`,children:(0,B.jsx)(Vm,{className:`size-4`})})]})]})}function cD({className:e,...t}){return(0,B.jsx)(`div`,{className:mg(`flex flex-col space-y-1.5 text-left`,e),...t})}function lD({className:e,...t}){return(0,B.jsx)(`div`,{className:mg(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function uD({className:e,...t}){return(0,B.jsx)(nD,{className:mg(`text-card-heading font-normal leading-tight`,e),...t})}function dD({className:e,...t}){return(0,B.jsx)(CE,{className:mg(`text-sm text-muted-foreground`,e),...t})}function fD({className:e,...t}){return(0,B.jsx)(`div`,{className:mg(`animate-pulse rounded-sm bg-soft-stone`,e),...t})}function pD(){let e=wT(),t=TT(),n=ET(),[r,i]=(0,z.useState)(null),[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(null);async function l(){if(a){c(null);try{await n.mutateAsync(a),o(null)}catch(e){c(e instanceof ww?e.message:`删除失败。`)}}}return(0,B.jsxs)(`div`,{className:`app-page-narrow max-w-4xl`,children:[(0,B.jsxs)(`header`,{className:`app-page-header sm:flex-row sm:items-end sm:justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Secrets`}),(0,B.jsx)(`p`,{className:`app-page-copy`,children:`常规 secret 通过配置编辑器管理;这里用于 out-of-band 轮换 / 应急处置。`})]}),(0,B.jsxs)(yg,{onClick:()=>i({kind:`add`}),children:[(0,B.jsx)(km,{className:`size-4`}),`添加 secret`]})]}),e.isLoading?(0,B.jsx)(fD,{className:`h-40`}):e.isError?(0,B.jsxs)(`p`,{role:`alert`,className:`app-alert-error`,children:[`加载 secrets 失败:`,e.error instanceof Error?e.error.message:`未知错误`]}):e.data?.keys.length===0?(0,B.jsx)(`p`,{className:`app-empty`,children:`尚无 secret。`}):(0,B.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.data?.keys.map(e=>(0,B.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-sm border border-hairline bg-card px-4 py-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(bm,{className:`size-4 text-muted-foreground`}),(0,B.jsx)(`code`,{className:`font-mono text-sm`,children:e})]}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(yg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i({kind:`replace`,key:e}),children:`替换`}),(0,B.jsx)(yg,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Delete secret ${e}`,onClick:()=>o(e),children:(0,B.jsx)(Rm,{className:`size-4`})})]})]},e))}),s&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error`,children:s}),r&&(0,B.jsx)(mD,{existingKeys:e.data?.keys??[],mode:r,submitting:t.isPending,onClose:()=>i(null),onSubmit:async({key:e,value:n})=>{c(null);try{await t.mutateAsync({key:e,value:n}),i(null)}catch(e){c(e instanceof ww?e.message:`保存失败。`)}}},r.kind===`add`?`__add`:`__replace_${r.key}`),(0,B.jsx)(rD,{open:a!==null,onOpenChange:e=>!e&&o(null),children:(0,B.jsxs)(sD,{className:`sm:max-w-md`,children:[(0,B.jsxs)(cD,{children:[(0,B.jsx)(uD,{children:`删除该 secret?`}),(0,B.jsxs)(dD,{children:[`将从 worker vault 移除`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:a}),`;config 里引用它的字段在替换前会加载失败。`]})]}),(0,B.jsxs)(lD,{children:[(0,B.jsx)(yg,{variant:`outline`,onClick:()=>o(null),children:`取消`}),(0,B.jsx)(yg,{variant:`destructive`,onClick:l,disabled:n.isPending,children:n.isPending?`删除中…`:`删除`})]})]})})]})}function mD({mode:e,existingKeys:t,submitting:n,onClose:r,onSubmit:i}){let a=(0,z.useId)(),o=(0,z.useId)(),[s,c]=(0,z.useState)(e.kind===`replace`?e.key:``),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(!1),[p,m]=(0,z.useState)(null);async function h(n){n.preventDefault(),m(null);let r=s.trim();if(r.length===0){m(`key 必填。`);return}if(l.length===0){m(`value 必填。`);return}if(e.kind===`add`&&t.includes(r)){m(`该 key 已存在;改用「替换」。`);return}await i({key:r,value:l}),u(``)}return(0,B.jsx)(rD,{open:!0,onOpenChange:e=>!e&&r(),children:(0,B.jsx)(sD,{className:`sm:max-w-md`,children:(0,B.jsxs)(`form`,{onSubmit:h,children:[(0,B.jsxs)(cD,{children:[(0,B.jsx)(uD,{children:e.kind===`add`?`添加 secret`:`替换 ${e.key}`}),(0,B.jsx)(dD,{children:`value 加密存入 worker vault,之后绝不再回传 UI。`})]}),(0,B.jsxs)(`div`,{className:`grid gap-4 py-4`,children:[(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(hw,{htmlFor:a,children:`Key`}),(0,B.jsx)(mw,{id:a,value:s,onChange:e=>c(e.target.value),disabled:e.kind===`replace`,autoFocus:e.kind===`add`,spellCheck:!1})]}),(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(hw,{htmlFor:o,children:`Value`}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(mw,{id:o,type:d?`text`:`password`,value:l,onChange:e=>u(e.target.value),autoComplete:`off`,spellCheck:!1,autoFocus:e.kind===`replace`}),(0,B.jsx)(yg,{type:`button`,variant:`outline`,size:`icon`,"aria-label":d?`Hide value`:`Show value`,onClick:()=>f(e=>!e),children:d?(0,B.jsx)(vm,{className:`size-4`}):(0,B.jsx)(ym,{className:`size-4`})})]})]}),p&&(0,B.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:p})]}),(0,B.jsxs)(lD,{children:[(0,B.jsx)(yg,{type:`button`,variant:`outline`,onClick:r,children:`取消`}),(0,B.jsxs)(yg,{type:`submit`,disabled:n,children:[n?(0,B.jsx)(xm,{className:`size-4 animate-spin`}):null,n?`保存中…`:`保存`]})]})]})})})}var hD=zi(`/secrets`)({component:pD}),gD=[`web`,`line`,`telegram`,`lark`,`whatsapp`];function _D(){let e=AT(),t=jT(),n=MT(),r=NT(),[i,a]=(0,z.useState)(null),[o,s]=(0,z.useState)(null),[c,l]=(0,z.useState)(null);async function u(e){l(null);try{await n.mutateAsync({id:e.id,patch:{enabled:!e.enabled}})}catch(e){l(e instanceof ww?e.message:`更新失败。`)}}async function d(){if(o){l(null);try{await r.mutateAsync(o.id),s(null)}catch(e){l(e instanceof ww?e.message:`删除失败。`)}}}let f=e.data?.jobs??[];return(0,B.jsxs)(`div`,{className:`app-page-narrow max-w-5xl`,children:[(0,B.jsxs)(`header`,{className:`app-page-header sm:flex-row sm:items-end sm:justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Cron`}),(0,B.jsx)(`p`,{className:`app-page-copy`,children:`按 cron 表达式定期触发的 prompt 任务。结果通过指定 channel 发出。`})]}),(0,B.jsxs)(yg,{onClick:()=>a({kind:`add`}),children:[(0,B.jsx)(km,{className:`size-4`}),`添加`]})]}),c&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error`,children:c}),e.isLoading?(0,B.jsx)(fD,{className:`h-40`}):e.isError?(0,B.jsxs)(`p`,{role:`alert`,className:`app-alert-error`,children:[`加载 cron 列表失败:`,e.error instanceof Error?e.error.message:`未知错误`]}):f.length===0?(0,B.jsx)(`p`,{className:`app-empty`,children:`尚无 cron。`}):(0,B.jsx)(`ul`,{className:`flex flex-col gap-3`,children:f.map(e=>(0,B.jsx)(`li`,{className:`flex flex-col gap-3 rounded-sm border border-hairline bg-card p-4`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`code`,{className:`font-mono text-sm`,children:e.expression}),(0,B.jsx)(`span`,{className:`rounded-full bg-soft-stone px-2 py-1 text-micro uppercase text-muted-foreground`,children:e.channel}),!e.enabled&&(0,B.jsx)(`span`,{className:`rounded-full bg-warning-soft px-2 py-1 text-micro font-medium text-warning`,children:`disabled`})]}),(0,B.jsx)(`p`,{className:`mt-1 truncate text-sm text-muted-foreground`,title:e.prompt,children:e.prompt}),(0,B.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`chatId`,(0,B.jsx)(`code`,{className:`ml-1 font-mono`,children:e.chatId}),(0,B.jsx)(`span`,{className:`mx-2`,children:`·`}),`account`,(0,B.jsx)(`code`,{className:`ml-1 font-mono`,children:e.accountId}),(0,B.jsx)(`span`,{className:`mx-2`,children:`·`}),`next`,(0,B.jsx)(`code`,{className:`ml-1 font-mono`,children:e.nextRunAt??`—`}),(0,B.jsx)(`span`,{className:`mx-2`,children:`·`}),`last`,(0,B.jsx)(`code`,{className:`ml-1 font-mono`,children:e.lastRunAt??`—`})]})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,B.jsx)(yg,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":e.enabled?`暂停`:`启用`,onClick:()=>void u(e),disabled:n.isPending,children:e.enabled?(0,B.jsx)(Em,{className:`size-4`}):(0,B.jsx)(Om,{className:`size-4`})}),(0,B.jsx)(yg,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`编辑`,onClick:()=>a({kind:`edit`,job:e}),children:(0,B.jsx)(Dm,{className:`size-4`})}),(0,B.jsx)(yg,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`删除`,onClick:()=>s(e),children:(0,B.jsx)(Rm,{className:`size-4`})})]})]})},e.id))}),i&&(0,B.jsx)(vD,{mode:i,submitting:t.isPending||n.isPending,onClose:()=>a(null),onSubmit:async e=>{l(null);try{i.kind===`add`?await t.mutateAsync(e):await n.mutateAsync({id:i.job.id,patch:e}),a(null)}catch(e){l(e instanceof ww?e.message:`保存失败。`)}}},i.kind===`add`?`__add`:`__edit_${i.job.id}`),(0,B.jsx)(rD,{open:o!==null,onOpenChange:e=>!e&&s(null),children:(0,B.jsxs)(sD,{className:`sm:max-w-md`,children:[(0,B.jsxs)(cD,{children:[(0,B.jsx)(uD,{children:`删除该 cron?`}),(0,B.jsxs)(dD,{children:[`将立即停止`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:o?.id}),` `,`的调度。`]})]}),(0,B.jsxs)(lD,{children:[(0,B.jsx)(yg,{variant:`outline`,onClick:()=>s(null),children:`取消`}),(0,B.jsx)(yg,{variant:`destructive`,onClick:d,disabled:r.isPending,children:r.isPending?`删除中…`:`删除`})]})]})})]})}function vD({mode:e,submitting:t,onClose:n,onSubmit:r}){let i=(0,z.useId)(),a=(0,z.useId)(),o=(0,z.useId)(),s=(0,z.useId)(),[c,l]=(0,z.useState)((0,z.useMemo)(()=>e.kind===`edit`?{expression:e.job.expression,prompt:e.job.prompt,channel:e.job.channel,chatId:e.job.chatId,accountId:e.job.accountId,enabled:e.job.enabled}:{expression:`0 9 * * *`,prompt:``,channel:`web`,chatId:``,accountId:``,enabled:!0},[e])),[u,d]=(0,z.useState)(null);function f(e,t){l(n=>({...n,[e]:t}))}async function p(e){if(e.preventDefault(),d(null),!c.expression.trim()||!c.prompt.trim()||!c.chatId.trim()){d(`expression / prompt / chatId 必填。`);return}let t={expression:c.expression.trim(),prompt:c.prompt.trim(),channel:c.channel,chatId:c.chatId.trim(),enabled:c.enabled};c.accountId.trim().length>0&&(t.accountId=c.accountId.trim()),await r(t)}return(0,B.jsx)(rD,{open:!0,onOpenChange:e=>!e&&n(),children:(0,B.jsx)(sD,{className:`sm:max-w-lg`,children:(0,B.jsxs)(`form`,{onSubmit:p,children:[(0,B.jsxs)(cD,{children:[(0,B.jsx)(uD,{children:e.kind===`add`?`添加 cron`:`编辑 ${e.job.id}`}),(0,B.jsx)(dD,{children:`cron 表达式遵循 5 字段标准(分 时 日 月 周)。`})]}),(0,B.jsxs)(`div`,{className:`grid gap-3 py-4`,children:[(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(hw,{htmlFor:i,children:`Expression`}),(0,B.jsx)(mw,{id:i,value:c.expression,onChange:e=>f(`expression`,e.target.value),className:`font-mono`})]}),(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(hw,{htmlFor:a,children:`Prompt`}),(0,B.jsx)(`textarea`,{id:a,className:`app-field min-h-[80px]`,value:c.prompt,onChange:e=>f(`prompt`,e.target.value)})]}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(hw,{children:`Channel`}),(0,B.jsx)(`select`,{className:`app-field h-10`,value:c.channel,onChange:e=>f(`channel`,e.target.value),children:gD.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))})]}),(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(hw,{htmlFor:o,children:`chatId`}),(0,B.jsx)(mw,{id:o,value:c.chatId,onChange:e=>f(`chatId`,e.target.value)})]}),(0,B.jsxs)(`div`,{className:`grid gap-1.5 sm:col-span-2`,children:[(0,B.jsx)(hw,{htmlFor:s,children:"accountId(留空 = `sys:cron`)"}),(0,B.jsx)(mw,{id:s,value:c.accountId,onChange:e=>f(`accountId`,e.target.value)})]}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-sm sm:col-span-2`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:c.enabled,onChange:e=>f(`enabled`,e.target.checked)}),`启用`]})]}),u&&(0,B.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:u})]}),(0,B.jsxs)(lD,{children:[(0,B.jsx)(yg,{type:`button`,variant:`outline`,onClick:n,children:`取消`}),(0,B.jsxs)(yg,{type:`submit`,disabled:t,children:[t?(0,B.jsx)(xm,{className:`size-4 animate-spin`}):null,t?`保存中…`:`保存`]})]})]})})})}var yD=zi(`/cron`)({component:_D});function bD(e){return{id:`brain-${e}`,type:`filesystem`,priority:100,readOnly:!1,config:{}}}function xD(e){return{id:`brain-${e}`,type:`cloud-gateway`,priority:100,readOnly:!1,config:{url:``,token:``}}}function SD({brains:e,brainWriteTarget:t,brainRetrieval:n,onChange:r}){function i(t,n){let i=e.slice();i[t]=n,r({brains:i})}function a(n){let i=e[n],a=e.filter((e,t)=>t!==n),o={brains:a};i&&t===i.id&&(o.brainWriteTarget=a[0]?.id??``),r(o)}function o(t){let n=t===`filesystem`?bD(e.length+1):xD(e.length+1);r({brains:[...e,n]})}return(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-5`,children:[(0,B.jsxs)(`header`,{className:`flex items-start justify-between gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Brain sources`}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`知识与记忆后端。Secret 字段留空表示沿用旧值。`})]}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsxs)(yg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>o(`filesystem`),children:[(0,B.jsx)(km,{className:`size-3.5`}),`Filesystem`]}),(0,B.jsxs)(yg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>o(`cloud-gateway`),children:[(0,B.jsx)(km,{className:`size-3.5`}),`Cloud gateway`]})]})]}),e.length===0&&(0,B.jsx)(`p`,{className:`app-empty p-5 sm:p-5`,children:`尚未配置 brain source。至少加一个才能启用 retrieval。`}),(0,B.jsx)(`ul`,{className:`flex flex-col gap-3`,children:e.map((e,t)=>(0,B.jsx)(CD,{source:e,onChange:e=>i(t,e),onRemove:()=>a(t)},e.id))}),e.length>0&&(0,B.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`Write target`}),(0,B.jsxs)(`select`,{className:`app-field h-10`,value:t,onChange:e=>r({brainWriteTarget:e.target.value}),children:[(0,B.jsx)(`option`,{value:``,children:`— none —`}),e.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.id},e.id))]}),(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`接收`,` `,(0,B.jsx)(`code`,{className:`font-mono text-micro`,children:`writeMemory`}),` `,`调用的 source。`]})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`Retrieval mode`}),(0,B.jsxs)(`select`,{className:`app-field h-10`,value:n,onChange:e=>r({brainRetrieval:e.target.value}),children:[(0,B.jsx)(`option`,{value:`merge-by-priority`,children:`merge-by-priority`}),(0,B.jsx)(`option`,{value:`first-match`,children:`first-match`})]})]})]})]})}function CD({source:e,onChange:t,onRemove:n}){function r(n){t({...e,...n})}function i(n){n!==e.type&&t(n===`filesystem`?{id:e.id,type:`filesystem`,priority:e.priority,readOnly:e.readOnly,config:{}}:{id:e.id,type:`cloud-gateway`,priority:e.priority,readOnly:e.readOnly,config:{url:``,token:``}})}return(0,B.jsxs)(`li`,{className:`flex flex-col gap-4 rounded-sm border border-hairline bg-background p-4`,children:[(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,160px)_minmax(0,120px)_auto]`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`Id`}),(0,B.jsx)(mw,{value:e.id,onChange:e=>r({id:e.target.value}),"aria-label":`Brain source id`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`Type`}),(0,B.jsxs)(`select`,{className:`app-field h-10`,value:e.type,onChange:e=>i(e.target.value),"aria-label":`Brain source type`,children:[(0,B.jsx)(`option`,{value:`filesystem`,children:`filesystem`}),(0,B.jsx)(`option`,{value:`cloud-gateway`,children:`cloud-gateway`})]})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`Priority`}),(0,B.jsx)(mw,{type:`number`,value:e.priority,onChange:e=>r({priority:Number.parseInt(e.target.value,10)||0})})]}),(0,B.jsxs)(`div`,{className:`flex flex-col items-end gap-2`,children:[(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e.readOnly,onChange:e=>r({readOnly:e.target.checked})}),`read-only`]}),(0,B.jsx)(yg,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Remove brain source`,onClick:n,children:(0,B.jsx)(Rm,{className:`size-4`})})]})]}),e.type===`filesystem`?(0,B.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:(0,B.jsx)(wD,{label:`home (optional — 默认 ~/.aiworker/workers/<id>/brain)`,children:(0,B.jsx)(mw,{value:e.config.home??``,onChange:n=>t({...e,config:{...e.config,home:n.target.value||void 0}})})})}):(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsx)(wD,{label:`url`,children:(0,B.jsx)(mw,{value:e.config.url,onChange:n=>t({...e,config:{...e.config,url:n.target.value}})})}),(0,B.jsx)(TD,{label:`token`,value:e.config.token,onChange:n=>t({...e,config:{...e.config,token:n}})}),(0,B.jsx)(wD,{label:`defaultCategory (optional)`,children:(0,B.jsx)(mw,{value:e.config.defaultCategory??``,onChange:n=>t({...e,config:{...e.config,defaultCategory:n.target.value}})})}),(0,B.jsx)(wD,{label:`defaultTypeId (optional)`,children:(0,B.jsx)(mw,{value:e.config.defaultTypeId??``,onChange:n=>t({...e,config:{...e.config,defaultTypeId:n.target.value}})})})]})]})}function wD({label:e,children:t}){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:e}),t]})}function TD({label:e,value:t,onChange:n,placeholder:r=`(unchanged)`}){let[i,a]=(0,z.useState)(!1);return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:e}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(mw,{type:i?`text`:`password`,value:t,onChange:e=>n(e.target.value),placeholder:r,autoComplete:`off`,spellCheck:!1}),(0,B.jsx)(yg,{type:`button`,variant:`outline`,size:`icon`,"aria-label":i?`Hide ${e}`:`Show ${e}`,onClick:()=>a(e=>!e),children:i?(0,B.jsx)(vm,{className:`size-4`}):(0,B.jsx)(ym,{className:`size-4`})})]}),(0,B.jsx)(`p`,{className:`text-micro text-muted-foreground`,children:`留空保留 vault 里旧值。`})]})}var ED=[`web`,`line`,`telegram`,`lark`,`whatsapp`];function DD(){let e=new Uint8Array(24);crypto.getRandomValues(e);let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function OD(e){switch(e){case`web`:return{channel:`web`,inboundToken:``};case`line`:return{channel:`line`,channelSecret:``,channelAccessToken:``};case`telegram`:return{channel:`telegram`,botToken:``};case`lark`:return{channel:`lark`,appId:``,appSecret:``,encryptKey:``,verificationToken:``};case`whatsapp`:return{channel:`whatsapp`,phoneNumberId:``,accessToken:``,appSecret:``,verifyToken:``}}}function kD(e){return{channel:e,enabled:!1,credentials:OD(e)}}function AD(e,t,n){let r=0;for(let i=0;i<n;i+=1)t[i]?.channel===e&&(r+=1);return r===0?e:`${e}#${r}`}function jD({channels:e,info:t,onChange:n}){function r(t,r){let i=e.slice();i[t]=r,n(i)}function i(t){n(e.filter((e,n)=>n!==t))}function a(t){n([...e,kD(t)])}return(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-5`,children:[(0,B.jsxs)(`header`,{className:`flex items-start justify-between gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Channels`}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`入站消息源。把卡片里的 webhook URL 粘到对应平台后台。`})]}),(0,B.jsx)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:ED.map(e=>(0,B.jsxs)(yg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>a(e),children:[(0,B.jsx)(km,{className:`size-3.5`}),e]},e))})]}),e.length===0&&(0,B.jsx)(`p`,{className:`app-empty p-5 sm:p-5`,children:`尚未绑定 channel。`}),(0,B.jsx)(`ul`,{className:`flex flex-col gap-3`,children:e.map((n,a)=>(0,B.jsx)(MD,{binding:n,webhookUrl:t?.channels.find(e=>e.channel===n.channel)?.webhookUrl,onChange:e=>r(a,e),onRemove:()=>i(a)},AD(n.channel,e,a)))})]})}function MD({binding:e,webhookUrl:t,onChange:n,onRemove:r}){function i(t){n({...e,credentials:t})}function a(t){t!==e.channel&&n({channel:t,enabled:e.enabled,credentials:OD(t)})}return(0,B.jsxs)(`li`,{className:`flex flex-col gap-4 rounded-sm border border-hairline bg-background p-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`select`,{className:`app-field h-10`,value:e.channel,onChange:e=>a(e.target.value),"aria-label":`Channel type`,children:ED.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e.enabled,onChange:t=>n({...e,enabled:t.target.checked})}),`enabled`]})]}),(0,B.jsx)(yg,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Remove ${e.channel} channel`,onClick:r,children:(0,B.jsx)(Rm,{className:`size-4`})})]}),t&&(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(hw,{children:`Webhook URL(只读,粘进平台后台即可)`}),(0,B.jsx)(mw,{value:t,readOnly:!0,className:`font-mono text-xs`})]}),(0,B.jsx)(ND,{credentials:e.credentials,onChange:i})]})}function ND({credentials:e,onChange:t}){switch(e.channel){case`web`:return(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end`,children:[(0,B.jsx)(TD,{label:`inboundToken`,value:e.inboundToken??``,onChange:n=>t({...e,inboundToken:n}),placeholder:`(unchanged — 留空沿用旧 token)`}),(0,B.jsx)(yg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>t({...e,inboundToken:DD()}),children:`Generate`})]}),(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`必填:调用`,` `,(0,B.jsx)(`code`,{className:`font-mono text-micro`,children:`POST /web/webhook`}),` `,`的客户端必须发`,` `,(0,B.jsx)(`code`,{className:`font-mono text-micro`,children:`Authorization: Bearer <inboundToken>`}),`。空 token = 拒绝所有入站(fail-closed)。`]})]});case`line`:return(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsx)(TD,{label:`channelSecret`,value:e.channelSecret,onChange:n=>t({...e,channelSecret:n})}),(0,B.jsx)(TD,{label:`channelAccessToken`,value:e.channelAccessToken,onChange:n=>t({...e,channelAccessToken:n})})]});case`telegram`:return(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsx)(TD,{label:`botToken`,value:e.botToken,onChange:n=>t({...e,botToken:n})}),(0,B.jsx)(TD,{label:`webhookSecretToken (optional)`,value:e.webhookSecretToken??``,onChange:n=>t({...e,webhookSecretToken:n||void 0})})]});case`lark`:return(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`appId`}),(0,B.jsx)(mw,{value:e.appId,onChange:n=>t({...e,appId:n.target.value})})]}),(0,B.jsx)(TD,{label:`appSecret`,value:e.appSecret,onChange:n=>t({...e,appSecret:n})}),(0,B.jsx)(TD,{label:`encryptKey`,value:e.encryptKey,onChange:n=>t({...e,encryptKey:n})}),(0,B.jsx)(TD,{label:`verificationToken`,value:e.verificationToken,onChange:n=>t({...e,verificationToken:n})})]});case`whatsapp`:return(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`phoneNumberId`}),(0,B.jsx)(mw,{value:e.phoneNumberId,onChange:n=>t({...e,phoneNumberId:n.target.value})})]}),(0,B.jsx)(TD,{label:`accessToken`,value:e.accessToken,onChange:n=>t({...e,accessToken:n})}),(0,B.jsx)(TD,{label:`appSecret`,value:e.appSecret,onChange:n=>t({...e,appSecret:n})}),(0,B.jsx)(TD,{label:`verifyToken`,value:e.verifyToken,onChange:n=>t({...e,verifyToken:n})})]})}}function PD(e){let t=new Map;if(!e)return t;for(let n of e){let e=n.agent?`${n.kind}:${n.agent}`:n.kind;t.set(e,n)}return t}function FD(e,t){let n=e.get(t);if(n)return n.status;let r=[...e.values()].filter(e=>e.kind===t);if(r.length!==0)return r.some(e=>e.status===`ready`)?`ready`:r.every(e=>e.status===`not-found`)?`not-found`:`login-required`}var ID=`__custom__`,LD=[],RD={};function zD({schema:e,value:t,secretFields:n=LD,fieldHints:r=RD,onChange:i}){let a=e.shape,o=new Set(n);function s(e,n){let r={...t};n===void 0?delete r[e]:r[e]=n,i(r)}return(0,B.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:Object.entries(a).map(([e,n])=>(0,B.jsx)(VD,{name:e,schema:n,value:t[e],isSecret:o.has(e),hintValues:r[e],onChange:t=>s(e,t)},e))})}function BD(e){return e instanceof Cs||e instanceof ws?{inner:e._def.innerType,optional:!0}:{inner:e,optional:!1}}function VD({name:e,schema:t,value:n,isSecret:r,hintValues:i,onChange:a}){let{inner:o,optional:s}=BD(t),c=s?` (optional)`:``;if(o instanceof Wo){let t=typeof n==`string`?n:``;return r?(0,B.jsx)(TD,{label:`${e}${c}`,value:t,onChange:e=>a(e||(s?void 0:``))}):i&&i.length>0?(0,B.jsx)(GD,{name:`${e}${c}`,fieldName:e,presets:i,optional:s,value:t,onChange:a}):(0,B.jsx)(WD,{label:`${e}${c}`,value:t,onChange:e=>a(e||(s?void 0:``))})}if(o instanceof Ko){let t=typeof n==`number`?n:0;return(0,B.jsx)(KD,{label:`${e}${c}`,value:t,onChange:e=>a(e)})}if(o instanceof Jo)return(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:n===!0,onChange:e=>a(e.target.checked)}),e]});if(o instanceof ys){let t=o._def.values??o.options??[],r=typeof n==`string`?n:s?``:t[0]??``;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`${e}${c}`}),(0,B.jsxs)(`select`,{className:`app-field h-10`,value:r,onChange:e=>a(e.target.value||(s?void 0:t[0])),children:[s&&(0,B.jsx)(`option`,{value:``,children:`— unset —`}),t.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]})]})}if(o instanceof rs){let t=Array.isArray(n)?n.filter(e=>typeof e==`string`):[];return(0,B.jsx)(WD,{label:`${e}${c} (空白或 , 分隔)`,value:t.join(` `),onChange:e=>{let t=e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean);t.length===0?a(s?void 0:[]):a(t)}})}if(o instanceof fs){let t=typeof n==`object`&&n?Object.fromEntries(Object.entries(n).filter(([,e])=>typeof e==`string`)):{},r=Object.entries(t).map(([e,t])=>`${e}=${t}`).join(`
|
|
1379
|
+
`);return(0,B.jsxs)(`div`,{className:`sm:col-span-2 flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`${e}${c} (KEY=value 每行一条)`}),(0,B.jsx)(`textarea`,{className:`app-field min-h-[80px] font-mono`,value:r,onChange:e=>{let t=[];for(let n of e.target.value.split(`
|
|
1380
|
+
`)){let e=n.indexOf(`=`);if(e<=0)continue;let r=n.slice(0,e).trim(),i=n.slice(e+1);r.length>0&&t.push([r,i])}t.length===0?a(s?void 0:{}):a(Object.fromEntries(t))}})]})}return(0,B.jsxs)(`div`,{className:`sm:col-span-2 flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`${e}${c} (JSON)`}),(0,B.jsx)(UD,{value:n,onChange:a,optional:s})]})}function HD(e){if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return``}}function UD({value:e,onChange:t,optional:n}){return(0,B.jsx)(`textarea`,{className:`app-field min-h-[80px] font-mono`,defaultValue:HD(e),onBlur:e=>{let r=e.target.value.trim();if(r.length===0){t(n?void 0:null);return}try{t(JSON.parse(r))}catch{}}})}function WD({label:e,value:t,onChange:n}){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:e}),(0,B.jsx)(mw,{value:t,onChange:e=>n(e.target.value)})]})}function GD({name:e,fieldName:t,presets:n,optional:r,value:i,onChange:a}){let o=i.length>0&&n.includes(i),[s,c]=(0,z.useState)(()=>i.length===0||o?`preset`:`custom`);function l(e){e.length===0?a(r?void 0:``):a(e)}function u(e){if(e===ID){c(`custom`);return}c(`preset`),l(e)}if(s===`custom`)return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(hw,{children:e}),(0,B.jsx)(`button`,{type:`button`,className:`text-xs text-muted-foreground underline decoration-dotted underline-offset-2 hover:text-foreground`,onClick:()=>{c(`preset`),n.includes(i)||l(``)},children:`选预设…`})]}),(0,B.jsx)(mw,{"data-testid":`field-${t}-input`,placeholder:n[0]??``,value:i,onChange:e=>l(e.target.value)})]});let d=o?i:``;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{htmlFor:`field-${t}-select`,children:e}),(0,B.jsxs)(`select`,{id:`field-${t}-select`,"data-testid":`field-${t}-select`,className:`app-field h-10`,value:d,onChange:e=>u(e.target.value),children:[r&&(0,B.jsx)(`option`,{value:``,children:`— unset —`}),!r&&d===``&&(0,B.jsx)(`option`,{value:``,disabled:!0,children:`— 选 model —`}),n.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e)),(0,B.jsx)(`option`,{value:ID,children:`Custom…`})]})]})}function KD({label:e,value:t,onChange:n}){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:e}),(0,B.jsx)(mw,{type:`number`,value:t,onChange:e=>{let t=Number.parseInt(e.target.value,10);n(Number.isNaN(t)?0:t)}})]})}var qD=X({baseUrl:Y(),apiKey:Y(),model:Y(),timeoutMs:Ns().int().positive()}),JD={secretFields:[`apiKey`]},YD=X({url:Y(),token:Y(),defaultModel:Y().optional(),tools:Is(Y()).optional(),timeoutMs:Ns().int().positive().optional()}),XD=X({command:Y(),args:Is(Y()),cwd:Y().optional(),env:zs(Y()).optional(),timeoutMs:Ns().int().positive().optional(),sandbox:Ps().optional()}),ZD=X({model:Y().optional(),cliVersion:Y().optional(),extraArgs:Is(Y()).optional(),env:zs(Y()).optional(),workspaceRoot:Y().optional(),timeoutMs:Ns().int().positive().optional(),permissionPolicy:Vs([`auto`,`supervised`,`plan`]).optional()}),QD=X({agent:Vs([`gemini`,`qwen`]),model:Y().optional(),cliVersion:Y().optional(),extraArgs:Is(Y()).optional(),env:zs(Y()).optional(),timeoutMs:Ns().int().positive().optional()}),$D=X({model:Y().optional(),timeoutMs:Ns().int().positive().optional()}),eO=X({model:Y().optional(),timeoutMs:Ns().int().positive().optional()}),tO=[`gpt-4o-mini`,`gpt-4o`,`gpt-5`,`gpt-5-mini`,`o3-mini`],nO=[`gemini-2.5-flash`,`gemini-2.5-pro`,`gemini-2.0-flash`],rO=[`deepseek-chat`,`deepseek-reasoner`],iO=[`Qwen/Qwen2.5-7B-Instruct`,`Qwen/Qwen2.5-72B-Instruct`,`deepseek-ai/DeepSeek-V3`],aO=[`anthropic/claude-sonnet-4.5`,`openai/gpt-5`,`openai/gpt-4o-mini`,`google/gemini-2.5-flash`],oO=[`sonnet`,`opus`,`haiku`],sO=[`gemini-2.5-pro`,`gemini-2.5-flash`,`gemini-2.0-flash`],cO=[`qwen3-coder-plus`,`qwen3-max`,`qwen3-72b`],lO=[`gpt-5.5`,`gpt-5.4`,`gpt-5.4-mini`,`gpt-5.3-codex`,`gpt-5.2`],uO=[`auto`,`claude-sonnet-4.5`,`gpt-5`,`gemini-2.5-pro`],dO={http:{label:`HTTP (OpenAI-compatible)`,description:`Generic chat-completions endpoint that speaks the OpenAI wire format.`,variants:{default:{label:`Default`,description:`Empty preset — fill in baseUrl, apiKey, model.`,schema:qD,...JD,fieldHints:{model:tO}},"gemini-openai-compat":{label:`Gemini (OpenAI-compat)`,description:`generativelanguage.googleapis.com OpenAI compatibility endpoint.`,schema:qD,...JD,fieldHints:{model:nO}},deepseek:{label:`DeepSeek`,description:`api.deepseek.com — model defaults to deepseek-chat.`,schema:qD,...JD,fieldHints:{model:rO}},siliconflow:{label:`SiliconFlow`,description:`api.siliconflow.cn/v1 — Chinese OpenAI-compatible aggregator.`,schema:qD,...JD,fieldHints:{model:iO}},openrouter:{label:`OpenRouter`,description:`openrouter.ai/api/v1 — fanout to 100+ provider models.`,schema:qD,...JD,fieldHints:{model:aO}}}},mcp:{label:`MCP (tool source)`,description:`Model Context Protocol streamable-http server. Exposes tools, not chat.`,variants:{default:{label:`Default`,description:`MCP server with bearer auth.`,schema:YD,secretFields:[`token`]}}},cli:{label:`Generic CLI`,description:`Spawn an arbitrary CLI per turn. Reserved for stub / debug use.`,variants:{default:{label:`Default`,description:`Manual command + args.`,schema:XD}}},"claude-code":{label:`Claude Code`,description:`Anthropic Claude Code CLI in stream-json mode (FEAT-012).`,variants:{default:{label:`Default`,description:`Auto-approve, CLI default model, 120s turn timeout.`,schema:ZD,fieldHints:{model:oO}},"opus-plan":{label:`Opus + Plan policy`,description:`Opus model with plan-mode permission policy, 180s turn timeout.`,schema:ZD,fieldHints:{model:oO}}}},acp:{label:`ACP (Gemini / Qwen)`,description:`Agent Client Protocol harness — variant key selects the CLI agent.`,variants:{gemini:{label:`Gemini CLI`,description:`google-gemini/gemini-cli with --experimental-acp + --yolo.`,schema:QD,fieldHints:{model:sO}},qwen:{label:`Qwen Code`,description:`qwenlm/qwen-code with --acp + --yolo.`,schema:QD,fieldHints:{model:cO}}}},codex:{label:`Codex`,description:`OpenAI @openai/codex app-server via JSON-RPC over stdio (FEAT-016).`,variants:{default:{label:`Default (gpt-5.5)`,description:`Codex app-server, 120s turn timeout.`,schema:$D,fieldHints:{model:lO}}}},cursor:{label:`Cursor Agent`,description:`Cursor CLI in stream-json mode — no npm fallback (install cursor-agent) (FEAT-016).`,variants:{default:{label:`Default (auto model)`,description:`cursor-agent -p --output-format=stream-json, 120s turn timeout.`,schema:eO,fieldHints:{model:uO}}}}};function fO(){return Object.keys(dO)}function pO(e){return Object.keys(dO[e].variants)}function mO(e){let t=pO(e);return{engine:e,variant:t.includes(`default`)?`default`:t[0]}}var hO={ready:`ready`,"login-required":`login required`,"not-found":`not installed`},gO={ready:`bg-success`,"login-required":`bg-warning`,"not-found":`bg-muted-foreground/40`},_O={ready:`text-success`,"login-required":`text-warning`,"not-found":`text-muted-foreground`};function vO({status:e,label:t,testId:n}){return e?(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs ${_O[e]}`,"data-testid":n,"data-status":e,children:[(0,B.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full ${gO[e]}`}),t??hO[e]]}):(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,"data-testid":n,children:[(0,B.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-muted-foreground/30`}),`unknown`]})}function yO({executor:e,onChange:t}){let n=dO[e.engine],r=n.variants[e.variant],[i,a]=(0,z.useState)(!1),o=ST(),s=PD(o.data?.engines),c=CT(),[l,u]=(0,z.useState)(!1);async function d(){u(!0);try{await c()}finally{u(!1)}}function f(n){if(n===e.engine)return;let r=pO(n).includes(e.variant)?e.variant:void 0;t(r?{engine:n,variant:r}:mO(n))}function p(n){n!==e.variant&&t({engine:e.engine,variant:n})}function m(n){if(!n||Object.keys(n).length===0){let{overrides:n,...r}=e;t(r);return}t({...e,overrides:n})}function h(t){let n=e.overrides?.cmd,r={...t};n&&Object.keys(n).length>0&&(r.cmd=n),m(r)}function g(t){let{cmd:n,...r}=e.overrides??{};if(!t||Object.keys(t).length===0){m(r);return}m({...r,cmd:t})}function _(n){let r={...e};n.modelId===void 0||n.modelId===``?delete r.modelId:r.modelId=n.modelId,n.reasoningId===void 0||n.reasoningId===``?delete r.reasoningId:r.reasoningId=n.reasoningId,n.permissionPolicy===void 0?delete r.permissionPolicy:r.permissionPolicy=n.permissionPolicy,t(r)}let{cmd:v,...y}=e.overrides??{},b=FD(s,e.engine),x=e.engine===`acp`?s.get(`acp:${e.variant}`):s.get(e.engine);return(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-5`,children:[(0,B.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Executor`}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`选 engine + variant,仅 override 想改的字段。`})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:d,disabled:l||o.isFetching,"aria-label":`Refresh engine availability`,"data-testid":`refresh-engines-btn`,className:`inline-flex items-center gap-1 rounded-sm border border-hairline px-2 py-1 text-xs text-muted-foreground hover:bg-soft-stone disabled:opacity-60`,children:[(0,B.jsx)(Am,{className:`size-3.5 ${l?`animate-spin`:``}`}),`Refresh`]})]}),s.size>0&&(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-sm border border-hairline bg-soft-stone p-2 text-xs`,children:fO().map(e=>{let t=FD(s,e);return(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-2 rounded-full border border-hairline bg-background px-2.5 py-1`,"data-testid":`engine-availability-${e}`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:dO[e].label}),(0,B.jsx)(vO,{status:t,testId:`engine-availability-badge-${e}`})]},e)})}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(hw,{htmlFor:`executor-engine`,children:`Engine`}),(0,B.jsx)(vO,{status:b,testId:`engine-selected-badge`})]}),(0,B.jsx)(`select`,{id:`executor-engine`,className:`app-field h-10`,value:e.engine,onChange:e=>f(e.target.value),children:fO().map(e=>{let t=FD(s,e),n=t?` — ${hO[t]}`:``;return(0,B.jsxs)(`option`,{value:e,children:[dO[e].label,n]},e)})}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.description})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(hw,{htmlFor:`executor-variant`,children:`Variant`}),e.engine===`acp`&&(0,B.jsx)(vO,{status:x?.status,testId:`variant-selected-badge`})]}),(0,B.jsx)(`select`,{id:`executor-variant`,className:`app-field h-10`,value:e.variant,onChange:e=>p(e.target.value),children:pO(e.engine).map(t=>{let r=e.engine===`acp`?s.get(`acp:${t}`)?.status:void 0,i=r?` — ${hO[r]}`:``;return(0,B.jsxs)(`option`,{value:t,children:[n.variants[t].label,i]},t)})}),r?.description&&(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r.description})]})]}),b===`not-found`&&(0,B.jsx)(bO,{engine:e.engine}),b===`login-required`&&(0,B.jsx)(xO,{engine:e.engine}),r&&(0,B.jsx)(zD,{schema:r.schema,value:y,secretFields:r.secretFields,fieldHints:r.fieldHints,onChange:h}),(0,B.jsxs)(`div`,{className:`border-t pt-4`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`text-sm font-medium text-muted-foreground hover:text-foreground`,onClick:()=>a(e=>!e),"aria-expanded":i,children:[i?`▾`:`▸`,` `,`Advanced (per-request + cmd overrides)`]}),i&&(0,B.jsxs)(`div`,{className:`mt-3 flex flex-col gap-4`,children:[(0,B.jsx)(CO,{modelId:e.modelId,reasoningId:e.reasoningId,permissionPolicy:e.permissionPolicy,onChange:_}),(0,B.jsx)(wO,{cmd:v,onChange:g})]})]})]})}function bO({engine:e}){let t=SO(e);return(0,B.jsxs)(`div`,{role:`alert`,"data-testid":`engine-install-callout`,className:`app-alert-warning`,children:[(0,B.jsx)(`p`,{className:`font-medium`,children:`本 worker 没有该 engine 对应的 CLI。`}),(0,B.jsxs)(`p`,{className:`mt-1 text-muted-foreground`,children:[`进 worker 容器装 / 登录后点 Refresh。具体步骤见`,` `,(0,B.jsxs)(`a`,{className:`underline decoration-dotted underline-offset-2 hover:text-foreground`,href:`/docs/executor-engines.md${t}`,target:`_blank`,rel:`noreferrer`,children:[`docs/executor-engines.md`,t]}),`。`]})]})}function xO({engine:e}){let t=SO(e);return(0,B.jsxs)(`div`,{role:`status`,"data-testid":`engine-login-callout`,className:`app-alert-warning`,children:[(0,B.jsx)(`p`,{className:`font-medium`,children:`CLI 已装但缺登录态。`}),(0,B.jsxs)(`p`,{className:`mt-1 text-muted-foreground`,children:[`在 worker 容器跑对应 CLI 的 login 命令(见`,` `,(0,B.jsxs)(`a`,{className:`underline decoration-dotted underline-offset-2 hover:text-foreground`,href:`/docs/executor-engines.md${t}`,target:`_blank`,rel:`noreferrer`,children:[`docs/executor-engines.md`,t]}),`)后 Refresh。`]})]})}function SO(e){switch(e){case`claude-code`:return`#claude-code`;case`acp`:return`#acp`;case`codex`:return`#codex`;case`cursor`:return`#cursor`;default:return``}}function CO({modelId:e,reasoningId:t,permissionPolicy:n,onChange:r}){return(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`modelId (per-request override)`}),(0,B.jsx)(mw,{value:e??``,onChange:e=>r({modelId:e.target.value,reasoningId:t,permissionPolicy:n})})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`reasoningId`}),(0,B.jsx)(mw,{value:t??``,onChange:t=>r({modelId:e,reasoningId:t.target.value,permissionPolicy:n})})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`permissionPolicy`}),(0,B.jsxs)(`select`,{className:`app-field h-10`,value:n??``,onChange:n=>{let i=n.target.value;r({modelId:e,reasoningId:t,...i?{permissionPolicy:i}:{}})},children:[(0,B.jsx)(`option`,{value:``,children:`— unset —`}),(0,B.jsx)(`option`,{value:`auto`,children:`auto`}),(0,B.jsx)(`option`,{value:`supervised`,children:`supervised`}),(0,B.jsx)(`option`,{value:`plan`,children:`plan`})]})]})]})}function wO({cmd:e,onChange:t}){function n(e){let n={};e.binary&&e.binary.length>0&&(n.binary=e.binary),e.extraArgs&&e.extraArgs.length>0&&(n.extraArgs=e.extraArgs),e.env&&Object.keys(e.env).length>0&&(n.env=e.env),e.cliVersion&&e.cliVersion.length>0&&(n.cliVersion=e.cliVersion),t(Object.keys(n).length>0?n:void 0)}let r=(e?.extraArgs??[]).join(` `),i=Object.entries(e?.env??{}).map(([e,t])=>`${e}=${t}`).join(`
|
|
1381
|
+
`);return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-sm border border-hairline bg-soft-stone p-3`,children:[(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`cmd overrides 仅对 spawn 二进制的 engine(cli / claude-code / acp)生效。`}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`cmd.binary`}),(0,B.jsx)(mw,{value:e?.binary??``,onChange:t=>n({...e,binary:t.target.value})})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(hw,{children:`cmd.cliVersion`}),(0,B.jsx)(mw,{value:e?.cliVersion??``,onChange:t=>n({...e,cliVersion:t.target.value})})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:col-span-2`,children:[(0,B.jsx)(hw,{children:`cmd.extraArgs (空白分隔)`}),(0,B.jsx)(mw,{value:r,onChange:t=>{let r=t.target.value.split(/\s+/).filter(Boolean);n({...e,extraArgs:r})}})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:col-span-2`,children:[(0,B.jsx)(hw,{children:`cmd.env (KEY=value 每行)`}),(0,B.jsx)(`textarea`,{className:`app-field min-h-[80px] font-mono`,value:i,onChange:t=>{let r=[];for(let e of t.target.value.split(`
|
|
1382
|
+
`)){let t=e.indexOf(`=`);if(t<=0)continue;let n=e.slice(0,t).trim(),i=e.slice(t+1);n.length>0&&r.push([n,i])}n({...e,env:Object.fromEntries(r)})}})]})]})]})}function TO(){let e=bT(),t=yT(),[n,r]=(0,z.useState)(0);return e.isLoading?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(fD,{className:`h-8 w-48`}),(0,B.jsx)(fD,{className:`h-40`}),(0,B.jsx)(fD,{className:`h-40`})]}):e.isError||!e.data?(0,B.jsxs)(`div`,{className:`app-alert-error`,children:[`加载 worker config 失败:`,` `,e.error instanceof Error?e.error.message:`未知错误`,` `,(0,B.jsx)(yg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void e.refetch(),children:`重试`})]}):(0,B.jsx)(EO,{initial:e.data.config,initialVersion:e.data.version,info:t.data,onReload:()=>{r(e=>e+1),e.refetch()}},n)}function EO({initial:e,initialVersion:t,info:n,onReload:r}){let[i,a]=(0,z.useState)(e),[o,s]=(0,z.useState)(t),[c,l]=(0,z.useState)(null),[u,d]=(0,z.useState)(null),[f,p]=(0,z.useState)(null),m=xT();function h(e){a(t=>({...t,...e}))}function g(e){a(t=>({...t,executor:e}))}function _(e){a(t=>({...t,channels:e}))}function v(e){a(t=>({...t,evolution:e}))}function y(){if(i.brains.length>0&&i.brainWriteTarget.length===0)return`配置了 brain source 后必须选 write target,或者删光所有 brain。`;if(i.brains.length>0&&!i.brains.some(e=>e.id===i.brainWriteTarget))return`brainWriteTarget "${i.brainWriteTarget}" 不在已配置的 brain id 列表里。`;let e=new Set;for(let t of i.brains){if(t.id.length===0)return`每个 brain source 必须有 id。`;if(e.has(t.id))return`重复的 brain id:${t.id}`;e.add(t.id)}return null}async function b(){l(null),d(null);let e=y();if(e){l(e);return}try{let e=await m.mutateAsync({config:i,ifMatchVersion:o});p(e.runtimeReload===`ok`?`已保存(version ${e.version})。`:`已保存(version ${e.version}),但 runtime reload 失败——重启 worker 才能让新 config 真正生效。`),a(e.config),s(e.version)}catch(e){if(e instanceof ww&&e.code===`version-conflict`){d({expected:e.expectedVersion,actual:e.actualVersion});return}if(e instanceof ww&&e.code===`invalid-config`){l(`worker 拒绝了 config:${e.message}`);return}l(e instanceof Error?e.message:`保存失败。`)}}return(0,B.jsxs)(`form`,{className:`app-page`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,B.jsxs)(`div`,{className:`app-page-header`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Configuration`}),(0,B.jsxs)(`p`,{className:`app-page-copy`,children:[`Version`,` `,(0,B.jsx)(`span`,{className:`font-mono`,children:o}),`。Secret 字段渲染为占位,留空保留旧值。`]})]}),u&&(0,B.jsxs)(`div`,{role:`alert`,className:`app-alert-warning flex items-start gap-3`,children:[(0,B.jsx)(zm,{className:`mt-0.5 size-4 text-warning`}),(0,B.jsxs)(`div`,{className:`flex-1`,children:[(0,B.jsx)(`p`,{className:`font-medium`,children:`Version 冲突`}),(0,B.jsxs)(`p`,{className:`text-muted-foreground`,children:[`你基于 version`,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:u.expected??o}),` `,`做了改动,但当前 stored version 是`,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:u.actual??`?`}),`。期间另一方已经保存了新版本。`]})]}),(0,B.jsx)(yg,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:`Reload 重新编辑`})]}),c&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error`,children:c}),f&&(0,B.jsx)(`p`,{role:`status`,className:`app-alert-success`,children:f}),(0,B.jsx)(SD,{brains:i.brains,brainWriteTarget:i.brainWriteTarget,brainRetrieval:i.brainRetrieval,onChange:h}),(0,B.jsx)(yO,{executor:i.executor,onChange:g}),(0,B.jsx)(jD,{channels:i.channels,info:n,onChange:_}),(0,B.jsxs)(`section`,{className:`app-panel flex flex-col gap-4`,children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal`,children:`Evolution (L3)`}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:i.evolution.enabled,onChange:e=>v({...i.evolution,enabled:e.target.checked})}),`启用 evolution observer`]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5 max-w-[240px]`,children:[(0,B.jsx)(`label`,{className:`text-sm font-medium`,children:`Observation 保留天数`}),(0,B.jsx)(`input`,{type:`number`,min:0,className:`app-field h-10`,value:i.evolution.observationRetentionDays,onChange:e=>v({...i.evolution,observationRetentionDays:Number.parseInt(e.target.value,10)||0})})]})]}),(0,B.jsxs)(`div`,{className:`app-panel flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,B.jsxs)(`p`,{className:`min-w-0 text-xs text-muted-foreground`,children:[`保存使用`,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:`If-Match: ${o}`}),`——若 stored version 已前移则返 409。`]}),(0,B.jsxs)(yg,{type:`submit`,className:`w-full sm:w-auto`,disabled:m.isPending,children:[m.isPending?(0,B.jsx)(xm,{className:`size-4 animate-spin`}):(0,B.jsx)(jm,{className:`size-4`}),m.isPending?`保存中…`:`保存配置`]})]})]})}var DO=zi(`/config`)({component:TO});function OO(){let e=RT(),[t,n]=(0,z.useState)(null),r=t,i=zT(r??void 0),a=IT(),o=LT(),s=BT(),c=VT(),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(null),[p,m]=(0,z.useState)(null),h=i.data?.messages??[],g=p!==null&&p.text.length>0&&!AO(p,h)?p:null,_=(0,z.useId)(),v=(0,z.useRef)(null);(0,z.useEffect)(()=>()=>{v.current?.abort()},[]);async function y(){let e=l.trim(),r=t,i=h.map(e=>e.id),d=a.isPending||o.isPending;if(!(e.length===0||d)){f(null);try{let t=r?await o.mutateAsync({conversationId:r,prompt:e}):await a.mutateAsync(e);u(``),v.current?.abort();let l=new AbortController;v.current=l,m({taskId:t.id,conversationId:r,text:``,done:!1,initialMessageIds:i}),kO(l,t.id,{onConversation:e=>{n(e),m(n=>!n||n.taskId!==t.id?n:{...n,conversationId:e})},onDelta:e=>{m(n=>!n||n.taskId!==t.id?n:{...n,text:n.text+e})},onDone:e=>{m(e=>e&&e.taskId===t.id?{...e,done:!0}:e),c(),e&&s(e)},onError:e=>{f(e),m(null)}})}catch(e){f(e instanceof ww?e.message:`提交失败。`)}}}return(0,B.jsxs)(`div`,{"data-testid":`worker-chat-panel`,className:`grid min-w-0 grid-cols-1 gap-4 lg:h-[calc(100vh-200px)] lg:min-h-[420px] lg:grid-cols-[280px_1fr]`,children:[(0,B.jsxs)(`aside`,{className:`flex max-h-56 min-h-0 min-w-0 flex-col gap-3 overflow-y-auto rounded-sm border border-hairline bg-card p-3 lg:max-h-none`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,B.jsx)(`h2`,{className:`px-1 text-feature font-normal`,children:`Conversations`}),(0,B.jsxs)(yg,{type:`button`,variant:t===null?`secondary`:`outline`,size:`sm`,className:`min-h-8 px-2 py-1 text-xs`,onClick:()=>n(null),children:[(0,B.jsx)(km,{className:`size-3.5`}),`新会话`]})]}),e.isLoading?(0,B.jsx)(fD,{className:`h-20`}):(e.data?.conversations??[]).length===0?(0,B.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:`尚无会话。`}):(0,B.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.data?.conversations.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:`flex w-full flex-col rounded-sm px-2 py-2 text-left text-xs transition-colors ${r===e.id?`bg-primary text-primary-foreground`:`hover:bg-soft-stone`}`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-micro`,children:[e.channel,`:`,e.chatId]}),(0,B.jsx)(`span`,{className:`truncate text-micro-label ${r===e.id?`text-primary-foreground/70`:`text-muted-foreground`}`,children:new Date(e.lastActiveAt).toLocaleString()})]})},e.id))})]}),(0,B.jsxs)(`section`,{className:`flex min-h-[420px] min-w-0 flex-col gap-3 rounded-lg border border-hairline bg-soft-stone p-3 text-foreground sm:p-4 lg:min-h-0`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 overflow-y-auto`,children:[r?i.isLoading?(0,B.jsx)(fD,{className:`h-40`}):i.isError?(0,B.jsxs)(`p`,{role:`alert`,className:`rounded-sm border border-coral-soft bg-coral/10 p-3 text-sm text-coral-soft`,children:[`加载消息失败:`,i.error instanceof Error?i.error.message:`未知错误`]}):(i.data?.messages??[]).map(e=>(0,B.jsxs)(`div`,{className:`max-w-[90%] rounded-sm p-3 text-sm sm:max-w-[80%] ${e.role===`user`?`self-end border border-hairline bg-background text-foreground`:`self-start bg-deep-green text-on-dark`}`,children:[(0,B.jsx)(`p`,{className:`whitespace-pre-wrap break-words`,children:e.content}),(0,B.jsxs)(`p`,{className:`mt-1 text-micro-label opacity-70`,children:[e.role,` · `,new Date(e.createdAt).toLocaleString()]})]},e.id)):(0,B.jsx)(`p`,{className:`rounded-sm border border-dashed border-hairline bg-background p-4 text-center text-sm text-muted-foreground sm:p-6`,children:`新会话`}),g&&(0,B.jsxs)(`div`,{className:`max-w-[90%] self-start rounded-sm bg-deep-green p-3 text-sm text-on-dark sm:max-w-[80%]`,children:[(0,B.jsx)(`p`,{className:`whitespace-pre-wrap break-words`,children:g.text}),!g.done&&(0,B.jsxs)(`p`,{className:`mt-1 text-micro-label text-on-dark/70`,children:[(0,B.jsx)(xm,{className:`inline size-3 animate-spin`}),` streaming…`]})]})]}),d&&(0,B.jsx)(`p`,{role:`alert`,className:`rounded-sm border border-coral-soft bg-coral/10 p-2 text-xs text-coral-soft`,children:d}),(0,B.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row`,onSubmit:e=>{e.preventDefault(),y()},children:[(0,B.jsx)(`label`,{htmlFor:_,className:`sr-only`,children:`Prompt`}),(0,B.jsx)(`textarea`,{id:_,className:`min-h-[60px] min-w-0 flex-1 resize-none rounded-sm border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,placeholder:`给 worker 发一条消息(Cmd/Ctrl + Enter 发送)`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),y())}}),(0,B.jsxs)(yg,{type:`submit`,className:`w-full sm:w-auto`,disabled:a.isPending||o.isPending||l.trim().length===0,children:[a.isPending||o.isPending?(0,B.jsx)(xm,{className:`size-4 animate-spin`}):(0,B.jsx)(Mm,{className:`size-4`}),`发送`]})]})]})]})}async function kO(e,t,n){let r=null,i=`task:${t}`;function a(e){r!==e&&(r=e,n.onConversation(e))}try{await Xw(e.signal,o=>{let s=o.data,c=typeof s.taskId==`string`?s.taskId:null;if(o.type===`conversation.created`&&(!c||c===t)&&(s.chatId===i||c===t)&&typeof s.conversationId==`string`){a(s.conversationId);return}let l=typeof s.conversationId==`string`?s.conversationId:null;if(!(c&&c!==t)&&!(!r&&c!==t)&&!(r&&l&&l!==r)){if(!r&&l&&o.type.startsWith(`orchestrator.`)&&a(l),o.type===`orchestrator.text`){let e=typeof s.delta==`string`?s.delta:``;e.length>0&&n.onDelta(e)}else if(o.type===`orchestrator.finished`)n.onDone(r),e.abort();else if(o.type===`orchestrator.error`){let t=typeof s.error==`string`?s.error:`事件流返回执行错误。`;n.onError(t),e.abort()}}})}catch(t){if(e.signal.aborted)return;n.onError(t instanceof Error?t.message:`事件流中断。`)}}function AO(e,t){if(!e.done||e.text.length===0)return!1;let n=new Set(e.initialMessageIds);return t.some(t=>t.role===`assistant`&&t.content===e.text&&!n.has(t.id)&&(!e.conversationId||t.conversationId===e.conversationId))}var jO=zi(`/chat`)({component:OO});function MO(){return(0,B.jsxs)(`section`,{className:`app-page-narrow`,children:[(0,B.jsxs)(`header`,{className:`app-page-header min-w-0`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Brain`}),(0,B.jsxs)(`p`,{className:`app-page-copy break-words`,children:[`Project Brain 摘要 + admission 审批 + brain artifact 注册表。 Brief 是 canonical brain(`,(0,B.jsx)(`code`,{className:`app-code`,children:`.aiworker/`}),`)的投影;这里展示的内容默认 redact secret-like 字段。`]})]}),(0,B.jsx)(NO,{}),(0,B.jsx)(FO,{}),(0,B.jsx)(IO,{})]})}function NO(){let e=HT();if(e.isLoading)return(0,B.jsx)(`section`,{className:`app-panel`,children:(0,B.jsx)(fD,{className:`h-24 w-full`})});if(e.error||e.data===void 0)return(0,B.jsxs)(`section`,{className:`app-alert-error`,children:[`无法加载 brain summary:`,e.error?.message??`unknown error`]});let{brainSummary:t,checkedAt:n}=e.data;return(0,B.jsxs)(`section`,{className:`grid gap-6 rounded-lg border border-hairline bg-soft-stone p-5 sm:grid-cols-2 sm:p-6`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`mb-2 text-micro uppercase text-muted-foreground`,children:`Scope manifest`}),t.scopeManifest.status===`ok`?(0,B.jsxs)(`ul`,{className:`space-y-1 text-sm`,children:[(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{children:`kind: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.scopeManifest.kind})]}),(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{children:`primary soul: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.scopeManifest.primarySoul})]}),t.scopeManifest.privacy&&(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{children:`privacy: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.scopeManifest.privacy})]}),t.scopeManifest.approval&&(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{children:`approval: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.scopeManifest.approval})]})]}):(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:`状态:`}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.scopeManifest.status}),t.scopeManifest.error&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`br`,{}),(0,B.jsx)(`span`,{className:`text-destructive`,children:t.scopeManifest.error})]})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`mb-2 text-micro uppercase text-muted-foreground`,children:`Aggregates`}),(0,B.jsxs)(`ul`,{className:`space-y-1 text-sm`,children:[(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{children:`artifacts: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.artifacts.total}),(0,B.jsx)(`span`,{children:` total, by status: ${Object.entries(t.artifacts.byStatus).map(([e,t])=>`${e}=${t}`).join(`, `)||`<none>`}`})]}),(0,B.jsx)(`li`,{children:(0,B.jsx)(`span`,{children:`admissions by status: ${Object.entries(t.admissions.byStatus).map(([e,t])=>`${e}=${t}`).join(`, `)||`<none>`}`})}),t.admissions.lastUpdatedAt&&(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{children:`last updated: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:t.admissions.lastUpdatedAt})]})]}),(0,B.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:`checked at: `}),(0,B.jsx)(`span`,{className:`font-mono`,children:n})]})]})]})}function PO(e){return e===`pending`?`secondary`:e===`approved`||e===`applied`?`default`:e===`rejected`||e===`failed`?`destructive`:`outline`}function FO(){let[e,t]=(0,z.useState)(``),n=HT(),r=UT({status:`pending`}),i=WT(),a=GT(),o=KT(),s=e.trim().length>0,c=r.data?.proposals??[];return(0,B.jsxs)(`section`,{className:`app-panel`,children:[(0,B.jsxs)(`header`,{className:`mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,B.jsx)(`h2`,{className:`text-micro uppercase text-muted-foreground`,children:`Admission proposals (pending)`}),(0,B.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,B.jsx)(mw,{className:`h-8 w-48`,placeholder:`--decided-by name`,value:e,onChange:e=>t(e.target.value)})})]}),r.isLoading&&(0,B.jsx)(fD,{className:`h-24 w-full`}),r.error&&(0,B.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`加载失败:`,r.error.message]}),!r.isLoading&&c.length===0&&(0,B.jsxs)(`div`,{className:`space-y-2 text-sm text-muted-foreground`,children:[(0,B.jsx)(`p`,{children:`暂无 pending 的 admission proposal。`}),n.data?.brainSummary.admissions.bypassRisk.status===`suspected`&&(0,B.jsx)(`p`,{className:`text-warning`,children:`最近有回复声称已提交 admission 或已写入长期记忆,但 AIWorker admission 数据库没有新增记录;外部 executor 可能写入了自己的 native memory。`})]}),(0,B.jsx)(`ul`,{className:`space-y-3`,children:c.map(t=>(0,B.jsxs)(`li`,{className:`rounded-sm border border-hairline bg-background p-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`font-mono`,children:t.id}),(0,B.jsx)(nE,{variant:PO(t.status),children:t.status}),(0,B.jsx)(nE,{variant:`outline`,children:t.kind}),(0,B.jsxs)(nE,{variant:`outline`,children:[`soul:`,t.soulId]}),(0,B.jsxs)(nE,{variant:`outline`,children:[`risk:`,t.risk]})]}),(0,B.jsx)(`p`,{className:`mt-1 text-sm`,children:t.summary}),(0,B.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`target:`,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:t.target})]}),(0,B.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,B.jsx)(yg,{size:`sm`,disabled:!s||i.isPending,onClick:()=>i.mutate({decidedBy:e,id:t.id}),children:`Approve`}),(0,B.jsx)(yg,{size:`sm`,variant:`destructive`,disabled:!s||a.isPending,onClick:()=>a.mutate({decidedBy:e,id:t.id}),children:`Reject`}),(0,B.jsx)(yg,{size:`sm`,variant:`outline`,disabled:!s||o.isPending,onClick:()=>o.mutate({decidedBy:e,id:t.id}),children:`Apply (dry-run)`}),(0,B.jsx)(yg,{size:`sm`,variant:`outline`,disabled:!s||o.isPending,onClick:()=>o.mutate({commit:!0,decidedBy:e,id:t.id}),children:`Apply --commit`})]})]},t.id))}),(i.error||a.error||o.error)&&(0,B.jsxs)(`p`,{className:`mt-3 text-sm text-destructive`,children:[`操作失败:`,(i.error??a.error??o.error)?.message]})]})}function IO(){let e=qT({limit:50});return(0,B.jsxs)(`section`,{className:`app-panel`,children:[(0,B.jsxs)(`header`,{className:`mb-4`,children:[(0,B.jsx)(`h2`,{className:`text-micro uppercase text-muted-foreground`,children:`Brain artifacts (read-only, redacted)`}),(0,B.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Confidential / secret artifact 的 ref 与 hash 默认替换为`,(0,B.jsx)(`code`,{className:`font-mono`,children:`<redacted>`}),`。`]})]}),e.isLoading&&(0,B.jsx)(fD,{className:`h-24 w-full`}),e.error&&(0,B.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`加载失败:`,e.error.message]}),!e.isLoading&&(e.data?.artifacts.length??0)===0&&(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`暂无登记的 brain artifact。`}),(0,B.jsx)(`ul`,{className:`space-y-2`,children:(e.data?.artifacts??[]).map(e=>(0,B.jsxs)(`li`,{className:`rounded-sm border border-hairline bg-background p-3 text-sm`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`font-mono`,children:e.id}),(0,B.jsx)(nE,{variant:`outline`,children:e.type}),(0,B.jsx)(nE,{variant:`outline`,children:e.status}),(0,B.jsxs)(nE,{variant:`outline`,children:[`sensitivity:`,e.sensitivity]}),e.scopeId&&(0,B.jsxs)(nE,{variant:`outline`,children:[`scope:`,e.scopeId]})]}),e.summary&&(0,B.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:e.summary}),(0,B.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`ref:`,` `,(0,B.jsx)(`code`,{className:`font-mono`,children:e.ref})]})]},e.id))})]})}var LO=zi(`/brain`)({component:MO});function RO(){let e=PT(),t=FT(),[n,r]=(0,z.useState)(null),i=(0,z.useMemo)(()=>e.data?.approvals??[],[e.data]);async function a(e,n){r(null);try{await t.mutateAsync({taskId:e.taskId,toolCallId:e.toolCallId,decision:n})}catch(e){r(e instanceof ww?e.message:`提交失败。`)}}return(0,B.jsxs)(`div`,{className:`app-page-narrow max-w-5xl`,children:[(0,B.jsxs)(`header`,{className:`app-page-header`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Approvals`}),(0,B.jsx)(`p`,{className:`app-page-copy`,children:"orchestrator 命中 toolPolicy `ask` 规则时挂起的工具调用。批准前 60s 内未处理视同 deny。"})]}),i.length>0&&(0,B.jsxs)(`div`,{role:`alert`,className:`app-alert-warning flex items-start gap-3`,children:[(0,B.jsx)(Nm,{className:`mt-0.5 size-4 text-warning`}),(0,B.jsxs)(`div`,{className:`flex-1`,children:[(0,B.jsxs)(`p`,{className:`font-medium`,children:[i.length,` `,`个 pending approval`]}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`超时(默认 60s)未处理 = deny。`})]})]}),n&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error`,children:n}),e.isLoading?(0,B.jsx)(fD,{className:`h-40`}):e.isError?(0,B.jsxs)(`p`,{role:`alert`,className:`app-alert-error`,children:[`加载失败:`,e.error instanceof Error?e.error.message:`未知错误`]}):i.length===0?(0,B.jsx)(`p`,{className:`app-empty`,children:`当前没有 pending approval。`}):(0,B.jsx)(`ul`,{className:`flex flex-col gap-3`,children:i.map(e=>(0,B.jsxs)(`li`,{className:`flex flex-col gap-3 rounded-sm border border-hairline bg-card p-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`code`,{className:`font-mono text-sm`,children:e.toolName}),(0,B.jsx)(zO,{at:e.expiresAt})]}),(0,B.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`task`,(0,B.jsx)(`code`,{className:`ml-1 font-mono`,children:e.taskId}),(0,B.jsx)(`span`,{className:`mx-2`,children:`·`}),`tool call`,(0,B.jsx)(`code`,{className:`ml-1 font-mono`,children:e.toolCallId})]})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,B.jsxs)(yg,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void a(e,`deny`),disabled:t.isPending,children:[(0,B.jsx)(Vm,{className:`size-4`}),`Deny`]}),(0,B.jsxs)(yg,{type:`button`,size:`sm`,onClick:()=>void a(e,`allow`),disabled:t.isPending,children:[t.isPending?(0,B.jsx)(xm,{className:`size-4 animate-spin`}):(0,B.jsx)(mm,{className:`size-4`}),`Allow`]})]})]}),(0,B.jsxs)(`details`,{className:`text-xs`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`查看 params`}),(0,B.jsx)(`pre`,{className:`mt-1 overflow-x-auto rounded-sm bg-soft-stone p-2 text-foreground`,children:JSON.stringify(e.params,null,2)})]})]},`${e.taskId}:${e.toolCallId}`))})]})}function zO({at:e}){let t=e-Date.now();if(t<=0)return(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-micro text-destructive`,children:[(0,B.jsx)(gm,{className:`size-3`}),`expired`]});let n=Math.max(0,Math.round(t/1e3));return(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-micro text-muted-foreground`,children:[(0,B.jsx)(gm,{className:`size-3`}),`剩`,n,`s`]})}var BO=zi(`/approvals`)({component:RO});function VO(){let e=vT(),t=yT(),n=AT(),r=PT();return(0,B.jsxs)(`section`,{className:`app-page-narrow`,children:[(0,B.jsxs)(`header`,{className:`app-page-header min-w-0`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`概览`}),(0,B.jsxs)(`p`,{className:`app-page-copy break-words`,children:[`单 worker 自管面板。所有数据通道走当前入口的`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`/api/worker/*`}),`兼容管理 API。`]})]}),(0,B.jsxs)(`div`,{className:`grid min-w-0 gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:[(0,B.jsx)(HO,{title:`Worker 健康`,icon:fm,loading:e.isLoading,error:e.error,children:e.data&&(0,B.jsxs)(`ul`,{className:`space-y-1 text-sm`,children:[(0,B.jsx)(UO,{label:`status`,value:e.data.status}),(0,B.jsx)(UO,{label:`config`,value:`v${e.data.configVersion}`}),(0,B.jsx)(UO,{label:`brain`,value:e.data.brain?e.data.brain.status:`unknown`}),(0,B.jsx)(UO,{label:`executor`,value:e.data.executor?e.data.executor.status:`unknown`})]})}),(0,B.jsx)(HO,{title:`Brain`,icon:pm,loading:t.isLoading,error:t.error,actionTo:`/config`,actionLabel:`改配置`,children:t.data&&(0,B.jsx)(`ul`,{className:`space-y-1 text-sm`,children:t.data.brains.length===0?(0,B.jsx)(`li`,{className:`text-muted-foreground`,children:`未配置 brain。`}):t.data.brains.map(e=>(0,B.jsxs)(`li`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`code`,{className:`font-mono text-xs`,children:e.id}),(0,B.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.type,` · `,e.status]})]},e.id))})}),(0,B.jsx)(HO,{title:`Executor`,icon:_m,loading:t.isLoading,error:t.error,actionTo:`/test`,actionLabel:`探测`,children:t.data&&(0,B.jsxs)(`ul`,{className:`space-y-1 text-sm`,children:[(0,B.jsx)(UO,{label:`type`,value:t.data.executor.type}),t.data.executor.model&&(0,B.jsx)(UO,{label:`model`,value:t.data.executor.model}),(0,B.jsx)(UO,{label:`status`,value:t.data.executor.status})]})}),(0,B.jsx)(HO,{title:`Cron 调度`,icon:Lm,loading:n.isLoading,error:n.error,actionTo:`/cron`,actionLabel:`管理`,children:n.data&&(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`共`,` `,(0,B.jsx)(`span`,{className:`font-medium text-foreground`,children:n.data.jobs.length}),` `,`个;`,` `,(0,B.jsx)(`span`,{className:`font-medium text-foreground`,children:n.data.jobs.filter(e=>e.enabled).length}),` `,`启用中。`]})}),(0,B.jsx)(HO,{title:`Approvals`,icon:Pm,loading:r.isLoading,error:r.error,actionTo:`/approvals`,actionLabel:r.data?.approvals.length?`处理`:`查看`,children:r.data&&(0,B.jsx)(`p`,{className:`text-sm`,children:(0,B.jsxs)(`span`,{className:r.data.approvals.length>0?`font-medium text-warning`:`text-muted-foreground`,children:[r.data.approvals.length,` `,`pending`]})})}),(0,B.jsx)(HO,{title:`Chat`,icon:Cm,loading:!1,actionTo:`/chat`,actionLabel:`打开`,children:(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`发条消息给 worker,检查 orchestrator 端到端通路。`})})]})]})}function HO({title:e,icon:t,loading:n,error:r,actionTo:i,actionLabel:a,children:o}){return(0,B.jsxs)(`article`,{className:`app-panel flex min-w-0 flex-col gap-3`,children:[(0,B.jsxs)(`header`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsx)(t,{className:`size-4 shrink-0 text-muted-foreground`}),(0,B.jsx)(`h3`,{className:`truncate text-feature font-normal`,children:e})]}),i&&(0,B.jsx)(JT,{to:i,className:`shrink-0 text-xs text-muted-foreground underline decoration-dotted underline-offset-2 hover:text-foreground`,children:a??`前往`})]}),n?(0,B.jsx)(fD,{className:`h-16`}):r?(0,B.jsx)(`p`,{className:`text-xs text-destructive`,children:r instanceof Error?r.message:`加载失败`}):o]})}function UO({label:e,value:t}){return(0,B.jsxs)(`li`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,B.jsx)(`code`,{className:`min-w-0 truncate font-mono text-xs`,children:t})]})}var WO=zi(`/`)({component:VO}),GO=fE.update({id:`/test`,path:`/test`,getParentRoute:()=>eE}),KO=hD.update({id:`/secrets`,path:`/secrets`,getParentRoute:()=>eE}),qO=yD.update({id:`/cron`,path:`/cron`,getParentRoute:()=>eE}),JO=DO.update({id:`/config`,path:`/config`,getParentRoute:()=>eE}),YO=jO.update({id:`/chat`,path:`/chat`,getParentRoute:()=>eE}),XO=LO.update({id:`/brain`,path:`/brain`,getParentRoute:()=>eE}),ZO=BO.update({id:`/approvals`,path:`/approvals`,getParentRoute:()=>eE}),QO={IndexRoute:WO.update({id:`/`,path:`/`,getParentRoute:()=>eE}),ApprovalsRoute:ZO,BrainRoute:XO,ChatRoute:YO,ConfigRoute:JO,CronRoute:qO,SecretsRoute:KO,TestRoute:GO},$O=eE._addFileChildren(QO)._addFileTypes();Qa(`worker`),Zp();var ek=ea({routeTree:$O,basepath:Gp(`worker`),defaultPreload:`intent`,defaultPreloadStaleTime:0,scrollRestoration:!0}),tk=document.getElementById(`root`);if(!tk)throw Error(`Root element not found`);(0,sa.createRoot)(tk).render((0,B.jsx)(z.StrictMode,{children:(0,B.jsxs)(ze,{client:to,children:[(0,B.jsx)($a,{scope:`worker`}),(0,B.jsx)(ra,{router:ek}),(0,B.jsx)(eo,{})]})}));
|