flowent 0.3.4 → 0.3.5
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/backend/pyproject.toml +1 -1
- package/backend/src/flowent/agent.py +5 -0
- package/backend/src/flowent/agent_runtime.py +14 -0
- package/backend/src/flowent/state/schema.py +8 -0
- package/backend/src/flowent/state/store.py +57 -0
- package/backend/src/flowent/static/assets/index-CvyP2CdF.css +2 -0
- package/backend/src/flowent/static/assets/{index-D3WSbctU.js → index-DAwMtAnm.js} +34 -34
- package/backend/src/flowent/static/index.html +2 -2
- package/backend/src/flowent/workflows.py +15 -4
- package/backend/uv.lock +1 -1
- package/dist/frontend/assets/index-CvyP2CdF.css +2 -0
- package/dist/frontend/assets/{index-D3WSbctU.js → index-DAwMtAnm.js} +34 -34
- package/dist/frontend/index.html +2 -2
- package/package.json +1 -1
- package/backend/src/flowent/static/assets/index-ByGH1ZWH.css +0 -2
- package/dist/frontend/assets/index-ByGH1ZWH.css +0 -2
|
@@ -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{me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?pe(n):``}function ge(e,t){switch(e.tag){case 26:case 27:case 5:return pe(e.type);case 16:return pe(`Lazy`);case 13:return e.child!==t&&t!==null?pe(`Suspense Fallback`):pe(`Suspense`);case 19:return pe(`SuspenseList`);case 0:case 15:return he(e.type,!1);case 11:return he(e.type.render,!1);case 1:return he(e.type,!0);case 31:return pe(`Activity`);default:return``}}function _e(e){try{var t=``,n=null;do t+=ge(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 ve=Object.prototype.hasOwnProperty,ye=t.unstable_scheduleCallback,be=t.unstable_cancelCallback,xe=t.unstable_shouldYield,Se=t.unstable_requestPaint,Ce=t.unstable_now,we=t.unstable_getCurrentPriorityLevel,Te=t.unstable_ImmediatePriority,V=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 Pe=Math.clz32?Math.clz32:H,Fe=Math.log,Ie=Math.LN2;function H(e){return e>>>=0,e===0?32:31-(Fe(e)/Ie|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 U(){var e=ze;return ze<<=1,!(ze&62914560)&&(ze=4194304),e}function We(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ge(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ke(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-Pe(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Pe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Je(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ye(e,t){var n=t&-t;return n=n&42?1:Xe(n),(n&(e.suspendedLanes|t))===0?n:0}function Xe(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 Ze(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Qe(){var e=L.p;return e===0?(e=window.event,e===void 0?32:bp(e.type)):e}function $e(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var et=Math.random().toString(36).slice(2),tt=`__reactFiber$`+et,nt=`__reactProps$`+et,rt=`__reactContainer$`+et,it=`__reactEvents$`+et,at=`__reactListeners$`+et,ot=`__reactHandles$`+et,st=`__reactResources$`+et,ct=`__reactMarker$`+et;function W(e){delete e[tt],delete e[nt],delete e[it],delete e[at],delete e[ot]}function lt(e){var t=e[tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rt]||n[tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_f(e);e!==null;){if(n=e[tt])return n;e=_f(e)}return t}e=n,n=e.parentNode}return null}function ut(e){if(e=e[tt]||e[rt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ft(e){var t=e[st];return t||=e[st]={hoistableStyles:new Map,hoistableScripts:new Map},t}function pt(e){e[ct]=!0}var mt=new Set,ht={};function gt(e,t){_t(e,t),_t(e+`Capture`,t)}function _t(e,t){for(ht[e]=t,e=0;e<t.length;e++)mt.add(t[e])}var vt=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]*$`),yt={},bt={};function xt(e){return ve.call(bt,e)?!0:ve.call(yt,e)?!1:vt.test(e)?bt[e]=!0:(yt[e]=!0,!1)}function St(e,t,n){if(xt(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 Ct(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 wt(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 Tt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Et(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Dt(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 Ot(e){if(!e._valueTracker){var t=Et(e)?`checked`:`value`;e._valueTracker=Dt(e,t,``+e[t])}}function kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Et(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function At(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 jt=/[\n"\\]/g;function Mt(e){return e.replace(jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Nt(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=``+Tt(t)):e.value!==``+Tt(t)&&(e.value=``+Tt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ft(e,o,Tt(n)):Ft(e,o,Tt(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=``+Tt(s):e.removeAttribute(`name`)}function Pt(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)){Ot(e);return}n=n==null?``:``+Tt(n),t=t==null?n:``+Tt(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),Ot(e)}function Ft(e,t,n){t===`number`&&At(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function It(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=``+Tt(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 Lt(e,t,n){if(t!=null&&(t=``+Tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Tt(n)}function Rt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(F(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Tt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ot(e)}function zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bt=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 Vt(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||Bt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ht(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&&Vt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Vt(e,o,t[o])}function Ut(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 Wt=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`]]),Gt=/^[\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 Kt(e){return Gt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function qt(){}var Jt=null;function Yt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xt=null,Zt=null;function Qt(e){var t=ut(e);if(t&&(e=t.stateNode)){var n=e[nt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Nt(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="`+Mt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[nt]||null;if(!a)throw Error(i(90));Nt(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&&kt(r)}break a;case`textarea`:Lt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&It(e,!!n.multiple,t,!1)}}}var $t=!1;function en(e,t,n){if($t)return e(t,n);$t=!0;try{return e(t)}finally{if($t=!1,(Xt!==null||Zt!==null)&&(wu(),Xt&&(t=Xt,e=Zt,Zt=Xt=null,Qt(t),e)))for(t=0;t<e.length;t++)Qt(e[t])}}function tn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[nt]||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 nn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),rn=!1;if(nn)try{var an={};Object.defineProperty(an,`passive`,{get:function(){rn=!0}}),window.addEventListener(`test`,an,an),window.removeEventListener(`test`,an,an)}catch{rn=!1}var on=null,sn=null,cn=null;function ln(){if(cn)return cn;var e,t=sn,n=t.length,r,i=`value`in on?on.value:on.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 cn=i.slice(e,1<r?1-r:void 0)}function un(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 dn(){return!0}function fn(){return!1}function pn(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)?dn:fn,this.isPropagationStopped=fn,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=dn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=dn)},persist:function(){},isPersistent:dn}),t}var mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hn=pn(mn),gn=f({},mn,{view:0,detail:0}),_n=pn(gn),vn,yn,bn,xn=f({},gn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mn,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!==bn&&(bn&&e.type===`mousemove`?(vn=e.screenX-bn.screenX,yn=e.screenY-bn.screenY):yn=vn=0,bn=e),vn)},movementY:function(e){return`movementY`in e?e.movementY:yn}}),Sn=pn(xn),Cn=pn(f({},xn,{dataTransfer:0})),wn=pn(f({},gn,{relatedTarget:0})),Tn=pn(f({},mn,{animationName:0,elapsedTime:0,pseudoElement:0})),En=pn(f({},mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Dn=pn(f({},mn,{data:0})),On={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},kn={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`},An={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=An[e])?!!t[e]:!1}function Mn(){return jn}var Nn=pn(f({},gn,{key:function(e){if(e.key){var t=On[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=un(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?kn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mn,charCode:function(e){return e.type===`keypress`?un(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?un(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Pn=pn(f({},xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Fn=pn(f({},gn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mn})),In=pn(f({},mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ln=pn(f({},xn,{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})),Rn=pn(f({},mn,{newState:0,oldState:0})),zn=[9,13,27,32],Bn=nn&&`CompositionEvent`in window,Vn=null;nn&&`documentMode`in document&&(Vn=document.documentMode);var Hn=nn&&`TextEvent`in window&&!Vn,Un=nn&&(!Bn||Vn&&8<Vn&&11>=Vn),Wn=` `,Gn=!1;function Kn(e,t){switch(e){case`keyup`:return zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Jn=!1;function Yn(e,t){switch(e){case`compositionend`:return qn(t);case`keypress`:return t.which===32?(Gn=!0,Wn):null;case`textInput`:return e=t.data,e===Wn&&Gn?null:e;default:return null}}function Xn(e,t){if(Jn)return e===`compositionend`||!Bn&&Kn(e,t)?(e=ln(),cn=sn=on=null,Jn=!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 Un&&t.locale!==`ko`?null:t.data;default:return null}}var Zn={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 Qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Zn[e.type]:t===`textarea`}function $n(e,t,n,r){Xt?Zt?Zt.push(r):Zt=[r]:Xt=r,t=Md(t,`onChange`),0<t.length&&(n=new hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var er=null,tr=null;function nr(e){wd(e,0)}function rr(e){if(kt(dt(e)))return e}function ir(e,t){if(e===`change`)return t}var ar=!1;if(nn){var or;if(nn){var sr=`oninput`in document;if(!sr){var cr=document.createElement(`div`);cr.setAttribute(`oninput`,`return;`),sr=typeof cr.oninput==`function`}or=sr}else or=!1;ar=or&&(!document.documentMode||9<document.documentMode)}function lr(){er&&(er.detachEvent(`onpropertychange`,ur),tr=er=null)}function ur(e){if(e.propertyName===`value`&&rr(tr)){var t=[];$n(t,tr,e,Yt(e)),en(nr,t)}}function dr(e,t,n){e===`focusin`?(lr(),er=t,tr=n,er.attachEvent(`onpropertychange`,ur)):e===`focusout`&&lr()}function fr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return rr(tr)}function pr(e,t){if(e===`click`)return rr(t)}function mr(e,t){if(e===`input`||e===`change`)return rr(t)}function hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var gr=typeof Object.is==`function`?Object.is:hr;function _r(e,t){if(gr(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(!ve.call(t,i)||!gr(e[i],t[i]))return!1}return!0}function vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yr(e,t){var n=vr(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=vr(n)}}function br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=At(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=At(e.document)}return t}function Sr(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 Cr=nn&&`documentMode`in document&&11>=document.documentMode,wr=null,Tr=null,Er=null,Dr=!1;function Or(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dr||wr==null||wr!==At(r)||(r=wr,`selectionStart`in r&&Sr(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}),Er&&_r(Er,r)||(Er=r,r=Md(Tr,`onSelect`),0<r.length&&(t=new hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=wr)))}function kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ar={animationend:kr(`Animation`,`AnimationEnd`),animationiteration:kr(`Animation`,`AnimationIteration`),animationstart:kr(`Animation`,`AnimationStart`),transitionrun:kr(`Transition`,`TransitionRun`),transitionstart:kr(`Transition`,`TransitionStart`),transitioncancel:kr(`Transition`,`TransitionCancel`),transitionend:kr(`Transition`,`TransitionEnd`)},jr={},Mr={};nn&&(Mr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),`TransitionEvent`in window||delete Ar.transitionend.transition);function Nr(e){if(jr[e])return jr[e];if(!Ar[e])return e;var t=Ar[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mr)return jr[e]=t[n];return e}var Pr=Nr(`animationend`),Fr=Nr(`animationiteration`),Ir=Nr(`animationstart`),Lr=Nr(`transitionrun`),Rr=Nr(`transitionstart`),zr=Nr(`transitioncancel`),Br=Nr(`transitionend`),Vr=new Map,Hr=`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(` `);Hr.push(`scrollEnd`);function Ur(e,t){Vr.set(e,t),gt(t,[e])}var Wr=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)},Gr=[],Kr=0,qr=0;function Jr(){for(var e=Kr,t=qr=Kr=0;t<e;){var n=Gr[t];Gr[t++]=null;var r=Gr[t];Gr[t++]=null;var i=Gr[t];Gr[t++]=null;var a=Gr[t];if(Gr[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&&Qr(n,i,a)}}function Yr(e,t,n,r){Gr[Kr++]=e,Gr[Kr++]=t,Gr[Kr++]=n,Gr[Kr++]=r,qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Xr(e,t,n,r){return Yr(e,t,n,r),$r(e)}function Zr(e,t){return Yr(e,null,null,t),$r(e)}function Qr(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-Pe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function $r(e){if(50<hu)throw hu=0,gu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ei={};function ti(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 ni(e,t,n,r){return new ti(e,t,n,r)}function ri(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ii(e,t){var n=e.alternate;return n===null?(n=ni(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 ai(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 oi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ri(e)&&(s=1);else if(typeof e==`string`)s=Yf(e,n,re.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ni(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return si(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ni(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ni(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ni(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function si(e,t,n,r){return e=ni(7,e,r,t),e.lanes=n,e}function ci(e,t,n){return e=ni(6,e,null,t),e.lanes=n,e}function li(e){var t=ni(18,null,null,0);return t.stateNode=e,t}function ui(e,t,n){return t=ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var di=new WeakMap;function fi(e,t){if(typeof e==`object`&&e){var n=di.get(e);return n===void 0?(t={value:e,source:t,stack:_e(t)},di.set(e,t),t):n}return{value:e,source:t,stack:_e(t)}}var pi=[],mi=0,hi=null,gi=0,_i=[],vi=0,yi=null,bi=1,xi=``;function Si(e,t){pi[mi++]=gi,pi[mi++]=hi,hi=e,gi=t}function Ci(e,t,n){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,yi=e;var r=bi;e=xi;var i=32-Pe(r)-1;r&=~(1<<i),n+=1;var a=32-Pe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,bi=1<<32-Pe(t)+i|n<<i|r,xi=a+e}else bi=1<<a|n<<i|r,xi=e}function wi(e){e.return!==null&&(Si(e,1),Ci(e,1,0))}function Ti(e){for(;e===hi;)hi=pi[--mi],pi[mi]=null,gi=pi[--mi],pi[mi]=null;for(;e===yi;)yi=_i[--vi],_i[vi]=null,xi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null}function Ei(e,t){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,bi=t.id,xi=t.overflow,yi=e}var Di=null,G=null,Oi=!1,ki=null,Ai=!1,ji=Error(i(519));function Mi(e){throw Ri(fi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ji}function Ni(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[tt]=e,t[nt]=r,n){case`dialog`:Td(`cancel`,t),Td(`close`,t);break;case`iframe`:case`object`:case`embed`:Td(`load`,t);break;case`video`:case`audio`:for(n=0;n<Sd.length;n++)Td(Sd[n],t);break;case`source`:Td(`error`,t);break;case`img`:case`image`:case`link`:Td(`error`,t),Td(`load`,t);break;case`details`:Td(`toggle`,t);break;case`input`:Td(`invalid`,t),Pt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Td(`invalid`,t);break;case`textarea`:Td(`invalid`,t),Rt(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||Rd(t.textContent,n)?(r.popover!=null&&(Td(`beforetoggle`,t),Td(`toggle`,t)),r.onScroll!=null&&Td(`scroll`,t),r.onScrollEnd!=null&&Td(`scrollend`,t),r.onClick!=null&&(t.onclick=qt),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Di=e.return;Di;)switch(Di.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Di=Di.return}}function Fi(e){if(e!==Di)return!1;if(!Oi)return Pi(e),Oi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Yd(e.type,e.memoizedProps)),n=!n),n&&G&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));G=gf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));G=gf(e)}else t===27?(t=G,rf(e.type)?(e=hf,hf=null,G=e):G=t):G=Di?mf(e.stateNode.nextSibling):null;return!0}function Ii(){G=Di=null,Oi=!1}function Li(){var e=ki;return e!==null&&(tu===null?tu=e:tu.push.apply(tu,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=R(null),Bi=null,Vi=null;function Hi(e,t,n){B(zi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=zi.current,z(zi)}function Wi(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 Gi(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),Wi(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),Wi(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 Ki(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;gr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===oe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ip]:e.push(ip))}a=a.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!gr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Bi=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yi(e){return Zi(Bi,e)}function Xi(e,t){return Bi===null&&Ji(e),Zi(e,t)}function Zi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Vi===null){if(e===null)throw Error(i(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return n}var Qi=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()})}},$i=t.unstable_scheduleCallback,ea=t.unstable_NormalPriority,ta={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function na(){return{controller:new Qi,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&$i(ea,function(){e.controller.abort()})}var ia=null,aa=0,oa=0,sa=null;function ca(e,t){if(ia===null){var n=ia=[];aa=0,oa=gd(),sa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return aa++,t.then(la,la),t}function la(){if(--aa===0&&ia!==null){sa!==null&&(sa.status=`fulfilled`);var e=ia;ia=null,oa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(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 da=I.S;I.S=function(e,t){iu=Ce(),typeof t==`object`&&t&&typeof t.then==`function`&&ca(e,t),da!==null&&da(e,t)};var fa=R(null);function pa(){var e=fa.current;return e===null?zl.pooledCache:e}function ma(e,t){t===null?B(fa,fa.current):B(fa,t.pool)}function ha(){var e=pa();return e===null?null:{parent:ta._currentValue,pool:e}}var ga=Error(i(460)),_a=Error(i(474)),va=Error(i(542)),ya={then:function(){}};function ba(e){return e=e.status,e===`fulfilled`||e===`rejected`}function xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(qt,qt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e;default:if(typeof t.status==`string`)t.then(qt,qt);else{if(e=zl,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,Ta(e),e}throw Ca=t,ga}}function Sa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ca=e,ga):e}}var Ca=null;function wa(){if(Ca===null)throw Error(i(459));var e=Ca;return Ca=null,e}function Ta(e){if(e===ga||e===va)throw Error(i(483))}var Ea=null,Da=0;function Oa(e){var t=Da;return Da+=1,Ea===null&&(Ea=[]),xa(Ea,e,t)}function ka(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Aa(e,t){throw t.$$typeof===m?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ja(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=ii(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=ci(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===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Sa(i)===t.type)?(t=a(t,n.props),ka(t,n),t.return=e,t):(t=oi(n.type,n.key,n.props,null,e.mode,r),ka(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=ui(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=si(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=ci(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=oi(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case v:return t=ui(t,e.mode,n),t.return=e,t;case O:return t=Sa(t),f(e,t,n)}if(F(t)||M(t))return t=si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Oa(t),n);if(t.$$typeof===C)return f(e,Xi(e,t),n);Aa(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 g:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Sa(n),p(e,t,n,r)}if(F(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Oa(n),r);if(n.$$typeof===C)return p(e,t,Xi(e,n),r);Aa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Sa(r),m(e,t,n,r,i)}if(F(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Oa(r),i);if(r.$$typeof===C)return m(e,t,n,Xi(t,r),i);Aa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Oi&&Si(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Oi&&Si(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Oi&&Si(i,h),l}function _(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Oi&&Si(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Oi&&Si(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Oi&&Si(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){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===O&&Sa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ka(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=oi(o.type,o.key,o.props,null,e.mode,c),ka(c,o),c.return=e,e=c)}return s(e);case v: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=ui(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Sa(o),b(e,r,o,c)}if(F(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),_(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Oa(o),c);if(o.$$typeof===C)return b(e,r,Xi(e,o),c);Aa(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=ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=b(e,t,n,r);return Ea=null,i}catch(t){if(t===ga||t===va)throw t;var a=ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(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 La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Rl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=$r(e),Qr(e,null,n),t}return Yr(e,r,t,n),$r(e)}function za(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,Je(e,n)}}function Ba(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 Va=!1;function Ha(){if(Va){var e=sa;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!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?(Vl&p)===p:(r&p)===p){p!==0&&p===oa&&(Va=!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:Pa=!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),Yl|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wa(n[e],t)}var Ka=R(null),qa=R(0);function Ja(e,t){e=ql,B(qa,e),B(Ka,t),ql=e|t.baseLanes}function Ya(){B(qa,ql),B(Ka,Ka.current)}function Xa(){ql=qa.current,z(Ka),z(qa)}var Za=R(null),Qa=null;function $a(e){var t=e.alternate;B(io,io.current&1),B(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){B(io,io.current),B(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(B(io,io.current),B(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){B(io,io.current),B(Za,Za.current)}function ro(e){z(Za),Qa===e&&(Qa=null),z(io)}var io=R(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||df(n)||ff(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 oo=0,K=null,so=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=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(!gr(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return oo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Is:Ls,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){I.H=Fs;var t=so!==null&&so.next!==null;if(oo=0,co=so=K=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||ec||(e=e.dependencies,e!==null&&qi(e)&&(ec=!0))}function xo(e,t,n,r){K=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,co=so=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=Rs,o=t(n,r)}while(uo);return o}function So(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(K.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}oo=0,co=so=K=null,uo=!1,mo=po=0,ho=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?K.memoizedState=co=e:co=co.next=e,co}function Do(){if(so===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=so.next;var t=co===null?K.memoizedState:co.next;if(t!==null)co=t,so=e;else{if(e===null)throw K.alternate===null?Error(i(467)):Error(i(310));so=e,e={memoizedState:so.memoizedState,baseState:so.baseState,baseQueue:so.baseQueue,queue:so.queue,next:null},co===null?K.memoizedState=co=e:co=co.next=e}return co}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=xa(ho,e,t),t=K,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Is:Ls),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===C)return Yi(e)}throw Error(i(438,String(e)))}function jo(e){var t=null,n=K.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=K.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Oo(),K.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]=A;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),so,e)}function Po(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?(oo&f)===f:(Vl&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===oa&&(d=!0);else if((oo&p)===p){u=u.next,p===oa&&(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,K.lanes|=p,Yl|=p;f=u.action,fo&&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,K.lanes|=f,Yl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!gr(o,e.memoizedState)&&(ec=!0,d&&(n=sa,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 Fo(e){var t=Do(),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);gr(o,t.memoizedState)||(ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=K,a=Do(),o=Oi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!gr((so||a).memoizedState,n);if(s&&(a.memoizedState=n,ec=!0),a=a.queue,ss(zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),zl===null)throw Error(i(349));o||oo&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=Oo(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gr(e,n)}catch{return!0}}function Vo(e){var t=Zr(e,2);t!==null&&yu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),fo){Ne(!0);try{n()}finally{Ne(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,so,typeof r==`function`?r:Mo)}function Wo(e,t,n,r,a){if(Ms(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)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(Oi){var n=zl.formState;if(n!==null){a:{var r=K;if(Oi){if(G){b:{for(var i=G,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=mf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){G=mf(i.nextSibling),r=i.data===`F!`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,K,r),r.dispatch=n,r=Ho(!1),a=js.bind(null,K,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Do(),so,e)}function $o(e,t,n){if(t=Po(e,t,Xo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===ga?va:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Do(),n=so;if(n!==null)return $o(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=Oo(),K.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function rs(){return Do().memoizedState}function is(e,t,n,r){var i=Eo();K.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&vo(r,so.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(K.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=Oo(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Do().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(Rl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||oo&1073741824&&!(Vl&261930)?e.memoizedState=t:(e.memoizedState=n,e=vu(),K.lanes|=e,Yl|=e,n)}function vs(e,t,n,r){return gr(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(Vl&261930)?(ec=!0,e.memoizedState=n):(e=vu(),K.lanes|=e,Yl|=e,t):(e=_s(e,n,r),gr(e,t)||(ec=!0),e)}function ys(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};I.T=s,js(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,ua(c,r),_u(e)):As(e,t,r,_u(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},_u())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,ee,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:ee},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},_u())}function ws(){return Yi(ip)}function Ts(){return Do().memoizedState}function Es(){return Do().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_u();e=La(n);var r=Ra(t,e,n);r!==null&&(yu(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=_u();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Xr(e,t,n,r),n!==null&&(yu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,_u())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,gr(s,o))return Yr(e,t,i,0),zl===null&&Jr(),!1}catch{}if(n=Xr(e,t,i,r),n!==null)return yu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:gd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Xr(e,n,r,2),t!==null&&yu(t,e,2)}function Ms(e){var t=e.alternate;return e===K||t!==null&&t===K}function Ns(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}var Fs={readContext:Yi,use:Ao,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};Fs.useEffectEvent=_o;var Is={readContext:Yi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){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=Os.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=ks.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=ys.bind(null,K,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,a=Eo();if(Oi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),zl===null)throw Error(i(349));Vl&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(zo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=zl.identifierPrefix;if(Oi){var n=xi,r=bi;n=(r&~(1<<32-Pe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Ds.bind(null,K)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Rl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:No,useRef:rs,useState:function(){return No(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Do(),so.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Uo(Do(),so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Ls.useEffectEvent=ls;var Rs={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Fo,useRef:rs,useState:function(){return Fo(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Do();return so===null?_s(n,e,t):vs(n,so.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Do();return so===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Rs.useEffectEvent=ls;function zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_u(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(yu(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_u(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(yu(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_u(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(yu(t,e,n),za(t,e,n))}};function Vs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!_r(n,r)||!_r(i,a):!0}function Hs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Bs.enqueueReplaceState(t,t.state,null)}function Us(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ws(e){Wr(e)}function Gs(e){console.error(e)}function Ks(e){Wr(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=La(e),e.tag=3,e}function Zs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(su===null?su=new Set([this]):su.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ki(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?ju():n.alternate===null&&Jl===0&&(Jl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Xu(e,r,a)),!1;case 22:return n.flags|=65536,r===ya?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)),Xu(e,r,a)),!1}throw Error(i(435,n.tag))}return Xu(e,r,a),ju(),!1}if(Oi)return t=Za.current,t===null?(r!==ji&&(t=Error(i(423),{cause:r}),Ri(fi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=fi(r,n),a=Ys(e.stateNode,r,a),Ba(e,a),Jl!==4&&(Jl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ji&&(e=Error(i(422),{cause:r}),Ri(fi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=fi(o,n),eu===null?eu=[o]:eu.push(o),Jl!==4&&(Jl=2),t===null)return!0;r=fi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ys(n.stateNode,r,e),Ba(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`&&(su===null||!su.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xs(a),Zs(a,e,n,r),Ba(n,a),!1}n=n.return}while(n!==null);return!1}var $s=Error(i(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ji(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(Oi&&s&&wi(t),t.flags|=1,tc(e,t,r,i),t.child)}function rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ri(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ic(e,t,a,r,i)):(e=oi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Dc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?_r:n,n(o,r)&&e.ref===t.ref)return Ec(e,t,i)}return t.flags|=1,e=ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(_r(a,r)&&e.ref===t.ref)if(ec=!1,t.pendingProps=r=a,Dc(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Ec(e,t,i)}return fc(e,t,n,r,i)}function ac(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return sc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ma(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,sc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ma(t,null),Ya(),no(t)):(ma(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return tc(e,t,i,n),t.child}function oc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sc(e,t,n,r,i){var a=pa();return a=a===null?null:{parent:ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ma(t,null),Ya(),to(t),e!==null&&Ki(e,t,r,!0),t.childLanes=i,null}function cc(e,t){return t=xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lc(e,t,n){return Ma(t,e.child,null,n),e=cc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function uc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Oi){if(r.mode===`hidden`)return e=cc(t,r),t.lanes=536870912,oc(null,e);if(eo(t),(e=G)?(e=uf(e,Ai),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,G=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return cc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),a)if(t.flags&256)t.flags&=-257,t=lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ec||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,ec||a){if(r=zl,r!==null&&(s=Ye(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Zr(e,s),yu(r,e,s),$s;ju(),t=lc(e,t,n)}else e=o.treeContext,G=mf(s.nextSibling),Di=t,Oi=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=cc(t,r),t.flags|=4096;return t}return e=ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function fc(e,t,n,r,i){return Ji(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(Oi&&r&&wi(t),t.flags|=1,tc(e,t,n,i),t.child)}function pc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!ec?(wo(e,t,a),Ec(e,t,a)):(Oi&&r&&wi(t),t.flags|=1,tc(e,t,n,a),t.child)}function mc(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=ei,o=n.contextType;typeof o==`object`&&o&&(a=Yi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Fa(t),o=n.contextType,a.context=typeof o==`object`&&o?Yi(o):ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Bs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),Ha(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=ei,typeof u==`object`&&u&&(o=Yi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Hs(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),Ha(),l=t.memoizedState,s||f!==l||Pa?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=Pa||Vs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ia(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ei,typeof l==`object`&&l&&(c=Yi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Hs(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),Ha();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=Pa||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,dc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ma(t,e.child,null,i),t.child=Ma(t,null,n,i)):tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ec(e,t,i),e}function hc(e,t,n,r){return Ii(),t.flags|=256,tc(e,t,n,r),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:ha()}}function vc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Ql),e}function yc(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:(io.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Oi){if(a?$a(t):no(t),(e=G)?(e=uf(e,Ai),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,G=null)):e=null,e===null)throw Mi(t);return ff(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=xc({mode:`hidden`,children:c},a),r=si(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(null,r)):($a(t),bc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=Sc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=xc({mode:`visible`,children:r.children},a),c=si(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ma(t,e.child,null,n),r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,t=oc(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),ff(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ri({value:r,source:null,stack:null}),t=Sc(e,t,n)}else if(ec||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,ec||s){if(s=zl,s!==null&&(r=Ye(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Zr(e,r),yu(s,e,r),$s;df(c)||ju(),t=Sc(e,t,n)}else df(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,G=mf(c.nextSibling),Di=t,Oi=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=bc(t,r.children),t.flags|=4096);return t}return a?(no(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ii(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=si(c,a,n,null),c.flags|=2):c=ii(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,oc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=_c(n):(a=c.cachePool,a===null?a=ha():(l=ta._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ii(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 bc(e,t){return t=xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function xc(e,t){return e=ni(22,e,null,t),e.lanes=0,e}function Sc(e,t,n){return Ma(t,e.child,null,n),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function wc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Tc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,B(io,o),tc(e,t,r,n),r=Oi?gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cc(e,n,t);else if(e.tag===19)Cc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),wc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}wc(t,!0,n,null,a,r);break;case`together`:wc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ec(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ki(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=ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&qi(e))):!0}function Oc(e,t,n){switch(t.tag){case 3:se(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Ii();break;case 27:case 5:le(t);break;case 4:se(t,t.stateNode.containerInfo);break;case 10:Hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Ec(e,t,n),e===null?null:e.sibling):yc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Tc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),B(io,io.current),r)break;return null;case 22:return t.lanes=0,ac(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return Ec(e,t,n)}function kc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Dc(e,n)&&!(t.flags&128))return ec=!1,Oc(e,t,n);ec=!!(e.flags&131072)}else ec=!1,Oi&&t.flags&1048576&&Ci(t,gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Sa(t.elementType),t.type=e,typeof e==`function`)ri(e)?(r=Us(e,r),t.tag=1,t=mc(null,t,e,r,n)):(t.tag=0,t=fc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=nc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),mc(e,t,r,a,n);case 3:a:{if(se(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ia(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Hi(t,ta,r),r!==o.cache&&Gi(t,[ta],n,!0),Ha(),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=hc(e,t,r,n);break a}else if(r!==a){a=fi(Error(i(424)),t),Ri(a),t=hc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(G=mf(e.firstChild),Di=t,Oi=!0,ki=null,Ai=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),r===a){t=Ec(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=Ff(t.type,null,t.pendingProps,null))?t.memoizedState=n:Oi||(n=t.type,e=t.pendingProps,r=Kd(ae.current).createElement(n),r[tt]=t,r[nt]=e,Vd(r,n,e),pt(r),t.stateNode=r):t.memoizedState=Ff(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return le(t),e===null&&Oi&&(r=t.stateNode=vf(t.type,t.pendingProps,ae.current),Di=t,Ai=!0,a=G,rf(t.type)?(hf=a,G=mf(r.firstChild)):G=a),tc(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oi&&((a=r=G)&&(r=cf(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Di=t,G=mf(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),le(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Yd(a,o)?r=null:s!==null&&Yd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yo(e,t,So,null,null,n),ip._currentValue=a),dc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&Oi&&((e=n=G)&&(n=lf(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Di=t,G=null,e=!0)),e||Mi(t)),null;case 13:return yc(e,t,n);case 4:return se(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),tc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ji(t),a=Yi(a),r=r(a),t.flags|=1,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return ic(e,t,t.type,t.pendingProps,n);case 19:return Tc(e,t,n);case 31:return uc(e,t,n);case 22:return ac(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(a=pa(),a===null&&(a=zl,o=na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Fa(t),Hi(t,ta,a)):((e.lanes&n)!==0&&(Ia(e,t),Ua(t,null,null,n),Ha()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Hi(t,ta,r),r!==a.cache&&Gi(t,[ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Hi(t,ta,r))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ac(e){e.flags|=4}function jc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Ou())e.flags|=8192;else throw Ca=ya,_a}else e.flags&=-16777217}function Mc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xf(t))if(Ou())e.flags|=8192;else throw Ca=ya,_a}function Nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:U(),e.lanes|=t,$l|=t)}function Pc(e,t){if(!Oi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Fc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ic(e,t,n){var r=t.pendingProps;switch(Ti(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fc(t),null;case 1:return Fc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(ta),ce(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?Ac(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Fc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ac(t),o===null?(Fc(t),jc(t,a,null,r,n)):(Fc(t),Mc(t,o))):o?o===e.memoizedState?(Fc(t),t.flags&=-16777217):(Ac(t),Fc(t),Mc(t,o)):(e=e.memoizedProps,e!==r&&Ac(t),Fc(t),jc(t,a,e,r,n)),null;case 27:if(ue(t),n=ae.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}e=re.current,Fi(t)?Ni(t,e):(e=vf(a,r,n),t.stateNode=e,Ac(t))}return Fc(t),null;case 5:if(ue(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}if(o=re.current,Fi(t))Ni(t,o);else{var s=Kd(ae.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[tt]=t,o[nt]=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(Vd(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&&Ac(t)}}return Fc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ae.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Di,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Rd(e.nodeValue,n)),e||Mi(t,!0)}else e=Kd(e).createTextNode(r),e[tt]=t,t.stateNode=e}return Fc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(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[tt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Fc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(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[tt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),a=!1}else a=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(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),Nc(t,t.updateQueue),Fc(t),null);case 4:return ce(),e===null&&Od(t.stateNode.containerInfo),Fc(t),null;case 10:return Ui(t.type),Fc(t),null;case 19:if(z(io),r=t.memoizedState,r===null)return Fc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Pc(r,!1);else{if(Jl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Pc(r,!1),e=o.updateQueue,t.updateQueue=e,Nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ai(n,e),n=n.sibling;return B(io,io.current&1|2),Oi&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ce()>au&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304)}else{if(!a)if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Nc(t,e),Pc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Oi)return Fc(t),null}else 2*Ce()-r.renderingStartTime>au&&n!==536870912&&(t.flags|=128,a=!0,Pc(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?(Fc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ce(),e.sibling=null,n=io.current,B(io,a?n&1|2:n&1),Oi&&Si(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Fc(t),t.subtreeFlags&6&&(t.flags|=8192)):Fc(t),n=t.updateQueue,n!==null&&Nc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&z(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Fc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Lc(e,t){switch(Ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),ce(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ue(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(io),null;case 4:return ce(),null;case 10:return Ui(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&z(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function Rc(e,t){switch(Ti(t),t.tag){case 3:Ui(ta),ce();break;case 26:case 27:case 5:ue(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:z(io);break;case 10:Ui(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&z(fa);break;case 24:Ui(ta)}}function zc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Yu(t,t.return,e)}}function Bc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Yu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Yu(t,t.return,e)}}function Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Yu(e,e.return,t)}}}function Hc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Yu(e,t,n)}}function Uc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Yu(e,t,n)}}function Wc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Yu(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){Yu(e,t,n)}else n.current=null}function Gc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Yu(e,e.return,t)}}function Kc(e,t,n){try{var r=e.stateNode;Hd(r,e.type,n,t),r[nt]=t}catch(t){Yu(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&rf(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&rf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=qt));else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Vd(t,r,n),t[tt]=e,t[nt]=n}catch(t){Yu(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,Gd=pp,e=xr(e),Sr(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(q={focusedElem:e,selectionRange:n},pp=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,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=Us(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Yu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)sf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:sf(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,nl=e;break}nl=t.return}}function il(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:yl(e,n),r&4&&zc(5,n);break;case 1:if(yl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Yu(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Yu(n,n.return,e)}}r&64&&Vc(n),r&512&&Uc(n,n.return);break;case 3:if(yl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ga(e,t)}catch(e){Yu(n,n.return,e)}}break;case 27:t===null&&r&4&&Zc(n);case 26:case 5:yl(e,n),t===null&&r&4&&Gc(n),r&512&&Uc(n,n.return);break;case 12:yl(e,n);break;case 31:yl(e,n),r&4&&ul(e,n);break;case 13:yl(e,n),r&4&&dl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=$u.bind(null,n),pf(e,n))));break;case 22:if(r=n.memoizedState!==null||Qc,!r){t=t!==null&&t.memoizedState!==null||$c,i=Qc;var a=$c;Qc=r,($c=t)&&!a?xl(e,n,(n.subtreeFlags&8772)!=0):yl(e,n),Qc=i,$c=a}break;case 30:break;default:yl(e,n)}}function al(e){var t=e.alternate;t!==null&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&W(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ol=null,sl=!1;function cl(e,t,n){for(n=n.child;n!==null;)ll(e,t,n),n=n.sibling}function ll(e,t,n){if(Me&&typeof Me.onCommitFiberUnmount==`function`)try{Me.onCommitFiberUnmount(je,n)}catch{}switch(n.tag){case 26:$c||Wc(n,t),cl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$c||Wc(n,t);var r=ol,i=sl;rf(n.type)&&(ol=n.stateNode,sl=!1),cl(e,t,n),yf(n.stateNode),ol=r,sl=i;break;case 5:$c||Wc(n,t);case 6:if(r=ol,i=sl,ol=null,cl(e,t,n),ol=r,sl=i,ol!==null)if(sl)try{(ol.nodeType===9?ol.body:ol.nodeName===`HTML`?ol.ownerDocument.body:ol).removeChild(n.stateNode)}catch(e){Yu(n,t,e)}else try{ol.removeChild(n.stateNode)}catch(e){Yu(n,t,e)}break;case 18:ol!==null&&(sl?(e=ol,af(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),zp(e)):af(ol,n.stateNode));break;case 4:r=ol,i=sl,ol=n.stateNode.containerInfo,sl=!0,cl(e,t,n),ol=r,sl=i;break;case 0:case 11:case 14:case 15:Bc(2,n,t),$c||Bc(4,n,t),cl(e,t,n);break;case 1:$c||(Wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Hc(n,t,r)),cl(e,t,n);break;case 21:cl(e,t,n);break;case 22:$c=(r=$c)||n.memoizedState!==null,cl(e,t,n),$c=r;break;default:cl(e,t,n)}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{zp(e)}catch(e){Yu(t,t.return,e)}}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{zp(e)}catch(e){Yu(t,t.return,e)}}function fl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tl),t;default:throw Error(i(435,e.tag))}}function pl(e,t){var n=fl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=ed.bind(null,e,t);t.then(r,r)}})}function ml(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(rf(c.type)){ol=c.stateNode,sl=!1;break a}break;case 5:ol=c.stateNode,sl=!1;break a;case 3:case 4:ol=c.stateNode.containerInfo,sl=!0;break a}c=c.return}if(ol===null)throw Error(i(160));ll(o,s,a),ol=null,sl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gl(t,e),t=t.sibling}var hl=null;function gl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ml(t,e),_l(e),r&4&&(Bc(3,e,e.return),zc(3,e),Bc(5,e,e.return));break;case 1:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&64&&Qc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=hl;if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(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[ct]||o[tt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Vd(o,r,n),o[tt]=e,pt(o),r=o;break a;case`link`:var s=qf(`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),Vd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=qf(`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),Vd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[tt]=e,pt(o),r=o}e.stateNode=r}else Jf(a,e.type,e.stateNode);else e.stateNode=Hf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Jf(a,e.type,e.stateNode):Hf(a,r,e.memoizedProps))}break;case 27:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),e.flags&32){a=e.stateNode;try{zt(a,``)}catch(t){Yu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Kc(e,a,n===null?a:n.memoizedProps)),r&1024&&(el=!0);break;case 6:if(ml(t,e),_l(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Yu(e,e.return,t)}}break;case 3:if(Kf=null,a=hl,hl=Sf(t.containerInfo),ml(t,e),hl=a,_l(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zp(t.containerInfo)}catch(t){Yu(e,e.return,t)}el&&(el=!1,vl(e));break;case 4:r=hl,hl=Sf(e.stateNode.containerInfo),ml(t,e),_l(e),hl=r;break;case 12:ml(t,e),_l(e);break;case 31:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 13:ml(t,e),_l(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ru=Ce()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Qc,d=$c;if(Qc=u||a,$c=d||l,ml(t,e),$c=d,Qc=u,_l(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Qc||$c||bl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(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){Yu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Yu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?of(m,!0):of(l.stateNode,!1)}catch(e){Yu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,pl(e,n))));break;case 19:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 30:break;case 21:break;default:ml(t,e),_l(e)}}function _l(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Xc(e,Jc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(zt(o,``),n.flags&=-33),Xc(e,Jc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Yc(e,Jc(e),s);break;default:throw Error(i(161))}}catch(t){Yu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)il(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bc(4,t,t.return),bl(t);break;case 1:Wc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Hc(t,t.return,n),bl(t);break;case 27:yf(t.stateNode);case 26:case 5:Wc(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function xl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:xl(i,a,n),zc(4,a);break;case 1:if(xl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Yu(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++)Wa(c[i],s)}catch(e){Yu(r,r.return,e)}}n&&o&64&&Vc(a),Uc(a,a.return);break;case 27:Zc(a);case 26:case 5:xl(i,a,n),n&&r===null&&o&4&&Gc(a),Uc(a,a.return);break;case 12:xl(i,a,n);break;case 31:xl(i,a,n),n&&o&4&&ul(i,a);break;case 13:xl(i,a,n),n&&o&4&&dl(i,a);break;case 22:a.memoizedState===null&&xl(i,a,n),Uc(a,a.return);break;case 30:break;default:xl(i,a,n)}t=t.sibling}}function Sl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ra(n))}function Cl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function wl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tl(e,t,n,r),t=t.sibling}function Tl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:wl(e,t,n,r),i&2048&&zc(9,t);break;case 1:wl(e,t,n,r);break;case 3:wl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(i&2048){wl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Yu(t,t.return,e)}}else wl(e,t,n,r);break;case 31:wl(e,t,n,r);break;case 13:wl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?wl(e,t,n,r):(a._visibility|=2,El(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?wl(e,t,n,r):Dl(e,t),i&2048&&Sl(o,t);break;case 24:wl(e,t,n,r),i&2048&&Cl(t.alternate,t);break;default:wl(e,t,n,r)}}function El(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:El(a,o,s,c,i),zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,El(a,o,s,c,i)):u._visibility&2?El(a,o,s,c,i):Dl(a,o),i&&l&2048&&Sl(o.alternate,o);break;case 24:El(a,o,s,c,i),i&&l&2048&&Cl(o.alternate,o);break;default:El(a,o,s,c,i)}t=t.sibling}}function Dl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Dl(n,r),i&2048&&Sl(r.alternate,r);break;case 24:Dl(n,r),i&2048&&Cl(r.alternate,r);break;default:Dl(n,r)}t=t.sibling}}var Ol=8192;function kl(e,t,n){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)Al(e,t,n),e=e.sibling}function Al(e,t,n){switch(e.tag){case 26:kl(e,t,n),e.flags&Ol&&e.memoizedState!==null&&Zf(n,hl,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,n);break;case 3:case 4:var r=hl;hl=Sf(e.stateNode.containerInfo),kl(e,t,n),hl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ol,Ol=16777216,kl(e,t,n),Ol=r):kl(e,t,n));break;default:kl(e,t,n)}}function jl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nl(e),e=e.sibling}function Nl(e){switch(e.tag){case 0:case 11:case 15:Ml(e),e.flags&2048&&Bc(9,e,e.return);break;case 3:Ml(e);break;case 12:Ml(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pl(e)):Ml(e);break;default:Ml(e)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bc(8,t,t.return),Pl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pl(t));break;default:Pl(t)}e=e.sibling}}function Fl(e,t){for(;nl!==null;){var n=nl;switch(n.tag){case 0:case 11:case 15:Bc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nl=r;else a:for(n=e;nl!==null;){r=nl;var i=r.sibling,a=r.return;if(al(r),r===n){nl=null;break a}if(i!==null){i.return=a,nl=i;break a}nl=a}}}var Il={getCacheForType:function(e){var t=Yi(ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yi(ta).controller.signal}},Ll=typeof WeakMap==`function`?WeakMap:Map,Rl=0,zl=null,Bl=null,Vl=0,Hl=0,Ul=null,Wl=!1,Gl=!1,Kl=!1,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=0,eu=null,tu=null,nu=!1,ru=0,iu=0,au=1/0,ou=null,su=null,cu=0,lu=null,uu=null,du=0,fu=0,pu=null,mu=null,hu=0,gu=null;function _u(){return Rl&2&&Vl!==0?Vl&-Vl:I.T===null?Qe():gd()}function vu(){if(Ql===0)if(!(Vl&536870912)||Oi){var e=Re;Re<<=1,!(Re&3932160)&&(Re=262144),Ql=e}else Ql=536870912;return e=Za.current,e!==null&&(e.flags|=32),Ql}function yu(e,t,n){(e===zl&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)&&(Eu(e,0),Cu(e,Vl,Ql,!1)),Ge(e,n),(!(Rl&2)||e!==zl)&&(e===zl&&(!(Rl&2)&&(Xl|=n),Jl===4&&Cu(e,Vl,Ql,!1)),cd(e))}function bu(e,t,n){if(Rl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||He(e,t),a=r?Pu(e,t):Mu(e,t,!0),o=r;do{if(a===0){Gl&&!r&&Cu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Su(n)){a=Mu(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=eu;var l=c.current.memoizedState.isDehydrated;if(l&&(Eu(c,s).flags|=256),s=Mu(c,s,!1),s!==2){if(Kl&&!l){c.errorRecoveryDisabledLanes|=o,Xl|=o,a=4;break a}o=tu,tu=a,o!==null&&(tu===null?tu=o:tu.push.apply(tu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Eu(e,0),Cu(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:Cu(r,t,Ql,!Wl);break a;case 2:tu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=ru+300-Ce(),10<a)){if(Cu(r,t,Ql,!Wl),Ve(r,0,!0)!==0)break a;du=t,r.timeoutHandle=Qd(xu.bind(null,r,n,tu,ou,nu,t,Ql,Xl,$l,Wl,o,`Throttled`,-0,0),a);break a}xu(r,n,tu,ou,nu,t,Ql,Xl,$l,Wl,o,null,-0,0)}}break}while(1);cd(e)}function xu(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:qt},Al(t,a,d);var m=(a&62914560)===a?ru-Ce():(a&4194048)===a?iu-Ce():0;if(m=$f(d,m),m!==null){du=a,e.cancelPendingCommit=m(Vu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Cu(e,a,o,!l);return}}Vu(e,t,a,n,r,i,o,s,c)}function Su(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(!gr(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 Cu(e,t,n,r){t&=~Zl,t&=~Xl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Pe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&qe(e,n,t)}function wu(){return Rl&6?!0:(ld(0,!1),!1)}function Tu(){if(Bl!==null){if(Hl===0)var e=Bl.return;else e=Bl,Vi=Bi=null,To(e),Ea=null,Da=0,e=Bl;for(;e!==null;)Rc(e.alternate,e),e=e.return;Bl=null}}function Eu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,$d(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),du=0,Tu(),zl=e,Bl=n=ii(e.current,null),Vl=t,Hl=0,Ul=null,Wl=!1,Gl=He(e,t),Kl=!1,$l=Ql=Zl=Xl=Yl=Jl=0,tu=eu=null,nu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Pe(r),a=1<<i;t|=e[i],r&=~a}return ql=t,Jr(),n}function Du(e,t){K=null,I.H=Fs,t===ga||t===va?(t=wa(),Hl=3):t===_a?(t=wa(),Hl=4):Hl=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ul=t,Bl===null&&(Jl=1,qs(e,fi(t,e.current)))}function Ou(){var e=Za.current;return e===null?!0:(Vl&4194048)===Vl?Qa===null:(Vl&62914560)===Vl||Vl&536870912?e===Qa:!1}function ku(){var e=I.H;return I.H=Fs,e===null?Fs:e}function Au(){var e=I.A;return I.A=Il,e}function ju(){Jl=4,Wl||(Vl&4194048)!==Vl&&Za.current!==null||(Gl=!0),!(Yl&134217727)&&!(Xl&134217727)||zl===null||Cu(zl,Vl,Ql,!1)}function Mu(e,t,n){var r=Rl;Rl|=2;var i=ku(),a=Au();(zl!==e||Vl!==t)&&(ou=null,Eu(e,t)),t=!1;var o=Jl;a:do try{if(Hl!==0&&Bl!==null){var s=Bl,c=Ul;switch(Hl){case 8:Tu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Hl;if(Hl=0,Ul=null,Ru(e,s,c,l),n&&Gl){o=0;break a}break;default:l=Hl,Hl=0,Ul=null,Ru(e,s,c,l)}}Nu(),o=Jl;break}catch(t){Du(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,Rl=r,I.H=i,I.A=a,Bl===null&&(zl=null,Vl=0,Jr()),o}function Nu(){for(;Bl!==null;)Iu(Bl)}function Pu(e,t){var n=Rl;Rl|=2;var r=ku(),a=Au();zl!==e||Vl!==t?(ou=null,au=Ce()+500,Eu(e,t)):Gl=He(e,t);a:do try{if(Hl!==0&&Bl!==null){t=Bl;var o=Ul;b:switch(Hl){case 1:Hl=0,Ul=null,Ru(e,t,o,1);break;case 2:case 9:if(ba(o)){Hl=0,Ul=null,Lu(t);break}t=function(){Hl!==2&&Hl!==9||zl!==e||(Hl=7),cd(e)},o.then(t,t);break a;case 3:Hl=7;break a;case 4:Hl=5;break a;case 7:ba(o)?(Hl=0,Ul=null,Lu(t)):(Hl=0,Ul=null,Ru(e,t,o,7));break;case 5:var s=null;switch(Bl.tag){case 26:s=Bl.memoizedState;case 5:case 27:var c=Bl;if(s?Xf(s):c.stateNode.complete){Hl=0,Ul=null;var l=c.sibling;if(l!==null)Bl=l;else{var u=c.return;u===null?Bl=null:(Bl=u,zu(u))}break b}}Hl=0,Ul=null,Ru(e,t,o,5);break;case 6:Hl=0,Ul=null,Ru(e,t,o,6);break;case 8:Tu(),Jl=6;break a;default:throw Error(i(462))}}Fu();break}catch(t){Du(e,t)}while(1);return Vi=Bi=null,I.H=r,I.A=a,Rl=n,Bl===null?(zl=null,Vl=0,Jr(),Jl):0}function Fu(){for(;Bl!==null&&!xe();)Iu(Bl)}function Iu(e){var t=kc(e.alternate,e,ql);e.memoizedProps=e.pendingProps,t===null?zu(e):Bl=t}function Lu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pc(n,t,t.pendingProps,t.type,void 0,Vl);break;case 11:t=pc(n,t,t.pendingProps,t.type.render,t.ref,Vl);break;case 5:To(t);default:Rc(n,t),t=Bl=ai(t,ql),t=kc(n,t,ql)}e.memoizedProps=e.pendingProps,t===null?zu(e):Bl=t}function Ru(e,t,n,r){Vi=Bi=null,To(t),Ea=null,Da=0;var i=t.return;try{if(Qs(e,i,t,n,Vl)){Jl=1,qs(e,fi(n,e.current)),Bl=null;return}}catch(t){if(i!==null)throw Bl=i,t;Jl=1,qs(e,fi(n,e.current)),Bl=null;return}t.flags&32768?(Oi||r===1?e=!0:Gl||Vl&536870912?e=!1:(Wl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),Bu(t,e)):zu(t)}function zu(e){var t=e;do{if(t.flags&32768){Bu(t,Wl);return}e=t.return;var n=Ic(t.alternate,t,ql);if(n!==null){Bl=n;return}if(t=t.sibling,t!==null){Bl=t;return}Bl=t=e}while(t!==null);Jl===0&&(Jl=5)}function Bu(e,t){do{var n=Lc(e.alternate,e);if(n!==null){n.flags&=32767,Bl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Bl=e;return}Bl=e=n}while(e!==null);Jl=6,Bl=null}function Vu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Ku();while(cu!==0);if(Rl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=qr,Ke(e,n,o,s,c,l),e===zl&&(Bl=zl=null,Vl=0),uu=t,lu=e,du=n,fu=o,pu=a,mu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,td(Ee,function(){return qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=I.T,I.T=null,a=L.p,L.p=2,s=Rl,Rl|=4;try{rl(e,t,n)}finally{Rl=s,L.p=a,I.T=r}}cu=1,Hu(),Uu(),Wu()}}function Hu(){if(cu===1){cu=0;var e=lu,t=uu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Rl;Rl|=4;try{gl(t,e);var a=q,o=xr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&br(s.ownerDocument.documentElement,s)){if(c!==null&&Sr(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 _=yr(s,h),v=yr(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}}pp=!!Gd,q=Gd=null}finally{Rl=i,L.p=r,I.T=n}}e.current=t,cu=2}}function Uu(){if(cu===2){cu=0;var e=lu,t=uu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Rl;Rl|=4;try{il(e,t.alternate,t)}finally{Rl=i,L.p=r,I.T=n}}cu=3}}function Wu(){if(cu===4||cu===3){cu=0,Se();var e=lu,t=uu,n=du,r=mu;t.subtreeFlags&10256||t.flags&10256?cu=5:(cu=0,uu=lu=null,Gu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(su=null),Ze(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=I.T,i=L.p,L.p=2,I.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{I.T=t,L.p=i}}du&3&&Ku(),cd(e),i=e.pendingLanes,n&261930&&i&42?e===gu?hu++:(hu=0,gu=e):hu=0,ld(0,!1)}}function Gu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Ku(){return Hu(),Uu(),Wu(),qu()}function qu(){if(cu!==5)return!1;var e=lu,t=fu;fu=0;var n=Ze(du),r=I.T,a=L.p;try{L.p=32>n?32:n,I.T=null,n=pu,pu=null;var o=lu,s=du;if(cu=0,uu=lu=null,du=0,Rl&6)throw Error(i(331));var c=Rl;if(Rl|=4,Nl(o.current),Tl(o,o.current,s,n),Rl=c,ld(0,!1),Me&&typeof Me.onPostCommitFiberRoot==`function`)try{Me.onPostCommitFiberRoot(je,o)}catch{}return!0}finally{L.p=a,I.T=r,Gu(e,t)}}function Ju(e,t,n){t=fi(n,t),t=Ys(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Ge(e,2),cd(e))}function Yu(e,t,n){if(e.tag===3)Ju(e,e,n);else for(;t!==null;){if(t.tag===3){Ju(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(su===null||!su.has(r))){e=fi(n,e),n=Xs(2),r=Ra(t,n,2),r!==null&&(Zs(n,r,t,e),Ge(r,2),cd(r));break}}t=t.return}}function Xu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Kl=!0,i.add(n),e=Zu.bind(null,e,t,n),t.then(e,e))}function Zu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,zl===e&&(Vl&n)===n&&(Jl===4||Jl===3&&(Vl&62914560)===Vl&&300>Ce()-ru?!(Rl&2)&&Eu(e,0):Zl|=n,$l===Vl&&($l=0)),cd(e)}function Qu(e,t){t===0&&(t=U()),e=Zr(e,t),e!==null&&(Ge(e,t),cd(e))}function $u(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Qu(e,n)}function ed(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 td(e,t){return ye(e,t)}var nd=null,rd=null,id=!1,ad=!1,od=!1,sd=0;function cd(e){e!==rd&&e.next===null&&(rd===null?nd=rd=e:rd=rd.next=e),ad=!0,id||(id=!0,hd())}function ld(e,t){if(!od&&ad){od=!0;do for(var n=!1,r=nd;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-Pe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,md(r,a))}else a=Vl,a=Ve(r,r===zl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||He(r,a)||(n=!0,md(r,a));r=r.next}while(n);od=!1}}function ud(){dd()}function dd(){ad=id=!1;var e=0;sd!==0&&Zd()&&(e=sd);for(var t=Ce(),n=null,r=nd;r!==null;){var i=r.next,a=fd(r,t);a===0?(r.next=null,n===null?nd=i:n.next=i,i===null&&(rd=n)):(n=r,(e!==0||a&3)&&(ad=!0)),r=i}cu!==0&&cu!==5||ld(e,!1),sd!==0&&(sd=0)}function fd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Pe(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=zl,n=Vl,n=Ve(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&be(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&&be(r),Ze(n)){case 2:case 8:n=V;break;case 32:n=Ee;break;case 268435456:n=Oe;break;default:n=Ee}return r=pd.bind(null,e),n=ye(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&be(r),e.callbackPriority=2,e.callbackNode=null,2}function pd(e,t){if(cu!==0&&cu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ku()&&e.callbackNode!==n)return null;var r=Vl;return r=Ve(e,e===zl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(bu(e,r,t),fd(e,Ce()),e.callbackNode!=null&&e.callbackNode===n?pd.bind(null,e):null)}function md(e,t){if(Ku())return null;bu(e,t,!0)}function hd(){tf(function(){Rl&6?ye(Te,ud):dd()})}function gd(){if(sd===0){var e=oa;e===0&&(e=Le,Le<<=1,!(Le&261888)&&(Le=256)),sd=e}return sd}function _d(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Kt(``+e)}function vd(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 yd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=_d((i[nt]||null).action),o=r.submitter;o&&(t=(t=o[nt]||null)?_d(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(sd!==0){var e=o?vd(i,o):new FormData(i);xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?vd(i,o):new FormData(i),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var bd=0;bd<Hr.length;bd++){var xd=Hr[bd];Ur(xd.toLowerCase(),`on`+(xd[0].toUpperCase()+xd.slice(1)))}Ur(Pr,`onAnimationEnd`),Ur(Fr,`onAnimationIteration`),Ur(Ir,`onAnimationStart`),Ur(`dblclick`,`onDoubleClick`),Ur(`focusin`,`onFocus`),Ur(`focusout`,`onBlur`),Ur(Lr,`onTransitionRun`),Ur(Rr,`onTransitionStart`),Ur(zr,`onTransitionCancel`),Ur(Br,`onTransitionEnd`),_t(`onMouseEnter`,[`mouseout`,`mouseover`]),_t(`onMouseLeave`,[`mouseout`,`mouseover`]),_t(`onPointerEnter`,[`pointerout`,`pointerover`]),_t(`onPointerLeave`,[`pointerout`,`pointerover`]),gt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),gt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),gt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),gt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Sd=`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(` `),Cd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Sd));function wd(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){Wr(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){Wr(e)}i.currentTarget=null,a=c}}}}function Td(e,t){var n=t[it];n===void 0&&(n=t[it]=new Set);var r=e+`__bubble`;n.has(r)||(kd(t,e,2,!1),n.add(r))}function Ed(e,t,n){var r=0;t&&(r|=4),kd(n,e,r,t)}var Dd=`_reactListening`+Math.random().toString(36).slice(2);function Od(e){if(!e[Dd]){e[Dd]=!0,mt.forEach(function(t){t!==`selectionchange`&&(Cd.has(t)||Ed(t,!1,e),Ed(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Dd]||(t[Dd]=!0,Ed(`selectionchange`,!1,t))}}function kd(e,t,n,r){switch(bp(t)){case 2:var i=mp;break;case 8:i=hp;break;default:i=gp}n=i.bind(null,t,n,e),i=void 0,!rn||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 Ad(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=lt(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}en(function(){var r=a,i=Yt(n),s=[];a:{var c=Vr.get(e);if(c!==void 0){var l=hn,u=e;switch(e){case`keypress`:if(un(n)===0)break a;case`keydown`:case`keyup`:l=Nn;break;case`focusin`:u=`focus`,l=wn;break;case`focusout`:u=`blur`,l=wn;break;case`beforeblur`:case`afterblur`:l=wn;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=Sn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Cn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Fn;break;case Pr:case Fr:case Ir:l=Tn;break;case Br:l=In;break;case`scroll`:case`scrollend`:l=_n;break;case`wheel`:l=Ln;break;case`copy`:case`cut`:case`paste`:l=En;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Pn;break;case`toggle`:case`beforetoggle`:l=Rn}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=tn(m,p),g!=null&&d.push(jd(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!==Jt&&(u=n.relatedTarget||n.fromElement)&&(lt(u)||u[rt]))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?lt(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=Sn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Pn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:dt(l),h=u==null?c:dt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,lt(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=Nd,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&&Pd(s,c,l,d,!1),u!==null&&f!==null&&Pd(s,f,u,d,!0)}}a:{if(c=r?dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ir;else if(Qn(c))if(ar)v=mr;else{v=fr;var y=dr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Ut(r.elementType)&&(v=ir):v=pr;if(v&&=v(e,r)){$n(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ft(c,`number`,c.value)}switch(y=r?dt(r):window,e){case`focusin`:(Qn(y)||y.contentEditable===`true`)&&(wr=y,Tr=r,Er=null);break;case`focusout`:Er=Tr=wr=null;break;case`mousedown`:Dr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Dr=!1,Or(s,n,i);break;case`selectionchange`:if(Cr)break;case`keydown`:case`keyup`:Or(s,n,i)}var b;if(Bn)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 Jn?Kn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Un&&n.locale!==`ko`&&(Jn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Jn&&(b=ln()):(on=i,sn=`value`in on?on.value:on.textContent,Jn=!0)),y=Md(r,x),0<y.length&&(x=new Dn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=qn(n),b!==null&&(x.data=b)))),(b=Hn?Yn(e,n):Xn(e,n))&&(x=Md(r,`onBeforeInput`),0<x.length&&(y=new Dn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),yd(s,e,r,n,i)}wd(s,t)})}function jd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Md(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=tn(e,n),i!=null&&r.unshift(jd(e,i,a)),i=tn(e,t),i!=null&&r.push(jd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Nd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Pd(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=tn(n,a),l!=null&&o.unshift(jd(n,l,c))):i||(l=tn(n,a),l!=null&&o.push(jd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Fd=/\r\n?/g,Id=/\u0000|\uFFFD/g;function Ld(e){return(typeof e==`string`?e:``+e).replace(Fd,`
|
|
9
|
-
`).replace(Id,``)}function Rd(e,t){return t=Ld(t),Ld(e)===t}function zd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&zt(e,``+r);break;case`className`:Ct(e,`class`,r);break;case`tabIndex`:Ct(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ct(e,n,r);break;case`style`:Ht(e,r,o);break;case`data`:if(t!==`object`){Ct(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=Kt(``+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`&&zd(e,t,`name`,a.name,a,null),zd(e,t,`formEncType`,a.formEncType,a,null),zd(e,t,`formMethod`,a.formMethod,a,null),zd(e,t,`formTarget`,a.formTarget,a,null)):(zd(e,t,`encType`,a.encType,a,null),zd(e,t,`method`,a.method,a,null),zd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`onScroll`:r!=null&&Td(`scroll`,e);break;case`onScrollEnd`:r!=null&&Td(`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=Kt(``+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`:Td(`beforetoggle`,e),Td(`toggle`,e),St(e,`popover`,r);break;case`xlinkActuate`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:St(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=Wt.get(n)||n,St(e,n,r))}}function Bd(e,t,n,r,a,o){switch(n){case`style`:Ht(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`?zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&zt(e,``+r);break;case`onScroll`:r!=null&&Td(`scroll`,e);break;case`onScrollEnd`:r!=null&&Td(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ht.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[nt]||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,``):St(e,n,r)}}}function Vd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Td(`error`,e),Td(`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:zd(e,t,o,s,n,null)}}a&&zd(e,t,`srcSet`,n.srcSet,n,null),r&&zd(e,t,`src`,n.src,n,null);return;case`input`:Td(`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:zd(e,t,r,d,n,null)}}Pt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Td(`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:zd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&It(e,!!r,n,!0):It(e,!!r,t,!1);return;case`textarea`:for(s in Td(`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:zd(e,t,s,c,n,null)}Rt(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:zd(e,t,l,r,n,null)}return;case`dialog`:Td(`beforetoggle`,e),Td(`toggle`,e),Td(`cancel`,e),Td(`close`,e);break;case`iframe`:case`object`:Td(`load`,e);break;case`video`:case`audio`:for(r=0;r<Sd.length;r++)Td(Sd[r],e);break;case`image`:Td(`error`,e),Td(`load`,e);break;case`details`:Td(`toggle`,e);break;case`embed`:case`source`:case`link`:Td(`error`,e),Td(`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:zd(e,t,u,r,n,null)}return;default:if(Ut(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Bd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&zd(e,t,c,r,n,null))}function Hd(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)||zd(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&&zd(e,t,p,m,r,f)}}Nt(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)||zd(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&&zd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?It(e,!!n,n?[]:``,!1):It(e,!!n,t,!0)):It(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:zd(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&&zd(e,t,s,a,r,o)}Lt(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:zd(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:zd(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)&&zd(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:zd(e,t,u,p,r,m)}return;default:if(Ut(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Bd(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||Bd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&zd(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||zd(e,t,f,p,r,m)}function Ud(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Wd(){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&&Ud(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&&Ud(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 Gd=null,q=null;function Kd(e){return e.nodeType===9?e:e.ownerDocument}function qd(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 Jd(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 Yd(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 Xd=null;function Zd(){var e=window.event;return e&&e.type===`popstate`?e===Xd?!1:(Xd=e,!0):(Xd=null,!1)}var Qd=typeof setTimeout==`function`?setTimeout:void 0,$d=typeof clearTimeout==`function`?clearTimeout:void 0,ef=typeof Promise==`function`?Promise:void 0,tf=typeof queueMicrotask==`function`?queueMicrotask:ef===void 0?Qd:function(e){return ef.resolve(null).then(e).catch(nf)};function nf(e){setTimeout(function(){throw e})}function rf(e){return e===`head`}function af(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),zp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)yf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,yf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&yf(e.ownerDocument.body);n=i}while(n);zp(t)}function of(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 sf(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`:sf(n),W(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function cf(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[ct])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=mf(e.nextSibling),e===null)break}return null}function lf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=mf(e.nextSibling),e===null))return null;return e}function uf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=mf(e.nextSibling),e===null))return null;return e}function df(e){return e.data===`$?`||e.data===`$~`}function ff(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function pf(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 mf(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 hf=null;function gf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return mf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function _f(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 vf(e,t,n){switch(t=Kd(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 yf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);W(e)}var bf=new Map,xf=new Set;function Sf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Cf=L.d;L.d={f:wf,r:Tf,D:Of,C:kf,L:Af,m:jf,X:Nf,S:Mf,M:Pf};function wf(){var e=Cf.f(),t=wu();return e||t}function Tf(e){var t=ut(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):Cf.r(e)}var Ef=typeof document>`u`?null:document;function Df(e,t,n){var r=Ef;if(r&&typeof t==`string`&&t){var i=Mt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xf.has(i)||(xf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Vd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Of(e){Cf.D(e),Df(`dns-prefetch`,e,null)}function kf(e,t){Cf.C(e,t),Df(`preconnect`,e,t)}function Af(e,t,n){Cf.L(e,t,n);var r=Ef;if(r&&e&&t){var i=`link[rel="preload"][as="`+Mt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Mt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Mt(n.imageSizes)+`"]`)):i+=`[href="`+Mt(e)+`"]`;var a=i;switch(t){case`style`:a=If(e);break;case`script`:a=Bf(e)}bf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lf(a))||t===`script`&&r.querySelector(Vf(a))||(t=r.createElement(`link`),Vd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function jf(e,t){Cf.m(e,t);var n=Ef;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Mt(r)+`"][href="`+Mt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bf(e)}if(!bf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),bf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vf(a)))return}r=n.createElement(`link`),Vd(r,`link`,e),pt(r),n.head.appendChild(r)}}}function Mf(e,t,n){Cf.S(e,t,n);var r=Ef;if(r&&e){var i=ft(r).hoistableStyles,a=If(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bf.get(a))&&Wf(e,n);var c=o=r.createElement(`link`);pt(c),Vd(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,Uf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nf(e,t){Cf.X(e,t);var n=Ef;if(n&&e){var r=ft(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=f({src:e,async:!0},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),pt(a),Vd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t){Cf.M(e,t);var n=Ef;if(n&&e){var r=ft(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),pt(a),Vd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t,n,r){var a=(a=ae.current)?Sf(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=If(n.href),n=ft(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=If(n.href);var o=ft(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(Lf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),bf.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},bf.set(e,n),o||zf(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=Bf(n),n=ft(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 If(e){return`href="`+Mt(e)+`"`}function Lf(e){return`link[rel="stylesheet"][`+e+`]`}function Rf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function zf(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}),Vd(t,`link`,n),pt(t),e.head.appendChild(t))}function Bf(e){return`[src="`+Mt(e)+`"]`}function Vf(e){return`script[async]`+e}function Hf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Mt(n.href)+`"]`);if(r)return t.instance=r,pt(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`),pt(r),Vd(r,`style`,a),Uf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=If(n.href);var o=e.querySelector(Lf(a));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;r=Rf(n),(a=bf.get(a))&&Wf(r,a),o=(e.ownerDocument||e).createElement(`link`),pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Vd(o,`link`,r),t.state.loading|=4,Uf(o,n.precedence,e),t.instance=o;case`script`:return o=Bf(n.src),(a=e.querySelector(Vf(o)))?(t.instance=a,pt(a),a):(r=n,(a=bf.get(o))&&(r=f({},n),Gf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),pt(a),Vd(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,Uf(r,n.precedence,e));return t.instance}function Uf(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 Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Kf=null;function qf(e,t,n){if(Kf===null){var r=new Map,i=Kf=new Map;i.set(n,r)}else i=Kf,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[ct]||a[tt]||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 Jf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Yf(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 Xf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zf(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=If(r.href),a=t.querySelector(Lf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ep.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,pt(a);return}a=t.ownerDocument||t,r=Rf(r),(i=bf.get(i))&&Wf(r,i),a=a.createElement(`link`),pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Vd(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=ep.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Qf=0;function $f(e,t){return e.stylesheets&&e.count===0&&np(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&np(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Qf===0&&(Qf=62500*Wd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&np(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ep(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)np(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var tp=null;function np(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,tp=new Map,t.forEach(rp,e),tp=null,ep.call(e))}function rp(e,t){if(!(t.state.loading&4)){var n=tp.get(e);if(n)var r=n.get(null);else{n=new Map,tp.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=ep.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 ip={$$typeof:C,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function ap(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=We(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=We(0),this.hiddenUpdates=We(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 op(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ap(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ni(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function sp(e){return e?(e=ei,e):ei}function cp(e,t,n,r,i,a){i=sp(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(yu(n,e,t),za(n,e,t))}function lp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function up(e,t){lp(e,t),(e=e.alternate)&&lp(e,t)}function dp(e){if(e.tag===13||e.tag===31){var t=Zr(e,67108864);t!==null&&yu(t,e,67108864),up(e,67108864)}}function fp(e){if(e.tag===13||e.tag===31){var t=_u();t=Xe(t);var n=Zr(e,t);n!==null&&yu(n,e,t),up(e,t)}}var pp=!0;function mp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,gp(e,t,n,r)}finally{L.p=a,I.T=i}}function hp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,gp(e,t,n,r)}finally{L.p=a,I.T=i}}function gp(e,t,n,r){if(pp){var i=_p(r);if(i===null)Ad(e,t,r,vp,n),kp(e,r);else if(jp(i,e,t,n,r))r.stopPropagation();else if(kp(e,r),t&4&&-1<Op.indexOf(e)){for(;i!==null;){var a=ut(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-Pe(o);s.entanglements[1]|=c,o&=~c}cd(a),!(Rl&6)&&(au=Ce()+500,ld(0,!1))}}break;case 31:case 13:s=Zr(a,2),s!==null&&yu(s,a,2),wu(),up(a,2)}if(a=_p(r),a===null&&Ad(e,t,r,vp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ad(e,t,r,null,n)}}function _p(e){return e=Yt(e),yp(e)}var vp=null;function yp(e){if(vp=null,e=lt(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 vp=e,null}function bp(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(we()){case Te:return 2;case V:return 8;case Ee:case De:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var xp=!1,Sp=null,Cp=null,wp=null,Tp=new Map,Ep=new Map,Dp=[],Op=`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 kp(e,t){switch(e){case`focusin`:case`focusout`:Sp=null;break;case`dragenter`:case`dragleave`:Cp=null;break;case`mouseover`:case`mouseout`:wp=null;break;case`pointerover`:case`pointerout`:Tp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ep.delete(t.pointerId)}}function Ap(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=ut(t),t!==null&&dp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function jp(e,t,n,r,i){switch(t){case`focusin`:return Sp=Ap(Sp,e,t,n,r,i),!0;case`dragenter`:return Cp=Ap(Cp,e,t,n,r,i),!0;case`mouseover`:return wp=Ap(wp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Tp.set(a,Ap(Tp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ep.set(a,Ap(Ep.get(a)||null,e,t,n,r,i)),!0}return!1}function Mp(e){var t=lt(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,$e(e.priority,function(){fp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,$e(e.priority,function(){fp(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 Np(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_p(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Jt=r,n.target.dispatchEvent(r),Jt=null}else return t=ut(n),t!==null&&dp(t),e.blockedOn=n,!1;t.shift()}return!0}function Pp(e,t,n){Np(e)&&n.delete(t)}function Fp(){xp=!1,Sp!==null&&Np(Sp)&&(Sp=null),Cp!==null&&Np(Cp)&&(Cp=null),wp!==null&&Np(wp)&&(wp=null),Tp.forEach(Pp),Ep.forEach(Pp)}function Ip(e,n){e.blockedOn===n&&(e.blockedOn=null,xp||(xp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Fp)))}var Lp=null;function Rp(e){Lp!==e&&(Lp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Lp===e&&(Lp=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(yp(r||n)===null)continue;break}var a=ut(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function zp(e){function t(t){return Ip(t,e)}Sp!==null&&Ip(Sp,e),Cp!==null&&Ip(Cp,e),wp!==null&&Ip(wp,e),Tp.forEach(t),Ep.forEach(t);for(var n=0;n<Dp.length;n++){var r=Dp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Dp.length&&(n=Dp[0],n.blockedOn===null);)Mp(n),n.blockedOn===null&&Dp.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[nt]||null;if(typeof a==`function`)o||Rp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[nt]||null)s=o.formAction;else if(yp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Rp(n)}}}function Bp(){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 Vp(e){this._internalRoot=e}Hp.prototype.render=Vp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;cp(n,_u(),e,t,null,null)},Hp.prototype.unmount=Vp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cp(e.current,2,null,e,null,null),wu(),t[rt]=null}};function Hp(e){this._internalRoot=e}Hp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dp.length&&t!==0&&t<Dp[n].priority;n++);Dp.splice(n,0,e),n===0&&Mp(e)}};var Up=n.version;if(Up!==`19.2.5`)throw Error(i(527,Up,`19.2.5`));L.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 Wp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Gp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gp.isDisabled&&Gp.supportsFiber)try{je=Gp.inject(Wp),Me=Gp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ws,s=Gs,c=Ks;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=op(e,1,!1,null,null,n,r,null,o,s,c,Bp),e[rt]=t.current,Od(e),new Vp(t)}})),y=s(((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=v()})),b=u(p(),1),x=y();function S(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=S(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function C(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=S(e))&&(r&&(r+=` `),r+=t);return r}var w=(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},T=(e,t)=>({classGroupId:e,validator:t}),E=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),D=`-`,O=[],k=`arbitrary..`,A=e=>{let t=N(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return M(e);let n=e.split(D);return j(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?w(i,t):t:i||O}return n[e]||O}}},j=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=j(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(D):e.slice(t).join(D),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},M=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?k+r:void 0})(),N=e=>{let{theme:t,classGroups:n}=e;return P(n,t)},P=(e,t)=>{let n=E();for(let r in e){let i=e[r];F(i,n,r,t)}return n},F=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];I(i,t,n,r)}},I=(e,t,n,r)=>{if(typeof e==`string`){L(e,t,n);return}if(typeof e==`function`){ee(e,t,n,r);return}te(e,t,n,r)},L=(e,t,n)=>{let r=e===``?t:ne(t,e);r.classGroupId=n},ee=(e,t,n,r)=>{if(R(e)){F(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(T(n,e))},te=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];F(o,ne(t,a),n,r)}},ne=(e,t)=>{let n=e,r=t.split(D),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=E(),n.nextPart.set(t,i)),n=i}return n},R=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,z=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)}}},B=`!`,re=`:`,ie=[],ae=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),oe=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===re){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(B)?(c=s.slice(0,-1),l=!0):s.startsWith(B)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ae(t,l,c,u)};if(t){let e=t+re,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ae(ie,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},se=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}},ce=e=>({cache:z(e.cacheSize),parseClassName:oe(e),sortModifiers:se(e),postfixLookupClassGroupIds:le(e),...A(e)}),le=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},ue=/\s+/,de=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(ue),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+B:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},fe=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=pe(n))&&(i&&(i+=` `),i+=r);return i},pe=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=pe(e[r]))&&(n&&(n+=` `),n+=t);return n},me=(e,...t)=>{let n,r,i,a,o=o=>(n=ce(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=de(e,n);return i(e,a),a};return a=o,(...e)=>a(fe(...e))},he=[],ge=e=>{let t=t=>t[e]||he;return t.isThemeGetter=!0,t},_e=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ve=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ye=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,be=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xe=/\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$/,Se=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ce=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,we=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Te=e=>ye.test(e),V=e=>!!e&&!Number.isNaN(Number(e)),Ee=e=>!!e&&Number.isInteger(Number(e)),De=e=>e.endsWith(`%`)&&V(e.slice(0,-1)),Oe=e=>be.test(e),ke=()=>!0,Ae=e=>xe.test(e)&&!Se.test(e),je=()=>!1,Me=e=>Ce.test(e),Ne=e=>we.test(e),Pe=e=>!H(e)&&!U(e),Fe=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Ie=e=>Ze(e,tt,je),H=e=>_e.test(e),Le=e=>Ze(e,nt,Ae),Re=e=>Ze(e,rt,V),ze=e=>Ze(e,at,ke),Be=e=>Ze(e,it,je),Ve=e=>Ze(e,$e,je),He=e=>Ze(e,et,Ne),Ue=e=>Ze(e,ot,Me),U=e=>ve.test(e),We=e=>Qe(e,nt),Ge=e=>Qe(e,it),Ke=e=>Qe(e,$e),qe=e=>Qe(e,tt),Je=e=>Qe(e,et),Ye=e=>Qe(e,ot,!0),Xe=e=>Qe(e,at,!0),Ze=(e,t,n)=>{let r=_e.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Qe=(e,t,n=!1)=>{let r=ve.exec(e);return r?r[1]?t(r[1]):n:!1},$e=e=>e===`position`||e===`percentage`,et=e=>e===`image`||e===`url`,tt=e=>e===`length`||e===`size`||e===`bg-size`,nt=e=>e===`length`,rt=e=>e===`number`,it=e=>e===`family-name`,at=e=>e===`number`||e===`weight`,ot=e=>e===`shadow`,st=me(()=>{let e=ge(`color`),t=ge(`font`),n=ge(`text`),r=ge(`font-weight`),i=ge(`tracking`),a=ge(`leading`),o=ge(`breakpoint`),s=ge(`container`),c=ge(`spacing`),l=ge(`radius`),u=ge(`shadow`),d=ge(`inset-shadow`),f=ge(`text-shadow`),p=ge(`drop-shadow`),m=ge(`blur`),h=ge(`perspective`),g=ge(`aspect`),_=ge(`ease`),v=ge(`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(),U,H],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[U,H,c],T=()=>[Te,`full`,`auto`,...w()],E=()=>[Ee,`none`,`subgrid`,U,H],D=()=>[`auto`,{span:[`full`,Ee,U,H]},Ee,U,H],O=()=>[Ee,`auto`,U,H],k=()=>[`auto`,`min`,`max`,`fr`,U,H],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Te,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Te,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Te,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,U,H],L=()=>[...b(),Ke,Ve,{position:[U,H]}],ee=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,qe,Ie,{size:[U,H]}],ne=()=>[De,We,Le],R=()=>[``,`none`,`full`,l,U,H],z=()=>[``,V,We,Le],B=()=>[`solid`,`dashed`,`dotted`,`double`],re=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ie=()=>[V,De,Ke,Ve],ae=()=>[``,`none`,m,U,H],oe=()=>[`none`,V,U,H],se=()=>[`none`,V,U,H],ce=()=>[V,U,H],le=()=>[Te,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Oe],breakpoint:[Oe],color:[ke],container:[Oe],"drop-shadow":[Oe],ease:[`in`,`out`,`in-out`],font:[Pe],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Oe],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Oe],shadow:[Oe],spacing:[`px`,V],text:[Oe],"text-shadow":[Oe],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Te,H,U,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,U,H]}],"container-named":[Fe],columns:[{columns:[V,H,U,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:[Ee,`auto`,U,H]}],basis:[{basis:[Te,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[V,Te,`auto`,`initial`,`none`,H]}],grow:[{grow:[``,V,U,H]}],shrink:[{shrink:[``,V,U,H]}],order:[{order:[Ee,`first`,`last`,`none`,U,H]}],"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":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],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:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,We,Le]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Xe,ze]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,De,H]}],"font-family":[{font:[Ge,Be,t]}],"font-features":[{"font-features":[H]}],"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,U,H]}],"line-clamp":[{"line-clamp":[V,`none`,U,Re]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,U,H]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,U,H]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...B(),`wavy`]}],"text-decoration-thickness":[{decoration:[V,`from-font`,`auto`,U,Le]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[V,`auto`,U,H]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Ee,U,H]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,U,H]}],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`,U,H]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Ee,U,H],radial:[``,U,H],conic:[Ee,U,H]},Je,He]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:z()}],"border-w-x":[{"border-x":z()}],"border-w-y":[{"border-y":z()}],"border-w-s":[{"border-s":z()}],"border-w-e":[{"border-e":z()}],"border-w-bs":[{"border-bs":z()}],"border-w-be":[{"border-be":z()}],"border-w-t":[{"border-t":z()}],"border-w-r":[{"border-r":z()}],"border-w-b":[{"border-b":z()}],"border-w-l":[{"border-l":z()}],"divide-x":[{"divide-x":z()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":z()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...B(),`hidden`,`none`]}],"divide-style":[{divide:[...B(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...B(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[V,U,H]}],"outline-w":[{outline:[``,V,We,Le]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Ye,Ue]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ye,Ue]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:z()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[V,Le]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":z()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Ye,Ue]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[V,U,H]}],"mix-blend":[{"mix-blend":[...re(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":re()}],"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":[V]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[U,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"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":[V]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,U,H]}],filter:[{filter:[``,`none`,U,H]}],blur:[{blur:ae()}],brightness:[{brightness:[V,U,H]}],contrast:[{contrast:[V,U,H]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ye,Ue]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,V,U,H]}],"hue-rotate":[{"hue-rotate":[V,U,H]}],invert:[{invert:[``,V,U,H]}],saturate:[{saturate:[V,U,H]}],sepia:[{sepia:[``,V,U,H]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,U,H]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[V,U,H]}],"backdrop-contrast":[{"backdrop-contrast":[V,U,H]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,V,U,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[V,U,H]}],"backdrop-invert":[{"backdrop-invert":[``,V,U,H]}],"backdrop-opacity":[{"backdrop-opacity":[V,U,H]}],"backdrop-saturate":[{"backdrop-saturate":[V,U,H]}],"backdrop-sepia":[{"backdrop-sepia":[``,V,U,H]}],"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`,U,H]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[V,`initial`,U,H]}],ease:[{ease:[`linear`,`initial`,_,U,H]}],delay:[{delay:[V,U,H]}],animate:[{animate:[`none`,v,U,H]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,U,H]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":[`scale-3d`],skew:[{skew:ce()}],"skew-x":[{"skew-x":ce()}],"skew-y":[{"skew-y":ce()}],transform:[{transform:[U,H,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":[`translate-none`],zoom:[{zoom:[Ee,U,H]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"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`,U,H]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,U,H]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[V,We,Le,Re]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}}),ct=!1;function W(...e){return st(C(e))}function lt(e){e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=``;for(let n of e)t+=n.toString(16).padStart(2,`0`);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function ut(){ct||(ct=!0,console.warn(`[client-id] Web Crypto is unavailable`))}function dt(e=globalThis.crypto){if(typeof e?.randomUUID==`function`)return e.randomUUID();if(typeof e?.getRandomValues==`function`){let t=new Uint8Array(16);return e.getRandomValues(t),lt(t)}throw ut(),Error(`Web Crypto is required for UUID generation`)}function ft(e=`id`,t=globalThis.crypto){return`${e}-${dt(t)}`}var pt=(e,t,n)=>{let r=[];e.status===`error`&&e.error&&r.push(`channel:telegram:${e.error}`);for(let e of t)e.status===`error`&&e.error&&r.push(`mcp:${e.id}:${e.error}`);for(let e of n)e.enabled&&e.error&&r.push(`skill:${e.id}:${e.error}`);return r},mt=(e,t)=>e===null||t===null?e:{...e,model_context_window:t},ht=e=>({apiKey:e.api_key,baseUrl:e.base_url,id:e.id,models:e.models,name:e.name,type:e.type}),gt=e=>({api_key:e.apiKey,base_url:e.baseUrl,id:e.id,models:e.models,name:e.name,type:e.type}),_t=e=>({chatId:e.chat_id,displayName:e.display_name,recentMessage:e.recent_message,status:e.status,updatedAt:e.updated_at??0,userId:e.user_id,username:e.username}),vt=e=>({chat_id:e.chatId,display_name:e.displayName,recent_message:e.recentMessage,status:e.status,updated_at:e.updatedAt,user_id:e.userId,username:e.username}),yt=()=>({botSecret:``,enabled:!1,error:``,sessions:[],status:`disabled`}),bt=e=>({botSecret:e?.bot_token??``,enabled:e?.enabled??!1,error:e?.error??``,sessions:(e?.sessions??[]).map(_t),status:e?.status??`disabled`}),xt=e=>({bot_token:e.botSecret,enabled:e.enabled,error:e.error,sessions:e.sessions.map(vt),status:e.status}),St=e=>({createdAt:e.created_at,path:e.path}),Ct=e=>({data:e.data??{},description:e.description??``,id:e.id,name:e.name,position:e.position??{x:0,y:0},type:e.type}),wt=e=>({data:e.data,description:e.description,id:e.id,name:e.name,position:e.position,type:e.type}),Tt=e=>({id:e.id,label:e.label??``,source:e.source,sourceHandle:e.source_handle??``,target:e.target,targetHandle:e.target_handle??``}),Et=e=>({id:e.id,label:e.label,source:e.source,source_handle:e.sourceHandle,target:e.target,target_handle:e.targetHandle}),Dt=e=>({edges:(e.edges??[]).map(Tt),nodes:(e.nodes??[]).map(Ct),version:e.version??1}),Ot=e=>({edges:e.edges.map(Et),nodes:e.nodes.map(wt),version:e.version}),kt=e=>({createdAt:e.created_at,definition:Dt(e.definition),id:e.id,name:e.name,updatedAt:e.updated_at}),At=e=>({created_at:e.createdAt,definition:Ot(e.definition),id:e.id,name:e.name,updated_at:e.updatedAt}),jt=e=>({nodeResults:e.node_results.map(e=>({error:e.error,id:e.id,output:e.output,status:e.status})),outputs:e.outputs,status:e.status,workflowId:e.workflow_id}),Mt=e=>({input:e.input??``,inputs:e.inputs??{},timer_id:e.timerId??``}),Nt=async(e,t)=>{try{let t=await e.json();if(typeof t.detail==`string`&&t.detail.trim())return t.detail}catch{return t}return t},Pt=e=>[e.command,...e.args].filter(Boolean).join(` `),Ft=e=>({description:e.description??``,inputSchema:e.input_schema??{},name:e.name,outputSchema:e.output_schema??null}),It=e=>({args:e.args??[],command:e.command??``,commandLine:Pt({args:e.args??[],command:e.command??``}),config:e.config??{},enabled:e.enabled,error:e.error??``,id:e.id,name:e.name,status:e.status??`disabled`,tools:(e.tools??[]).map(Ft),type:e.type,url:e.url??``}),Lt=e=>({args:e.args,command:e.command,config:e.config,enabled:e.enabled,error:e.error,id:e.id,name:e.name,status:e.status,tools:e.tools.map(e=>({description:e.description,input_schema:e.inputSchema,name:e.name,output_schema:e.outputSchema})),type:e.type,url:e.url}),Rt=()=>({args:[],command:``,commandLine:``,config:{},enabled:!0,error:``,id:`new`,name:``,status:`disabled`,tools:[],type:`command`,url:``}),zt=e=>{let t=[],n=``,r=``,i=!1;for(let a of e){if(i){n+=a,i=!1;continue}if(a===`\\`){i=!0;continue}if(r){a===r?r=``:n+=a;continue}if(a===`'`||a===`"`){r=a;continue}if(/\s/.test(a)){n&&=(t.push(n),``);continue}n+=a}return n&&t.push(n),{args:t.slice(1),command:t[0]??``}},Bt=e=>{let t=e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``);return t?`mcp-${t}`:ft(`mcp`)},Vt=async e=>{let t=await fetch(`/api/workflows`,{body:JSON.stringify(At(e)),headers:{"Content-Type":`application/json`},method:`PUT`});return t.ok?{data:kt(await t.json()),error:``}:{data:null,error:await Nt(t,`Workflow could not be saved.`)}},Ht=async e=>(await fetch(`/api/workflows/${encodeURIComponent(e)}`,{headers:{"Content-Type":`application/json`},method:`DELETE`})).ok,Ut=async(e,t={})=>{let n=await fetch(`/api/workflows/${encodeURIComponent(e)}/run`,{body:JSON.stringify(Mt(t)),headers:{"Content-Type":`application/json`},method:`POST`,signal:t.signal});return n.ok?{data:jt(await n.json()),error:``}:{data:null,error:await Nt(n,`Run could not be completed.`)}},Wt=(e=``)=>{let[t,n]=(0,b.useState)([]),[r,i]=(0,b.useState)(null),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(e),[l,u]=(0,b.useState)(0),d=(0,b.useMemo)(()=>t.find(e=>e.id===s)??null,[s,t]),f=(0,b.useCallback)(e=>{n(e),c(t=>t&&!e.some(e=>e.id===t)?``:t)},[]),p=(0,b.useCallback)(()=>{c(``),i(null),u(e=>e+1)},[]),m=(0,b.useCallback)(e=>{c(e)},[]),h=(0,b.useCallback)(()=>{c(``)},[]),g=(0,b.useCallback)(async e=>{let t=await Vt(e);if(!t.data)return t;let r=t.data;return n(e=>e.some(e=>e.id===r.id)?e.map(e=>e.id===r.id?r:e):[r,...e]),c(r.id),t},[]);return{activeWorkflow:d,activeWorkflowId:s,closeWorkflowEditor:h,deleteWorkflow:(0,b.useCallback)(async e=>await Ht(e)?(n(t=>t.filter(t=>t.id!==e)),i(t=>t?.workflowId===e?null:t),c(t=>t===e?``:t),!0):!1,[]),newWorkflowKey:l,openNewWorkflow:p,openWorkflow:m,replaceWorkflows:f,runWorkflow:(0,b.useCallback)(async(e,t={})=>{o(e),t.timerId||i(null);try{let n=await Ut(e,t);return i(n.data),n}finally{t.timerId||o(``)}},[]),runningWorkflowId:a,finishWorkflowRun:(0,b.useCallback)(e=>{o(t=>t===e?``:t)},[]),saveWorkflow:g,workflowRunResult:r,workflows:t}},Gt=async()=>{let e=await fetch(`/api/state`);return e.ok?await e.json():null},Kt=async()=>{let e=await fetch(`/api/about`);return e.ok?await e.json():{}},qt=async e=>{await fetch(`/api/settings`,{body:JSON.stringify({agent_prompt:e.agentPrompt,context_window_limit:e.contextWindowLimit,reasoning_effort:e.reasoningEffort,selected_model:e.selectedModel,selected_provider_id:e.selectedProviderId}),headers:{"Content-Type":`application/json`},method:`PUT`})},Jt=async e=>{let t=await fetch(`/api/mcp/import/preview`,{body:JSON.stringify({source:e}),headers:{"Content-Type":`application/json`},method:`POST`});if(!t.ok)throw Error(`Scan could not be completed.`);return((await t.json()).servers??[]).map(e=>It(e))},Yt=async({serverId:e,source:t})=>{let n=await fetch(`/api/mcp/import`,{body:JSON.stringify({server_id:e,source:t}),headers:{"Content-Type":`application/json`},method:`POST`});if(!n.ok)throw Error(`Import could not be completed.`);return(await n.json()).map(e=>It(e))},Xt=async e=>{let t=await fetch(`/api/mcp/servers`,{body:JSON.stringify(Lt(e)),headers:{"Content-Type":`application/json`},method:`PUT`});return t.ok?It(await t.json()):null},Zt=async e=>{let t=await fetch(`/api/mcp/servers/${e}/reconnect`,{headers:{"Content-Type":`application/json`},method:`POST`});return t.ok?It(await t.json()):null},Qt=async e=>(await fetch(`/api/mcp/servers/${e}`,{headers:{"Content-Type":`application/json`},method:`DELETE`})).ok,$t=({showError:e})=>{let[t,n]=(0,b.useState)([]),[r,i]=(0,b.useState)(`new`),[a,o]=(0,b.useState)(()=>Rt()),[s,c]=(0,b.useState)(!1),[l,u]=(0,b.useState)([]),[d,f]=(0,b.useState)(`claude_code`),[p,m]=(0,b.useState)(!1),[h,g]=(0,b.useState)(``),_=r===`new`,v=(0,b.useMemo)(()=>t.some(e=>e.status===`starting`),[t]),y=(0,b.useCallback)(e=>{n(e),e[0]&&(i(e[0].id),o(e[0]))},[]),x=(0,b.useCallback)(e=>{c(!1),i(e.id),o(e)},[]),S=(0,b.useCallback)(()=>{c(!1),i(`new`),o(Rt())},[]),C=(0,b.useCallback)(e=>{o(t=>({...t,...e}))},[]),w=(0,b.useCallback)(async(t=d)=>{m(!0);try{u(await Jt(t))}catch{u([]),e(`Scan could not be completed.`)}finally{m(!1)}},[d,e]),T=(0,b.useCallback)(()=>{c(!0),u([]),f(`claude_code`),w(`claude_code`)},[w]),E=(0,b.useCallback)(async t=>{if(!l.some(e=>e.id===t)){e(`No servers found.`);return}g(t);try{let e=await Yt({serverId:t,source:d});n(e);let r=e.find(e=>e.id===t)??e[0];r&&(c(!1),i(r.id),o(r))}catch{e(`Import could not be completed.`)}finally{g(``)}},[l,d,e]),D=(0,b.useCallback)(e=>{f(e),u([]),w(e)},[w]),O=(0,b.useCallback)(async()=>{let e=a.type===`command`?zt(a.commandLine):{args:[],command:``},t=await Xt({...a,args:e.args,command:e.command,id:_||a.id===`new`?Bt(a.name):a.id,name:a.name.trim()||`Server`,tools:_?[]:a.tools,url:a.type===`url`?a.url:``});t&&(n(e=>_?[...e,t]:e.map(e=>e.id===t.id?t:e)),i(t.id),o(t))},[_,a]),k=(0,b.useCallback)(async()=>{if(_)return;let e=await Zt(a.id);e&&(n(t=>t.map(t=>t.id===e.id?e:t)),o(e))},[_,a.id]),A=(0,b.useCallback)(async()=>{if(!_&&await Qt(a.id)){let e=t.filter(e=>e.id!==a.id);n(e);let r=e[0];r?(i(r.id),o(r)):S()}},[_,a.id,t,S]);return(0,b.useEffect)(()=>{if(!v)return;let e=!0,t=async()=>{try{let t=await Gt();if(!t||!e)return;let r=(t.mcp_servers??[]).map(It);n(r),o(e=>{let t=r.find(t=>t.id===e.id);return t?{...e,error:t.error,status:t.status,tools:t.tools}:e})}catch{return}};t();let r=window.setInterval(()=>{t()},1e3);return()=>{e=!1,window.clearInterval(r)}},[v]),{importMcpServer:E,importingMcpServerId:h,isCreatingMcpServer:_,isMcpImportOpen:s,isPreviewingMcpImport:p,loadMcpEditor:x,mcpDraft:a,mcpImportPreview:l,mcpImportSource:d,mcpServers:t,openMcpImport:T,openNewMcpEditor:S,reconnectMcpServer:k,removeMcpServer:A,replaceMcpServers:y,saveMcpServer:O,updateMcpDraft:C,updateMcpImportSource:D}},en=async e=>{let t=await fetch(`/api/telegram-bot`,{body:JSON.stringify(xt(e)),headers:{"Content-Type":`application/json`},method:`PUT`});return t.ok?bt(await t.json()):null},tn=async e=>{let t=await fetch(`/api/telegram-bot/approve`,{body:JSON.stringify({chat_id:e}),headers:{"Content-Type":`application/json`},method:`POST`});return t.ok?_t(await t.json()):null},nn=async e=>{let t=await fetch(`/api/permissions/writable-paths`,{body:JSON.stringify({path:e}),headers:{"Content-Type":`application/json`},method:`DELETE`});return t.ok?((await t.json()).writable_paths??[]).map(St):null},rn=async e=>{let t=await fetch(`/api/permissions/writable-paths`,{body:JSON.stringify({path:e}),headers:{"Content-Type":`application/json`},method:`POST`});if(!t.ok)throw Error(`Directory could not be added.`);return St(await t.json())},an=async()=>{let e=await fetch(`/api/skills/reload`,{headers:{"Content-Type":`application/json`},method:`POST`});return e.ok?await e.json():null},on=async(e,t)=>{let n=await fetch(`/api/skills/${encodeURIComponent(e)}`,{body:JSON.stringify({enabled:t}),headers:{"Content-Type":`application/json`},method:`PUT`});return n.ok?await n.json():null},sn=()=>{let[e,t]=(0,b.useState)([]),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(()=>yt()),[o,s]=(0,b.useState)([]),c=(0,b.useMemo)(()=>e.find(e=>e.id===n)??e[0],[n,e]),l=(0,b.useCallback)(e=>{t(e),r(e[0]?.id??``)},[]),u=(0,b.useCallback)(e=>{r(e.id)},[]),d=(0,b.useCallback)(async()=>{let e=await an();e&&(t(e),r(t=>e.some(e=>e.id===t)?t:e[0]?.id??``))},[]),f=(0,b.useCallback)(async(e,n)=>{let r=await on(e.id,n);r&&t(e=>e.map(e=>e.id===r.id?r:e))},[]),p=(0,b.useCallback)(e=>{a(e)},[]),m=(0,b.useCallback)(e=>{a(t=>({...t,...e}))},[]),h=(0,b.useCallback)(async()=>{let e=await en(i);e&&a(e)},[i]),g=(0,b.useCallback)(async e=>{let t=await tn(e);t&&a(e=>({...e,sessions:e.sessions.map(e=>e.chatId===t.chatId?t:e)}))},[]),_=(0,b.useCallback)(e=>{s(e)},[]),v=(0,b.useCallback)(async e=>{let t=await nn(e);t&&s(t)},[]);return{activeSkill:c,addWritablePath:(0,b.useCallback)(async e=>{let t=await rn(e);s(e=>e.some(e=>e.path===t.path)?e:[...e,t])},[]),approveTelegramSession:g,reloadSkills:d,removeWritablePath:v,replaceSkills:l,replaceTelegramBot:p,replaceWritablePaths:_,saveTelegramBot:h,selectSkill:u,skills:e,telegramBot:i,toggleSkill:f,updateTelegramBot:m,writablePaths:o}},cn={access_denied:{description:`Check the key and account access.`,message:`Access denied.`},connection_failed:{description:`Check the address and try again.`,message:`Connection failed.`},provider_unavailable:{description:`The service is currently unreachable.`,message:`Provider unavailable.`},rate_limited:{description:`Please wait a moment and try again.`,message:`Too many requests.`},request_failed:{description:`Check the connection settings and try again.`,message:`Request failed.`}},ln=class extends Error{notification;constructor(e){super(e.message),this.name=`ProviderModelFetchError`,this.notification=e}},un=e=>typeof e==`string`&&e in cn,dn=async e=>{try{let t=(await e.json()).detail?.code;if(un(t))return t}catch{return`request_failed`}return`request_failed`},fn=async e=>{try{let t=await fetch(`/api/providers/models`,{body:JSON.stringify({base_url:e.baseUrl,provider:e.type,secret_reference:e.apiKey}),headers:{"Content-Type":`application/json`},method:`POST`});if(!t.ok)throw new ln(cn[await dn(t)]);return(await t.json()).models??[]}catch(e){throw e instanceof ln?e:new ln(cn.connection_failed)}},pn=async e=>{await fetch(`/api/providers`,{body:JSON.stringify(gt(e)),headers:{"Content-Type":`application/json`},method:`POST`})},mn=async e=>(await fetch(`/api/providers/${e}`,{headers:{"Content-Type":`application/json`},method:`DELETE`})).ok,hn=[{id:`openai`,label:`OpenAI`},{id:`openai_responses`,label:`OpenAI Responses`},{id:`anthropic`,label:`Anthropic`},{id:`gemini`,label:`Gemini`}],gn=()=>({apiKey:``,baseUrl:``,id:`new`,models:[],name:``,type:`openai`}),_n=({onContextWindowLimitChange:e,refreshAppState:t,showError:n})=>{let[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)(null),[d,f]=(0,b.useState)(`default`),[p,m]=(0,b.useState)([]),[h,g]=(0,b.useState)(`new`),[_,v]=(0,b.useState)(()=>gn()),[y,x]=(0,b.useState)(!1),S=(0,b.useMemo)(()=>p.find(e=>e.id===a),[p,a]),C=h===`new`,w=(0,b.useCallback)(e=>{m(e)},[]),T=(0,b.useCallback)(e=>{i(e.agentPrompt),o(e.selectedProviderId),c(e.selectedModel),u(e.contextWindowLimit),f(e.reasoningEffort)},[]),E=(0,b.useCallback)(e=>{g(e.id),v(e)},[]),D=(0,b.useCallback)(()=>{g(`new`),v(gn())},[]),O=(0,b.useCallback)(e=>{v(t=>({...t,...e}))},[]),k=(0,b.useCallback)(async e=>{T(e),await qt(e),await t()},[t,T]),A=(0,b.useCallback)(e=>{let t=p.find(t=>t.id===e);if(!t){o(``),c(``),k({agentPrompt:r,contextWindowLimit:l,reasoningEffort:d,selectedModel:``,selectedProviderId:``});return}o(t.id),c(``),k({agentPrompt:r,contextWindowLimit:l,reasoningEffort:d,selectedModel:``,selectedProviderId:t.id})},[r,l,k,p,d]),j=(0,b.useCallback)(e=>{c(e),k({agentPrompt:r,contextWindowLimit:l,reasoningEffort:d,selectedModel:e,selectedProviderId:a})},[r,l,k,d,a]),M=(0,b.useCallback)(e=>{f(e),qt({agentPrompt:r,contextWindowLimit:l,reasoningEffort:e,selectedModel:s,selectedProviderId:a})},[r,l,s,a]),N=(0,b.useCallback)(t=>{T(t),e(t.contextWindowLimit),k(t)},[e,k,T]),P=(0,b.useCallback)(async()=>{x(!0);try{let e=await fn(_);O({models:e}),e.length===0&&n({description:`No models available for this provider.`,message:`No models found.`})}catch(e){e instanceof ln&&n(e.notification)}finally{x(!1)}},[_,n,O]),F=(0,b.useCallback)(async()=>{let e={..._,id:C?ft(`provider`):_.id,name:_.name.trim()||hn.find(e=>e.id===_.type)?.label||`Provider`};m(t=>C?[...t,e]:t.map(t=>t.id===e.id?e:t)),g(e.id),v(e),a||(qt({agentPrompt:r,contextWindowLimit:l,reasoningEffort:d,selectedModel:``,selectedProviderId:e.id}),o(e.id),c(``)),await pn(e)},[r,l,C,_,d,a]);return{activeProvider:S,agentPrompt:r,contextWindowLimit:l,fetchProviderModels:P,handleActiveModelChange:j,handleActiveProviderChange:A,handleReasoningEffortChange:M,isCreatingProvider:C,isFetchingModels:y,loadProviderEditor:E,openNewProviderEditor:D,providerDraft:_,providers:p,reasoningEffort:d,removeProvider:(0,b.useCallback)(async()=>{if(C)return;let e=_.id;if(await mn(e)){let t=p.findIndex(t=>t.id===e),n=p.filter(t=>t.id!==e);m(n);let i=n[t]||n[t-1];if(i?E(i):D(),a===e){let e=i?.id??``,t=i?.models[0]??``;o(e),c(t),qt({agentPrompt:r,contextWindowLimit:l,reasoningEffort:d,selectedModel:t,selectedProviderId:e})}}},[r,l,C,E,D,_.id,p,d,a]),replaceProviders:w,replaceRuntimeSettings:T,saveProvider:F,saveRuntimeSettings:N,selectedModel:s,selectedProviderId:a,updateProviderDraft:O}},vn=e=>{if(e.groups?.length)return e.groups;let t=e.thinking?{content:e.thinking,id:`${e.id}-thinking-existing`,isStreaming:!1,type:`thinking`}:null,n=(e.tools??[]).map(e=>({id:`tool-${e.id}`,tool:e,type:`tool`})),r=[],i=[...t?[t]:[],...n];return i.length&&r.push({id:`${e.id}-process-existing`,items:i}),e.content&&r.push({id:`${e.id}-content-existing`,items:[{content:e.content,id:`${e.id}-text-existing`,type:`text`}]}),r},yn=(e,t)=>e.flatMap(e=>e.items).filter(e=>e.type===t).length,bn=e=>{for(let t=e.length-1;t>=0;--t){let n=e[t]?.items??[];for(let e=n.length-1;e>=0;--e){let t=n[e];if(t)return t}}return null},xn=(e,t)=>{let n=[],r=!1;for(let i of vn(e)){let e=[];for(let n of i.items){if(n.type===`error`&&n.id===t){r=!0;break}e.push(n)}if(r){e.length>0&&n.push({...i,items:e});break}n.push(i)}return r?{...e,content:n.flatMap(e=>e.items).filter(e=>e.type===`text`).map(e=>e.content).join(``),groups:n,isStreamingText:!1,isStreamingThinking:!1,status:`running`,thinking:n.flatMap(e=>e.items).filter(e=>e.type===`thinking`).map(e=>e.content).join(``),tools:n.flatMap(e=>e.items).filter(e=>e.type===`tool`).map(e=>e.tool)}:null},Sn=(e,t)=>({id:`${t||`assistant`}-error-1`,message:e,title:`Response interrupted`,type:`error`}),Cn=`Check the model connection settings and try again.`,wn=(e,t)=>({id:t,message:Cn,title:`Request failed`,type:`error`,...e&&e!==`Check the model connection settings and try again.`&&e!==`Request failed`?{detail:e}:{}}),Tn=(e,t=ft(`message`))=>({author:`assistant`,content:``,groups:[{id:`${t}-errors`,items:[wn(e,`${t}-error-1`)]}],id:t,status:`failed`}),En=(e,t,n)=>({...e,active_output:null,groups:[...e.groups??[],{id:`${e.id}-errors`,items:[wn(t,n)]}],isStreamingText:!1,isStreamingThinking:!1,status:`failed`}),Dn=(e,t=ft(`message`))=>({author:`assistant`,content:``,groups:[{id:`${t}-errors`,items:[{...e,id:e.id||`${t}-error-1`}]}],id:t,status:`failed`}),On=e=>(e.groups??[]).flatMap(e=>e.items).some(e=>e.type===`error`),kn=(e,t)=>e.slice(t).some(e=>e.author===`assistant`&&On(e)),An=e=>{for(let t=e.length-1;t>=0;--t){let n=e[t]?.usage_info;if(n)return n}return null},jn=e=>typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`,Mn=class extends Error{},Nn=class extends Error{errorMessage;outputError;constructor(e,t,n){super(e),this.errorMessage=n,this.outputError=t}},Pn=(e,t)=>{for(let n=t;n>=0;--n){let t=e[n];if(t?.author===`user`)return t}return null},Fn=e=>{let t=e.split(`
|
|
9
|
+
`).replace(Id,``)}function Rd(e,t){return t=Ld(t),Ld(e)===t}function zd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&zt(e,``+r);break;case`className`:Ct(e,`class`,r);break;case`tabIndex`:Ct(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ct(e,n,r);break;case`style`:Ht(e,r,o);break;case`data`:if(t!==`object`){Ct(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=Kt(``+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`&&zd(e,t,`name`,a.name,a,null),zd(e,t,`formEncType`,a.formEncType,a,null),zd(e,t,`formMethod`,a.formMethod,a,null),zd(e,t,`formTarget`,a.formTarget,a,null)):(zd(e,t,`encType`,a.encType,a,null),zd(e,t,`method`,a.method,a,null),zd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`onScroll`:r!=null&&Td(`scroll`,e);break;case`onScrollEnd`:r!=null&&Td(`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=Kt(``+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`:Td(`beforetoggle`,e),Td(`toggle`,e),St(e,`popover`,r);break;case`xlinkActuate`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:St(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=Wt.get(n)||n,St(e,n,r))}}function Bd(e,t,n,r,a,o){switch(n){case`style`:Ht(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`?zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&zt(e,``+r);break;case`onScroll`:r!=null&&Td(`scroll`,e);break;case`onScrollEnd`:r!=null&&Td(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ht.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[nt]||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,``):St(e,n,r)}}}function Vd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Td(`error`,e),Td(`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:zd(e,t,o,s,n,null)}}a&&zd(e,t,`srcSet`,n.srcSet,n,null),r&&zd(e,t,`src`,n.src,n,null);return;case`input`:Td(`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:zd(e,t,r,d,n,null)}}Pt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Td(`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:zd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&It(e,!!r,n,!0):It(e,!!r,t,!1);return;case`textarea`:for(s in Td(`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:zd(e,t,s,c,n,null)}Rt(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:zd(e,t,l,r,n,null)}return;case`dialog`:Td(`beforetoggle`,e),Td(`toggle`,e),Td(`cancel`,e),Td(`close`,e);break;case`iframe`:case`object`:Td(`load`,e);break;case`video`:case`audio`:for(r=0;r<Sd.length;r++)Td(Sd[r],e);break;case`image`:Td(`error`,e),Td(`load`,e);break;case`details`:Td(`toggle`,e);break;case`embed`:case`source`:case`link`:Td(`error`,e),Td(`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:zd(e,t,u,r,n,null)}return;default:if(Ut(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Bd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&zd(e,t,c,r,n,null))}function Hd(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)||zd(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&&zd(e,t,p,m,r,f)}}Nt(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)||zd(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&&zd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?It(e,!!n,n?[]:``,!1):It(e,!!n,t,!0)):It(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:zd(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&&zd(e,t,s,a,r,o)}Lt(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:zd(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:zd(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)&&zd(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:zd(e,t,u,p,r,m)}return;default:if(Ut(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Bd(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||Bd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&zd(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||zd(e,t,f,p,r,m)}function Ud(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Wd(){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&&Ud(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&&Ud(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 Gd=null,q=null;function Kd(e){return e.nodeType===9?e:e.ownerDocument}function qd(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 Jd(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 Yd(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 Xd=null;function Zd(){var e=window.event;return e&&e.type===`popstate`?e===Xd?!1:(Xd=e,!0):(Xd=null,!1)}var Qd=typeof setTimeout==`function`?setTimeout:void 0,$d=typeof clearTimeout==`function`?clearTimeout:void 0,ef=typeof Promise==`function`?Promise:void 0,tf=typeof queueMicrotask==`function`?queueMicrotask:ef===void 0?Qd:function(e){return ef.resolve(null).then(e).catch(nf)};function nf(e){setTimeout(function(){throw e})}function rf(e){return e===`head`}function af(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),zp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)yf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,yf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&yf(e.ownerDocument.body);n=i}while(n);zp(t)}function of(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 sf(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`:sf(n),W(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function cf(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[ct])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=mf(e.nextSibling),e===null)break}return null}function lf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=mf(e.nextSibling),e===null))return null;return e}function uf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=mf(e.nextSibling),e===null))return null;return e}function df(e){return e.data===`$?`||e.data===`$~`}function ff(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function pf(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 mf(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 hf=null;function gf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return mf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function _f(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 vf(e,t,n){switch(t=Kd(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 yf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);W(e)}var bf=new Map,xf=new Set;function Sf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Cf=L.d;L.d={f:wf,r:Tf,D:Of,C:kf,L:Af,m:jf,X:Nf,S:Mf,M:Pf};function wf(){var e=Cf.f(),t=wu();return e||t}function Tf(e){var t=ut(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):Cf.r(e)}var Ef=typeof document>`u`?null:document;function Df(e,t,n){var r=Ef;if(r&&typeof t==`string`&&t){var i=Mt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xf.has(i)||(xf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Vd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Of(e){Cf.D(e),Df(`dns-prefetch`,e,null)}function kf(e,t){Cf.C(e,t),Df(`preconnect`,e,t)}function Af(e,t,n){Cf.L(e,t,n);var r=Ef;if(r&&e&&t){var i=`link[rel="preload"][as="`+Mt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Mt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Mt(n.imageSizes)+`"]`)):i+=`[href="`+Mt(e)+`"]`;var a=i;switch(t){case`style`:a=If(e);break;case`script`:a=Bf(e)}bf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lf(a))||t===`script`&&r.querySelector(Vf(a))||(t=r.createElement(`link`),Vd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function jf(e,t){Cf.m(e,t);var n=Ef;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Mt(r)+`"][href="`+Mt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bf(e)}if(!bf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),bf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vf(a)))return}r=n.createElement(`link`),Vd(r,`link`,e),pt(r),n.head.appendChild(r)}}}function Mf(e,t,n){Cf.S(e,t,n);var r=Ef;if(r&&e){var i=ft(r).hoistableStyles,a=If(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bf.get(a))&&Wf(e,n);var c=o=r.createElement(`link`);pt(c),Vd(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,Uf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nf(e,t){Cf.X(e,t);var n=Ef;if(n&&e){var r=ft(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=f({src:e,async:!0},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),pt(a),Vd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t){Cf.M(e,t);var n=Ef;if(n&&e){var r=ft(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),pt(a),Vd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t,n,r){var a=(a=ae.current)?Sf(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=If(n.href),n=ft(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=If(n.href);var o=ft(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(Lf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),bf.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},bf.set(e,n),o||zf(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=Bf(n),n=ft(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 If(e){return`href="`+Mt(e)+`"`}function Lf(e){return`link[rel="stylesheet"][`+e+`]`}function Rf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function zf(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}),Vd(t,`link`,n),pt(t),e.head.appendChild(t))}function Bf(e){return`[src="`+Mt(e)+`"]`}function Vf(e){return`script[async]`+e}function Hf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Mt(n.href)+`"]`);if(r)return t.instance=r,pt(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`),pt(r),Vd(r,`style`,a),Uf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=If(n.href);var o=e.querySelector(Lf(a));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;r=Rf(n),(a=bf.get(a))&&Wf(r,a),o=(e.ownerDocument||e).createElement(`link`),pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Vd(o,`link`,r),t.state.loading|=4,Uf(o,n.precedence,e),t.instance=o;case`script`:return o=Bf(n.src),(a=e.querySelector(Vf(o)))?(t.instance=a,pt(a),a):(r=n,(a=bf.get(o))&&(r=f({},n),Gf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),pt(a),Vd(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,Uf(r,n.precedence,e));return t.instance}function Uf(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 Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Kf=null;function qf(e,t,n){if(Kf===null){var r=new Map,i=Kf=new Map;i.set(n,r)}else i=Kf,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[ct]||a[tt]||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 Jf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Yf(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 Xf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zf(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=If(r.href),a=t.querySelector(Lf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ep.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,pt(a);return}a=t.ownerDocument||t,r=Rf(r),(i=bf.get(i))&&Wf(r,i),a=a.createElement(`link`),pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Vd(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=ep.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Qf=0;function $f(e,t){return e.stylesheets&&e.count===0&&np(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&np(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Qf===0&&(Qf=62500*Wd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&np(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ep(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)np(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var tp=null;function np(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,tp=new Map,t.forEach(rp,e),tp=null,ep.call(e))}function rp(e,t){if(!(t.state.loading&4)){var n=tp.get(e);if(n)var r=n.get(null);else{n=new Map,tp.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=ep.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 ip={$$typeof:C,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function ap(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=We(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=We(0),this.hiddenUpdates=We(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 op(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ap(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ni(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function sp(e){return e?(e=ei,e):ei}function cp(e,t,n,r,i,a){i=sp(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(yu(n,e,t),za(n,e,t))}function lp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function up(e,t){lp(e,t),(e=e.alternate)&&lp(e,t)}function dp(e){if(e.tag===13||e.tag===31){var t=Zr(e,67108864);t!==null&&yu(t,e,67108864),up(e,67108864)}}function fp(e){if(e.tag===13||e.tag===31){var t=_u();t=Xe(t);var n=Zr(e,t);n!==null&&yu(n,e,t),up(e,t)}}var pp=!0;function mp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,gp(e,t,n,r)}finally{L.p=a,I.T=i}}function hp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,gp(e,t,n,r)}finally{L.p=a,I.T=i}}function gp(e,t,n,r){if(pp){var i=_p(r);if(i===null)Ad(e,t,r,vp,n),kp(e,r);else if(jp(i,e,t,n,r))r.stopPropagation();else if(kp(e,r),t&4&&-1<Op.indexOf(e)){for(;i!==null;){var a=ut(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-Pe(o);s.entanglements[1]|=c,o&=~c}cd(a),!(Rl&6)&&(au=Ce()+500,ld(0,!1))}}break;case 31:case 13:s=Zr(a,2),s!==null&&yu(s,a,2),wu(),up(a,2)}if(a=_p(r),a===null&&Ad(e,t,r,vp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ad(e,t,r,null,n)}}function _p(e){return e=Yt(e),yp(e)}var vp=null;function yp(e){if(vp=null,e=lt(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 vp=e,null}function bp(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(we()){case Te:return 2;case V:return 8;case Ee:case De:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var xp=!1,Sp=null,Cp=null,wp=null,Tp=new Map,Ep=new Map,Dp=[],Op=`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 kp(e,t){switch(e){case`focusin`:case`focusout`:Sp=null;break;case`dragenter`:case`dragleave`:Cp=null;break;case`mouseover`:case`mouseout`:wp=null;break;case`pointerover`:case`pointerout`:Tp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ep.delete(t.pointerId)}}function Ap(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=ut(t),t!==null&&dp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function jp(e,t,n,r,i){switch(t){case`focusin`:return Sp=Ap(Sp,e,t,n,r,i),!0;case`dragenter`:return Cp=Ap(Cp,e,t,n,r,i),!0;case`mouseover`:return wp=Ap(wp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Tp.set(a,Ap(Tp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ep.set(a,Ap(Ep.get(a)||null,e,t,n,r,i)),!0}return!1}function Mp(e){var t=lt(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,$e(e.priority,function(){fp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,$e(e.priority,function(){fp(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 Np(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_p(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Jt=r,n.target.dispatchEvent(r),Jt=null}else return t=ut(n),t!==null&&dp(t),e.blockedOn=n,!1;t.shift()}return!0}function Pp(e,t,n){Np(e)&&n.delete(t)}function Fp(){xp=!1,Sp!==null&&Np(Sp)&&(Sp=null),Cp!==null&&Np(Cp)&&(Cp=null),wp!==null&&Np(wp)&&(wp=null),Tp.forEach(Pp),Ep.forEach(Pp)}function Ip(e,n){e.blockedOn===n&&(e.blockedOn=null,xp||(xp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Fp)))}var Lp=null;function Rp(e){Lp!==e&&(Lp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Lp===e&&(Lp=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(yp(r||n)===null)continue;break}var a=ut(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function zp(e){function t(t){return Ip(t,e)}Sp!==null&&Ip(Sp,e),Cp!==null&&Ip(Cp,e),wp!==null&&Ip(wp,e),Tp.forEach(t),Ep.forEach(t);for(var n=0;n<Dp.length;n++){var r=Dp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Dp.length&&(n=Dp[0],n.blockedOn===null);)Mp(n),n.blockedOn===null&&Dp.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[nt]||null;if(typeof a==`function`)o||Rp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[nt]||null)s=o.formAction;else if(yp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Rp(n)}}}function Bp(){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 Vp(e){this._internalRoot=e}Hp.prototype.render=Vp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;cp(n,_u(),e,t,null,null)},Hp.prototype.unmount=Vp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cp(e.current,2,null,e,null,null),wu(),t[rt]=null}};function Hp(e){this._internalRoot=e}Hp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dp.length&&t!==0&&t<Dp[n].priority;n++);Dp.splice(n,0,e),n===0&&Mp(e)}};var Up=n.version;if(Up!==`19.2.5`)throw Error(i(527,Up,`19.2.5`));L.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 Wp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Gp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gp.isDisabled&&Gp.supportsFiber)try{je=Gp.inject(Wp),Me=Gp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ws,s=Gs,c=Ks;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=op(e,1,!1,null,null,n,r,null,o,s,c,Bp),e[rt]=t.current,Od(e),new Vp(t)}})),y=s(((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=v()})),b=u(p(),1),x=y();function S(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=S(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function C(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=S(e))&&(r&&(r+=` `),r+=t);return r}var w=(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},T=(e,t)=>({classGroupId:e,validator:t}),E=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),D=`-`,O=[],k=`arbitrary..`,A=e=>{let t=N(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return M(e);let n=e.split(D);return j(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?w(i,t):t:i||O}return n[e]||O}}},j=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=j(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(D):e.slice(t).join(D),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},M=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?k+r:void 0})(),N=e=>{let{theme:t,classGroups:n}=e;return P(n,t)},P=(e,t)=>{let n=E();for(let r in e){let i=e[r];F(i,n,r,t)}return n},F=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];I(i,t,n,r)}},I=(e,t,n,r)=>{if(typeof e==`string`){L(e,t,n);return}if(typeof e==`function`){ee(e,t,n,r);return}te(e,t,n,r)},L=(e,t,n)=>{let r=e===``?t:ne(t,e);r.classGroupId=n},ee=(e,t,n,r)=>{if(R(e)){F(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(T(n,e))},te=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];F(o,ne(t,a),n,r)}},ne=(e,t)=>{let n=e,r=t.split(D),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=E(),n.nextPart.set(t,i)),n=i}return n},R=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,z=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)}}},B=`!`,re=`:`,ie=[],ae=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),oe=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===re){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(B)?(c=s.slice(0,-1),l=!0):s.startsWith(B)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ae(t,l,c,u)};if(t){let e=t+re,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ae(ie,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},se=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}},ce=e=>({cache:z(e.cacheSize),parseClassName:oe(e),sortModifiers:se(e),postfixLookupClassGroupIds:le(e),...A(e)}),le=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},ue=/\s+/,de=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(ue),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+B:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},fe=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=pe(n))&&(i&&(i+=` `),i+=r);return i},pe=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=pe(e[r]))&&(n&&(n+=` `),n+=t);return n},me=(e,...t)=>{let n,r,i,a,o=o=>(n=ce(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=de(e,n);return i(e,a),a};return a=o,(...e)=>a(fe(...e))},he=[],ge=e=>{let t=t=>t[e]||he;return t.isThemeGetter=!0,t},_e=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ve=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ye=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,be=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xe=/\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$/,Se=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ce=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,we=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Te=e=>ye.test(e),V=e=>!!e&&!Number.isNaN(Number(e)),Ee=e=>!!e&&Number.isInteger(Number(e)),De=e=>e.endsWith(`%`)&&V(e.slice(0,-1)),Oe=e=>be.test(e),ke=()=>!0,Ae=e=>xe.test(e)&&!Se.test(e),je=()=>!1,Me=e=>Ce.test(e),Ne=e=>we.test(e),Pe=e=>!H(e)&&!U(e),Fe=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Ie=e=>Ze(e,tt,je),H=e=>_e.test(e),Le=e=>Ze(e,nt,Ae),Re=e=>Ze(e,rt,V),ze=e=>Ze(e,at,ke),Be=e=>Ze(e,it,je),Ve=e=>Ze(e,$e,je),He=e=>Ze(e,et,Ne),Ue=e=>Ze(e,ot,Me),U=e=>ve.test(e),We=e=>Qe(e,nt),Ge=e=>Qe(e,it),Ke=e=>Qe(e,$e),qe=e=>Qe(e,tt),Je=e=>Qe(e,et),Ye=e=>Qe(e,ot,!0),Xe=e=>Qe(e,at,!0),Ze=(e,t,n)=>{let r=_e.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Qe=(e,t,n=!1)=>{let r=ve.exec(e);return r?r[1]?t(r[1]):n:!1},$e=e=>e===`position`||e===`percentage`,et=e=>e===`image`||e===`url`,tt=e=>e===`length`||e===`size`||e===`bg-size`,nt=e=>e===`length`,rt=e=>e===`number`,it=e=>e===`family-name`,at=e=>e===`number`||e===`weight`,ot=e=>e===`shadow`,st=me(()=>{let e=ge(`color`),t=ge(`font`),n=ge(`text`),r=ge(`font-weight`),i=ge(`tracking`),a=ge(`leading`),o=ge(`breakpoint`),s=ge(`container`),c=ge(`spacing`),l=ge(`radius`),u=ge(`shadow`),d=ge(`inset-shadow`),f=ge(`text-shadow`),p=ge(`drop-shadow`),m=ge(`blur`),h=ge(`perspective`),g=ge(`aspect`),_=ge(`ease`),v=ge(`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(),U,H],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[U,H,c],T=()=>[Te,`full`,`auto`,...w()],E=()=>[Ee,`none`,`subgrid`,U,H],D=()=>[`auto`,{span:[`full`,Ee,U,H]},Ee,U,H],O=()=>[Ee,`auto`,U,H],k=()=>[`auto`,`min`,`max`,`fr`,U,H],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Te,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Te,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Te,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,U,H],L=()=>[...b(),Ke,Ve,{position:[U,H]}],ee=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,qe,Ie,{size:[U,H]}],ne=()=>[De,We,Le],R=()=>[``,`none`,`full`,l,U,H],z=()=>[``,V,We,Le],B=()=>[`solid`,`dashed`,`dotted`,`double`],re=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ie=()=>[V,De,Ke,Ve],ae=()=>[``,`none`,m,U,H],oe=()=>[`none`,V,U,H],se=()=>[`none`,V,U,H],ce=()=>[V,U,H],le=()=>[Te,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Oe],breakpoint:[Oe],color:[ke],container:[Oe],"drop-shadow":[Oe],ease:[`in`,`out`,`in-out`],font:[Pe],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Oe],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Oe],shadow:[Oe],spacing:[`px`,V],text:[Oe],"text-shadow":[Oe],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Te,H,U,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,U,H]}],"container-named":[Fe],columns:[{columns:[V,H,U,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:[Ee,`auto`,U,H]}],basis:[{basis:[Te,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[V,Te,`auto`,`initial`,`none`,H]}],grow:[{grow:[``,V,U,H]}],shrink:[{shrink:[``,V,U,H]}],order:[{order:[Ee,`first`,`last`,`none`,U,H]}],"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":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],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:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,We,Le]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Xe,ze]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,De,H]}],"font-family":[{font:[Ge,Be,t]}],"font-features":[{"font-features":[H]}],"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,U,H]}],"line-clamp":[{"line-clamp":[V,`none`,U,Re]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,U,H]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,U,H]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...B(),`wavy`]}],"text-decoration-thickness":[{decoration:[V,`from-font`,`auto`,U,Le]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[V,`auto`,U,H]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Ee,U,H]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,U,H]}],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`,U,H]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Ee,U,H],radial:[``,U,H],conic:[Ee,U,H]},Je,He]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:z()}],"border-w-x":[{"border-x":z()}],"border-w-y":[{"border-y":z()}],"border-w-s":[{"border-s":z()}],"border-w-e":[{"border-e":z()}],"border-w-bs":[{"border-bs":z()}],"border-w-be":[{"border-be":z()}],"border-w-t":[{"border-t":z()}],"border-w-r":[{"border-r":z()}],"border-w-b":[{"border-b":z()}],"border-w-l":[{"border-l":z()}],"divide-x":[{"divide-x":z()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":z()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...B(),`hidden`,`none`]}],"divide-style":[{divide:[...B(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...B(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[V,U,H]}],"outline-w":[{outline:[``,V,We,Le]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Ye,Ue]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ye,Ue]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:z()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[V,Le]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":z()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Ye,Ue]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[V,U,H]}],"mix-blend":[{"mix-blend":[...re(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":re()}],"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":[V]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[U,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"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":[V]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,U,H]}],filter:[{filter:[``,`none`,U,H]}],blur:[{blur:ae()}],brightness:[{brightness:[V,U,H]}],contrast:[{contrast:[V,U,H]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ye,Ue]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,V,U,H]}],"hue-rotate":[{"hue-rotate":[V,U,H]}],invert:[{invert:[``,V,U,H]}],saturate:[{saturate:[V,U,H]}],sepia:[{sepia:[``,V,U,H]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,U,H]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[V,U,H]}],"backdrop-contrast":[{"backdrop-contrast":[V,U,H]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,V,U,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[V,U,H]}],"backdrop-invert":[{"backdrop-invert":[``,V,U,H]}],"backdrop-opacity":[{"backdrop-opacity":[V,U,H]}],"backdrop-saturate":[{"backdrop-saturate":[V,U,H]}],"backdrop-sepia":[{"backdrop-sepia":[``,V,U,H]}],"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`,U,H]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[V,`initial`,U,H]}],ease:[{ease:[`linear`,`initial`,_,U,H]}],delay:[{delay:[V,U,H]}],animate:[{animate:[`none`,v,U,H]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,U,H]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":[`scale-3d`],skew:[{skew:ce()}],"skew-x":[{"skew-x":ce()}],"skew-y":[{"skew-y":ce()}],transform:[{transform:[U,H,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":[`translate-none`],zoom:[{zoom:[Ee,U,H]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"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`,U,H]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,U,H]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[V,We,Le,Re]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}}),ct=!1;function W(...e){return st(C(e))}function lt(e){e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=``;for(let n of e)t+=n.toString(16).padStart(2,`0`);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function ut(){ct||(ct=!0,console.warn(`[client-id] Web Crypto is unavailable`))}function dt(e=globalThis.crypto){if(typeof e?.randomUUID==`function`)return e.randomUUID();if(typeof e?.getRandomValues==`function`){let t=new Uint8Array(16);return e.getRandomValues(t),lt(t)}throw ut(),Error(`Web Crypto is required for UUID generation`)}function ft(e=`id`,t=globalThis.crypto){return`${e}-${dt(t)}`}var pt=(e,t,n)=>{let r=[];e.status===`error`&&e.error&&r.push(`channel:telegram:${e.error}`);for(let e of t)e.status===`error`&&e.error&&r.push(`mcp:${e.id}:${e.error}`);for(let e of n)e.enabled&&e.error&&r.push(`skill:${e.id}:${e.error}`);return r},mt=(e,t)=>e===null||t===null?e:{...e,model_context_window:t},ht=e=>({apiKey:e.api_key,baseUrl:e.base_url,id:e.id,models:e.models,name:e.name,type:e.type}),gt=e=>({api_key:e.apiKey,base_url:e.baseUrl,id:e.id,models:e.models,name:e.name,type:e.type}),_t=e=>({chatId:e.chat_id,displayName:e.display_name,recentMessage:e.recent_message,status:e.status,updatedAt:e.updated_at??0,userId:e.user_id,username:e.username}),vt=e=>({chat_id:e.chatId,display_name:e.displayName,recent_message:e.recentMessage,status:e.status,updated_at:e.updatedAt,user_id:e.userId,username:e.username}),yt=()=>({botSecret:``,enabled:!1,error:``,sessions:[],status:`disabled`}),bt=e=>({botSecret:e?.bot_token??``,enabled:e?.enabled??!1,error:e?.error??``,sessions:(e?.sessions??[]).map(_t),status:e?.status??`disabled`}),xt=e=>({bot_token:e.botSecret,enabled:e.enabled,error:e.error,sessions:e.sessions.map(vt),status:e.status}),St=e=>({createdAt:e.created_at,path:e.path}),Ct=e=>({data:e.data??{},description:e.description??``,id:e.id,name:e.name,position:e.position??{x:0,y:0},type:e.type}),wt=e=>({data:e.data,description:e.description,id:e.id,name:e.name,position:e.position,type:e.type}),Tt=e=>({id:e.id,label:e.label??``,source:e.source,sourceHandle:e.source_handle??``,target:e.target,targetHandle:e.target_handle??``}),Et=e=>({id:e.id,label:e.label,source:e.source,source_handle:e.sourceHandle,target:e.target,target_handle:e.targetHandle}),Dt=e=>({edges:(e.edges??[]).map(Tt),nodes:(e.nodes??[]).map(Ct),version:e.version??1}),Ot=e=>({edges:e.edges.map(Et),nodes:e.nodes.map(wt),version:e.version}),kt=e=>({createdAt:e.created_at,definition:Dt(e.definition),id:e.id,name:e.name,updatedAt:e.updated_at}),At=e=>({created_at:e.createdAt,definition:Ot(e.definition),id:e.id,name:e.name,updated_at:e.updatedAt}),jt=e=>({nodeResults:e.node_results.map(e=>({error:e.error,id:e.id,output:e.output,status:e.status})),outputs:e.outputs,status:e.status,workflowId:e.workflow_id}),Mt=e=>({input:e.input??``,inputs:e.inputs??{},timer_id:e.timerId??``}),Nt=async(e,t)=>{try{let t=await e.json();if(typeof t.detail==`string`&&t.detail.trim())return t.detail}catch{return t}return t},Pt=e=>[e.command,...e.args].filter(Boolean).join(` `),Ft=e=>({description:e.description??``,inputSchema:e.input_schema??{},name:e.name,outputSchema:e.output_schema??null}),It=e=>({args:e.args??[],command:e.command??``,commandLine:Pt({args:e.args??[],command:e.command??``}),config:e.config??{},enabled:e.enabled,error:e.error??``,id:e.id,name:e.name,status:e.status??`disabled`,tools:(e.tools??[]).map(Ft),type:e.type,url:e.url??``}),Lt=e=>({args:e.args,command:e.command,config:e.config,enabled:e.enabled,error:e.error,id:e.id,name:e.name,status:e.status,tools:e.tools.map(e=>({description:e.description,input_schema:e.inputSchema,name:e.name,output_schema:e.outputSchema})),type:e.type,url:e.url}),Rt=()=>({args:[],command:``,commandLine:``,config:{},enabled:!0,error:``,id:`new`,name:``,status:`disabled`,tools:[],type:`command`,url:``}),zt=e=>{let t=[],n=``,r=``,i=!1;for(let a of e){if(i){n+=a,i=!1;continue}if(a===`\\`){i=!0;continue}if(r){a===r?r=``:n+=a;continue}if(a===`'`||a===`"`){r=a;continue}if(/\s/.test(a)){n&&=(t.push(n),``);continue}n+=a}return n&&t.push(n),{args:t.slice(1),command:t[0]??``}},Bt=e=>{let t=e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``);return t?`mcp-${t}`:ft(`mcp`)},Vt=async e=>{let t=await fetch(`/api/workflows`,{body:JSON.stringify(At(e)),headers:{"Content-Type":`application/json`},method:`PUT`});return t.ok?{data:kt(await t.json()),error:``}:{data:null,error:await Nt(t,`Workflow could not be saved.`)}},Ht=async e=>(await fetch(`/api/workflows/${encodeURIComponent(e)}`,{headers:{"Content-Type":`application/json`},method:`DELETE`})).ok,Ut=async(e,t={})=>{let n=await fetch(`/api/workflows/${encodeURIComponent(e)}/run`,{body:JSON.stringify(Mt(t)),headers:{"Content-Type":`application/json`},method:`POST`,signal:t.signal});return n.ok?{data:jt(await n.json()),error:``}:{data:null,error:await Nt(n,`Run could not be completed.`)}},Wt=(e=``)=>{let[t,n]=(0,b.useState)([]),[r,i]=(0,b.useState)(null),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(e),[l,u]=(0,b.useState)(0),d=(0,b.useMemo)(()=>t.find(e=>e.id===s)??null,[s,t]),f=(0,b.useCallback)(e=>{n(e),c(t=>t&&!e.some(e=>e.id===t)?``:t)},[]),p=(0,b.useCallback)(()=>{c(``),i(null),u(e=>e+1)},[]),m=(0,b.useCallback)(e=>{c(e)},[]),h=(0,b.useCallback)(()=>{c(``)},[]),g=(0,b.useCallback)(async e=>{let t=await Vt(e);if(!t.data)return t;let r=t.data;return n(e=>e.some(e=>e.id===r.id)?e.map(e=>e.id===r.id?r:e):[r,...e]),c(r.id),t},[]);return{activeWorkflow:d,activeWorkflowId:s,closeWorkflowEditor:h,deleteWorkflow:(0,b.useCallback)(async e=>await Ht(e)?(n(t=>t.filter(t=>t.id!==e)),i(t=>t?.workflowId===e?null:t),c(t=>t===e?``:t),!0):!1,[]),newWorkflowKey:l,openNewWorkflow:p,openWorkflow:m,replaceWorkflows:f,renameWorkflow:(0,b.useCallback)(async(e,n)=>{let r=t.find(t=>t.id===e);return r?g({...r,name:n}):{data:null,error:`Workflow could not be renamed.`}},[g,t]),runWorkflow:(0,b.useCallback)(async(e,t={})=>{o(e),t.timerId||i(null);try{let n=await Ut(e,t);return i(n.data),n}finally{t.timerId||o(``)}},[]),runningWorkflowId:a,finishWorkflowRun:(0,b.useCallback)(e=>{o(t=>t===e?``:t)},[]),saveWorkflow:g,workflowRunResult:r,workflows:t}},Gt=async()=>{let e=await fetch(`/api/state`);return e.ok?await e.json():null},Kt=async()=>{let e=await fetch(`/api/about`);return e.ok?await e.json():{}},qt=async e=>{await fetch(`/api/settings`,{body:JSON.stringify({agent_prompt:e.agentPrompt,context_window_limit:e.contextWindowLimit,reasoning_effort:e.reasoningEffort,selected_model:e.selectedModel,selected_provider_id:e.selectedProviderId}),headers:{"Content-Type":`application/json`},method:`PUT`})},Jt=async e=>{let t=await fetch(`/api/mcp/import/preview`,{body:JSON.stringify({source:e}),headers:{"Content-Type":`application/json`},method:`POST`});if(!t.ok)throw Error(`Scan could not be completed.`);return((await t.json()).servers??[]).map(e=>It(e))},Yt=async({serverId:e,source:t})=>{let n=await fetch(`/api/mcp/import`,{body:JSON.stringify({server_id:e,source:t}),headers:{"Content-Type":`application/json`},method:`POST`});if(!n.ok)throw Error(`Import could not be completed.`);return(await n.json()).map(e=>It(e))},Xt=async e=>{let t=await fetch(`/api/mcp/servers`,{body:JSON.stringify(Lt(e)),headers:{"Content-Type":`application/json`},method:`PUT`});return t.ok?It(await t.json()):null},Zt=async e=>{let t=await fetch(`/api/mcp/servers/${e}/reconnect`,{headers:{"Content-Type":`application/json`},method:`POST`});return t.ok?It(await t.json()):null},Qt=async e=>(await fetch(`/api/mcp/servers/${e}`,{headers:{"Content-Type":`application/json`},method:`DELETE`})).ok,$t=({showError:e})=>{let[t,n]=(0,b.useState)([]),[r,i]=(0,b.useState)(`new`),[a,o]=(0,b.useState)(()=>Rt()),[s,c]=(0,b.useState)(!1),[l,u]=(0,b.useState)([]),[d,f]=(0,b.useState)(`claude_code`),[p,m]=(0,b.useState)(!1),[h,g]=(0,b.useState)(``),_=r===`new`,v=(0,b.useMemo)(()=>t.some(e=>e.status===`starting`),[t]),y=(0,b.useCallback)(e=>{n(e),e[0]&&(i(e[0].id),o(e[0]))},[]),x=(0,b.useCallback)(e=>{c(!1),i(e.id),o(e)},[]),S=(0,b.useCallback)(()=>{c(!1),i(`new`),o(Rt())},[]),C=(0,b.useCallback)(e=>{o(t=>({...t,...e}))},[]),w=(0,b.useCallback)(async(t=d)=>{m(!0);try{u(await Jt(t))}catch{u([]),e(`Scan could not be completed.`)}finally{m(!1)}},[d,e]),T=(0,b.useCallback)(()=>{c(!0),u([]),f(`claude_code`),w(`claude_code`)},[w]),E=(0,b.useCallback)(async t=>{if(!l.some(e=>e.id===t)){e(`No servers found.`);return}g(t);try{let e=await Yt({serverId:t,source:d});n(e);let r=e.find(e=>e.id===t)??e[0];r&&(c(!1),i(r.id),o(r))}catch{e(`Import could not be completed.`)}finally{g(``)}},[l,d,e]),D=(0,b.useCallback)(e=>{f(e),u([]),w(e)},[w]),O=(0,b.useCallback)(async()=>{let e=a.type===`command`?zt(a.commandLine):{args:[],command:``},t=await Xt({...a,args:e.args,command:e.command,id:_||a.id===`new`?Bt(a.name):a.id,name:a.name.trim()||`Server`,tools:_?[]:a.tools,url:a.type===`url`?a.url:``});t&&(n(e=>_?[...e,t]:e.map(e=>e.id===t.id?t:e)),i(t.id),o(t))},[_,a]),k=(0,b.useCallback)(async()=>{if(_)return;let e=await Zt(a.id);e&&(n(t=>t.map(t=>t.id===e.id?e:t)),o(e))},[_,a.id]),A=(0,b.useCallback)(async()=>{if(!_&&await Qt(a.id)){let e=t.filter(e=>e.id!==a.id);n(e);let r=e[0];r?(i(r.id),o(r)):S()}},[_,a.id,t,S]);return(0,b.useEffect)(()=>{if(!v)return;let e=!0,t=async()=>{try{let t=await Gt();if(!t||!e)return;let r=(t.mcp_servers??[]).map(It);n(r),o(e=>{let t=r.find(t=>t.id===e.id);return t?{...e,error:t.error,status:t.status,tools:t.tools}:e})}catch{return}};t();let r=window.setInterval(()=>{t()},1e3);return()=>{e=!1,window.clearInterval(r)}},[v]),{importMcpServer:E,importingMcpServerId:h,isCreatingMcpServer:_,isMcpImportOpen:s,isPreviewingMcpImport:p,loadMcpEditor:x,mcpDraft:a,mcpImportPreview:l,mcpImportSource:d,mcpServers:t,openMcpImport:T,openNewMcpEditor:S,reconnectMcpServer:k,removeMcpServer:A,replaceMcpServers:y,saveMcpServer:O,updateMcpDraft:C,updateMcpImportSource:D}},en=async e=>{let t=await fetch(`/api/telegram-bot`,{body:JSON.stringify(xt(e)),headers:{"Content-Type":`application/json`},method:`PUT`});return t.ok?bt(await t.json()):null},tn=async e=>{let t=await fetch(`/api/telegram-bot/approve`,{body:JSON.stringify({chat_id:e}),headers:{"Content-Type":`application/json`},method:`POST`});return t.ok?_t(await t.json()):null},nn=async e=>{let t=await fetch(`/api/permissions/writable-paths`,{body:JSON.stringify({path:e}),headers:{"Content-Type":`application/json`},method:`DELETE`});return t.ok?((await t.json()).writable_paths??[]).map(St):null},rn=async e=>{let t=await fetch(`/api/permissions/writable-paths`,{body:JSON.stringify({path:e}),headers:{"Content-Type":`application/json`},method:`POST`});if(!t.ok)throw Error(`Directory could not be added.`);return St(await t.json())},an=async()=>{let e=await fetch(`/api/skills/reload`,{headers:{"Content-Type":`application/json`},method:`POST`});return e.ok?await e.json():null},on=async(e,t)=>{let n=await fetch(`/api/skills/${encodeURIComponent(e)}`,{body:JSON.stringify({enabled:t}),headers:{"Content-Type":`application/json`},method:`PUT`});return n.ok?await n.json():null},sn=()=>{let[e,t]=(0,b.useState)([]),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(()=>yt()),[o,s]=(0,b.useState)([]),c=(0,b.useMemo)(()=>e.find(e=>e.id===n)??e[0],[n,e]),l=(0,b.useCallback)(e=>{t(e),r(e[0]?.id??``)},[]),u=(0,b.useCallback)(e=>{r(e.id)},[]),d=(0,b.useCallback)(async()=>{let e=await an();e&&(t(e),r(t=>e.some(e=>e.id===t)?t:e[0]?.id??``))},[]),f=(0,b.useCallback)(async(e,n)=>{let r=await on(e.id,n);r&&t(e=>e.map(e=>e.id===r.id?r:e))},[]),p=(0,b.useCallback)(e=>{a(e)},[]),m=(0,b.useCallback)(e=>{a(t=>({...t,...e}))},[]),h=(0,b.useCallback)(async()=>{let e=await en(i);e&&a(e)},[i]),g=(0,b.useCallback)(async e=>{let t=await tn(e);t&&a(e=>({...e,sessions:e.sessions.map(e=>e.chatId===t.chatId?t:e)}))},[]),_=(0,b.useCallback)(e=>{s(e)},[]),v=(0,b.useCallback)(async e=>{let t=await nn(e);t&&s(t)},[]);return{activeSkill:c,addWritablePath:(0,b.useCallback)(async e=>{let t=await rn(e);s(e=>e.some(e=>e.path===t.path)?e:[...e,t])},[]),approveTelegramSession:g,reloadSkills:d,removeWritablePath:v,replaceSkills:l,replaceTelegramBot:p,replaceWritablePaths:_,saveTelegramBot:h,selectSkill:u,skills:e,telegramBot:i,toggleSkill:f,updateTelegramBot:m,writablePaths:o}},cn={access_denied:{description:`Check the key and account access.`,message:`Access denied.`},connection_failed:{description:`Check the address and try again.`,message:`Connection failed.`},provider_unavailable:{description:`The service is currently unreachable.`,message:`Provider unavailable.`},rate_limited:{description:`Please wait a moment and try again.`,message:`Too many requests.`},request_failed:{description:`Check the connection settings and try again.`,message:`Request failed.`}},ln=class extends Error{notification;constructor(e){super(e.message),this.name=`ProviderModelFetchError`,this.notification=e}},un=e=>typeof e==`string`&&e in cn,dn=async e=>{try{let t=(await e.json()).detail?.code;if(un(t))return t}catch{return`request_failed`}return`request_failed`},fn=async e=>{try{let t=await fetch(`/api/providers/models`,{body:JSON.stringify({base_url:e.baseUrl,provider:e.type,secret_reference:e.apiKey}),headers:{"Content-Type":`application/json`},method:`POST`});if(!t.ok)throw new ln(cn[await dn(t)]);return(await t.json()).models??[]}catch(e){throw e instanceof ln?e:new ln(cn.connection_failed)}},pn=async e=>{await fetch(`/api/providers`,{body:JSON.stringify(gt(e)),headers:{"Content-Type":`application/json`},method:`POST`})},mn=async e=>(await fetch(`/api/providers/${e}`,{headers:{"Content-Type":`application/json`},method:`DELETE`})).ok,hn=[{id:`openai`,label:`OpenAI`},{id:`openai_responses`,label:`OpenAI Responses`},{id:`anthropic`,label:`Anthropic`},{id:`gemini`,label:`Gemini`}],gn=()=>({apiKey:``,baseUrl:``,id:`new`,models:[],name:``,type:`openai`}),_n=({onContextWindowLimitChange:e,refreshAppState:t,showError:n})=>{let[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)(null),[d,f]=(0,b.useState)(`default`),[p,m]=(0,b.useState)([]),[h,g]=(0,b.useState)(`new`),[_,v]=(0,b.useState)(()=>gn()),[y,x]=(0,b.useState)(!1),S=(0,b.useMemo)(()=>p.find(e=>e.id===a),[p,a]),C=h===`new`,w=(0,b.useCallback)(e=>{m(e)},[]),T=(0,b.useCallback)(e=>{i(e.agentPrompt),o(e.selectedProviderId),c(e.selectedModel),u(e.contextWindowLimit),f(e.reasoningEffort)},[]),E=(0,b.useCallback)(e=>{g(e.id),v(e)},[]),D=(0,b.useCallback)(()=>{g(`new`),v(gn())},[]),O=(0,b.useCallback)(e=>{v(t=>({...t,...e}))},[]),k=(0,b.useCallback)(async e=>{T(e),await qt(e),await t()},[t,T]),A=(0,b.useCallback)(e=>{let t=p.find(t=>t.id===e);if(!t){o(``),c(``),k({agentPrompt:r,contextWindowLimit:l,reasoningEffort:d,selectedModel:``,selectedProviderId:``});return}o(t.id),c(``),k({agentPrompt:r,contextWindowLimit:l,reasoningEffort:d,selectedModel:``,selectedProviderId:t.id})},[r,l,k,p,d]),j=(0,b.useCallback)(e=>{c(e),k({agentPrompt:r,contextWindowLimit:l,reasoningEffort:d,selectedModel:e,selectedProviderId:a})},[r,l,k,d,a]),M=(0,b.useCallback)(e=>{f(e),qt({agentPrompt:r,contextWindowLimit:l,reasoningEffort:e,selectedModel:s,selectedProviderId:a})},[r,l,s,a]),N=(0,b.useCallback)(t=>{T(t),e(t.contextWindowLimit),k(t)},[e,k,T]),P=(0,b.useCallback)(async()=>{x(!0);try{let e=await fn(_);O({models:e}),e.length===0&&n({description:`No models available for this provider.`,message:`No models found.`})}catch(e){e instanceof ln&&n(e.notification)}finally{x(!1)}},[_,n,O]),F=(0,b.useCallback)(async()=>{let e={..._,id:C?ft(`provider`):_.id,name:_.name.trim()||hn.find(e=>e.id===_.type)?.label||`Provider`};m(t=>C?[...t,e]:t.map(t=>t.id===e.id?e:t)),g(e.id),v(e),a||(qt({agentPrompt:r,contextWindowLimit:l,reasoningEffort:d,selectedModel:``,selectedProviderId:e.id}),o(e.id),c(``)),await pn(e)},[r,l,C,_,d,a]);return{activeProvider:S,agentPrompt:r,contextWindowLimit:l,fetchProviderModels:P,handleActiveModelChange:j,handleActiveProviderChange:A,handleReasoningEffortChange:M,isCreatingProvider:C,isFetchingModels:y,loadProviderEditor:E,openNewProviderEditor:D,providerDraft:_,providers:p,reasoningEffort:d,removeProvider:(0,b.useCallback)(async()=>{if(C)return;let e=_.id;if(await mn(e)){let t=p.findIndex(t=>t.id===e),n=p.filter(t=>t.id!==e);m(n);let i=n[t]||n[t-1];if(i?E(i):D(),a===e){let e=i?.id??``,t=i?.models[0]??``;o(e),c(t),qt({agentPrompt:r,contextWindowLimit:l,reasoningEffort:d,selectedModel:t,selectedProviderId:e})}}},[r,l,C,E,D,_.id,p,d,a]),replaceProviders:w,replaceRuntimeSettings:T,saveProvider:F,saveRuntimeSettings:N,selectedModel:s,selectedProviderId:a,updateProviderDraft:O}},vn=e=>{if(e.groups?.length)return e.groups;let t=e.thinking?{content:e.thinking,id:`${e.id}-thinking-existing`,isStreaming:!1,type:`thinking`}:null,n=(e.tools??[]).map(e=>({id:`tool-${e.id}`,tool:e,type:`tool`})),r=[],i=[...t?[t]:[],...n];return i.length&&r.push({id:`${e.id}-process-existing`,items:i}),e.content&&r.push({id:`${e.id}-content-existing`,items:[{content:e.content,id:`${e.id}-text-existing`,type:`text`}]}),r},yn=(e,t)=>e.flatMap(e=>e.items).filter(e=>e.type===t).length,bn=e=>{for(let t=e.length-1;t>=0;--t){let n=e[t]?.items??[];for(let e=n.length-1;e>=0;--e){let t=n[e];if(t)return t}}return null},xn=(e,t)=>{let n=[],r=!1;for(let i of vn(e)){let e=[];for(let n of i.items){if(n.type===`error`&&n.id===t){r=!0;break}e.push(n)}if(r){e.length>0&&n.push({...i,items:e});break}n.push(i)}return r?{...e,content:n.flatMap(e=>e.items).filter(e=>e.type===`text`).map(e=>e.content).join(``),groups:n,isStreamingText:!1,isStreamingThinking:!1,status:`running`,thinking:n.flatMap(e=>e.items).filter(e=>e.type===`thinking`).map(e=>e.content).join(``),tools:n.flatMap(e=>e.items).filter(e=>e.type===`tool`).map(e=>e.tool)}:null},Sn=(e,t)=>({id:`${t||`assistant`}-error-1`,message:e,title:`Response interrupted`,type:`error`}),Cn=`Check the model connection settings and try again.`,wn=(e,t)=>({id:t,message:Cn,title:`Request failed`,type:`error`,...e&&e!==`Check the model connection settings and try again.`&&e!==`Request failed`?{detail:e}:{}}),Tn=(e,t=ft(`message`))=>({author:`assistant`,content:``,groups:[{id:`${t}-errors`,items:[wn(e,`${t}-error-1`)]}],id:t,status:`failed`}),En=(e,t,n)=>({...e,active_output:null,groups:[...e.groups??[],{id:`${e.id}-errors`,items:[wn(t,n)]}],isStreamingText:!1,isStreamingThinking:!1,status:`failed`}),Dn=(e,t=ft(`message`))=>({author:`assistant`,content:``,groups:[{id:`${t}-errors`,items:[{...e,id:e.id||`${t}-error-1`}]}],id:t,status:`failed`}),On=e=>(e.groups??[]).flatMap(e=>e.items).some(e=>e.type===`error`),kn=(e,t)=>e.slice(t).some(e=>e.author===`assistant`&&On(e)),An=e=>{for(let t=e.length-1;t>=0;--t){let n=e[t]?.usage_info;if(n)return n}return null},jn=e=>typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`,Mn=class extends Error{},Nn=class extends Error{errorMessage;outputError;constructor(e,t,n){super(e),this.errorMessage=n,this.outputError=t}},Pn=(e,t)=>{for(let n=t;n>=0;--n){let t=e[n];if(t?.author===`user`)return t}return null},Fn=e=>{let t=e.split(`
|
|
10
10
|
`),n=t.find(e=>e.startsWith(`id: `))?.slice(4),r=t.find(e=>e.startsWith(`event: `))?.slice(7),i=t.find(e=>e.startsWith(`data: `))?.slice(6);if(!r||!i)throw Error(`Message could not be sent.`);let a=n?Number(n):void 0;return{data:JSON.parse(i),event:r,eventIndex:Number.isSafeInteger(a)?a:void 0}},In=async(e,t)=>{if(!e.body)throw Error(`Message could not be sent.`);let n=e.body.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:a}=await n.read();i+=r.decode(a,{stream:!e});let o=i.split(`
|
|
11
11
|
|
|
12
12
|
`);i=o.pop()??``;for(let e of o){if(!e.trim())continue;let n=Fn(e);if(n.eventIndex!==void 0&&t.onEventIndex(n.eventIndex),n.event===`start`&&t.onStart(n.data.id),n.event===`output_start`&&t.onOutputStart(n.data.index),n.event===`output_done`&&t.onOutputDone(),n.event===`delta`&&t.onDelta(n.data.content),n.event===`thinking_delta`&&t.onThinkingDelta(n.data.content),n.event===`snapshot`&&t.onSnapshot(n.data.message),n.event===`context_optimized`&&(n.data.usage_info&&t.onUsage(n.data.usage_info),t.onContextOptimized(n.data.message)),n.event===`usage`&&t.onUsage(n.data.usage_info),n.event===`done`){t.onDone(n.data.message);return}if(n.event===`tool_start`&&t.onToolStart(n.data.tool),(n.event===`tool_update`||n.event===`tool_done`||n.event===`tool_error`)&&t.onToolDone(n.data),n.event===`error`){let e=n.data.error??Sn(n.data.message,``),r=t.onError(e)??null;throw new Nn(n.data.message,e,r)}}if(e)break}throw Error(`Message could not be sent.`)},Ln=async e=>{try{let t=await e.json();if(typeof t.detail==`string`)return t.detail}catch{return`Message could not be sent.`}return e.status===409?`Response in progress`:`Message could not be sent.`},Rn=async()=>{let e=await fetch(`/api/workspace/clear`,{headers:{"Content-Type":`application/json`},method:`POST`});if(!e.ok)throw Error(`Conversation could not be cleared.`);return await e.json()},zn=async({action:e,content:t,messageId:n})=>{let r=await fetch(`/api/workspace/messages/${encodeURIComponent(n)}/edit`,{body:JSON.stringify({action:e,content:t}),headers:{"Content-Type":`application/json`},method:`POST`});if(!r.ok){let e=``;try{let t=await r.json();typeof t.detail==`string`&&(e=t.detail)}catch{e=``}throw Error(e||(r.status===409?`Response in progress`:`Message could not be updated.`))}let i=await r.json();if(!Array.isArray(i.messages))throw Error(`Message could not be updated.`);return i},Bn=async({errorId:e,messageId:t})=>{let n=await fetch(`/api/workspace/messages/${encodeURIComponent(t)}/errors/${encodeURIComponent(e)}/retry`,{headers:{"Content-Type":`application/json`},method:`POST`});if(!n.ok)throw Error(await Ln(n));let r=await n.json();if(!Array.isArray(r.messages))throw Error(`Message could not be updated.`);return r},Vn=async({content:e,handlers:t,messageId:n,signal:r})=>{let i=await fetch(`/api/workspace/respond`,{body:JSON.stringify({content:e,message_id:n}),headers:{"Content-Type":`application/json`},method:`POST`,signal:r});if(!i.ok)throw new Mn(await Ln(i));await In(i,t)},Hn=async({after:e,handlers:t,signal:n})=>{let r=await fetch(`/api/workspace/stream?after=${e}`,{headers:{"Content-Type":`text/event-stream`},method:`GET`,signal:n});if(!r.ok)throw Error(await Ln(r));await In(r,t)},Un=async()=>{let e=await fetch(`/api/workspace/compact`,{headers:{"Content-Type":`application/json`},method:`POST`});if(!e.ok)throw Error(await Ln(e));return e},Wn=()=>fetch(`/api/workspace/stop`,{headers:{"Content-Type":`application/json`},method:`POST`}),Gn=({baseMessages:e,messagesRef:t,responseEventIndexRef:n,responseRun:r,responseRunRef:i,setIsResponding:a,setMessages:o,setTrackedUsageInfo:s,usageInfoRef:c})=>{let l=e.at(-1),u=l?.author===`assistant`?l:null,d=u,f=u?.content??``,p=u?.id??``,m=u?.thinking??``,h=``,g=0,_=u?vn(u):[],v=_.flatMap(e=>e.items).reverse().find(e=>e.type===`text`)?.id??``,y=yn(_,`text`),b=!1,x=!1,S=u?.tools??[],C=c.current,w=null,T=u?e.slice(0,-1):e,E=()=>i.current===r,D=()=>{let e=d?[...T,d]:[...T];t.current=e,o(e)},O=()=>{w!==null&&(window.cancelAnimationFrame(w),w=null)},k=()=>{O(),D()},A=()=>{E()&&w===null&&(w=window.requestAnimationFrame(()=>{w=null,E()&&D()}))},j=e=>{if(E()){if(k(),T.push(e),d){D();return}D()}},M=(e={})=>{if(!(!p||!E())){if(d={author:`assistant`,content:f,id:p,groups:_,thinking:m,isStreamingThinking:b,tools:S,isStreamingText:x,usage_info:C},e.immediate){k();return}A()}},N=()=>{b&&(b=!1,_=_.map(e=>({...e,items:e.items.map(e=>e.type===`thinking`?{...e,isStreaming:!1}:e)})))},P=e=>{let t=`${p||`assistant`}-group-${e}`;_.at(-1)?.id!==t&&(N(),v=``,x=!1,_=[..._,{id:t,items:[]}])},F=()=>{_.length===0&&P(1)},I=e=>{F();let t=_.length-1;_=_.map((n,r)=>r===t?{...n,items:e(n.items)}:n)},L=e=>{v=``,x=!1,h||(g+=1,h=`${p}-thinking-${g}`,I(e=>[...e,{content:``,id:h,isStreaming:!0,type:`thinking`}])),m+=e,b=!0,I(t=>t.map(t=>t.type===`thinking`&&t.id===h?{...t,content:t.content+e,isStreaming:!0}:t)),M()},ee=e=>{N(),v||(y+=1,v=`${p}-text-${y}`,I(e=>[...e,{content:``,id:v,type:`text`}])),f+=e,I(t=>t.map(t=>t.type===`text`&&t.id===v?{...t,content:t.content+e}:t)),x=!0,M()},te=e=>{if(N(),v=``,x=!1,e.id&&_.flatMap(e=>e.items).some(t=>t.type===`error`&&t.id===e.id)||I(t=>[...t,e]),!E())return null;let t=p||ft(`message`);p=t;let n=_.flatMap(e=>e.items).some(e=>e.type===`text`);return f&&!n&&(_=[{id:`${t}-content`,items:[{content:f,id:`${t}-text-1`,type:`text`}]},..._]),d={author:`assistant`,content:f,groups:_,id:t,isStreamingText:!1,isStreamingThinking:!1,status:`failed`,thinking:m,tools:S,usage_info:C},k(),d},ne=(e,t)=>{let n=null;S=S.map(r=>r.id===e?(n=t(r),n):r),_=_.map(r=>({...r,items:r.items.map(r=>r.type===`tool`&&r.tool.id===e?{...r,tool:n??t(r.tool)}:r)}))},R=()=>_.flatMap(e=>e.items).filter(e=>e.type===`thinking`).map(e=>e.content).join(``),z=()=>_.flatMap(e=>e.items).filter(e=>e.type===`text`).map(e=>e.content).join(``),B=e=>_.flatMap(e=>e.items).reverse().find(t=>t.type===e)?.id??``,re=(e,t=e.author===`assistant`&&e.status===`running`)=>{!E()||e.author!==`assistant`||(p=e.id,f=e.content,m=e.thinking??``,_=vn(e),S=e.tools??[],C=e.usage_info??C,e.usage_info&&s(e.usage_info),v=B(`text`),h=B(`thinking`),y=yn(_,`text`),g=yn(_,`thinking`),x=e.active_output===`text`&&t&&bn(_)?.type===`text`,b=e.active_output===`thinking`&&t&&m.length>0,_=_.map(e=>({...e,items:e.items.map(e=>e.type===`thinking`?{...e,isStreaming:b}:e)})),d={...e,groups:_,isStreamingThinking:b,isStreamingText:x,thinking:m,tools:S,usage_info:C},k())},ie=e=>!!(e.groups?.length||e.items?.length||e.tools?.length||e.status&&e.status!==`completed`),ae=e=>{if(ie(e)||_.length===0){re(e,!1);return}p=e.id,f=e.content;let t=e.thinking??``;m=t||m,N();let n=R();if(t&&n!==t){let r=t.startsWith(n)?t.slice(n.length):t;g+=1,I(t=>[...t,{content:r,id:`${e.id}-thinking-${g}`,isStreaming:!1,type:`thinking`}])}let r=z();e.content&&r!==e.content&&(y+=1,I(t=>[...t,{content:e.content.startsWith(r)?e.content.slice(r.length):e.content,id:`${e.id}-text-${y}`,type:`text`}])),d={...e,groups:_,isStreamingThinking:!1,isStreamingText:!1,thinking:m,tools:S,usage_info:e.usage_info??C},k()};return{onContextOptimized:j,onDelta:e=>{E()&&ee(e)},onDone:e=>{E()&&(ae(e),O(),n.current=0,a(!1))},onError:e=>{if(E())return te(e.id?e:{...e,id:`${p}-error-1`})},onOutputDone:()=>{E()&&(N(),v=``,x=!1,M({immediate:!0}))},onOutputStart:e=>{E()&&(P(e),M())},onSnapshot:re,onStart:e=>{E()&&(p=e,M())},onThinkingDelta:e=>{E()&&L(e)},onToolDone:e=>{E()&&(N(),v=``,x=!1,ne(e.id,t=>({...t,...e})),M())},onToolStart:e=>{E()&&(N(),v=``,x=!1,S=[...S,e],I(t=>[...t,{id:`tool-${e.id}`,tool:e,type:`tool`}]),M())},onUsage:e=>{E()&&(C=e,s(e),M({immediate:!0}))},onEventIndex:e=>{E()&&(n.current=e)}}};function Kn({refreshAppState:e,showError:t}){let[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)([]),[o,s]=(0,b.useState)(null),c=(0,b.useRef)(null),[l,u]=(0,b.useState)(!1),[d,f]=(0,b.useState)(!1),[p,m]=(0,b.useState)(``),h=(0,b.useRef)(null),g=(0,b.useRef)(0),_=(0,b.useRef)([]),v=(0,b.useRef)(0),[y,x]=(0,b.useState)(0),S=(0,b.useCallback)(e=>{if(typeof e!=`function`){c.current=e,s(e);return}s(t=>{let n=e(t);return c.current=n,n})},[]),C=(0,b.useCallback)(e=>{S(t=>mt(t,e))},[S]),w=(0,b.useCallback)((e,t={})=>{let n=!!e.is_responding;return a(e.messages),S(mt(e.usage_info??An(e.messages),e.settings.context_window_limit??null)),g.current=e.response_event_index??0,u(n),f(!!e.is_compacting),t.reconnectIfResponding&&n&&x(e=>e+1),{shouldResumeResponse:n}},[S]);(0,b.useEffect)(()=>{_.current=i},[i]),(0,b.useEffect)(()=>{if(!d)return;let t=window.setInterval(()=>{e().catch(()=>void 0)},1e3);return()=>{window.clearInterval(t)}},[d,e]);let T=(0,b.useCallback)(e=>{t(e)},[t]),E=(0,b.useCallback)((e,t)=>Gn({baseMessages:e,messagesRef:_,responseEventIndexRef:g,responseRun:t,responseRunRef:v,setIsResponding:u,setMessages:a,setTrackedUsageInfo:S,usageInfoRef:c}),[S]);(0,b.useEffect)(()=>{if(y===0)return;let t=v.current||1;v.current=t;let n=new AbortController;return h.current=n,u(!0),m(``),(async()=>{let r=E(_.current,t);try{await Hn({after:g.current,handlers:r,signal:n.signal})}catch(r){if(v.current!==t||n.signal.aborted)return;if((await e().catch(()=>null))?.is_responding){x(e=>e+1);return}g.current=0,u(!1),m(r instanceof Error?r.message:`Message could not be sent.`)}finally{v.current===t&&(h.current=null)}})(),()=>{n.abort()}},[E,e,y]);let D=async()=>{m(``),f(!0);let t=i.length,n=e=>{a(t=>t.some(t=>t.id===e.id)?t:[...t,e])},r=e=>{a(t=>{let n=t.findIndex(t=>t.id===e.id);return n>=0?t.map((t,r)=>r===n?e:t):[...t,e]})};try{await In(await Un(),{onEventIndex:()=>void 0,onContextOptimized:n,onDelta:()=>void 0,onDone:n,onError:()=>void 0,onOutputDone:()=>void 0,onOutputStart:()=>void 0,onSnapshot:r,onStart:()=>void 0,onThinkingDelta:()=>void 0,onToolDone:()=>void 0,onToolStart:()=>void 0,onUsage:S}),f(!1)}catch(n){if(jn(n)){e().catch(()=>void 0);return}if(n instanceof Nn){f(!1);return}let r=n instanceof Error?n.message:`Context could not be compacted.`;a(e=>kn(e,t)?e:[...e,Tn(r)]),f(!1)}},O=(0,b.useMemo)(()=>[{description:`Clear the conversation`,id:`clear`,label:`/clear`,name:`clear`},{description:`Compact context`,id:`compact`,label:`/compact`,name:`compact`}],[]),k=async()=>{let e=i,t=o;h.current?.abort(),h.current=null,g.current=0,v.current+=1,a([]),S(null),m(``),u(!1);try{let e=await Rn();Array.isArray(e.messages)&&a(e.messages),S(e.usage_info??null)}catch{a(e),S(t),T(`Conversation could not be cleared.`)}},A=e=>e===`clear`?(k(),!0):e===`compact`?l?(T(`Compact is unavailable while Flowent is responding.`),!1):(D(),!0):!1,j=e=>{T(e)},M=(e,t)=>e instanceof Error?e.message:t,N=(e,t,n)=>[...e,Tn(M(t,n))],P=(e,t,n,r,i)=>[...e,En(t,M(r,i),n)],F=()=>{l&&Wn(),v.current+=1,g.current=0,h.current?.abort(),h.current=null,m(``),u(!1)},I=async(t=n,o=i,s={})=>{if(t.length===0||l||d)return;let c=s.clearDraft??o===i,f=v.current+1,p=new AbortController;h.current=p,v.current=f,g.current=0;let _=t,y=ft(`message`),b=[...o,{author:`user`,content:_,id:y}];m(``),u(!0),a(b),c&&r(``);try{await Vn({content:_,handlers:E(b,f),messageId:y,signal:p.signal})}catch(t){if(v.current!==f||t instanceof DOMException&&t.name===`AbortError`&&p.signal.aborted)return;if(t instanceof Error&&t.message===`Response in progress`){a(o),c&&r(_),u(!1),T(t.message);return}if(!(t instanceof Mn)){let t=await e().catch(()=>null);if(t?.is_responding){x(e=>e+1);return}if(t?.messages&&kn(t.messages,o.length)){a(t.messages),u(!1);return}}if(t instanceof Nn){a([...b,t.errorMessage??Dn(t.outputError)]),u(!1);return}a(e=>kn(e,o.length)?e:N(b,t,`Message could not be sent.`)),u(!1)}finally{v.current===f&&(h.current=null)}},L=e=>{v.current+=1,g.current=0,a(e),u(!0),x(e=>e+1)};return{commands:O,draft:n,editMessage:async({action:e,content:t,messageId:n})=>{if(l)return;let r=i.findIndex(e=>e.id===n);if(r<0||i[r].author!==`user`)return;let o=i;m(``),e===`resend`&&u(!0);try{let r=await zn({action:e,content:t,messageId:n});if(e===`resend`){if(!r.is_responding)throw Error(`Message could not be sent.`);L(r.messages);return}a(r.messages)}catch(n){a(e===`resend`?N([...o.slice(0,r),{...o[r],content:t}],n,`Message could not be updated.`):o),e===`resend`&&u(!1),e!==`resend`&&T(M(n,`Message could not be updated.`))}},handleCommandError:j,isRefiningContext:d,isResponding:l,loadState:w,messages:i,responseError:p,retryError:async({errorId:e,messageId:t})=>{if(l)return;let n=i.findIndex(e=>e.id===t);if(n<0||i[n].author!==`assistant`)return;let r=xn(i[n],e);if(!r)return;let o=[...i.slice(0,n),r];m(``),u(!0),a(o);try{let n=await Bn({errorId:e,messageId:t});if(!n.is_responding)throw Error(`Message could not be sent.`);L(n.messages)}catch(t){a(P(i.slice(0,n),r,e,t,`Message could not be sent.`)),u(!1)}},retryMessage:async e=>{if(l)return;let t=i.findIndex(t=>t.id===e);if(t<0)return;let n=i[t],r=n.author===`user`?n:Pn(i,t-1);if(!r)return;let o=i.findIndex(e=>e.id===r.id);m(``),u(!0);try{let e=await zn({action:`resend`,content:r.content,messageId:r.id});if(!e.is_responding)throw Error(`Message could not be sent.`);L(e.messages)}catch(e){a(N(i.slice(0,o+1),e,`Message could not be updated.`)),u(!1)}},runCommand:A,sendMessage:I,setContextWindowLimit:C,setDraft:r,stopResponse:F,usageInfo:o}}function qn({loadWorkspaceState:e,mcpServers:t,replaceMcpServers:n,replaceProviders:r,replaceRuntimeSettings:i,replaceSkills:a,replaceTelegramBot:o,replaceWorkflows:s,replaceWritablePaths:c,showError:l,skills:u,telegramBot:d}){let[f,p]=(0,b.useState)(``),m=(0,b.useRef)(new Set),h=(0,b.useRef)(!1);(0,b.useEffect)(()=>{let e=new Set,n=(t,n)=>{e.add(t),!m.current.has(t)&&l(n)};d.status===`error`&&d.error&&n(`channel:telegram:${d.error}`,d.error);for(let e of t)e.status!==`error`||!e.error||n(`mcp:${e.id}:${e.error}`,e.error);for(let e of u)!e.enabled||!e.error||n(`skill:${e.id}:${e.error}`,e.error);m.current=e},[t,l,u,d]);let g=(0,b.useCallback)(t=>{r(t.providers.map(ht));let l=(t.mcp_servers??[]).map(It);n(l);let u=t.skills??[];a(u),i({agentPrompt:t.settings.agent_prompt??``,contextWindowLimit:t.settings.context_window_limit??null,reasoningEffort:t.settings.reasoning_effort??`default`,selectedModel:t.settings.selected_model,selectedProviderId:t.settings.selected_provider_id});let d=bt(t.telegram_bot);o(d),c((t.writable_paths??[]).map(St)),s((t.workflows??[]).map(kt)),e(t,{reconnectIfResponding:!h.current}),h.current||=(m.current=new Set(pt(d,l,u)),!0)},[e,n,r,i,a,o,s,c]),_=(0,b.useCallback)(async()=>{let e=await Gt();return e?(g(e),e):null},[g]);return(0,b.useEffect)(()=>{let e=!0;return(async()=>{try{let[t,n]=await Promise.all([_(),Kt()]);if(!t||!e)return;p(typeof n.version==`string`?n.version:``)}catch{return}})(),()=>{e=!1}},[_]),{appVersion:f,refreshAppState:_}}var Jn=new Set([`workspace`,`workflows`,`providers`,`channels`,`mcp`,`permissions`,`skills`,`settings`]),Yn={view:`workspace`,workflowId:``},Xn=e=>e&&Jn.has(e)?e:Yn.view,Zn=e=>{try{return decodeURIComponent(e)}catch{return``}},Qn=e=>{let[t,n=``]=e.split(`/`).filter(Boolean).map(Zn);return t?t===`workflows`?{view:`workflows`,workflowId:n}:Jn.has(t)?{view:t,workflowId:``}:null:Yn},$n=e=>{let t=new URLSearchParams(e),n=Xn(t.get(`view`));return{view:n,workflowId:n===`workflows`?t.get(`workflow`)??``:``}},er=(e=window.location)=>{let t=Qn(e.pathname),n=new URLSearchParams(e.search).has(`view`);return t&&(!n||t.view!==Yn.view)?t:$n(e.search)},tr=({view:e,workflowId:t})=>e===`workflows`?t?`/workflows/${encodeURIComponent(t)}`:`/workflows`:e===Yn.view?`/`:`/${e}`,nr=(e,t={})=>{let n=`${tr(e)}${window.location.hash}`;if(n!==`${window.location.pathname}${window.location.search}${window.location.hash}`){if(t.replace){window.history.replaceState(null,``,n);return}window.history.pushState(null,``,n)}},rr=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),ir=s(((e,t)=>{t.exports=rr()})),ar=(0,b.createContext)({});function or(e){let t=(0,b.useRef)(null);return t.current===null&&(t.current=e()),t.current}var sr=typeof window<`u`?b.useLayoutEffect:b.useEffect,cr=(0,b.createContext)(null);function lr(e,t){e.indexOf(t)===-1&&e.push(t)}function ur(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var dr=(e,t,n)=>n>t?t:n<e?e:n,fr={},pr=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),mr=e=>typeof e==`object`&&!!e,hr=e=>/^0[^.\s]+$/u.test(e);function gr(e){let t;return()=>(t===void 0&&(t=e()),t)}var _r=e=>e,vr=(...e)=>e.reduce((e,t)=>n=>t(e(n))),yr=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},br=class{constructor(){this.subscriptions=[]}add(e){return lr(this.subscriptions,e),()=>ur(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},xr=e=>e*1e3,Sr=e=>e/1e3,Cr=(e,t)=>t?1e3/t*e:0,wr=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Tr=1e-7,Er=12;function Dr(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=wr(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Tr&&++s<Er);return o}function Or(e,t,n,r){if(e===t&&n===r)return _r;let i=t=>Dr(t,0,1,e,n);return e=>e===0||e===1?e:wr(i(e),t,r)}var kr=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ar=e=>t=>1-e(1-t),jr=Or(.33,1.53,.69,.99),Mr=Ar(jr),Nr=kr(Mr),Pr=e=>e>=1?1:(e*=2)<1?.5*Mr(e):.5*(2-2**(-10*(e-1))),Fr=e=>1-Math.sin(Math.acos(e)),Ir=Ar(Fr),Lr=kr(Fr),Rr=Or(.42,0,1,1),zr=Or(0,0,.58,1),Br=Or(.42,0,.58,1),Vr=e=>Array.isArray(e)&&typeof e[0]!=`number`,Hr=e=>Array.isArray(e)&&typeof e[0]==`number`,Ur={linear:_r,easeIn:Rr,easeInOut:Br,easeOut:zr,circIn:Fr,circInOut:Lr,circOut:Ir,backIn:Mr,backInOut:Nr,backOut:jr,anticipate:Pr},Wr=e=>typeof e==`string`,Gr=e=>{if(Hr(e)){e.length;let[t,n,r,i]=e;return Or(t,n,r,i)}else if(Wr(e))return Ur[e],`${e}`,Ur[e];return e},Kr=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],qr={value:null,addProjectionMetrics:null};function Jr(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&qr.value&&qr.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var Yr=40;function Xr(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Kr.reduce((e,n)=>(e[n]=Jr(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=fr.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,Yr),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Kr.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Kr.length;t++)o[Kr[t]].cancel(e)},state:i,steps:o}}var{schedule:Zr,cancel:Qr,state:$r,steps:ei}=Xr(typeof requestAnimationFrame<`u`?requestAnimationFrame:_r,!0),ti;function ni(){ti=void 0}var ri={now:()=>(ti===void 0&&ri.set($r.isProcessing||fr.useManualTiming?$r.timestamp:performance.now()),ti),set:e=>{ti=e,queueMicrotask(ni)}},ii={layout:0,mainThread:0,waapi:0},ai=e=>t=>typeof t==`string`&&t.startsWith(e),oi=ai(`--`),si=ai(`var(--`),ci=e=>si(e)?li.test(e.split(`/*`)[0].trim()):!1,li=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ui(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var di={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},fi={...di,transform:e=>dr(0,1,e)},pi={...di,default:1},mi=e=>Math.round(e*1e5)/1e5,hi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function gi(e){return e==null}var _i=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vi=(e,t)=>n=>!!(typeof n==`string`&&_i.test(n)&&n.startsWith(e)||t&&!gi(n)&&Object.prototype.hasOwnProperty.call(n,t)),yi=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(hi);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},bi=e=>dr(0,255,e),xi={...di,transform:e=>Math.round(bi(e))},Si={test:vi(`rgb`,`red`),parse:yi(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+xi.transform(e)+`, `+xi.transform(t)+`, `+xi.transform(n)+`, `+mi(fi.transform(r))+`)`};function Ci(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var wi={test:vi(`#`),parse:Ci,transform:Si.transform},Ti=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ei=Ti(`deg`),Di=Ti(`%`),G=Ti(`px`),Oi=Ti(`vh`),ki=Ti(`vw`),Ai={...Di,parse:e=>Di.parse(e)/100,transform:e=>Di.transform(e*100)},ji={test:vi(`hsl`,`hue`),parse:yi(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Di.transform(mi(t))+`, `+Di.transform(mi(n))+`, `+mi(fi.transform(r))+`)`},Mi={test:e=>Si.test(e)||wi.test(e)||ji.test(e),parse:e=>Si.test(e)?Si.parse(e):ji.test(e)?ji.parse(e):wi.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Si.transform(e):ji.transform(e),getAnimatableNone:e=>{let t=Mi.parse(e);return t.alpha=0,Mi.transform(t)}},Ni=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Pi(e){return isNaN(e)&&typeof e==`string`&&(e.match(hi)?.length||0)+(e.match(Ni)?.length||0)>0}var Fi=`number`,Ii=`color`,Li=`var`,Ri=`var(`,zi="${}",Bi=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Vi(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Bi,e=>(Mi.test(e)?(r.color.push(a),i.push(Ii),n.push(Mi.parse(e))):e.startsWith(Ri)?(r.var.push(a),i.push(Li),n.push(e)):(r.number.push(a),i.push(Fi),n.push(parseFloat(e))),++a,zi)).split(zi),indexes:r,types:i}}function Hi(e){return Vi(e).values}function Ui({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===Fi?i+=mi(r[a]):e===Ii?i+=Mi.transform(r[a]):i+=r[a]}return i}}function Wi(e){return Ui(Vi(e))}var Gi=e=>typeof e==`number`?0:Mi.test(e)?Mi.getAnimatableNone(e):e,Ki=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Gi(e);function qi(e){let t=Vi(e);return Ui(t)(t.values.map((e,n)=>Ki(e,t.split[n])))}var Ji={test:Pi,parse:Hi,createTransformer:Wi,getAnimatableNone:qi};function Yi(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Xi({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Yi(s,r,e+1/3),a=Yi(s,r,e),o=Yi(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Zi(e,t){return n=>n>0?t:e}var Qi=(e,t,n)=>e+(t-e)*n,$i=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},ea=[wi,Si,ji],ta=e=>ea.find(t=>t.test(e));function na(e){let t=ta(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===ji&&(n=Xi(n)),n}var ra=(e,t)=>{let n=na(e),r=na(t);if(!n||!r)return Zi(e,t);let i={...n};return e=>(i.red=$i(n.red,r.red,e),i.green=$i(n.green,r.green,e),i.blue=$i(n.blue,r.blue,e),i.alpha=Qi(n.alpha,r.alpha,e),Si.transform(i))},ia=new Set([`none`,`hidden`]);function aa(e,t){return ia.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function oa(e,t){return n=>Qi(e,t,n)}function sa(e){return typeof e==`number`?oa:typeof e==`string`?ci(e)?Zi:Mi.test(e)?ra:da:Array.isArray(e)?ca:typeof e==`object`?Mi.test(e)?ra:la:Zi}function ca(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>sa(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function la(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=sa(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function ua(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var da=(e,t)=>{let n=Ji.createTransformer(t),r=Vi(e),i=Vi(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?ia.has(e)&&!i.values.length||ia.has(t)&&!r.values.length?aa(e,t):vr(ca(ua(r,i),i.values),n):(`${e}${t}`,Zi(e,t))};function fa(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Qi(e,t,n):sa(e)(e,t)}var pa=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Zr.update(t,e),stop:()=>Qr(t),now:()=>$r.isProcessing?$r.timestamp:ri.now()}},ma=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},ha=2e4;function ga(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function _a(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(ga(r),ha);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Sr(i)}}var va={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function ya(e,t){return e*Math.sqrt(1-t*t)}var ba=12;function xa(e,t,n){let r=n;for(let n=1;n<ba;n++)r-=e(r)/t(r);return r}var Sa=.001;function Ca({duration:e=va.duration,bounce:t=va.bounce,velocity:n=va.velocity,mass:r=va.mass}){let i,a;va.maxDuration;let o=1-t;o=dr(va.minDamping,va.maxDamping,o),e=dr(va.minDuration,va.maxDuration,Sr(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=ya(t,o),c=Math.exp(-i);return Sa-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=ya(t**2,o);return(-i(t)+Sa>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-Sa+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=xa(i,a,s);if(e=xr(e),isNaN(c))return{stiffness:va.stiffness,damping:va.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var wa=[`duration`,`bounce`],Ta=[`stiffness`,`damping`,`mass`];function Ea(e,t){return t.some(t=>e[t]!==void 0)}function Da(e){let t={velocity:va.velocity,stiffness:va.stiffness,damping:va.damping,mass:va.mass,isResolvedFromDuration:!1,...e};if(!Ea(e,Ta)&&Ea(e,wa))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*dr(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:va.mass,stiffness:i,damping:a}}else{let n=Ca({...e,velocity:0});t={...t,...n,mass:va.mass},t.isResolvedFromDuration=!0}return t}function Oa(e=va.visualDuration,t=va.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Da({...n,velocity:-Sr(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Sr(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?va.restSpeed.granular:va.restSpeed.default,i||=v?va.restDelta.granular:va.restDelta.default;let y,b,x,S,C,w;if(h<1)x=ya(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>xr(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=xr(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=xr(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(ga(T),ha),t=ma(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Oa.applyToOptions=e=>{let t=_a(e,100,Oa);return e.ease=t.ease,e.duration=xr(t.duration),e.type=`keyframes`,e};var ka=5;function Aa(e,t,n){let r=Math.max(t-ka,0);return Cr(n-e(r),t-r)}function ja({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Oa({keyframes:[f.value,m(f.value)],velocity:Aa(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Ma(e,t,n){let r=[],i=n||fr.mix||fa,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=vr(Array.isArray(t)?t[n]||_r:t,a)),r.push(a)}return r}function Na(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Ma(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=yr(e[r],e[r+1],n);return s[r](i)};return n?t=>l(dr(e[0],e[a-1],t)):l}function Pa(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=yr(0,t,r);e.push(Qi(n,1,i))}}function Fa(e){let t=[0];return Pa(t,e.length-1),t}function Ia(e,t){return e.map(e=>e*t)}function La(e,t){return e.map(()=>t||Br).splice(0,e.length-1)}function Ra({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Vr(r)?r.map(Gr):Gr(r),a={done:!1,value:t[0]},o=Na(Ia(n&&n.length===t.length?n:Fa(t),e),t,{ease:Array.isArray(i)?i:La(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var za=e=>e!==null;function Ba(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(za),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Va={decay:ja,inertia:ja,tween:Ra,keyframes:Ra,spring:Oa};function Ha(e){typeof e.type==`string`&&(e.type=Va[e.type])}var Ua=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Wa=e=>e/100,Ga=class extends Ua{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==ri.now()&&this.tick(ri.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},ii.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Ha(e);let{type:t=Ra,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Ra;s!==Ra&&typeof o[0]!=`number`&&(this.mixKeyframes=vr(Wa,fa(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=ga(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=dr(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==ja&&(b.value=Ba(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Sr(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Sr(e)}get time(){return Sr(this.currentTime)}set time(e){e=xr(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return Aa(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(ri.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Sr(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=pa,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(ri.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,ii.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Ka(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var qa=e=>e*180/Math.PI,Ja=e=>Xa(qa(Math.atan2(e[1],e[0]))),Ya={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ja,rotateZ:Ja,skewX:e=>qa(Math.atan(e[1])),skewY:e=>qa(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Xa=e=>(e%=360,e<0&&(e+=360),e),Za=Ja,Qa=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),$a=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),eo={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Qa,scaleY:$a,scale:e=>(Qa(e)+$a(e))/2,rotateX:e=>Xa(qa(Math.atan2(e[6],e[5]))),rotateY:e=>Xa(qa(Math.atan2(-e[2],e[0]))),rotateZ:Za,rotate:Za,skewX:e=>qa(Math.atan(e[4])),skewY:e=>qa(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function to(e){return+!!e.includes(`scale`)}function no(e,t){if(!e||e===`none`)return to(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=eo,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Ya,i=t}if(!i)return to(t);let a=r[t],o=i[1].split(`,`).map(io);return typeof a==`function`?a(o):o[a]}var ro=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return no(n,t)};function io(e){return parseFloat(e.trim())}var ao=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],oo=new Set([...ao,`pathRotation`]),K=e=>e===di||e===G,so=new Set([`x`,`y`,`z`]),co=ao.filter(e=>!so.has(e));function lo(e){let t=[];return co.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var uo={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>no(t,`x`),y:(e,{transform:t})=>no(t,`y`)};uo.translateX=uo.x,uo.translateY=uo.y;var fo=new Set,po=!1,mo=!1,ho=!1;function go(){if(mo){let e=Array.from(fo).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=lo(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}mo=!1,po=!1,fo.forEach(e=>e.complete(ho)),fo.clear()}function _o(){fo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(mo=!0)})}function vo(){ho=!0,_o(),go(),ho=!1}var yo=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(fo.add(this),po||(po=!0,Zr.read(_o),Zr.resolveKeyframes(go))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Ka(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),fo.delete(this)}cancel(){this.state===`scheduled`&&(fo.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},bo=e=>e.startsWith(`--`);function xo(e,t,n){bo(t)?e.style.setProperty(t,n):e.style[t]=n}var So={};function Co(e,t){let n=gr(e);return()=>So[t]??n()}var wo=Co(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),To=Co(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Eo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Do={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Eo([0,.65,.55,1]),circOut:Eo([.55,0,1,.45]),backIn:Eo([.31,.01,.66,-.59]),backOut:Eo([.33,1.53,.69,.99])};function Oo(e,t){if(e)return typeof e==`function`?To()?ma(e,t):`ease-out`:Hr(e)?Eo(e):Array.isArray(e)?e.map(e=>Oo(e,t)||Do.easeOut):Do[e]}function ko(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Oo(s,i);Array.isArray(d)&&(u.easing=d),qr.value&&ii.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return qr.value&&p.finished.finally(()=>{ii.waapi--}),p}function Ao(e){return typeof e==`function`&&`applyToOptions`in e}function jo({type:e,...t}){return Ao(e)&&To()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Mo=class extends Ua{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=jo(e);this.animation=ko(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Ba(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),xo(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Sr(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Sr(e)}get time(){return Sr(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=xr(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&wo()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),_r):r(this)}},No={anticipate:Pr,backInOut:Nr,circInOut:Lr};function Po(e){return e in No}function Fo(e){typeof e.ease==`string`&&Po(e.ease)&&(e.ease=No[e.ease])}var Io=10,Lo=class extends Mo{constructor(e){Fo(e),Ha(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Ga({...a,autoplay:!1}),s=Math.max(Io,ri.now()-this.startTime),c=dr(0,Io,s-Io),l=o.sample(s).value,{name:u}=this.options;i&&u&&xo(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Ro=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Ji.test(e)||e===`0`)&&!e.startsWith(`url(`));function zo(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Bo(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Ro(i,t),s=Ro(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:zo(e)||(n===`spring`||Ao(n))&&r}function Vo(e){e.duration=0,e.type=`keyframes`}var Ho=new Set([`opacity`,`clipPath`,`filter`,`transform`]),Uo=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Wo(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Uo.test(e[t]))return!0;return!1}var Go=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Ko=gr(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function qo(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return Ko()&&n&&(Ho.has(n)||Go.has(n)&&Wo(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Jo=40,Yo=class extends Ua{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ri.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||yo;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=ri.now();let u=!0;Bo(e,i,a,o)||(u=!1,(fr.instantAnimations||!s)&&l?.(Ba(e,n,t)),e[0]=e[e.length-1],Vo(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>Jo?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&qo(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new Lo({...d,element:p})}catch{m=new Ga(d)}else m=new Ga(d);m.finished.then(()=>{this.notifyFinished()}).catch(_r),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),vo()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Xo(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Zo=30,Qo=e=>!isNaN(parseFloat(e)),$o={current:void 0},es=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=ri.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=ri.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Qo(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new br);let n=this.events[e].add(t);return e===`change`?()=>{n(),Zr.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return $o.current&&$o.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=ri.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Zo)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Zo);return Cr(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function ts(e,t){return new es(e,t)}function ns(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function rs(e,t){let n=e?.[t]??e?.default??e;return n===e?n:ns(n,e)}var is={type:`spring`,stiffness:500,damping:25,restSpeed:10},as=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),os={type:`keyframes`,duration:.8},ss={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},cs=(e,{keyframes:t})=>t.length>2?os:oo.has(e)?e.startsWith(`scale`)?as(t[1]):is:ss,ls=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function us(e){for(let t in e)if(!ls.has(t))return!0;return!1}var ds=(e,t,n,r={},i,a)=>o=>{let s=rs(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=xr(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};us(s)||Object.assign(u,cs(e,u)),u.duration&&=xr(u.duration),u.repeatDelay&&=xr(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Vo(u),u.delay===0&&(d=!0)),(fr.instantAnimations||fr.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Vo(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Ba(u.keyframes,s);if(e!==void 0){Zr.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Ga(u):new Yo(u)},fs=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ps(e){let t=fs.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function ms(e,t,n=1){`${e}`;let[r,i]=ps(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return pr(e)?parseFloat(e):e}return ci(i)?ms(i,t,n+1):i}function hs(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function gs(e,t,n,r){if(typeof t==`function`){let[i,a]=hs(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=hs(r);t=t(n===void 0?e.custom:n,i,a)}return t}function _s(e,t,n){let r=e.getProps();return gs(r,t,n===void 0?r.custom:n,e)}var vs=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...ao]),ys=e=>Array.isArray(e);function bs(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ts(n))}function xs(e){return ys(e)?e[e.length-1]||0:e}function Ss(e,t){let{transitionEnd:n={},transition:r={},...i}=_s(e,t)||{};i={...i,...n};for(let t in i)bs(e,t,xs(i[t]))}var Cs=e=>!!(e&&e.getVelocity);function ws(e){return!!(Cs(e)&&e.add)}function Ts(e,t){let n=e.getValue(`willChange`);if(ws(n))return n.add(t);if(!n&&fr.WillChange){let n=new fr.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Es(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Ds=`data-`+Es(`framerAppearId`);function Os(e){return e.props[Ds]}function ks({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function As(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?ns(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&ks(f,t))continue;let o={delay:n,...rs(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Zr.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=Os(e);if(n){let e=window.MotionHandoffAnimation(n,t,Zr);e!==null&&(o.startTime=e,p=!0)}}Ts(e,t);let m=l??e.shouldReduceMotion;r.start(ds(t,r,i,m&&vs.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Zr.update(()=>{o&&Ss(e,o)});d.length?Promise.all(d).then(t):t()}return d}function js(e,t,n={}){let r=_s(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(As(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Ms(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function Ms(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(js(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Xo(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Ns(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>js(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=js(e,t,n);else{let i=typeof t==`function`?_s(e,t,n.custom):t;r=Promise.all(As(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Ps={test:e=>e===`auto`,parse:e=>e},Fs=e=>t=>t.test(e),Is=[di,G,Di,Ei,ki,Oi,Ps],Ls=e=>Is.find(Fs(e));function Rs(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||hr(e)}var zs=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Bs(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(hi)||[];if(!r)return e;let i=n.replace(r,``),a=+!!zs.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Vs=/\b([a-z-]*)\(.*?\)/gu,Hs={...Ji,getAnimatableNone:e=>{let t=e.match(Vs);return t?t.map(Bs).join(` `):e}},Us={...Ji,getAnimatableNone:e=>{let t=Ji.parse(e);return Ji.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Ws={...di,transform:Math.round},Gs={borderWidth:G,borderTopWidth:G,borderRightWidth:G,borderBottomWidth:G,borderLeftWidth:G,borderRadius:G,borderTopLeftRadius:G,borderTopRightRadius:G,borderBottomRightRadius:G,borderBottomLeftRadius:G,width:G,maxWidth:G,height:G,maxHeight:G,top:G,right:G,bottom:G,left:G,inset:G,insetBlock:G,insetBlockStart:G,insetBlockEnd:G,insetInline:G,insetInlineStart:G,insetInlineEnd:G,padding:G,paddingTop:G,paddingRight:G,paddingBottom:G,paddingLeft:G,paddingBlock:G,paddingBlockStart:G,paddingBlockEnd:G,paddingInline:G,paddingInlineStart:G,paddingInlineEnd:G,margin:G,marginTop:G,marginRight:G,marginBottom:G,marginLeft:G,marginBlock:G,marginBlockStart:G,marginBlockEnd:G,marginInline:G,marginInlineStart:G,marginInlineEnd:G,fontSize:G,backgroundPositionX:G,backgroundPositionY:G,rotate:Ei,pathRotation:Ei,rotateX:Ei,rotateY:Ei,rotateZ:Ei,scale:pi,scaleX:pi,scaleY:pi,scaleZ:pi,skew:Ei,skewX:Ei,skewY:Ei,distance:G,translateX:G,translateY:G,translateZ:G,x:G,y:G,z:G,perspective:G,transformPerspective:G,opacity:fi,originX:Ai,originY:Ai,originZ:G,zIndex:Ws,fillOpacity:fi,strokeOpacity:fi,numOctaves:Ws},Ks={...Gs,color:Mi,backgroundColor:Mi,outlineColor:Mi,fill:Mi,stroke:Mi,borderColor:Mi,borderTopColor:Mi,borderRightColor:Mi,borderBottomColor:Mi,borderLeftColor:Mi,filter:Hs,WebkitFilter:Hs,mask:Us,WebkitMask:Us},qs=e=>Ks[e],Js=new Set([Hs,Us]);function Ys(e,t){let n=qs(e);return Js.has(n)||(n=Ji),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Xs=new Set([`auto`,`none`,`0`]);function Zs(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Xs.has(t)&&Vi(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Ys(n,i)}var Qs=class extends yo{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),ci(r))){let i=ms(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!vs.has(n)||e.length!==2)return;let[r,i]=e,a=Ls(r),o=Ls(i);if(ui(r)!==ui(i)&&uo[n]){this.needsMeasurement=!0;return}if(a!==o)if(K(a)&&K(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else uo[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Rs(e[t]))&&n.push(t);n.length&&Zs(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=uo[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=uo[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function $s(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var ec=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function tc(e){return mr(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:nc,cancel:rc}=Xr(queueMicrotask,!1),ic={x:!1,y:!1};function ac(){return ic.x||ic.y}function oc(e){return e===`x`||e===`y`?ic[e]?null:(ic[e]=!0,()=>{ic[e]=!1}):ic.x||ic.y?null:(ic.x=ic.y=!0,()=>{ic.x=ic.y=!1})}function sc(e,t){let n=$s(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function cc(e){return!(e.pointerType===`touch`||ac())}function lc(e,t,n={}){let[r,i,a]=sc(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!cc(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var uc=(e,t)=>t?e===t?!0:uc(e,t.parentElement):!1,dc=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,fc=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function pc(e){return fc.has(e.tagName)||e.isContentEditable===!0}var mc=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function hc(e){return mc.has(e.tagName)||e.isContentEditable===!0}var gc=new WeakSet;function _c(e){return t=>{t.key===`Enter`&&e(t)}}function vc(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var yc=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=_c(()=>{if(gc.has(n))return;vc(n,`down`);let e=_c(()=>{vc(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>vc(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function bc(e){return dc(e)&&!ac()}var xc=new WeakSet;function Sc(e,t,n={}){let[r,i,a]=sc(e,n),o=e=>{let r=e.currentTarget;if(!bc(e)||xc.has(e))return;gc.add(r),n.stopPropagation&&xc.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),gc.has(r)&&gc.delete(r),bc(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||uc(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),tc(e)&&(e.addEventListener(`focus`,e=>yc(e,i)),!pc(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Cc(e){return mr(e)&&`ownerSVGElement`in e}var wc=new WeakMap,Tc,Ec=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Cc(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Dc=Ec(`inline`,`width`,`offsetWidth`),Oc=Ec(`block`,`height`,`offsetHeight`);function kc({target:e,borderBoxSize:t}){wc.get(e)?.forEach(n=>{n(e,{get width(){return Dc(e,t)},get height(){return Oc(e,t)}})})}function Ac(e){e.forEach(kc)}function jc(){typeof ResizeObserver>`u`||(Tc=new ResizeObserver(Ac))}function Mc(e,t){Tc||jc();let n=$s(e);return n.forEach(e=>{let n=wc.get(e);n||(n=new Set,wc.set(e,n)),n.add(t),Tc?.observe(e)}),()=>{n.forEach(e=>{let n=wc.get(e);n?.delete(t),n?.size||Tc?.unobserve(e)})}}var Nc=new Set,Pc;function Fc(){Pc=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Nc.forEach(t=>t(e))},window.addEventListener(`resize`,Pc)}function Ic(e){return Nc.add(e),Pc||Fc(),()=>{Nc.delete(e),!Nc.size&&typeof Pc==`function`&&(window.removeEventListener(`resize`,Pc),Pc=void 0)}}function Lc(e,t){return typeof e==`function`?Ic(e):Mc(e,t)}function Rc(e){return Cc(e)&&e.tagName===`svg`}var zc=[...Is,Mi,Ji],Bc=e=>zc.find(Fs(e)),Vc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Hc=()=>({x:Vc(),y:Vc()}),Uc=()=>({min:0,max:0}),Wc=()=>({x:Uc(),y:Uc()}),Gc=new WeakMap;function Kc(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function qc(e){return typeof e==`string`||Array.isArray(e)}var Jc=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Yc=[`initial`,...Jc];function Xc(e){return Kc(e.animate)||Yc.some(t=>qc(e[t]))}function Zc(e){return!!(Xc(e)||e.variants)}function Qc(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Cs(i))e.addValue(r,i);else if(Cs(a))e.addValue(r,ts(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,ts(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var $c={current:null},el={current:!1},tl=typeof window<`u`;function nl(){if(el.current=!0,tl)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>$c.current=e.matches;e.addEventListener(`change`,t),t()}else $c.current=!1}var rl=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],il={};function al(e){il=e}function ol(){return il}var sl=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=yo,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=ri.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Zr.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Xc(t),this.isVariantNode=Zc(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&Cs(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,Gc.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(el.current||nl(),this.shouldReduceMotion=$c.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Qr(this.notifyUpdate),Qr(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Ho.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Mo({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:xr(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=oo.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Zr.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in il){let t=il[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Wc()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<rl.length;t++){let n=rl[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Qc(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=ts(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(pr(n)||hr(n))?n=parseFloat(n):!Bc(n)&&Ji.test(t)&&(n=Ys(e,t)),this.setBaseTarget(e,Cs(n)?n.get():n)),Cs(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=gs(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Cs(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new br),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){nc.render(this.render)}},cl=class extends sl{constructor(){super(...arguments),this.KeyframeResolver=Qs}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;Cs(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},ll=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function ul({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function dl({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function fl(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function pl(e){return e===void 0||e===1}function ml({scale:e,scaleX:t,scaleY:n}){return!pl(e)||!pl(t)||!pl(n)}function hl(e){return ml(e)||gl(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function gl(e){return _l(e.x)||_l(e.y)}function _l(e){return e&&e!==`0%`}function vl(e,t,n){return n+t*(e-n)}function yl(e,t,n,r,i){return i!==void 0&&(e=vl(e,i,r)),vl(e,n,r)+t}function bl(e,t=0,n=1,r,i){e.min=yl(e.min,t,n,r,i),e.max=yl(e.max,t,n,r,i)}function xl(e,{x:t,y:n}){bl(e.x,t.translate,t.scale,t.originPoint),bl(e.y,n.translate,n.scale,n.originPoint)}var Sl=.999999999999,Cl=1.0000000000001;function wl(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Tl(e.x,-a.scroll.offset.x),Tl(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,xl(e,o)),r&&hl(a.latestValues)&&Ol(e,a.latestValues,a.layout?.layoutBox))}t.x<Cl&&t.x>Sl&&(t.x=1),t.y<Cl&&t.y>Sl&&(t.y=1)}function Tl(e,t){e.min+=t,e.max+=t}function El(e,t,n,r,i=.5){bl(e,t,n,Qi(e.min,e.max,i),r)}function Dl(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Ol(e,t,n){let r=n??e;El(e.x,Dl(t.x,r.x),t.scaleX,t.scale,t.originX),El(e.y,Dl(t.y,r.y),t.scaleY,t.scale,t.originY)}function kl(e,t){return ul(fl(e.getBoundingClientRect(),t))}function Al(e,t,n){let r=kl(e,n),{scroll:i}=t;return i&&(Tl(r.x,i.offset.x),Tl(r.y,i.offset.y)),r}var jl={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Ml=ao.length;function Nl(e,t,n){let r=``,i=!0;for(let a=0;a<Ml;a++){let o=ao[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=ec(s,Gs[o]);if(!c){i=!1;let t=jl[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${ec(a,Gs.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Pl(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(oo.has(e)){o=!0;continue}else if(oi(e)){i[e]=n;continue}else{let t=ec(n,Gs[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Nl(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Fl(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Il(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ll={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(G.test(e))e=parseFloat(e);else return e;return`${Il(e,t.target.x)}% ${Il(e,t.target.y)}%`}},Rl={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Ji.parse(e);if(i.length>5)return r;let a=Ji.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Qi(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},zl={borderRadius:{...Ll,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Ll,borderTopRightRadius:Ll,borderBottomLeftRadius:Ll,borderBottomRightRadius:Ll,boxShadow:Rl};function Bl(e,{layout:t,layoutId:n}){return oo.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!zl[e]||e===`opacity`)}function Vl(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Cs(r[t])||i&&Cs(i[t])||Bl(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Hl(e){return window.getComputedStyle(e)}var Ul=class extends cl{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Fl}readValueFromInstance(e,t){if(oo.has(t))return this.projection?.isProjecting?to(t):ro(e,t);{let n=Hl(e),r=(oi(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return kl(e,t)}build(e,t,n){Pl(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Vl(e,t,n)}},Wl={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Gl={offset:`strokeDashoffset`,array:`strokeDasharray`};function Kl(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Wl:Gl;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var ql=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Jl(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Pl(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of ql)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Kl(d,i,a,o,!1)}var Yl=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Xl=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Zl(e,t,n,r){Fl(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Yl.has(n)?n:Es(n),t.attrs[n])}function Ql(e,t,n){let r=Vl(e,t,n);for(let n in e)if(Cs(e[n])||Cs(t[n])){let t=ao.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var $l=class extends cl{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Wc}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(oo.has(t)){let e=qs(t);return e&&e.default||0}return t=Yl.has(t)?t:Es(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Ql(e,t,n)}build(e,t,n){Jl(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Zl(e,t,n,r)}mount(e){this.isSVGTag=Xl(e.tagName),super.mount(e)}},eu=Yc.length;function tu(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&tu(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<eu;n++){let r=Yc[n],i=e.props[r];(qc(i)||i===!1)&&(t[r]=i)}return t}function nu(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var ru=[...Jc].reverse(),iu=Jc.length;function au(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Ns(e,t,n)))}function ou(e){let t=au(e),n=lu(),r=!0,i=!1,a=t=>(n,r)=>{let i=_s(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=tu(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<iu;t++){let p=ru[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=qc(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Kc(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=su(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=ys(t)&&ys(n)?!nu(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=_s(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Xo(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=_s(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=lu(),i=!0}}}function su(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!nu(t,e):!1}function cu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function lu(){return{animate:cu(!0),whileInView:cu(),whileHover:cu(),whileTap:cu(),whileDrag:cu(),whileFocus:cu(),exit:cu()}}function uu(e,t){e.min=t.min,e.max=t.max}function du(e,t){uu(e.x,t.x),uu(e.y,t.y)}function fu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var pu=1e-4,mu=1-pu,hu=1+pu,gu=.01,_u=0-gu,vu=0+gu;function yu(e){return e.max-e.min}function bu(e,t,n){return Math.abs(e-t)<=n}function xu(e,t,n,r=.5){e.origin=r,e.originPoint=Qi(t.min,t.max,e.origin),e.scale=yu(n)/yu(t),e.translate=Qi(n.min,n.max,e.origin)-e.originPoint,(e.scale>=mu&&e.scale<=hu||isNaN(e.scale))&&(e.scale=1),(e.translate>=_u&&e.translate<=vu||isNaN(e.translate))&&(e.translate=0)}function Su(e,t,n,r){xu(e.x,t.x,n.x,r?r.originX:void 0),xu(e.y,t.y,n.y,r?r.originY:void 0)}function Cu(e,t,n,r=0){e.min=(r?Qi(n.min,n.max,r):n.min)+t.min,e.max=e.min+yu(t)}function wu(e,t,n,r){Cu(e.x,t.x,n.x,r?.x),Cu(e.y,t.y,n.y,r?.y)}function Tu(e,t,n,r=0){let i=r?Qi(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+yu(t)}function Eu(e,t,n,r){Tu(e.x,t.x,n.x,r?.x),Tu(e.y,t.y,n.y,r?.y)}function Du(e,t,n,r,i){return e-=t,e=vl(e,1/n,r),i!==void 0&&(e=vl(e,1/i,r)),e}function Ou(e,t=0,n=1,r=.5,i,a=e,o=e){if(Di.test(t)&&(t=parseFloat(t),t=Qi(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Qi(a.min,a.max,r);e===a&&(s-=t),e.min=Du(e.min,t,n,s,i),e.max=Du(e.max,t,n,s,i)}function ku(e,t,[n,r,i],a,o){Ou(e,t[n],t[r],t[i],t.scale,a,o)}var Au=[`x`,`scaleX`,`originX`],ju=[`y`,`scaleY`,`originY`];function Mu(e,t,n,r){ku(e.x,t,Au,n?n.x:void 0,r?r.x:void 0),ku(e.y,t,ju,n?n.y:void 0,r?r.y:void 0)}function Nu(e){return e.translate===0&&e.scale===1}function Pu(e){return Nu(e.x)&&Nu(e.y)}function Fu(e,t){return e.min===t.min&&e.max===t.max}function Iu(e,t){return Fu(e.x,t.x)&&Fu(e.y,t.y)}function Lu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ru(e,t){return Lu(e.x,t.x)&&Lu(e.y,t.y)}function zu(e){return yu(e.x)/yu(e.y)}function Bu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Vu(e){return[e(`x`),e(`y`)]}function Hu(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Uu=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],Wu=Uu.length,Gu=e=>typeof e==`string`?parseFloat(e):e,Ku=e=>typeof e==`number`||G.test(e);function qu(e,t,n,r,i,a){i?(e.opacity=Qi(0,n.opacity??1,Yu(r)),e.opacityExit=Qi(t.opacity??1,0,Xu(r))):a&&(e.opacity=Qi(t.opacity??1,n.opacity??1,r));for(let i=0;i<Wu;i++){let a=Uu[i],o=Ju(t,a),s=Ju(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||Ku(o)===Ku(s)?(e[a]=Math.max(Qi(Gu(o),Gu(s),r),0),(Di.test(s)||Di.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Qi(t.rotate||0,n.rotate||0,r))}function Ju(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Yu=Zu(0,.5,Ir),Xu=Zu(.5,.95,_r);function Zu(e,t,n){return r=>r<e?0:r>t?1:n(yr(e,t,r))}function Qu(e,t,n){let r=Cs(e)?e:ts(e);return r.start(ds(``,r,t,n)),r.animation}function $u(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var ed=(e,t)=>e.depth-t.depth,td=class{constructor(){this.children=[],this.isDirty=!1}add(e){lr(this.children,e),this.isDirty=!0}remove(e){ur(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ed),this.isDirty=!1,this.children.forEach(e)}};function nd(e,t){let n=ri.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Qr(r),e(a-t))};return Zr.setup(r,!0),()=>Qr(r)}function rd(e){return Cs(e)?e.get():e}var id=class{constructor(){this.members=[]}add(e){lr(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(ur(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(ur(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},ad={hasAnimatedSinceResize:!0,hasEverUpdated:!1},od={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},sd=[``,`X`,`Y`,`Z`],cd=1e3,ld=0;function ud(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function dd(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Os(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Zr,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&dd(r)}function fd({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=ld++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,qr.value&&(od.nodes=od.calculatedTargetDeltas=od.calculatedProjections=0),this.nodes.forEach(hd),this.nodes.forEach(wd),this.nodes.forEach(Td),this.nodes.forEach(gd),qr.addProjectionMetrics&&qr.addProjectionMetrics(od)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new td)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new br),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Cc(t)&&!Rc(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Zr.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=nd(i,250),ad.hasAnimatedSinceResize&&(ad.hasAnimatedSinceResize=!1,this.nodes.forEach(Cd)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Md,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Ru(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...rs(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Cd(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Qr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ed),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&dd(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(yd),this.nodes.forEach(vd);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(bd);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(xd),this.nodes.forEach(Sd),this.nodes.forEach(pd),this.nodes.forEach(md)):this.nodes.forEach(bd),this.clearAllSnapshots();let e=ri.now();$r.delta=dr(0,1e3/60,e-$r.timestamp),$r.timestamp=e,$r.isProcessing=!0,ei.update.process($r),ei.preRender.process($r),ei.render.process($r),$r.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,nc.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(_d),this.sharedNodes.forEach(Dd)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Zr.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Zr.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!yu(this.snapshot.measuredBox.x)&&!yu(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=Wc(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Pu(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||hl(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Id(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Wc();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Rd))){let{scroll:e}=this.root;e&&(Tl(t.x,e.offset.x),Tl(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Wc();if(du(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&du(t,e),Tl(t.x,i.offset.x),Tl(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Wc();du(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Tl(r.x,-n.scroll.offset.x),Tl(r.y,-n.scroll.offset.y)),hl(n.latestValues)&&Ol(r,n.latestValues,n.layout?.layoutBox)}return hl(this.latestValues)&&Ol(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Wc();du(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!hl(n.latestValues))continue;let r;n.instance&&(ml(n.latestValues)&&n.updateSnapshot(),r=Wc(),du(r,n.measurePageBox())),Mu(t,n.latestValues,n.snapshot?.layoutBox,r)}return hl(this.latestValues)&&Mu(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==$r.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=$r.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Wc(),this.targetWithTransforms=Wc()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),wu(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):du(this.target,this.layout.layoutBox),xl(this.target,this.targetDelta)):du(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),qr.value&&od.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||ml(this.parent.latestValues)||gl(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Wc(),this.relativeTargetOrigin=Wc(),Eu(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),du(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===$r.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;du(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;wl(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Wc());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fu(this.prevProjectionDelta.x,this.projectionDelta.x),fu(this.prevProjectionDelta.y,this.projectionDelta.y)),Su(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Bu(this.projectionDelta.x,this.prevProjectionDelta.x)||!Bu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),qr.value&&od.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Hc(),this.projectionDelta=Hc(),this.projectionDeltaWithTransform=Hc()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Hc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Wc(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(jd));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=Qi(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=Qi(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Od(o.x,e.x,n),Od(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Eu(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ad(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Iu(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Wc(),du(f,this.relativeTarget)),c&&(this.animationValues=a,qu(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Qr(this.pendingAnimation),void 0),this.pendingAnimation=Zr.update(()=>{ad.hasAnimatedSinceResize=!0,ii.layout++,this.motionValue||=ts(0),this.motionValue.jump(0,!1),this.currentAnimation=Qu(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{ii.layout--},onComplete:()=>{ii.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(cd),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&Ld(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Wc();let t=yu(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=yu(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}du(t,n),Ol(t,i),Su(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new id),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&ud(`z`,e,r,this.animationValues);for(let t=0;t<sd.length;t++)ud(`rotate${sd[t]}`,e,r,this.animationValues),ud(`skew${sd[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=rd(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=rd(t?.pointerEvents)||``),this.hasProjected&&!hl(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Hu(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in zl){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=zl[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?rd(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(vd),this.root.sharedNodes.clear()}}}function pd(e){e.updateLayout()}function md(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Vu(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=yu(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;uu(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Ld(i,t.layoutBox,n)&&Vu(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=yu(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Hc();Su(o,n,t.layoutBox);let s=Hc();a?Su(s,e.applyTransform(r,!0),t.measuredBox):Su(s,n,t.layoutBox);let c=!Pu(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Wc();Eu(s,t.layoutBox,i.layoutBox,o);let c=Wc();Eu(c,n,a.layoutBox,o),Ru(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function hd(e){qr.value&&od.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function gd(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function _d(e){e.clearSnapshot()}function vd(e){e.clearMeasurements()}function yd(e){e.isLayoutDirty=!0,e.updateLayout()}function bd(e){e.isLayoutDirty=!1}function xd(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Sd(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Cd(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function wd(e){e.resolveTargetDelta()}function Td(e){e.calcProjection()}function Ed(e){e.resetSkewAndRotation()}function Dd(e){e.removeLeadSnapshot()}function Od(e,t,n){e.translate=Qi(t.translate,0,n),e.scale=Qi(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function kd(e,t,n,r){e.min=Qi(t.min,n.min,r),e.max=Qi(t.max,n.max,r)}function Ad(e,t,n,r){kd(e.x,t.x,n.x,r),kd(e.y,t.y,n.y,r)}function jd(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Md={duration:.45,ease:[.4,0,.1,1]},Nd=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Pd=Nd(`applewebkit/`)&&!Nd(`chrome/`)?Math.round:_r;function Fd(e){e.min=Pd(e.min),e.max=Pd(e.max)}function Id(e){Fd(e.x),Fd(e.y)}function Ld(e,t,n){return e===`position`||e===`preserve-aspect`&&!bu(zu(t),zu(n),.2)}function Rd(e){return e!==e.root&&e.scroll?.wasRoot}var zd=fd({attachResizeListener:(e,t)=>$u(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Bd={current:void 0},Vd=fd({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Bd.current){let e=new zd({});e.mount(window),e.setOptions({layoutScroll:!0}),Bd.current=e}return Bd.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Hd=(0,b.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Ud(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Wd(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ud(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ud(e[t],null)}}}}function Gd(...e){return b.useCallback(Wd(...e),e)}var q=ir(),Kd=class extends b.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(tc(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=tc(e)&&e.offsetWidth||0,r=tc(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function qd({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,b.useId)(),s=(0,b.useRef)(null),c=(0,b.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,b.useContext)(Hd),u=Gd(s,e.props?.ref??e?.ref);return(0,b.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
@@ -17,12 +17,12 @@ Error generating stack: `+e.message+`
|
|
|
17
17
|
${_}px !important;
|
|
18
18
|
${v}px !important;
|
|
19
19
|
}
|
|
20
|
-
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,q.jsx)(Kd,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:b.cloneElement(e,{ref:u})})}var Jd=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=or(Yd),d=(0,b.useId)(),f=!0,p=(0,b.useMemo)(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>u.delete(e))}),[n,u,r]);return a&&f&&(p={...p}),(0,b.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),b.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,q.jsx)(qd,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,q.jsx)(cr.Provider,{value:p,children:e})};function Yd(){return new Map}function Xd(e=!0){let t=(0,b.useContext)(cr);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,b.useId)();(0,b.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,b.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Zd=e=>e.key||``;function Qd(e){let t=[];return b.Children.forEach(e,e=>{(0,b.isValidElement)(e)&&t.push(e)}),t}var $d=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Xd(o),f=(0,b.useMemo)(()=>Qd(e),[e]),p=o&&!u?[]:f.map(Zd),m=(0,b.useRef)(!0),h=(0,b.useRef)(f),g=or(()=>new Map),_=(0,b.useRef)(new Set),[v,y]=(0,b.useState)(f),[x,S]=(0,b.useState)(f);sr(()=>{m.current=!1,h.current=f;for(let e=0;e<x.length;e++){let t=Zd(x[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[x,p.length,p.join(`-`)]);let C=[];if(f!==v){let e=[...f];for(let t=0;t<x.length;t++){let n=x[t],r=Zd(n);p.includes(r)||(e.splice(t,0,n),C.push(n))}return a===`wait`&&C.length&&(e=C),S(Qd(e)),y(f),null}let{forceRender:w}=(0,b.useContext)(ar);return(0,q.jsx)(q.Fragment,{children:x.map(e=>{let v=Zd(e),y=o&&!u?!1:f===x||p.includes(v);return(0,q.jsx)(Jd,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(w?.(),S(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},ef=(0,b.createContext)({strict:!1}),tf={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},nf=!1;function rf(){if(nf)return;let e={};for(let t in tf)e[t]={isEnabled:e=>tf[t].some(t=>!!e[t])};al(e),nf=!0}function af(){return rf(),ol()}function of(e){let t=af();for(let n in e)t[n]={...t[n],...e[n]};al(t)}var sf=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function cf(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||sf.has(e)}var lf=c({default:()=>uf}),uf,df=o((()=>{throw uf={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),ff=e=>!cf(e);function pf(e){typeof e==`function`&&(ff=t=>t.startsWith(`on`)?!cf(t):e(t))}try{pf((df(),d(lf)).default)}catch{}function mf(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||Cs(e[i])||(ff(i)||n===!0&&cf(i)||!t&&!cf(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var hf=(0,b.createContext)({});function gf(e,t){if(Xc(e)){let{initial:t,animate:n}=e;return{initial:t===!1||qc(t)?t:void 0,animate:qc(n)?n:void 0}}return e.inherit===!1?{}:t}function _f(e){let{initial:t,animate:n}=gf(e,(0,b.useContext)(hf));return(0,b.useMemo)(()=>({initial:t,animate:n}),[vf(t),vf(n)])}function vf(e){return Array.isArray(e)?e.join(` `):e}var yf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function bf(e,t,n){for(let r in t)!Cs(t[r])&&!Bl(r,n)&&(e[r]=t[r])}function xf({transformTemplate:e},t){return(0,b.useMemo)(()=>{let n=yf();return Pl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Sf(e,t){let n=e.style||{},r={};return bf(r,n,e),Object.assign(r,xf(e,t)),r}function Cf(e,t){let n={},r=Sf(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var wf=()=>({...yf(),attrs:{}});function Tf(e,t,n,r){let i=(0,b.useMemo)(()=>{let n=wf();return Jl(n,t,Xl(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};bf(t,e.style,e),i.style={...t,...i.style}}return i}var Ef=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Df(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Ef.indexOf(e)>-1||/[A-Z]/u.test(e))}function Of(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??Df(e)?Tf:Cf)(t,r,i,e),c=mf(t,typeof e==`string`,a),l=e===b.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,b.useMemo)(()=>Cs(u)?u.get():u,[u]);return(0,b.createElement)(e,{...l,children:d})}function kf({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Af(n,r,i,e),renderState:t()}}function Af(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=rd(a[e]);let{initial:o,animate:s}=e,c=Xc(e),l=Zc(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Kc(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=gs(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var jf=e=>(t,n)=>{let r=(0,b.useContext)(hf),i=(0,b.useContext)(cr),a=()=>kf(e,t,r,i);return n?a():or(a)},Mf=jf({scrapeMotionValuesFromProps:Vl,createRenderState:yf}),Nf=jf({scrapeMotionValuesFromProps:Ql,createRenderState:wf}),Pf=Symbol.for(`motionComponentSymbol`);function Ff(e,t,n){let r=(0,b.useRef)(n);(0,b.useInsertionEffect)(()=>{r.current=n});let i=(0,b.useRef)(null);return(0,b.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}var If=(0,b.createContext)({});function Lf(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Rf(e,t,n,r,i,a){let{visualElement:o}=(0,b.useContext)(hf),s=(0,b.useContext)(ef),c=(0,b.useContext)(cr),l=(0,b.useContext)(Hd),u=l.reducedMotion,d=l.skipAnimations,f=(0,b.useRef)(null),p=(0,b.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,b.useContext)(If);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&zf(f.current,n,i,h);let g=(0,b.useRef)(!1);(0,b.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[Ds],v=(0,b.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return sr(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,b.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function zf(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Bf(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Lf(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Bf(e){if(e)return e.options.allowProjection===!1?Bf(e.parent):e.projection}function Vf(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&of(r);let a=n?n===`svg`:Df(e),o=a?Nf:Mf;function s(n,s){let c,l={...(0,b.useContext)(Hd),...n,layoutId:Hf(n)},{isStatic:u}=l,d=_f(n),f=o(n,u);if(!u&&typeof window<`u`){Uf(l,r);let t=Wf(l);c=t.MeasureLayout,d.visualElement=Rf(e,f,l,i,t.ProjectionNode,a)}return(0,q.jsxs)(hf.Provider,{value:d,children:[c&&d.visualElement?(0,q.jsx)(c,{visualElement:d.visualElement,...l}):null,Of(e,n,Ff(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,b.forwardRef)(s);return c[Pf]=e,c}function Hf({layoutId:e}){let t=(0,b.useContext)(ar).id;return t&&e!==void 0?t+`-`+e:e}function Uf(e,t){(0,b.useContext)(ef).strict}function Wf(e){let{drag:t,layout:n}=af();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Gf(e,t){if(typeof Proxy>`u`)return Vf;let n=new Map,r=(n,r)=>Vf(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Vf(a,void 0,e,t)),n.get(a))})}var Kf=(e,t)=>t.isSVG??Df(e)?new $l(t):new Ul(t,{allowProjection:e!==b.Fragment}),qf=class extends ll{constructor(e){super(e),e.animationState||=ou(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Kc(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Jf=0,Yf={animation:{Feature:qf},exit:{Feature:class extends ll{constructor(){super(...arguments),this.id=Jf++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=_s(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Xf(e){return{point:{x:e.pageX,y:e.pageY}}}var Zf=e=>t=>dc(t)&&e(t,Xf(t));function Qf(e,t,n,r){return $u(e,t,Zf(n),r)}var $f=({current:e})=>e?e.ownerDocument.defaultView:null,ep=(e,t)=>Math.abs(e-t);function tp(e,t){let n=ep(e.x,t.x),r=ep(e.y,t.y);return Math.sqrt(n**2+r**2)}var np=new Set([`auto`,`scroll`]),rp=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ip(this.lastRawMoveEventInfo,this.transformPagePoint));let e=op(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=tp(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=$r;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=ip(t,this.transformPagePoint),Zr.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=op(e.type===`pointercancel`?this.lastMoveEventInfo:ip(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!dc(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=ip(Xf(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=$r;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,op(s,this.history)),this.removeListeners=vr(Qf(this.contextWindow,`pointermove`,this.handlePointerMove),Qf(this.contextWindow,`pointerup`,this.handlePointerUp),Qf(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(np.has(e.overflowX)||np.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Zr.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Qr(this.updatePoint)}};function ip(e,t){return t?{point:t(e.point)}:e}function ap(e,t){return{x:e.x-t.x,y:e.y-t.y}}function op({point:e},t){return{point:e,delta:ap(e,cp(t)),offset:ap(e,sp(t)),velocity:lp(t,.1)}}function sp(e){return e[0]}function cp(e){return e[e.length-1]}function lp(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=cp(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>xr(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>xr(t)*2&&(r=e[1]);let a=Sr(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function up(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Qi(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Qi(n,e,r.max):Math.min(e,n)),e}function dp(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function fp(e,{top:t,left:n,bottom:r,right:i}){return{x:dp(e.x,n,i),y:dp(e.y,t,r)}}function pp(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function mp(e,t){return{x:pp(e.x,t.x),y:pp(e.y,t.y)}}function hp(e,t){let n=.5,r=yu(e),i=yu(t);return i>r?n=yr(t.min,t.max-r,e.min):r>i&&(n=yr(e.min,e.max-i,t.min)),dr(0,1,n)}function gp(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var _p=.35;function vp(e=_p){return e===!1?e=0:e===!0&&(e=_p),{x:yp(e,`left`,`right`),y:yp(e,`top`,`bottom`)}}function yp(e,t,n){return{min:bp(e,t),max:bp(e,n)}}function bp(e,t){return typeof e==`number`?e:e[t]||0}var xp=new WeakMap,Sp=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Wc(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Xf(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=oc(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Vu(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Di.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=yu(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Zr.update(()=>i(e,t),!1,!0),Ts(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Ep(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&Zr.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new rp(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:$f(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&Zr.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Tp(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=up(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Lf(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=fp(n.layoutBox,e):this.constraints=!1,this.elastic=vp(t),r!==this.constraints&&!Lf(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Vu(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=gp(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Lf(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Al(n,r.root,this.visualElement.getTransformPagePoint()),a=mp(r.layout.layoutBox,i);if(t){let e=t(dl(a));this.hasMutatedConstraints=!!e,e&&(a=ul(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Vu(o=>{if(!Tp(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Ts(this.visualElement,e),n.start(ds(e,n,0,t,this.visualElement,!1))}stopAnimation(){Vu(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Vu(t=>{let{drag:n}=this.getProps();if(!Tp(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Qi(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Lf(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};Vu(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=hp({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Vu(t=>{if(!Tp(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Qi(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;xp.set(this.visualElement,this);let e=this.visualElement.current,t=Qf(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&hc(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Lf(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=wp(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Zr.read(r);let o=$u(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Vu(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=_p,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Cp(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function wp(e,t,n){let r=Lc(e,Cp(n)),i=Lc(t,Cp(n));return()=>{r(),i()}}function Tp(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Ep(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Dp=class extends ll{constructor(e){super(e),this.removeGroupControls=_r,this.removeListeners=_r,this.controls=new Sp(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_r}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Op=e=>(t,n)=>{e&&Zr.update(()=>e(t,n),!1,!0)},kp=class extends ll{constructor(){super(...arguments),this.removePointerDownListener=_r}onPointerDown(e){this.session=new rp(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$f(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Op(e),onStart:Op(t),onMove:Op(n),onEnd:(e,t)=>{delete this.session,r&&Zr.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Qf(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Ap=!1,jp=class extends b.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Ap&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ad.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Ap=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Zr.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),nc.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Ap=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Mp(e){let[t,n]=Xd(),r=(0,b.useContext)(ar);return(0,q.jsx)(jp,{...e,layoutGroup:r,switchLayoutGroup:(0,b.useContext)(If),isPresent:t,safeToRemove:n})}var Np={pan:{Feature:kp},drag:{Feature:Dp,ProjectionNode:Vd,MeasureLayout:Mp}};function Pp(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&Zr.postRender(()=>i(t,Xf(t)))}var Fp=class extends ll{mount(){let{current:e}=this.node;e&&(this.unmount=lc(e,(e,t)=>(Pp(this.node,t,`Start`),e=>Pp(this.node,e,`End`))))}unmount(){}},Ip=class extends ll{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=vr($u(this.node.current,`focus`,()=>this.onFocus()),$u(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Lp(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&Zr.postRender(()=>i(t,Xf(t)))}var Rp=class extends ll{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Sc(e,(e,t)=>(Lp(this.node,t,`Start`),(e,{success:t})=>Lp(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},zp=new WeakMap,Bp=new WeakMap,Vp=e=>{let t=zp.get(e.target);t&&t(e)},Hp=e=>{e.forEach(Vp)};function Up({root:e,...t}){let n=e||document;Bp.has(n)||Bp.set(n,{});let r=Bp.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Hp,{root:e,...t})),r[i]}function Wp(e,t,n){let r=Up(t);return zp.set(e,n),r.observe(e),()=>{zp.delete(e),r.unobserve(e)}}var Gp={some:0,all:1},Kp=class extends ll{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Gp[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Wp(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(qp(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function qp({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Jp={inView:{Feature:Kp},tap:{Feature:Rp},focus:{Feature:Ip},hover:{Feature:Fp}},Yp={layout:{ProjectionNode:Vd,MeasureLayout:Mp}},Xp=Gf({...Yf,...Jp,...Np,...Yp},Kf);function Zp(){!el.current&&nl();let[e]=(0,b.useState)($c.current);return e}var Qp=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),$p=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),em=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),tm=e=>{let t=em(e);return t.charAt(0).toUpperCase()+t.slice(1)},nm={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},rm=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},im=(0,b.createContext)({}),am=()=>(0,b.useContext)(im),om=(0,b.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=am()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,b.createElement)(`svg`,{ref:c,...nm,width:t??l??nm.width,height:t??l??nm.height,stroke:e??f,strokeWidth:m,className:Qp(`lucide`,p,i),...!a&&!rm(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,b.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),J=(e,t)=>{let n=(0,b.forwardRef)(({className:n,...r},i)=>(0,b.createElement)(om,{ref:i,iconNode:t,className:Qp(`lucide-${$p(tm(e))}`,`lucide-${e}`,n),...r}));return n.displayName=tm(e),n},sm=J(`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`}]]),cm=J(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),lm=J(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),um=J(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),dm=J(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),fm=J(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),pm=J(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),mm=J(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),hm=J(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),gm=J(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),_m=J(`circle-plus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),vm=J(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),ym=J(`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`}]]),bm=J(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),xm=J(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Sm=J(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),Cm=J(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),wm=J(`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`}]]),Tm=J(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Em=J(`maximize`,[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]),Dm=J(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),Om=J(`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`}]]),km=J(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),Am=J(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),jm=J(`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`}]]),Mm=J(`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`}]]),Nm=J(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),Pm=J(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Fm=J(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Im=J(`redo`,[[`path`,{d:`M21 7v6h-6`,key:`3ptur4`}],[`path`,{d:`M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7`,key:`1kgawr`}]]),Lm=J(`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=J(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),zm=J(`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`}]]),Bm=J(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Vm=J(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),Hm=J(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Um=J(`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`}]]),Wm=J(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Gm=J(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Km=J(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),qm=J(`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`}]]),Jm=J(`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`}]]),Ym=J(`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`}]]),Xm=J(`undo`,[[`path`,{d:`M3 7v6h6`,key:`1v2h90`}],[`path`,{d:`M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13`,key:`1r6uu6`}]]),Zm=J(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Qm=J(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),$m=J(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),eh=J(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]);function th(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function nh(...e){return t=>{let n=!1,r=e.map(e=>{let r=th(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():th(e[t],null)}}}}function rh(...e){return b.useCallback(nh(...e),e)}function ih(e){let t=oh(e),n=b.forwardRef((e,n)=>{let{children:r,...i}=e,a=b.Children.toArray(r),o=a.find(lh);if(o){let e=o.props.children,r=a.map(t=>t===o?b.Children.count(e)>1?b.Children.only(null):b.isValidElement(e)?e.props.children:null:t);return(0,q.jsx)(t,{...i,ref:n,children:b.isValidElement(e)?b.cloneElement(e,void 0,r):null})}return(0,q.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var ah=ih(`Slot`);function oh(e){let t=b.forwardRef((e,t)=>{let{children:n,...r}=e;if(b.isValidElement(n)){let e=dh(n),i=uh(r,n.props);return n.type!==b.Fragment&&(i.ref=t?nh(t,e):e),b.cloneElement(n,i)}return b.Children.count(n)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sh=Symbol(`radix.slottable`);function ch(e){let t=({children:e})=>(0,q.jsx)(q.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=sh,t}function lh(e){return b.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===sh}function uh(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function dh(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fh=u(_(),1),ph=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ih(`Primitive.${t}`),r=b.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,q.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function mh(e,t){e&&fh.flushSync(()=>e.dispatchEvent(t))}var hh=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),gh=`VisuallyHidden`,_h=b.forwardRef((e,t)=>(0,q.jsx)(ph.span,{...e,ref:t,style:{...hh,...e.style}}));_h.displayName=gh;var vh=_h;function yh(e,t=[]){let n=[];function r(t,r){let i=b.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=b.useMemo(()=>o,Object.values(o));return(0,q.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=b.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>b.createContext(e));return function(n){let r=n?.[e]||t;return b.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,bh(i,...t)]}function bh(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function xh(e){let t=e+`CollectionProvider`,[n,r]=yh(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=b.useRef(null),a=b.useRef(new Map).current;return(0,q.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=ih(s),l=b.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,q.jsx)(c,{ref:rh(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=ih(u),p=b.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=b.useRef(null),s=rh(t,o),c=a(u,n);return b.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,q.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return b.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}typeof window<`u`&&window.document&&window.document.createElement;function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var Sh=globalThis?.document?b.useLayoutEffect:()=>{},Ch=b.useInsertionEffect||Sh;function wh({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Th({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=b.useRef(e!==void 0);b.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,b.useCallback(t=>{if(s){let n=Eh(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Th({defaultProp:e,onChange:t}){let[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return Ch(()=>{a.current=t},[t]),b.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Eh(e){return typeof e==`function`}function Dh(e,t){return b.useReducer((e,n)=>t[e][n]??e,e)}var Oh=e=>{let{present:t,children:n}=e,r=kh(t),i=typeof n==`function`?n({present:r.isPresent}):b.Children.only(n),a=rh(r.ref,jh(i));return typeof n==`function`||r.isPresent?b.cloneElement(i,{ref:a}):null};Oh.displayName=`Presence`;function kh(e){let[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef(`none`),[o,s]=Dh(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return b.useEffect(()=>{let e=Ah(r.current);a.current=o===`mounted`?e:`none`},[o]),Sh(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Ah(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Sh(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Ah(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Ah(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:b.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Ah(e){return e?.animationName||`none`}function jh(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Mh=b.useId||(()=>void 0),Nh=0;function Ph(e){let[t,n]=b.useState(Mh());return Sh(()=>{e||n(e=>e??String(Nh++))},[e]),e||(t?`radix-${t}`:``)}var Fh=`Collapsible`,[Ih,Lh]=yh(Fh),[Rh,zh]=Ih(Fh),Bh=b.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=wh({prop:r,defaultProp:i??!1,onChange:o,caller:Fh});return(0,q.jsx)(Rh,{scope:n,disabled:a,contentId:Ph(),open:c,onOpenToggle:b.useCallback(()=>l(e=>!e),[l]),children:(0,q.jsx)(ph.div,{"data-state":Kh(c),"data-disabled":a?``:void 0,...s,ref:t})})});Bh.displayName=Fh;var Vh=`CollapsibleTrigger`,Hh=b.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=zh(Vh,n);return(0,q.jsx)(ph.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Kh(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Y(e.onClick,i.onOpenToggle)})});Hh.displayName=Vh;var Uh=`CollapsibleContent`,Wh=b.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=zh(Uh,e.__scopeCollapsible);return(0,q.jsx)(Oh,{present:n||i.open,children:({present:e})=>(0,q.jsx)(Gh,{...r,ref:t,present:e})})});Wh.displayName=Uh;var Gh=b.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=zh(Uh,n),[s,c]=b.useState(r),l=b.useRef(null),u=rh(t,l),d=b.useRef(0),f=d.current,p=b.useRef(0),m=p.current,h=o.open||s,g=b.useRef(h),_=b.useRef(void 0);return b.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),Sh(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,q.jsx)(ph.div,{"data-state":Kh(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function Kh(e){return e?`open`:`closed`}var qh=Bh,Jh=b.createContext(void 0);function Yh(e){let t=b.useContext(Jh);return e||t||`ltr`}function Xh(e){let t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...e)=>t.current?.(...e),[])}function Zh(e,t=globalThis?.document){let n=Xh(e);b.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Qh=`DismissableLayer`,$h=`dismissableLayer.update`,eg=`dismissableLayer.pointerDownOutside`,tg=`dismissableLayer.focusOutside`,ng,rg=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ig=b.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=b.useContext(rg),[u,d]=b.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=b.useState({}),m=rh(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,x=v>=_,S=sg(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=cg(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Zh(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),b.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(ng=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),lg(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=ng)}},[u,f,n,l]),b.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),lg())},[u,l]),b.useEffect(()=>{let e=()=>p({});return document.addEventListener($h,e),()=>document.removeEventListener($h,e)},[]),(0,q.jsx)(ph.div,{...c,ref:m,style:{pointerEvents:y?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,S.onPointerDownCapture)})});ig.displayName=Qh;var ag=`DismissableLayerBranch`,og=b.forwardRef((e,t)=>{let n=b.useContext(rg),r=b.useRef(null),i=rh(t,r);return b.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,q.jsx)(ph.div,{...e,ref:i})});og.displayName=ag;function sg(e,t=globalThis?.document){let n=Xh(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){ug(eg,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function cg(e,t=globalThis?.document){let n=Xh(e),r=b.useRef(!1);return b.useEffect(()=>{let e=e=>{e.target&&!r.current&&ug(tg,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function lg(){let e=new CustomEvent($h);document.dispatchEvent(e)}function ug(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?mh(i,a):i.dispatchEvent(a)}var dg=ig,fg=og,pg=`focusScope.autoFocusOnMount`,mg=`focusScope.autoFocusOnUnmount`,hg={bubbles:!1,cancelable:!0},gg=`FocusScope`,_g=b.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=b.useState(null),l=Xh(i),u=Xh(a),d=b.useRef(null),f=rh(t,e=>c(e)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:wg(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||wg(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&wg(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),b.useEffect(()=>{if(s){Tg.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(pg,hg);s.addEventListener(pg,l),s.dispatchEvent(t),t.defaultPrevented||(vg(Og(bg(s)),{select:!0}),document.activeElement===e&&wg(s))}return()=>{s.removeEventListener(pg,l),setTimeout(()=>{let t=new CustomEvent(mg,hg);s.addEventListener(mg,u),s.dispatchEvent(t),t.defaultPrevented||wg(e??document.body,{select:!0}),s.removeEventListener(mg,u),Tg.remove(p)},0)}}},[s,l,u,p]);let m=b.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=yg(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&wg(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&wg(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,q.jsx)(ph.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});_g.displayName=gg;function vg(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(wg(r,{select:t}),document.activeElement!==n)return}function yg(e){let t=bg(e);return[xg(t,e),xg(t.reverse(),e)]}function bg(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xg(e,t){for(let n of e)if(!Sg(n,{upTo:t}))return n}function Sg(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Cg(e){return e instanceof HTMLInputElement&&`select`in e}function wg(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Cg(e)&&t&&e.select()}}var Tg=Eg();function Eg(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Dg(e,t),e.unshift(t)},remove(t){e=Dg(e,t),e[0]?.resume()}}}function Dg(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Og(e){return e.filter(e=>e.tagName!==`A`)}var kg=`Portal`,Ag=b.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=b.useState(!1);Sh(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?fh.createPortal((0,q.jsx)(ph.div,{...r,ref:t}),o):null});Ag.displayName=kg;var jg=0;function Mg(){b.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Ng()),document.body.insertAdjacentElement(`beforeend`,e[1]??Ng()),jg++,()=>{jg===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),jg--}},[])}function Ng(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Pg=function(){return Pg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Pg.apply(this,arguments)};function Fg(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ig(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Lg=`right-scroll-bar-position`,Rg=`width-before-scroll-bar`,zg=`with-scroll-bars-hidden`,Bg=`--removed-body-scroll-bar-size`;function Vg(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Hg(e,t){var n=(0,b.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ug=typeof window<`u`?b.useLayoutEffect:b.useEffect,Wg=new WeakMap;function Gg(e,t){var n=Hg(t||null,function(t){return e.forEach(function(e){return Vg(e,t)})});return Ug(function(){var t=Wg.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Vg(e,null)}),i.forEach(function(e){r.has(e)||Vg(e,a)})}Wg.set(n,e)},[e]),n}function Kg(e){return e}function qg(e,t){t===void 0&&(t=Kg);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Jg(e){e===void 0&&(e={});var t=qg(null);return t.options=Pg({async:!0,ssr:!1},e),t}var Yg=function(e){var t=e.sideCar,n=Fg(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return b.createElement(r,Pg({},n))};Yg.isSideCarExport=!0;function Xg(e,t){return e.useMedium(t),Yg}var Zg=Jg(),Qg=function(){},$g=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:Qg,onWheelCapture:Qg,onTouchMoveCapture:Qg}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,x=Fg(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Gg([n,t]),w=Pg(Pg({},x),i);return b.createElement(b.Fragment,null,u&&b.createElement(S,{sideCar:Zg,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?b.cloneElement(b.Children.only(s),Pg(Pg({},w),{ref:C})):b.createElement(v,Pg({},w,{className:c,ref:C}),s))});$g.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$g.classNames={fullWidth:Rg,zeroRight:Lg};var e_,t_=function(){if(e_)return e_;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function n_(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=t_();return t&&e.setAttribute(`nonce`,t),e}function r_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function i_(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var a_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=n_())&&(r_(t,n),i_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},o_=function(){var e=a_();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},s_=function(){var e=o_();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},c_={left:0,top:0,right:0,gap:0},l_=function(e){return parseInt(e||``,10)||0},u_=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[l_(n),l_(r),l_(i)]},d_=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return c_;var t=u_(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},f_=s_(),p_=`data-scroll-locked`,m_=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
21
|
-
.${
|
|
20
|
+
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,q.jsx)(Kd,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:b.cloneElement(e,{ref:u})})}var Jd=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=or(Yd),d=(0,b.useId)(),f=!0,p=(0,b.useMemo)(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>u.delete(e))}),[n,u,r]);return a&&f&&(p={...p}),(0,b.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),b.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,q.jsx)(qd,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,q.jsx)(cr.Provider,{value:p,children:e})};function Yd(){return new Map}function Xd(e=!0){let t=(0,b.useContext)(cr);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,b.useId)();(0,b.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,b.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Zd=e=>e.key||``;function Qd(e){let t=[];return b.Children.forEach(e,e=>{(0,b.isValidElement)(e)&&t.push(e)}),t}var $d=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Xd(o),f=(0,b.useMemo)(()=>Qd(e),[e]),p=o&&!u?[]:f.map(Zd),m=(0,b.useRef)(!0),h=(0,b.useRef)(f),g=or(()=>new Map),_=(0,b.useRef)(new Set),[v,y]=(0,b.useState)(f),[x,S]=(0,b.useState)(f);sr(()=>{m.current=!1,h.current=f;for(let e=0;e<x.length;e++){let t=Zd(x[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[x,p.length,p.join(`-`)]);let C=[];if(f!==v){let e=[...f];for(let t=0;t<x.length;t++){let n=x[t],r=Zd(n);p.includes(r)||(e.splice(t,0,n),C.push(n))}return a===`wait`&&C.length&&(e=C),S(Qd(e)),y(f),null}let{forceRender:w}=(0,b.useContext)(ar);return(0,q.jsx)(q.Fragment,{children:x.map(e=>{let v=Zd(e),y=o&&!u?!1:f===x||p.includes(v);return(0,q.jsx)(Jd,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(w?.(),S(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},ef=(0,b.createContext)({strict:!1}),tf={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},nf=!1;function rf(){if(nf)return;let e={};for(let t in tf)e[t]={isEnabled:e=>tf[t].some(t=>!!e[t])};al(e),nf=!0}function af(){return rf(),ol()}function of(e){let t=af();for(let n in e)t[n]={...t[n],...e[n]};al(t)}var sf=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function cf(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||sf.has(e)}var lf=c({default:()=>uf}),uf,df=o((()=>{throw uf={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),ff=e=>!cf(e);function pf(e){typeof e==`function`&&(ff=t=>t.startsWith(`on`)?!cf(t):e(t))}try{pf((df(),d(lf)).default)}catch{}function mf(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||Cs(e[i])||(ff(i)||n===!0&&cf(i)||!t&&!cf(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var hf=(0,b.createContext)({});function gf(e,t){if(Xc(e)){let{initial:t,animate:n}=e;return{initial:t===!1||qc(t)?t:void 0,animate:qc(n)?n:void 0}}return e.inherit===!1?{}:t}function _f(e){let{initial:t,animate:n}=gf(e,(0,b.useContext)(hf));return(0,b.useMemo)(()=>({initial:t,animate:n}),[vf(t),vf(n)])}function vf(e){return Array.isArray(e)?e.join(` `):e}var yf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function bf(e,t,n){for(let r in t)!Cs(t[r])&&!Bl(r,n)&&(e[r]=t[r])}function xf({transformTemplate:e},t){return(0,b.useMemo)(()=>{let n=yf();return Pl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Sf(e,t){let n=e.style||{},r={};return bf(r,n,e),Object.assign(r,xf(e,t)),r}function Cf(e,t){let n={},r=Sf(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var wf=()=>({...yf(),attrs:{}});function Tf(e,t,n,r){let i=(0,b.useMemo)(()=>{let n=wf();return Jl(n,t,Xl(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};bf(t,e.style,e),i.style={...t,...i.style}}return i}var Ef=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Df(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Ef.indexOf(e)>-1||/[A-Z]/u.test(e))}function Of(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??Df(e)?Tf:Cf)(t,r,i,e),c=mf(t,typeof e==`string`,a),l=e===b.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,b.useMemo)(()=>Cs(u)?u.get():u,[u]);return(0,b.createElement)(e,{...l,children:d})}function kf({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Af(n,r,i,e),renderState:t()}}function Af(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=rd(a[e]);let{initial:o,animate:s}=e,c=Xc(e),l=Zc(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Kc(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=gs(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var jf=e=>(t,n)=>{let r=(0,b.useContext)(hf),i=(0,b.useContext)(cr),a=()=>kf(e,t,r,i);return n?a():or(a)},Mf=jf({scrapeMotionValuesFromProps:Vl,createRenderState:yf}),Nf=jf({scrapeMotionValuesFromProps:Ql,createRenderState:wf}),Pf=Symbol.for(`motionComponentSymbol`);function Ff(e,t,n){let r=(0,b.useRef)(n);(0,b.useInsertionEffect)(()=>{r.current=n});let i=(0,b.useRef)(null);return(0,b.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}var If=(0,b.createContext)({});function Lf(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Rf(e,t,n,r,i,a){let{visualElement:o}=(0,b.useContext)(hf),s=(0,b.useContext)(ef),c=(0,b.useContext)(cr),l=(0,b.useContext)(Hd),u=l.reducedMotion,d=l.skipAnimations,f=(0,b.useRef)(null),p=(0,b.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,b.useContext)(If);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&zf(f.current,n,i,h);let g=(0,b.useRef)(!1);(0,b.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[Ds],v=(0,b.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return sr(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,b.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function zf(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Bf(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Lf(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Bf(e){if(e)return e.options.allowProjection===!1?Bf(e.parent):e.projection}function Vf(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&of(r);let a=n?n===`svg`:Df(e),o=a?Nf:Mf;function s(n,s){let c,l={...(0,b.useContext)(Hd),...n,layoutId:Hf(n)},{isStatic:u}=l,d=_f(n),f=o(n,u);if(!u&&typeof window<`u`){Uf(l,r);let t=Wf(l);c=t.MeasureLayout,d.visualElement=Rf(e,f,l,i,t.ProjectionNode,a)}return(0,q.jsxs)(hf.Provider,{value:d,children:[c&&d.visualElement?(0,q.jsx)(c,{visualElement:d.visualElement,...l}):null,Of(e,n,Ff(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,b.forwardRef)(s);return c[Pf]=e,c}function Hf({layoutId:e}){let t=(0,b.useContext)(ar).id;return t&&e!==void 0?t+`-`+e:e}function Uf(e,t){(0,b.useContext)(ef).strict}function Wf(e){let{drag:t,layout:n}=af();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Gf(e,t){if(typeof Proxy>`u`)return Vf;let n=new Map,r=(n,r)=>Vf(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Vf(a,void 0,e,t)),n.get(a))})}var Kf=(e,t)=>t.isSVG??Df(e)?new $l(t):new Ul(t,{allowProjection:e!==b.Fragment}),qf=class extends ll{constructor(e){super(e),e.animationState||=ou(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Kc(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Jf=0,Yf={animation:{Feature:qf},exit:{Feature:class extends ll{constructor(){super(...arguments),this.id=Jf++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=_s(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Xf(e){return{point:{x:e.pageX,y:e.pageY}}}var Zf=e=>t=>dc(t)&&e(t,Xf(t));function Qf(e,t,n,r){return $u(e,t,Zf(n),r)}var $f=({current:e})=>e?e.ownerDocument.defaultView:null,ep=(e,t)=>Math.abs(e-t);function tp(e,t){let n=ep(e.x,t.x),r=ep(e.y,t.y);return Math.sqrt(n**2+r**2)}var np=new Set([`auto`,`scroll`]),rp=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ip(this.lastRawMoveEventInfo,this.transformPagePoint));let e=op(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=tp(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=$r;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=ip(t,this.transformPagePoint),Zr.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=op(e.type===`pointercancel`?this.lastMoveEventInfo:ip(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!dc(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=ip(Xf(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=$r;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,op(s,this.history)),this.removeListeners=vr(Qf(this.contextWindow,`pointermove`,this.handlePointerMove),Qf(this.contextWindow,`pointerup`,this.handlePointerUp),Qf(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(np.has(e.overflowX)||np.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Zr.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Qr(this.updatePoint)}};function ip(e,t){return t?{point:t(e.point)}:e}function ap(e,t){return{x:e.x-t.x,y:e.y-t.y}}function op({point:e},t){return{point:e,delta:ap(e,cp(t)),offset:ap(e,sp(t)),velocity:lp(t,.1)}}function sp(e){return e[0]}function cp(e){return e[e.length-1]}function lp(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=cp(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>xr(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>xr(t)*2&&(r=e[1]);let a=Sr(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function up(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Qi(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Qi(n,e,r.max):Math.min(e,n)),e}function dp(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function fp(e,{top:t,left:n,bottom:r,right:i}){return{x:dp(e.x,n,i),y:dp(e.y,t,r)}}function pp(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function mp(e,t){return{x:pp(e.x,t.x),y:pp(e.y,t.y)}}function hp(e,t){let n=.5,r=yu(e),i=yu(t);return i>r?n=yr(t.min,t.max-r,e.min):r>i&&(n=yr(e.min,e.max-i,t.min)),dr(0,1,n)}function gp(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var _p=.35;function vp(e=_p){return e===!1?e=0:e===!0&&(e=_p),{x:yp(e,`left`,`right`),y:yp(e,`top`,`bottom`)}}function yp(e,t,n){return{min:bp(e,t),max:bp(e,n)}}function bp(e,t){return typeof e==`number`?e:e[t]||0}var xp=new WeakMap,Sp=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Wc(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Xf(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=oc(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Vu(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Di.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=yu(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Zr.update(()=>i(e,t),!1,!0),Ts(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Ep(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&Zr.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new rp(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:$f(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&Zr.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Tp(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=up(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Lf(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=fp(n.layoutBox,e):this.constraints=!1,this.elastic=vp(t),r!==this.constraints&&!Lf(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Vu(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=gp(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Lf(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Al(n,r.root,this.visualElement.getTransformPagePoint()),a=mp(r.layout.layoutBox,i);if(t){let e=t(dl(a));this.hasMutatedConstraints=!!e,e&&(a=ul(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Vu(o=>{if(!Tp(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Ts(this.visualElement,e),n.start(ds(e,n,0,t,this.visualElement,!1))}stopAnimation(){Vu(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Vu(t=>{let{drag:n}=this.getProps();if(!Tp(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Qi(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Lf(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};Vu(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=hp({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Vu(t=>{if(!Tp(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Qi(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;xp.set(this.visualElement,this);let e=this.visualElement.current,t=Qf(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&hc(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Lf(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=wp(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Zr.read(r);let o=$u(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Vu(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=_p,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Cp(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function wp(e,t,n){let r=Lc(e,Cp(n)),i=Lc(t,Cp(n));return()=>{r(),i()}}function Tp(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Ep(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Dp=class extends ll{constructor(e){super(e),this.removeGroupControls=_r,this.removeListeners=_r,this.controls=new Sp(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_r}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Op=e=>(t,n)=>{e&&Zr.update(()=>e(t,n),!1,!0)},kp=class extends ll{constructor(){super(...arguments),this.removePointerDownListener=_r}onPointerDown(e){this.session=new rp(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$f(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Op(e),onStart:Op(t),onMove:Op(n),onEnd:(e,t)=>{delete this.session,r&&Zr.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Qf(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Ap=!1,jp=class extends b.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Ap&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ad.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Ap=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Zr.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),nc.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Ap=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Mp(e){let[t,n]=Xd(),r=(0,b.useContext)(ar);return(0,q.jsx)(jp,{...e,layoutGroup:r,switchLayoutGroup:(0,b.useContext)(If),isPresent:t,safeToRemove:n})}var Np={pan:{Feature:kp},drag:{Feature:Dp,ProjectionNode:Vd,MeasureLayout:Mp}};function Pp(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&Zr.postRender(()=>i(t,Xf(t)))}var Fp=class extends ll{mount(){let{current:e}=this.node;e&&(this.unmount=lc(e,(e,t)=>(Pp(this.node,t,`Start`),e=>Pp(this.node,e,`End`))))}unmount(){}},Ip=class extends ll{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=vr($u(this.node.current,`focus`,()=>this.onFocus()),$u(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Lp(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&Zr.postRender(()=>i(t,Xf(t)))}var Rp=class extends ll{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Sc(e,(e,t)=>(Lp(this.node,t,`Start`),(e,{success:t})=>Lp(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},zp=new WeakMap,Bp=new WeakMap,Vp=e=>{let t=zp.get(e.target);t&&t(e)},Hp=e=>{e.forEach(Vp)};function Up({root:e,...t}){let n=e||document;Bp.has(n)||Bp.set(n,{});let r=Bp.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Hp,{root:e,...t})),r[i]}function Wp(e,t,n){let r=Up(t);return zp.set(e,n),r.observe(e),()=>{zp.delete(e),r.unobserve(e)}}var Gp={some:0,all:1},Kp=class extends ll{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Gp[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Wp(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(qp(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function qp({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Jp={inView:{Feature:Kp},tap:{Feature:Rp},focus:{Feature:Ip},hover:{Feature:Fp}},Yp={layout:{ProjectionNode:Vd,MeasureLayout:Mp}},Xp=Gf({...Yf,...Jp,...Np,...Yp},Kf);function Zp(){!el.current&&nl();let[e]=(0,b.useState)($c.current);return e}var Qp=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),$p=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),em=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),tm=e=>{let t=em(e);return t.charAt(0).toUpperCase()+t.slice(1)},nm={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},rm=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},im=(0,b.createContext)({}),am=()=>(0,b.useContext)(im),om=(0,b.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=am()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,b.createElement)(`svg`,{ref:c,...nm,width:t??l??nm.width,height:t??l??nm.height,stroke:e??f,strokeWidth:m,className:Qp(`lucide`,p,i),...!a&&!rm(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,b.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),J=(e,t)=>{let n=(0,b.forwardRef)(({className:n,...r},i)=>(0,b.createElement)(om,{ref:i,iconNode:t,className:Qp(`lucide-${$p(tm(e))}`,`lucide-${e}`,n),...r}));return n.displayName=tm(e),n},sm=J(`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`}]]),cm=J(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),lm=J(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),um=J(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),dm=J(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),fm=J(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),pm=J(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),mm=J(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),hm=J(`chevrons-left`,[[`path`,{d:`m11 17-5-5 5-5`,key:`13zhaf`}],[`path`,{d:`m18 17-5-5 5-5`,key:`h8a8et`}]]),gm=J(`chevrons-right`,[[`path`,{d:`m6 17 5-5-5-5`,key:`xnjwq`}],[`path`,{d:`m13 17 5-5-5-5`,key:`17xmmf`}]]),_m=J(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),vm=J(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ym=J(`circle-plus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),bm=J(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),xm=J(`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`}]]),Sm=J(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Cm=J(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),wm=J(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Tm=J(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Em=J(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),Dm=J(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Om=J(`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`}]]),km=J(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Am=J(`maximize`,[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]),jm=J(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),Mm=J(`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`}]]),Nm=J(`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`}]]),Pm=J(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),Fm=J(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),Im=J(`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`}]]),Lm=J(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),Rm=J(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),zm=J(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Bm=J(`redo`,[[`path`,{d:`M21 7v6h-6`,key:`3ptur4`}],[`path`,{d:`M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7`,key:`1kgawr`}]]),Vm=J(`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`}]]),Hm=J(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Um=J(`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`}]]),Wm=J(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Gm=J(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),Km=J(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),qm=J(`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`}]]),Jm=J(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Ym=J(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Xm=J(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Zm=J(`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`}]]),Qm=J(`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`}]]),$m=J(`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`}]]),eh=J(`undo`,[[`path`,{d:`M3 7v6h6`,key:`1v2h90`}],[`path`,{d:`M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13`,key:`1r6uu6`}]]),th=J(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),nh=J(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),rh=J(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),ih=J(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]);function ah(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function oh(...e){return t=>{let n=!1,r=e.map(e=>{let r=ah(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():ah(e[t],null)}}}}function sh(...e){return b.useCallback(oh(...e),e)}function ch(e){let t=uh(e),n=b.forwardRef((e,n)=>{let{children:r,...i}=e,a=b.Children.toArray(r),o=a.find(ph);if(o){let e=o.props.children,r=a.map(t=>t===o?b.Children.count(e)>1?b.Children.only(null):b.isValidElement(e)?e.props.children:null:t);return(0,q.jsx)(t,{...i,ref:n,children:b.isValidElement(e)?b.cloneElement(e,void 0,r):null})}return(0,q.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var lh=ch(`Slot`);function uh(e){let t=b.forwardRef((e,t)=>{let{children:n,...r}=e;if(b.isValidElement(n)){let e=hh(n),i=mh(r,n.props);return n.type!==b.Fragment&&(i.ref=t?oh(t,e):e),b.cloneElement(n,i)}return b.Children.count(n)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dh=Symbol(`radix.slottable`);function fh(e){let t=({children:e})=>(0,q.jsx)(q.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=dh,t}function ph(e){return b.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===dh}function mh(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function hh(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gh=u(_(),1),_h=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ch(`Primitive.${t}`),r=b.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,q.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vh(e,t){e&&gh.flushSync(()=>e.dispatchEvent(t))}var yh=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),bh=`VisuallyHidden`,xh=b.forwardRef((e,t)=>(0,q.jsx)(_h.span,{...e,ref:t,style:{...yh,...e.style}}));xh.displayName=bh;var Sh=xh;function Ch(e,t=[]){let n=[];function r(t,r){let i=b.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=b.useMemo(()=>o,Object.values(o));return(0,q.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=b.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>b.createContext(e));return function(n){let r=n?.[e]||t;return b.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,wh(i,...t)]}function wh(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Th(e){let t=e+`CollectionProvider`,[n,r]=Ch(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=b.useRef(null),a=b.useRef(new Map).current;return(0,q.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=ch(s),l=b.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,q.jsx)(c,{ref:sh(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=ch(u),p=b.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=b.useRef(null),s=sh(t,o),c=a(u,n);return b.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,q.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return b.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}typeof window<`u`&&window.document&&window.document.createElement;function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var Eh=globalThis?.document?b.useLayoutEffect:()=>{},Dh=b.useInsertionEffect||Eh;function Oh({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=kh({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=b.useRef(e!==void 0);b.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,b.useCallback(t=>{if(s){let n=Ah(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function kh({defaultProp:e,onChange:t}){let[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return Dh(()=>{a.current=t},[t]),b.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Ah(e){return typeof e==`function`}function jh(e,t){return b.useReducer((e,n)=>t[e][n]??e,e)}var Mh=e=>{let{present:t,children:n}=e,r=Nh(t),i=typeof n==`function`?n({present:r.isPresent}):b.Children.only(n),a=sh(r.ref,Fh(i));return typeof n==`function`||r.isPresent?b.cloneElement(i,{ref:a}):null};Mh.displayName=`Presence`;function Nh(e){let[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef(`none`),[o,s]=jh(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return b.useEffect(()=>{let e=Ph(r.current);a.current=o===`mounted`?e:`none`},[o]),Eh(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Ph(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Eh(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Ph(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Ph(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:b.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Ph(e){return e?.animationName||`none`}function Fh(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ih=b.useId||(()=>void 0),Lh=0;function Rh(e){let[t,n]=b.useState(Ih());return Eh(()=>{e||n(e=>e??String(Lh++))},[e]),e||(t?`radix-${t}`:``)}var zh=`Collapsible`,[Bh,Vh]=Ch(zh),[Hh,Uh]=Bh(zh),Wh=b.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Oh({prop:r,defaultProp:i??!1,onChange:o,caller:zh});return(0,q.jsx)(Hh,{scope:n,disabled:a,contentId:Rh(),open:c,onOpenToggle:b.useCallback(()=>l(e=>!e),[l]),children:(0,q.jsx)(_h.div,{"data-state":Xh(c),"data-disabled":a?``:void 0,...s,ref:t})})});Wh.displayName=zh;var Gh=`CollapsibleTrigger`,Kh=b.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=Uh(Gh,n);return(0,q.jsx)(_h.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Xh(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Y(e.onClick,i.onOpenToggle)})});Kh.displayName=Gh;var qh=`CollapsibleContent`,Jh=b.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Uh(qh,e.__scopeCollapsible);return(0,q.jsx)(Mh,{present:n||i.open,children:({present:e})=>(0,q.jsx)(Yh,{...r,ref:t,present:e})})});Jh.displayName=qh;var Yh=b.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=Uh(qh,n),[s,c]=b.useState(r),l=b.useRef(null),u=sh(t,l),d=b.useRef(0),f=d.current,p=b.useRef(0),m=p.current,h=o.open||s,g=b.useRef(h),_=b.useRef(void 0);return b.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),Eh(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,q.jsx)(_h.div,{"data-state":Xh(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function Xh(e){return e?`open`:`closed`}var Zh=Wh,Qh=b.createContext(void 0);function $h(e){let t=b.useContext(Qh);return e||t||`ltr`}function eg(e){let t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...e)=>t.current?.(...e),[])}function tg(e,t=globalThis?.document){let n=eg(e);b.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var ng=`DismissableLayer`,rg=`dismissableLayer.update`,ig=`dismissableLayer.pointerDownOutside`,ag=`dismissableLayer.focusOutside`,og,sg=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cg=b.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=b.useContext(sg),[u,d]=b.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=b.useState({}),m=sh(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,x=v>=_,S=dg(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=fg(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return tg(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),b.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(og=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),pg(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=og)}},[u,f,n,l]),b.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),pg())},[u,l]),b.useEffect(()=>{let e=()=>p({});return document.addEventListener(rg,e),()=>document.removeEventListener(rg,e)},[]),(0,q.jsx)(_h.div,{...c,ref:m,style:{pointerEvents:y?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,S.onPointerDownCapture)})});cg.displayName=ng;var lg=`DismissableLayerBranch`,ug=b.forwardRef((e,t)=>{let n=b.useContext(sg),r=b.useRef(null),i=sh(t,r);return b.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,q.jsx)(_h.div,{...e,ref:i})});ug.displayName=lg;function dg(e,t=globalThis?.document){let n=eg(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){mg(ig,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function fg(e,t=globalThis?.document){let n=eg(e),r=b.useRef(!1);return b.useEffect(()=>{let e=e=>{e.target&&!r.current&&mg(ag,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function pg(){let e=new CustomEvent(rg);document.dispatchEvent(e)}function mg(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?vh(i,a):i.dispatchEvent(a)}var hg=cg,gg=ug,_g=`focusScope.autoFocusOnMount`,vg=`focusScope.autoFocusOnUnmount`,yg={bubbles:!1,cancelable:!0},bg=`FocusScope`,xg=b.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=b.useState(null),l=eg(i),u=eg(a),d=b.useRef(null),f=sh(t,e=>c(e)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Og(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Og(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Og(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),b.useEffect(()=>{if(s){kg.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(_g,yg);s.addEventListener(_g,l),s.dispatchEvent(t),t.defaultPrevented||(Sg(Mg(wg(s)),{select:!0}),document.activeElement===e&&Og(s))}return()=>{s.removeEventListener(_g,l),setTimeout(()=>{let t=new CustomEvent(vg,yg);s.addEventListener(vg,u),s.dispatchEvent(t),t.defaultPrevented||Og(e??document.body,{select:!0}),s.removeEventListener(vg,u),kg.remove(p)},0)}}},[s,l,u,p]);let m=b.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Cg(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Og(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Og(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,q.jsx)(_h.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});xg.displayName=bg;function Sg(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Og(r,{select:t}),document.activeElement!==n)return}function Cg(e){let t=wg(e);return[Tg(t,e),Tg(t.reverse(),e)]}function wg(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Tg(e,t){for(let n of e)if(!Eg(n,{upTo:t}))return n}function Eg(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Dg(e){return e instanceof HTMLInputElement&&`select`in e}function Og(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Dg(e)&&t&&e.select()}}var kg=Ag();function Ag(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=jg(e,t),e.unshift(t)},remove(t){e=jg(e,t),e[0]?.resume()}}}function jg(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Mg(e){return e.filter(e=>e.tagName!==`A`)}var Ng=`Portal`,Pg=b.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=b.useState(!1);Eh(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?gh.createPortal((0,q.jsx)(_h.div,{...r,ref:t}),o):null});Pg.displayName=Ng;var Fg=0;function Ig(){b.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Lg()),document.body.insertAdjacentElement(`beforeend`,e[1]??Lg()),Fg++,()=>{Fg===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Fg--}},[])}function Lg(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Rg=function(){return Rg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Rg.apply(this,arguments)};function zg(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Bg(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Vg=`right-scroll-bar-position`,Hg=`width-before-scroll-bar`,Ug=`with-scroll-bars-hidden`,Wg=`--removed-body-scroll-bar-size`;function Gg(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Kg(e,t){var n=(0,b.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var qg=typeof window<`u`?b.useLayoutEffect:b.useEffect,Jg=new WeakMap;function Yg(e,t){var n=Kg(t||null,function(t){return e.forEach(function(e){return Gg(e,t)})});return qg(function(){var t=Jg.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Gg(e,null)}),i.forEach(function(e){r.has(e)||Gg(e,a)})}Jg.set(n,e)},[e]),n}function Xg(e){return e}function Zg(e,t){t===void 0&&(t=Xg);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Qg(e){e===void 0&&(e={});var t=Zg(null);return t.options=Rg({async:!0,ssr:!1},e),t}var $g=function(e){var t=e.sideCar,n=zg(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return b.createElement(r,Rg({},n))};$g.isSideCarExport=!0;function e_(e,t){return e.useMedium(t),$g}var t_=Qg(),n_=function(){},r_=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:n_,onWheelCapture:n_,onTouchMoveCapture:n_}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,x=zg(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Yg([n,t]),w=Rg(Rg({},x),i);return b.createElement(b.Fragment,null,u&&b.createElement(S,{sideCar:t_,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?b.cloneElement(b.Children.only(s),Rg(Rg({},w),{ref:C})):b.createElement(v,Rg({},w,{className:c,ref:C}),s))});r_.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},r_.classNames={fullWidth:Hg,zeroRight:Vg};var i_,a_=function(){if(i_)return i_;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function o_(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=a_();return t&&e.setAttribute(`nonce`,t),e}function s_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function c_(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var l_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=o_())&&(s_(t,n),c_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},u_=function(){var e=l_();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},d_=function(){var e=u_();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},f_={left:0,top:0,right:0,gap:0},p_=function(e){return parseInt(e||``,10)||0},m_=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[p_(n),p_(r),p_(i)]},h_=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return f_;var t=m_(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},g_=d_(),__=`data-scroll-locked`,v_=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
21
|
+
.${Ug} {
|
|
22
22
|
overflow: hidden ${r};
|
|
23
23
|
padding-right: ${s}px ${r};
|
|
24
24
|
}
|
|
25
|
-
body[${
|
|
25
|
+
body[${__}] {
|
|
26
26
|
overflow: hidden ${r};
|
|
27
27
|
overscroll-behavior: contain;
|
|
28
28
|
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
@@ -35,64 +35,64 @@ Error generating stack: `+e.message+`
|
|
|
35
35
|
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.${
|
|
38
|
+
.${Vg} {
|
|
39
39
|
right: ${s}px ${r};
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.${
|
|
42
|
+
.${Hg} {
|
|
43
43
|
margin-right: ${s}px ${r};
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.${
|
|
46
|
+
.${Vg} .${Vg} {
|
|
47
47
|
right: 0 ${r};
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.${
|
|
50
|
+
.${Hg} .${Hg} {
|
|
51
51
|
margin-right: 0 ${r};
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
body[${
|
|
55
|
-
${
|
|
54
|
+
body[${__}] {
|
|
55
|
+
${Wg}: ${s}px;
|
|
56
56
|
}
|
|
57
|
-
`},
|
|
57
|
+
`},y_=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},b_=function(){b.useEffect(function(){return document.body.setAttribute(__,(y_()+1).toString()),function(){var e=y_()-1;e<=0?document.body.removeAttribute(__):document.body.setAttribute(__,e.toString())}},[])},x_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;b_();var a=b.useMemo(function(){return h_(i)},[i]);return b.createElement(g_,{styles:v_(a,!t,i,n?``:`!important`)})},S_=!1;if(typeof window<`u`)try{var C_=Object.defineProperty({},`passive`,{get:function(){return S_=!0,!0}});window.addEventListener(`test`,C_,C_),window.removeEventListener(`test`,C_,C_)}catch{S_=!1}var w_=S_?{passive:!1}:!1,T_=function(e){return e.tagName===`TEXTAREA`},E_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!T_(e)&&n[t]===`visible`)},D_=function(e){return E_(e,`overflowY`)},O_=function(e){return E_(e,`overflowX`)},k_=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),M_(e,r)){var i=N_(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},A_=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},j_=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},M_=function(e,t){return e===`v`?D_(t):O_(t)},N_=function(e,t){return e===`v`?A_(t):j_(t)},P_=function(e,t){return e===`h`&&t===`rtl`?-1:1},F_=function(e,t,n,r,i){var a=P_(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=N_(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&M_(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},I_=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},L_=function(e){return[e.deltaX,e.deltaY]},R_=function(e){return e&&`current`in e?e.current:e},z_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},B_=function(e){return`
|
|
58
58
|
.block-interactivity-${e} {pointer-events: none;}
|
|
59
59
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
60
|
-
`},L_=0,R_=[];function z_(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(L_++)[0],a=b.useState(s_)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ig([e.lockRef.current],(e.shards||[]).map(P_),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=b.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=M_(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=T_(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=T_(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return j_(h,t,e,h===`h`?s:c,!0)},[]),c=b.useCallback(function(e){var n=e;if(!(!R_.length||R_[R_.length-1]!==a)){var r=`deltaY`in n?N_(n):M_(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&F_(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(P_).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=b.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:B_(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=b.useCallback(function(e){n.current=M_(e),r.current=void 0},[]),d=b.useCallback(function(t){l(t.type,N_(t),t.target,s(t,e.lockRef.current))},[]),f=b.useCallback(function(t){l(t.type,M_(t),t.target,s(t,e.lockRef.current))},[]);b.useEffect(function(){return R_.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,b_),document.addEventListener(`touchmove`,c,b_),document.addEventListener(`touchstart`,u,b_),function(){R_=R_.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,b_),document.removeEventListener(`touchmove`,c,b_),document.removeEventListener(`touchstart`,u,b_)}},[]);var p=e.removeScrollBar,m=e.inert;return b.createElement(b.Fragment,null,m?b.createElement(a,{styles:I_(i)}):null,p?b.createElement(__,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function B_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var V_=Xg(Zg,z_),H_=b.forwardRef(function(e,t){return b.createElement($g,Pg({},e,{ref:t,sideCar:V_}))});H_.classNames=$g.classNames;var U_=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},W_=new WeakMap,G_=new WeakMap,K_={},q_=0,J_=function(e){return e&&(e.host||J_(e.parentNode))},Y_=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=J_(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},X_=function(e,t,n,r){var i=Y_(t,Array.isArray(e)?e:[e]);K_[n]||(K_[n]=new WeakMap);var a=K_[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(W_.get(e)||0)+1,l=(a.get(e)||0)+1;W_.set(e,c),a.set(e,l),o.push(e),c===1&&i&&G_.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),q_++,function(){o.forEach(function(e){var t=W_.get(e)-1,i=a.get(e)-1;W_.set(e,t),a.set(e,i),t||(G_.has(e)||e.removeAttribute(r),G_.delete(e)),i||e.removeAttribute(n)}),q_--,q_||(W_=new WeakMap,W_=new WeakMap,G_=new WeakMap,K_={})}},Z_=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||U_(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),X_(r,i,n,`aria-hidden`)):function(){return null}},Q_=s((e=>{var t=p();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),$_=s(((e,t)=>{t.exports=Q_()}));function ev(e){let t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function tv(e){let[t,n]=b.useState(void 0);return Sh(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var nv=[`top`,`right`,`bottom`,`left`],rv=Math.min,iv=Math.max,av=Math.round,ov=Math.floor,sv=e=>({x:e,y:e}),cv={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function lv(e,t,n){return iv(e,rv(t,n))}function uv(e,t){return typeof e==`function`?e(t):e}function dv(e){return e.split(`-`)[0]}function fv(e){return e.split(`-`)[1]}function pv(e){return e===`x`?`y`:`x`}function mv(e){return e===`y`?`height`:`width`}function hv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function gv(e){return pv(hv(e))}function _v(e,t,n){n===void 0&&(n=!1);let r=fv(e),i=gv(e),a=mv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ev(o)),[o,Ev(o)]}function vv(e){let t=Ev(e);return[yv(e),t,yv(t)]}function yv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var bv=[`left`,`right`],xv=[`right`,`left`],Sv=[`top`,`bottom`],Cv=[`bottom`,`top`];function wv(e,t,n){switch(e){case`top`:case`bottom`:return n?t?xv:bv:t?bv:xv;case`left`:case`right`:return t?Sv:Cv;default:return[]}}function Tv(e,t,n,r){let i=fv(e),a=wv(dv(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(yv)))),a}function Ev(e){let t=dv(e);return cv[t]+e.slice(t.length)}function Dv(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ov(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Dv(e)}function kv(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}}function Av(e,t,n){let{reference:r,floating:i}=e,a=hv(t),o=gv(t),s=mv(o),c=dv(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(fv(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 jv(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}=uv(t,e),p=Ov(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=kv(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=kv(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 Mv=50,Nv=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:jv},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Av(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<Mv&&(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}=Av(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Pv=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}=uv(e,t)||{};if(l==null)return{};let d=Ov(u),f={x:n,y:r},p=gv(i),m=mv(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=rv(d[_],T),D=rv(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=lv(O,A,k),M=!c.arrow&&fv(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Fv=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}=uv(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=dv(r),_=hv(o),v=dv(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ev(o)]:vv(o)),x=p!==`none`;!d&&x&&b.push(...Tv(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=_v(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`&&_!==hv(t))||T.every(e=>hv(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=hv(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 Iv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Lv(e){return nv.some(t=>e[t]>=0)}var Rv=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=uv(e,t);switch(i){case`referenceHidden`:{let e=Iv(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Lv(e)}}}case`escaped`:{let e=Iv(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Lv(e)}}}default:return{}}}}},zv=new Set([`left`,`top`]);async function Bv(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=dv(n),s=fv(n),c=hv(n)===`y`,l=zv.has(o)?-1:1,u=a&&c?-1:1,d=uv(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 Vv=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 Bv(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}}}}},Hv=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}=uv(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=hv(dv(i)),p=pv(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=lv(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=lv(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}}}}}},Uv=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}=uv(e,t),u={x:n,y:r},d=hv(i),f=pv(d),p=u[f],m=u[d],h=uv(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=zv.has(dv(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}}}},Wv=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}=uv(e,t),u=await o.detectOverflow(t,l),d=dv(i),f=fv(i),p=hv(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=rv(h-u[g],v),x=rv(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=iv(u.left,0),t=iv(u.right,0),n=iv(u.top,0),r=iv(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:iv(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:iv(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 Gv(){return typeof window<`u`}function Kv(e){return Yv(e)?(e.nodeName||``).toLowerCase():`#document`}function qv(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jv(e){return((Yv(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Yv(e){return Gv()?e instanceof Node||e instanceof qv(e).Node:!1}function Xv(e){return Gv()?e instanceof Element||e instanceof qv(e).Element:!1}function Zv(e){return Gv()?e instanceof HTMLElement||e instanceof qv(e).HTMLElement:!1}function Qv(e){return!Gv()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof qv(e).ShadowRoot}function $v(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=uy(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ey(e){return/^(table|td|th)$/.test(Kv(e))}function ty(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ny=/transform|translate|scale|rotate|perspective|filter/,ry=/paint|layout|strict|content/,iy=e=>!!e&&e!==`none`,ay;function oy(e){let t=Xv(e)?uy(e):e;return iy(t.transform)||iy(t.translate)||iy(t.scale)||iy(t.rotate)||iy(t.perspective)||!cy()&&(iy(t.backdropFilter)||iy(t.filter))||ny.test(t.willChange||``)||ry.test(t.contain||``)}function sy(e){let t=fy(e);for(;Zv(t)&&!ly(t);){if(oy(t))return t;if(ty(t))return null;t=fy(t)}return null}function cy(){return ay??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ay}function ly(e){return/^(html|body|#document)$/.test(Kv(e))}function uy(e){return qv(e).getComputedStyle(e)}function dy(e){return Xv(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fy(e){if(Kv(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Qv(e)&&e.host||Jv(e);return Qv(t)?t.host:t}function py(e){let t=fy(e);return ly(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zv(t)&&$v(t)?t:py(t)}function my(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=py(e),i=r===e.ownerDocument?.body,a=qv(r);if(i){let e=hy(a);return t.concat(a,a.visualViewport||[],$v(r)?r:[],e&&n?my(e):[])}else return t.concat(r,my(r,[],n))}function hy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gy(e){let t=uy(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Zv(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=av(n)!==a||av(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function _y(e){return Xv(e)?e:e.contextElement}function vy(e){let t=_y(e);if(!Zv(t))return sv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=gy(t),o=(a?av(n.width):n.width)/r,s=(a?av(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var yy=sv(0);function by(e){let t=qv(e);return!cy()||!t.visualViewport?yy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qv(e)?!1:t}function Sy(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=_y(e),o=sv(1);t&&(r?Xv(r)&&(o=vy(r)):o=vy(e));let s=xy(a,n,r)?by(a):sv(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=qv(a),t=r&&Xv(r)?qv(r):r,n=e,i=hy(n);for(;i&&r&&t!==n;){let e=vy(i),t=i.getBoundingClientRect(),r=uy(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=qv(i),i=hy(n)}}return kv({width:u,height:d,x:c,y:l})}function Cy(e,t){let n=dy(e).scrollLeft;return t?t.left+n:Sy(Jv(e)).left+n}function wy(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Cy(e,n),y:n.top+t.scrollTop}}function Ty(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Jv(r),s=t?ty(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=sv(1),u=sv(0),d=Zv(r);if((d||!d&&!a)&&((Kv(r)!==`body`||$v(o))&&(c=dy(r)),d)){let e=Sy(r);l=vy(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?wy(o,c):sv(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 Ey(e){return Array.from(e.getClientRects())}function Dy(e){let t=Jv(e),n=dy(e),r=e.ownerDocument.body,i=iv(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=iv(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Cy(e),s=-n.scrollTop;return uy(r).direction===`rtl`&&(o+=iv(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Oy=25;function ky(e,t){let n=qv(e),r=Jv(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=cy();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Cy(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<=Oy&&(a-=o)}else l<=Oy&&(a+=l);return{width:a,height:o,x:s,y:c}}function Ay(e,t){let n=Sy(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Zv(e)?vy(e):sv(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function jy(e,t,n){let r;if(t===`viewport`)r=ky(e,n);else if(t===`document`)r=Dy(Jv(e));else if(Xv(t))r=Ay(t,n);else{let n=by(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return kv(r)}function My(e,t){let n=fy(e);return n===t||!Xv(n)||ly(n)?!1:uy(n).position===`fixed`||My(n,t)}function Ny(e,t){let n=t.get(e);if(n)return n;let r=my(e,[],!1).filter(e=>Xv(e)&&Kv(e)!==`body`),i=null,a=uy(e).position===`fixed`,o=a?fy(e):e;for(;Xv(o)&&!ly(o);){let t=uy(o),n=oy(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||$v(o)&&!n&&My(e,o))?r=r.filter(e=>e!==o):i=t,o=fy(o)}return t.set(e,r),r}function Py(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ty(t)?[]:Ny(t,this._c):[].concat(n),r],o=jy(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=jy(t,a[e],i);s=iv(n.top,s),c=rv(n.right,c),l=rv(n.bottom,l),u=iv(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Fy(e){let{width:t,height:n}=gy(e);return{width:t,height:n}}function Iy(e,t,n){let r=Zv(t),i=Jv(t),a=n===`fixed`,o=Sy(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=sv(0);function l(){c.x=Cy(i)}if(r||!r&&!a)if((Kv(t)!==`body`||$v(i))&&(s=dy(t)),r){let e=Sy(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?wy(i,s):sv(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 Ly(e){return uy(e).position===`static`}function Ry(e,t){if(!Zv(e)||uy(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Jv(e)===n&&(n=n.ownerDocument.body),n}function zy(e,t){let n=qv(e);if(ty(e))return n;if(!Zv(e)){let t=fy(e);for(;t&&!ly(t);){if(Xv(t)&&!Ly(t))return t;t=fy(t)}return n}let r=Ry(e,t);for(;r&&ey(r)&&Ly(r);)r=Ry(r,t);return r&&ly(r)&&Ly(r)&&!oy(r)?n:r||sy(e)||n}var By=async function(e){let t=this.getOffsetParent||zy,n=this.getDimensions,r=await n(e.floating);return{reference:Iy(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Vy(e){return uy(e).direction===`rtl`}var Hy={convertOffsetParentRelativeRectToViewportRelativeRect:Ty,getDocumentElement:Jv,getClippingRect:Py,getOffsetParent:zy,getElementRects:By,getClientRects:Ey,getDimensions:Fy,getScale:vy,isElement:Xv,isRTL:Vy};function Uy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wy(e,t){let n=null,r,i=Jv(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=ov(d),h=ov(i.clientWidth-(u+f)),g=ov(i.clientHeight-(d+p)),_=ov(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:iv(0,rv(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&&!Uy(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 Gy(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=_y(e),u=i||a?[...l?my(l):[],...t?my(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Wy(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?Sy(e):null;c&&g();function g(){let t=Sy(e);h&&!Uy(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 Ky=Vv,qy=Hv,Jy=Fv,Yy=Wv,Xy=Rv,Zy=Pv,Qy=Uv,$y=(e,t,n)=>{let r=new Map,i={platform:Hy,...n},a={...i.platform,_c:r};return Nv(e,t,{...i,platform:a})},eb=typeof document<`u`?b.useLayoutEffect:function(){};function tb(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(!tb(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)&&!tb(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function nb(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rb(e,t){let n=nb(e);return Math.round(t*n)/n}function ib(e){let t=b.useRef(e);return eb(()=>{t.current=e}),t}function ab(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]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);tb(f,r)||p(r);let[m,h]=b.useState(null),[g,_]=b.useState(null),v=b.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=b.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=b.useRef(null),w=b.useRef(null),T=b.useRef(u),E=c!=null,D=ib(c),O=ib(i),k=ib(l),A=b.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),$y(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!tb(T.current,t)&&(T.current=t,fh.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);eb(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=b.useRef(!1);eb(()=>(j.current=!0,()=>{j.current=!1}),[]),eb(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=b.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),N=b.useMemo(()=>({reference:x,floating:S}),[x,S]),P=b.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=rb(N.floating,u.x),r=rb(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...nb(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var ob=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Zy({element:r.current,padding:i}).fn(n):r?Zy({element:r,padding:i}).fn(n):{}}}},sb=(e,t)=>{let n=Ky(e);return{name:n.name,fn:n.fn,options:[e,t]}},cb=(e,t)=>{let n=qy(e);return{name:n.name,fn:n.fn,options:[e,t]}},lb=(e,t)=>({fn:Qy(e).fn,options:[e,t]}),ub=(e,t)=>{let n=Jy(e);return{name:n.name,fn:n.fn,options:[e,t]}},db=(e,t)=>{let n=Yy(e);return{name:n.name,fn:n.fn,options:[e,t]}},fb=(e,t)=>{let n=Xy(e);return{name:n.name,fn:n.fn,options:[e,t]}},pb=(e,t)=>{let n=ob(e);return{name:n.name,fn:n.fn,options:[e,t]}},mb=`Arrow`,hb=b.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,q.jsx)(ph.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,q.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});hb.displayName=mb;var gb=hb,_b=`Popper`,[vb,yb]=yh(_b),[bb,xb]=vb(_b),Sb=e=>{let{__scopePopper:t,children:n}=e,[r,i]=b.useState(null);return(0,q.jsx)(bb,{scope:t,anchor:r,onAnchorChange:i,children:n})};Sb.displayName=_b;var Cb=`PopperAnchor`,wb=b.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=xb(Cb,n),o=b.useRef(null),s=rh(t,o),c=b.useRef(null);return b.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,q.jsx)(ph.div,{...i,ref:s})});wb.displayName=Cb;var Tb=`PopperContent`,[Eb,Db]=vb(Tb),Ob=b.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=xb(Tb,n),[_,v]=b.useState(null),y=rh(t,e=>v(e)),[x,S]=b.useState(null),C=tv(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Mb),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=ab({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>Gy(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[sb({mainAxis:i+T,alignmentAxis:o}),c&&cb({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?lb():void 0,...A}),c&&ub({...A}),db({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&pb({element:x,padding:s}),Nb({arrowWidth:w,arrowHeight:T}),f&&fb({strategy:`referenceHidden`,...A})]}),[I,L]=Pb(N),ee=Xh(m);Sh(()=>{P&&ee?.()},[P,ee]);let te=F.arrow?.x,ne=F.arrow?.y,R=F.arrow?.centerOffset!==0,[z,B]=b.useState();return Sh(()=>{_&&B(window.getComputedStyle(_).zIndex)},[_]),(0,q.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:z,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,q.jsx)(Eb,{scope:n,placedSide:I,onArrowChange:S,arrowX:te,arrowY:ne,shouldHideArrow:R,children:(0,q.jsx)(ph.div,{"data-side":I,"data-align":L,...h,ref:y,style:{...h.style,animation:P?void 0:`none`}})})})});Ob.displayName=Tb;var kb=`PopperArrow`,Ab={top:`bottom`,right:`left`,bottom:`top`,left:`right`},jb=b.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Db(kb,n),a=Ab[i.placedSide];return(0,q.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,q.jsx)(gb,{...r,ref:t,style:{...r.style,display:`block`}})})});jb.displayName=kb;function Mb(e){return e!==null}var Nb=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Pb(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Pb(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Fb=Sb,Ib=wb,Lb=Ob,Rb=jb,zb=`rovingFocusGroup.onEntryFocus`,Bb={bubbles:!1,cancelable:!0},Vb=`RovingFocusGroup`,[Hb,Ub,Wb]=xh(Vb),[Gb,Kb]=yh(Vb,[Wb]),[qb,Jb]=Gb(Vb),Yb=b.forwardRef((e,t)=>(0,q.jsx)(Hb.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,q.jsx)(Hb.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,q.jsx)(Xb,{...e,ref:t})})}));Yb.displayName=Vb;var Xb=b.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=b.useRef(null),p=rh(t,f),m=Yh(a),[h,g]=wh({prop:o,defaultProp:s??null,onChange:c,caller:Vb}),[_,v]=b.useState(!1),y=Xh(l),x=Ub(n),S=b.useRef(!1),[C,w]=b.useState(0);return b.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(zb,y),()=>e.removeEventListener(zb,y)},[y]),(0,q.jsx)(qb,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:b.useCallback(e=>g(e),[g]),onItemShiftTab:b.useCallback(()=>v(!0),[]),onFocusableItemAdd:b.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:b.useCallback(()=>w(e=>e-1),[]),children:(0,q.jsx)(ph.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:Y(e.onMouseDown,()=>{S.current=!0}),onFocus:Y(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(zb,Bb);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);nx([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:Y(e.onBlur,()=>v(!1))})})}),Zb=`RovingFocusGroupItem`,Qb=b.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Ph(),l=a||c,u=Jb(Zb,n),d=u.currentTabStopId===l,f=Ub(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return b.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,q.jsx)(Hb.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,q.jsx)(ph.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Y(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Y(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Y(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=tx(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?rx(n,r+1):n.slice(r+1)}setTimeout(()=>nx(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Qb.displayName=Zb;var $b={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ex(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function tx(e,t,n){let r=ex(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return $b[r]}function nx(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function rx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ix=Yb,ax=Qb,ox=`Label`,sx=b.forwardRef((e,t)=>(0,q.jsx)(ph.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));sx.displayName=ox;var cx=sx;function lx(e,[t,n]){return Math.min(n,Math.max(t,e))}var ux=[` `,`Enter`,`ArrowUp`,`ArrowDown`],dx=[` `,`Enter`],fx=`Select`,[px,mx,hx]=xh(fx),[gx,_x]=yh(fx,[hx,yb]),vx=yb(),[yx,bx]=gx(fx),[xx,Sx]=gx(fx),Cx=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=vx(t),[g,_]=b.useState(null),[v,y]=b.useState(null),[x,S]=b.useState(!1),C=Yh(l),[w,T]=wh({prop:r,defaultProp:i??!1,onChange:a,caller:fx}),[E,D]=wh({prop:o,defaultProp:s,onChange:c,caller:fx}),O=b.useRef(null),k=g?m||!!g.closest(`form`):!0,[A,j]=b.useState(new Set),M=Array.from(A).map(e=>e.props.value).join(`;`);return(0,q.jsx)(Fb,{...h,children:(0,q.jsxs)(yx,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:Ph(),value:E,onValueChange:D,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:f,children:[(0,q.jsx)(px.Provider,{scope:t,children:(0,q.jsx)(xx,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(e=>{j(t=>new Set(t).add(e))},[]),onNativeOptionRemove:b.useCallback(e=>{j(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),k?(0,q.jsxs)(vS,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:E,onChange:e=>D(e.target.value),disabled:f,form:m,children:[E===void 0?(0,q.jsx)(`option`,{value:``}):null,Array.from(A)]},M):null]})})};Cx.displayName=fx;var wx=`SelectTrigger`,Tx=b.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=vx(n),o=bx(wx,n),s=o.disabled||r,c=rh(t,o.onTriggerChange),l=mx(n),u=b.useRef(`touch`),[d,f,p]=bS(e=>{let t=l().filter(e=>!e.disabled),n=xS(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,q.jsx)(Ib,{asChild:!0,...a,children:(0,q.jsx)(ph.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":yS(o.value)?``:void 0,...i,ref:c,onClick:Y(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:Y(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:Y(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&ux.includes(e.key)&&(m(),e.preventDefault())})})})});Tx.displayName=wx;var Ex=`SelectValue`,Dx=b.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=bx(Ex,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=rh(t,c.onValueNodeChange);return Sh(()=>{l(u)},[l,u]),(0,q.jsx)(ph.span,{...s,ref:d,style:{pointerEvents:`none`},children:yS(c.value)?(0,q.jsx)(q.Fragment,{children:o}):a})});Dx.displayName=Ex;var Ox=`SelectIcon`,kx=b.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,q.jsx)(ph.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});kx.displayName=Ox;var Ax=`SelectPortal`,jx=e=>(0,q.jsx)(Ag,{asChild:!0,...e});jx.displayName=Ax;var Mx=`SelectContent`,Nx=b.forwardRef((e,t)=>{let n=bx(Mx,e.__scopeSelect),[r,i]=b.useState();if(Sh(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?fh.createPortal((0,q.jsx)(Fx,{scope:e.__scopeSelect,children:(0,q.jsx)(px.Slot,{scope:e.__scopeSelect,children:(0,q.jsx)(`div`,{children:e.children})})}),t):null}return(0,q.jsx)(zx,{...e,ref:t})});Nx.displayName=Mx;var Px=10,[Fx,Ix]=gx(Mx),Lx=`SelectContentImpl`,Rx=ih(`SelectContent.RemoveScroll`),zx=b.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=bx(Mx,n),[y,x]=b.useState(null),[S,C]=b.useState(null),w=rh(t,e=>x(e)),[T,E]=b.useState(null),[D,O]=b.useState(null),k=mx(n),[A,j]=b.useState(!1),M=b.useRef(!1);b.useEffect(()=>{if(y)return Z_(y)},[y]),Mg();let N=b.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),P=b.useCallback(()=>N([T,y]),[N,T,y]);b.useEffect(()=>{A&&P()},[A,P]);let{onOpenChange:F,triggerPointerDownPosRef:I}=v;b.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||F(!1),document.removeEventListener(`pointermove`,t),I.current=null};return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,F,I]),b.useEffect(()=>{let e=()=>F(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[L,ee]=bS(e=>{let t=k().filter(e=>!e.disabled),n=xS(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),te=b.useCallback((e,t,n)=>{let r=!M.current&&!n;(v.value!==void 0&&v.value===t||r)&&(E(e),r&&(M.current=!0))},[v.value]),ne=b.useCallback(()=>y?.focus(),[y]),R=b.useCallback((e,t,n)=>{let r=!M.current&&!n;(v.value!==void 0&&v.value===t||r)&&O(e)},[v.value]),z=r===`popper`?Ux:Vx,B=z===Ux?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,q.jsx)(Fx,{scope:n,content:y,viewport:S,onViewportChange:C,itemRefCallback:te,selectedItem:T,onItemLeave:ne,itemTextRefCallback:R,focusSelectedItem:P,selectedItemText:D,position:r,isPositioned:A,searchRef:L,children:(0,q.jsx)(H_,{as:Rx,allowPinchZoom:!0,children:(0,q.jsx)(_g,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Y(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,q.jsx)(ig,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,q.jsx)(z,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...B,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:Y(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ee(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})});zx.displayName=Lx;var Bx=`SelectItemAlignedPosition`,Vx=b.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=bx(Mx,n),o=Ix(Mx,n),[s,c]=b.useState(null),[l,u]=b.useState(null),d=rh(t,e=>u(e)),f=mx(n),p=b.useRef(!1),m=b.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=b.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Px,d=lx(a,[Px,Math.max(Px,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Px,d=lx(a,[Px,Math.max(Px,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Px*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Px,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${Px}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Sh(()=>y(),[y]);let[x,S]=b.useState();return Sh(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,q.jsx)(Wx,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:b.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,q.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,q.jsx)(ph.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});Vx.displayName=Bx;var Hx=`SelectPopperPosition`,Ux=b.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Px,...a}=e,o=vx(n);return(0,q.jsx)(Lb,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});Ux.displayName=Hx;var[Wx,Gx]=gx(Mx,{}),Kx=`SelectViewport`,qx=b.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Ix(Kx,n),o=Gx(Kx,n),s=rh(t,a.onViewportChange),c=b.useRef(0);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,q.jsx)(px.Slot,{scope:n,children:(0,q.jsx)(ph.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:Y(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Px*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});qx.displayName=Kx;var Jx=`SelectGroup`,[Yx,Xx]=gx(Jx),Zx=b.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ph();return(0,q.jsx)(Yx,{scope:n,id:i,children:(0,q.jsx)(ph.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Zx.displayName=Jx;var Qx=`SelectLabel`,$x=b.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Xx(Qx,n);return(0,q.jsx)(ph.div,{id:i.id,...r,ref:t})});$x.displayName=Qx;var eS=`SelectItem`,[tS,nS]=gx(eS),rS=b.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=bx(eS,n),c=Ix(eS,n),l=s.value===r,[u,d]=b.useState(a??``),[f,p]=b.useState(!1),m=rh(t,e=>c.itemRefCallback?.(e,r,i)),h=Ph(),g=b.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,q.jsx)(tS,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:b.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,q.jsx)(px.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,q.jsx)(ph.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:Y(o.onFocus,()=>p(!0)),onBlur:Y(o.onBlur,()=>p(!1)),onClick:Y(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:Y(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:Y(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:Y(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Y(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Y(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(dx.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});rS.displayName=eS;var iS=`SelectItemText`,aS=b.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=bx(iS,n),s=Ix(iS,n),c=nS(iS,n),l=Sx(iS,n),[u,d]=b.useState(null),f=rh(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=b.useMemo(()=>(0,q.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return Sh(()=>(h(m),()=>g(m)),[h,g,m]),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ph.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?fh.createPortal(a.children,o.valueNode):null]})});aS.displayName=iS;var oS=`SelectItemIndicator`,sS=b.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return nS(oS,n).isSelected?(0,q.jsx)(ph.span,{"aria-hidden":!0,...r,ref:t}):null});sS.displayName=oS;var cS=`SelectScrollUpButton`,lS=b.forwardRef((e,t)=>{let n=Ix(cS,e.__scopeSelect),r=Gx(cS,e.__scopeSelect),[i,a]=b.useState(!1),o=rh(t,r.onScrollButtonChange);return Sh(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,q.jsx)(fS,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});lS.displayName=cS;var uS=`SelectScrollDownButton`,dS=b.forwardRef((e,t)=>{let n=Ix(uS,e.__scopeSelect),r=Gx(uS,e.__scopeSelect),[i,a]=b.useState(!1),o=rh(t,r.onScrollButtonChange);return Sh(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,q.jsx)(fS,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});dS.displayName=uS;var fS=b.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Ix(`SelectScrollButton`,n),o=b.useRef(null),s=mx(n),c=b.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),Sh(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,q.jsx)(ph.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Y(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Y(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Y(i.onPointerLeave,()=>{c()})})}),pS=`SelectSeparator`,mS=b.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,q.jsx)(ph.div,{"aria-hidden":!0,...r,ref:t})});mS.displayName=pS;var hS=`SelectArrow`,gS=b.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=vx(n),a=bx(hS,n),o=Ix(hS,n);return a.open&&o.position===`popper`?(0,q.jsx)(Rb,{...i,...r,ref:t}):null});gS.displayName=hS;var _S=`SelectBubbleInput`,vS=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=b.useRef(null),a=rh(r,i),o=ev(t);return b.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,q.jsx)(ph.select,{...n,style:{...hh,...n.style},ref:a,defaultValue:t})});vS.displayName=_S;function yS(e){return e===``||e===void 0}function bS(e){let t=Xh(e),n=b.useRef(``),r=b.useRef(0),i=b.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=b.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function xS(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=SS(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function SS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CS=Cx,wS=Tx,TS=Dx,ES=kx,DS=jx,OS=Nx,kS=qx,AS=rS,jS=aS,MS=sS,NS=lS,PS=dS,FS=`Tabs`,[IS,LS]=yh(FS,[Kb]),RS=Kb(),[zS,BS]=IS(FS),VS=b.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Yh(s),[d,f]=wh({prop:r,onChange:i,defaultProp:a??``,caller:FS});return(0,q.jsx)(zS,{scope:n,baseId:Ph(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,q.jsx)(ph.div,{dir:u,"data-orientation":o,...l,ref:t})})});VS.displayName=FS;var HS=`TabsList`,US=b.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=BS(HS,n),o=RS(n);return(0,q.jsx)(ix,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,q.jsx)(ph.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});US.displayName=HS;var WS=`TabsTrigger`,GS=b.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=BS(WS,n),s=RS(n),c=JS(o.baseId,r),l=YS(o.baseId,r),u=r===o.value;return(0,q.jsx)(ax,{asChild:!0,...s,focusable:!i,active:u,children:(0,q.jsx)(ph.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Y(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:Y(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:Y(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});GS.displayName=WS;var KS=`TabsContent`,qS=b.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=BS(KS,n),c=JS(s.baseId,r),l=YS(s.baseId,r),u=r===s.value,d=b.useRef(u);return b.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,q.jsx)(Oh,{present:i||u,children:({present:n})=>(0,q.jsx)(ph.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});qS.displayName=KS;function JS(e,t){return`${e}-trigger-${t}`}function YS(e,t){return`${e}-content-${t}`}var XS=VS,ZS=US,QS=GS,$S=qS,eC=`ToastProvider`,[tC,nC,rC]=xh(`Toast`),[iC,aC]=yh(`Toast`,[rC]),[oC,sC]=iC(eC),cC=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=b.useState(null),[l,u]=b.useState(0),d=b.useRef(!1),f=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${eC}\`. Expected non-empty \`string\`.`),(0,q.jsx)(tC.Provider,{scope:t,children:(0,q.jsx)(oC,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:b.useCallback(()=>u(e=>e+1),[]),onToastRemove:b.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};cC.displayName=eC;var lC=`ToastViewport`,uC=[`F8`],dC=`toast.viewportPause`,fC=`toast.viewportResume`,pC=b.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=uC,label:i=`Notifications ({hotkey})`,...a}=e,o=sC(lC,n),s=nC(n),c=b.useRef(null),l=b.useRef(null),u=b.useRef(null),d=b.useRef(null),f=rh(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;b.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),b.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(dC);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(fC);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=b.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...BC(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return b.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);VC(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,q.jsxs)(fg,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,q.jsx)(hC,{ref:l,onFocusFromOutsideViewport:()=>{VC(h({tabbingDirection:`forwards`}))}}),(0,q.jsx)(tC.Slot,{scope:n,children:(0,q.jsx)(ph.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,q.jsx)(hC,{ref:u,onFocusFromOutsideViewport:()=>{VC(h({tabbingDirection:`backwards`}))}})]})});pC.displayName=lC;var mC=`ToastFocusProxy`,hC=b.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=sC(mC,n);return(0,q.jsx)(_h,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});hC.displayName=mC;var gC=`Toast`,_C=`toast.swipeStart`,vC=`toast.swipeMove`,yC=`toast.swipeCancel`,bC=`toast.swipeEnd`,xC=b.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=wh({prop:r,defaultProp:i??!0,onChange:a,caller:gC});return(0,q.jsx)(Oh,{present:n||s,children:(0,q.jsx)(wC,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:Xh(e.onPause),onResume:Xh(e.onResume),onSwipeStart:Y(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:Y(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:Y(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:Y(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});xC.displayName=gC;var[SC,CC]=iC(gC,{onClose(){}}),wC=b.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=sC(gC,n),[g,_]=b.useState(null),v=rh(t,e=>_(e)),y=b.useRef(null),x=b.useRef(null),S=i||h.duration,C=b.useRef(0),w=b.useRef(S),T=b.useRef(0),{onToastAdd:E,onToastRemove:D}=h,O=Xh(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),k=b.useCallback(e=>{!e||e===1/0||(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(O,e))},[O]);b.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{k(w.current),l?.()},n=()=>{let e=new Date().getTime()-C.current;w.current-=e,window.clearTimeout(T.current),c?.()};return e.addEventListener(dC,n),e.addEventListener(fC,t),()=>{e.removeEventListener(dC,n),e.removeEventListener(fC,t)}}},[h.viewport,S,c,l,k]),b.useEffect(()=>{a&&!h.isClosePausedRef.current&&k(S)},[a,S,h.isClosePausedRef,k]),b.useEffect(()=>(E(),()=>D()),[E,D]);let A=b.useMemo(()=>g?FC(g):null,[g]);return h.viewport?(0,q.jsxs)(q.Fragment,{children:[A&&(0,q.jsx)(TC,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:A}),(0,q.jsx)(SC,{scope:n,onClose:O,children:fh.createPortal((0,q.jsx)(tC.ItemSlot,{scope:n,children:(0,q.jsx)(dg,{asChild:!0,onEscapeKeyDown:Y(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||O(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,q.jsx)(ph.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:v,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:Y(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:Y(e.onPointerDown,e=>{e.button===0&&(y.current={x:e.clientX,y:e.clientY})}),onPointerMove:Y(e.onPointerMove,e=>{if(!y.current)return;let t=e.clientX-y.current.x,n=e.clientY-y.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,IC(vC,d,f,{discrete:!1})):LC(l,h.swipeDirection,c)?(x.current=l,IC(_C,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(y.current=null)}),onPointerUp:Y(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,y.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};LC(t,h.swipeDirection,h.swipeThreshold)?IC(bC,p,r,{discrete:!0}):IC(yC,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),TC=e=>{let{__scopeToast:t,children:n,...r}=e,i=sC(gC,t),[a,o]=b.useState(!1),[s,c]=b.useState(!1);return RC(()=>o(!0)),b.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,q.jsx)(Ag,{asChild:!0,children:(0,q.jsx)(_h,{...r,children:a&&(0,q.jsxs)(q.Fragment,{children:[i.label,` `,n]})})})},EC=`ToastTitle`,DC=b.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,q.jsx)(ph.div,{...r,ref:t})});DC.displayName=EC;var OC=`ToastDescription`,kC=b.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,q.jsx)(ph.div,{...r,ref:t})});kC.displayName=OC;var AC=`ToastAction`,jC=b.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,q.jsx)(PC,{altText:n,asChild:!0,children:(0,q.jsx)(NC,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${AC}\`. Expected non-empty \`string\`.`),null)});jC.displayName=AC;var MC=`ToastClose`,NC=b.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=CC(MC,n);return(0,q.jsx)(PC,{asChild:!0,children:(0,q.jsx)(ph.button,{type:`button`,...r,ref:t,onClick:Y(e.onClick,i.onClose)})})});NC.displayName=MC;var PC=b.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,q.jsx)(ph.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function FC(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),zC(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...FC(e))}}),t}function IC(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?mh(i,a):i.dispatchEvent(a)}var LC=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function RC(e=()=>{}){let t=Xh(e);Sh(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function zC(e){return e.nodeType===e.ELEMENT_NODE}function BC(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function VC(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var HC=cC,UC=pC,WC=xC,GC=DC,KC=kC,qC=NC,[JC,YC]=yh(`Tooltip`,[yb]),XC=yb(),ZC=`TooltipProvider`,QC=700,$C=`tooltip.open`,[ew,tw]=JC(ZC),nw=e=>{let{__scopeTooltip:t,delayDuration:n=QC,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=b.useRef(!0),s=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,q.jsx)(ew,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:b.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};nw.displayName=ZC;var rw=`Tooltip`,[iw,aw]=JC(rw),ow=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=tw(rw,e.__scopeTooltip),l=XC(t),[u,d]=b.useState(null),f=Ph(),p=b.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=b.useRef(!1),[_,v]=wh({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent($C))):c.onClose(),a?.(e)},caller:rw}),y=b.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),x=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),S=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),C=b.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return b.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,q.jsx)(Fb,{...l,children:(0,q.jsx)(iw,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:b.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};ow.displayName=rw;var sw=`TooltipTrigger`,cw=b.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=aw(sw,n),a=tw(sw,n),o=XC(n),s=rh(t,b.useRef(null),i.onTriggerChange),c=b.useRef(!1),l=b.useRef(!1),u=b.useCallback(()=>c.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,q.jsx)(Ib,{asChild:!0,...o,children:(0,q.jsx)(ph.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Y(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Y(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Y(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Y(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Y(e.onBlur,i.onClose),onClick:Y(e.onClick,i.onClose)})})});cw.displayName=sw;var lw=`TooltipPortal`,[uw,dw]=JC(lw,{forceMount:void 0}),fw=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=aw(lw,t);return(0,q.jsx)(uw,{scope:t,forceMount:n,children:(0,q.jsx)(Oh,{present:n||a.open,children:(0,q.jsx)(Ag,{asChild:!0,container:i,children:r})})})};fw.displayName=lw;var pw=`TooltipContent`,mw=b.forwardRef((e,t)=>{let n=dw(pw,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=aw(pw,e.__scopeTooltip);return(0,q.jsx)(Oh,{present:r||o.open,children:o.disableHoverableContent?(0,q.jsx)(yw,{side:i,...a,ref:t}):(0,q.jsx)(hw,{side:i,...a,ref:t})})}),hw=b.forwardRef((e,t)=>{let n=aw(pw,e.__scopeTooltip),r=tw(pw,e.__scopeTooltip),i=b.useRef(null),a=rh(t,i),[o,s]=b.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=b.useCallback(()=>{s(null),d(!1)},[d]),p=b.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Cw(r,Sw(r,n.getBoundingClientRect())),a=ww(t.getBoundingClientRect());s(Ew([...i,...a])),d(!0)},[d]);return b.useEffect(()=>()=>f(),[f]),b.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),b.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Tw(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,q.jsx)(yw,{...e,ref:a})}),[gw,_w]=JC(rw,{isInside:!1}),vw=ch(`TooltipContent`),yw=b.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=aw(pw,n),l=XC(n),{onClose:u}=c;return b.useEffect(()=>(document.addEventListener($C,u),()=>document.removeEventListener($C,u)),[u]),b.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,q.jsx)(ig,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,q.jsxs)(Lb,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,q.jsx)(vw,{children:r}),(0,q.jsx)(gw,{scope:n,isInside:!0,children:(0,q.jsx)(vh,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});mw.displayName=pw;var bw=`TooltipArrow`,xw=b.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=XC(n);return _w(bw,n).isInside?null:(0,q.jsx)(Rb,{...i,...r,ref:t})});xw.displayName=bw;function Sw(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Cw(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ww(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Tw(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Ew(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Dw(t)}function Dw(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ow=nw,kw=ow,Aw=cw,jw=fw,Mw=mw,Nw=xw,Pw=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Fw=C,Iw=(e,t)=>n=>{if(t?.variants==null)return Fw(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=Pw(t)||Pw(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 Fw(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)},Lw=Iw(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-base font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function X({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,q.jsx)(r?ah:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:W(Lw({variant:t,size:n,className:e})),...i})}function Rw({...e}){return(0,q.jsx)(qh,{"data-slot":`collapsible`,...e})}function zw({...e}){return(0,q.jsx)(Hh,{"data-slot":`collapsible-trigger`,...e})}function Bw({...e}){return(0,q.jsx)(Wh,{"data-slot":`collapsible-content`,...e})}var Vw=Iw(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Hw({className:e,orientation:t=`horizontal`,...n}){return(0,q.jsx)(XS,{"data-slot":`tabs`,"data-orientation":t,className:W(`group/tabs flex gap-2 data-horizontal:flex-col`,e),orientation:t,...n})}function Uw({className:e,variant:t=`default`,...n}){return(0,q.jsx)(ZS,{"data-slot":`tabs-list`,"data-variant":t,className:W(Vw({variant:t}),e),...n})}function Ww({className:e,...t}){return(0,q.jsx)(QS,{"data-slot":`tabs-trigger`,className:W(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-base font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function Gw({className:e,...t}){return(0,q.jsx)($S,{"data-slot":`tabs-content`,className:W(`flex-1 text-base outline-none`,e),...t})}var Kw=`h-full min-h-0 min-w-0 overflow-hidden`,qw=`text-[#9b9b9b]`,Jw=`text-base font-semibold text-white`,Yw=`flowent-navigation-label`,Xw=`[scrollbar-gutter:stable]`,Zw=`overflow-hidden rounded-lg border border-dashed border-white/10 bg-black`,Qw=`grid min-h-11 grid-cols-[132px_minmax(0,1fr)] items-center gap-3 border-b border-white/10 px-3 py-2 last:border-b-0 max-[640px]:grid-cols-1 max-[640px]:gap-1`,$w=`text-xs text-[#9b9b9b]`,eT=`m-0 rounded-lg border border-dashed border-white/10 bg-black px-3 py-2.5 text-xs leading-[1.4] text-[#9b9b9b]`,tT=`grid gap-1.5`,nT=`text-xs font-medium text-[#dedede]`,rT=`h-8 rounded-md border-white/10 bg-input/30 px-2.5 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,iT=`h-8 w-full rounded-md border-white/10 bg-input/30 px-2.5 text-base text-white shadow-none focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,aT=`mt-4 flex justify-end gap-2 max-[900px]:flex-col max-[900px]:items-stretch`,oT=`h-8 border-dashed border-white/20 bg-input/30 text-base text-white shadow-none hover:bg-input/50`,sT={icon:Om,id:`workspace`,label:`Workspace`},cT={icon:_m,id:`workflows`,label:`Workflows`},lT=[{label:`Tools`,items:[{id:`skills`,label:`Skills`,icon:Wm},{id:`mcp`,label:`MCP`,icon:Nm}]},{label:`Setup`,items:[{id:`providers`,label:`Providers`,icon:wm},{id:`channels`,label:`Channels`,icon:Fm},{id:`permissions`,label:`Permissions`,icon:Um},{id:`settings`,label:`Settings`,icon:Hm}]}];function uT({isSidebarCollapsed:e,item:t,onClick:n,shouldReduceMotion:r,suppressActiveStyle:i=!1}){let a=t.icon;return(0,q.jsxs)(Ww,{"aria-label":e?t.label:void 0,title:e?t.label:void 0,value:t.id,onClick:n,className:W(`flowent-navigation-item cursor-pointer justify-start gap-2 rounded-lg border border-transparent bg-transparent px-2 py-1 shadow-none transition-colors duration-100 hover:bg-[#151515] data-[state=active]:bg-[#202020] max-[900px]:justify-center max-[560px]:min-w-fit max-[560px]:flex-none max-[560px]:px-2 max-[560px]:[&_svg]:hidden`,Yw,`dark:hover:bg-[#151515] dark:data-[state=active]:border-transparent dark:data-[state=active]:bg-[#202020]`,e&&`justify-center gap-0 px-0 max-[900px]:justify-center max-[900px]:gap-2 max-[900px]:px-2`,i&&`data-[state=active]:!bg-transparent data-[state=active]:!text-white dark:data-[state=active]:!bg-transparent`),children:[(0,q.jsx)(a,{"aria-hidden":`true`}),(0,q.jsx)(pT,{className:`flowent-navigation-text`,isVisible:!e,shouldReduceMotion:r,children:t.label})]})}function dT({isActive:e,onSelect:t,workflow:n}){return(0,q.jsx)(X,{className:W(`flowent-workflow-history-item h-8 w-full cursor-pointer justify-start rounded-lg border border-transparent bg-transparent px-2 py-1 text-left shadow-none transition-colors duration-100 hover:bg-[#151515] max-[900px]:justify-center max-[560px]:min-w-fit max-[560px]:flex-none max-[560px]:px-2`,Yw,e&&`flowent-workflow-history-item-active bg-[#202020]`),onClick:()=>t(n.id),title:n.name,type:`button`,variant:`ghost`,children:(0,q.jsx)(`span`,{className:`flowent-navigation-text min-w-0 truncate`,children:n.name})})}function fT({activeProviderName:e,activeView:t,activeWorkflowId:n,children:r,onNewWorkflow:i,onViewChange:a,onWorkflowSelect:o,workflows:s}){let[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(!0),f=Zp()??!1,p=(0,b.useCallback)(()=>{l(e=>!e)},[]);return(0,b.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(max-width: 900px)`),t=()=>{e.matches&&l(!1)};return t(),e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}},[]),(0,b.useEffect)(()=>{let e=e=>{!e.ctrlKey||e.metaKey||e.altKey||e.code===`KeyB`&&(e.preventDefault(),p())};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[p]),(0,q.jsxs)(Hw,{value:t,onValueChange:e=>a(e),orientation:`vertical`,className:W(`grid h-[var(--flowent-viewport-height)] min-h-0 gap-0 overflow-hidden bg-black pt-[var(--flowent-safe-area-top)] pr-[var(--flowent-safe-area-right)] pb-[var(--flowent-safe-area-bottom)] pl-[var(--flowent-safe-area-left)] text-white transition-[grid-template-columns] ease-out max-[900px]:grid-cols-1 max-[900px]:grid-rows-[auto_minmax(0,1fr)]`,f?`duration-0`:`duration-200`,c?`grid-cols-[64px_minmax(0,1fr)]`:`grid-cols-[232px_minmax(0,1fr)]`),children:[(0,q.jsxs)(`aside`,{className:W(`relative flex min-h-0 flex-col border-r border-white/10 bg-black py-3 transition-[padding] ease-out max-[900px]:min-h-auto max-[900px]:border-r-0 max-[900px]:border-b max-[900px]:px-3 max-[900px]:py-3`,f?`duration-0`:`duration-200`,c?`px-2`:`px-3`),children:[(0,q.jsxs)(`div`,{className:W(`flex min-h-10 items-center bg-black px-1 max-[560px]:min-h-10`,c?`flex-col justify-center gap-2 max-[900px]:flex-row max-[900px]:justify-start`:`gap-2.5`),children:[c?(0,q.jsx)(`button`,{"aria-label":`Expand sidebar from Flowent`,className:`grid size-8 cursor-pointer place-items-center overflow-hidden rounded-md border border-white/10 bg-input/30 transition-colors hover:bg-input/50`,onClick:()=>l(!1),title:`Expand sidebar`,type:`button`,children:(0,q.jsx)(`img`,{alt:``,className:`size-full object-cover`,src:`/flowent.png`})}):(0,q.jsx)(`div`,{className:`grid size-8 place-items-center overflow-hidden rounded-md border border-white/10 bg-input/30`,children:(0,q.jsx)(`img`,{alt:``,className:`size-full object-cover`,src:`/flowent.png`})}),(0,q.jsx)(pT,{className:`min-w-0 flex-1 self-center`,isVisible:!c,shouldReduceMotion:f,children:(0,q.jsx)(`div`,{className:`flowent-sidebar-brand truncate`,children:`Flowent`})}),(0,q.jsx)(X,{"aria-label":c?`Expand sidebar`:`Collapse sidebar`,className:W(`flowent-sidebar-chrome-button size-8 cursor-pointer border border-transparent bg-transparent shadow-none hover:bg-[#151515] max-[900px]:hidden`,c&&`size-7`),onClick:p,size:`icon`,title:c?`Expand sidebar`:`Collapse sidebar`,type:`button`,variant:`ghost`,children:c?(0,q.jsx)(Am,{"aria-hidden":`true`}):(0,q.jsx)(km,{"aria-hidden":`true`})})]}),(0,q.jsx)(`nav`,{"aria-label":`Primary navigation`,children:(0,q.jsxs)(Uw,{className:W(`mt-4 flex w-auto flex-none flex-col items-stretch gap-0 p-0 max-[900px]:mt-3 max-[900px]:mx-0 max-[900px]:flex-row max-[560px]:justify-start max-[560px]:overflow-x-auto`,c?`mx-0`:`-mx-1`),variant:`line`,children:[(0,q.jsx)(uT,{isSidebarCollapsed:c,item:sT,shouldReduceMotion:f}),(0,q.jsx)(uT,{isSidebarCollapsed:c,item:cT,onClick:t===`workflows`&&n?i:void 0,shouldReduceMotion:f,suppressActiveStyle:t===`workflows`&&!!n}),lT.map(e=>(0,q.jsxs)(b.Fragment,{children:[c?null:(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`flowent-sidebar-section-label mt-4 mb-1 px-2 max-[900px]:hidden`,children:e.label}),e.items.map(e=>(0,q.jsx)(uT,{isSidebarCollapsed:c,item:e,shouldReduceMotion:f},e.id))]},e.label)),c?null:(0,q.jsx)(mT,{activeView:t,activeWorkflowId:n,isOpen:u,onOpenChange:d,onWorkflowSelect:o,shouldReduceMotion:f,workflows:s})]})}),(0,q.jsxs)(`div`,{className:W(`flowent-sidebar-status mt-auto flex h-8 items-center gap-2 max-[900px]:hidden`,c?`justify-center px-0`:`-mx-1 px-2`),title:e??`No provider`,children:[(0,q.jsx)(`div`,{className:`size-1.5 rounded-full bg-[#7ddf89]`,"aria-hidden":`true`}),(0,q.jsx)(pT,{isVisible:!c,shouldReduceMotion:f,children:(0,q.jsx)(`span`,{children:e??`No provider`})})]}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`absolute top-0 right-[-4px] z-10 hidden h-full w-2 cursor-ew-resize outline-none transition-colors hover:bg-white/10 focus-visible:bg-white/10 max-[900px]:hidden sm:block`,onDoubleClick:p,title:`Double-click to toggle sidebar`})]}),(0,q.jsx)(`main`,{className:`min-h-0 min-w-0 overflow-hidden bg-black`,children:r})]})}function pT({children:e,className:t,isVisible:n,shouldReduceMotion:r}){return(0,q.jsx)($d,{initial:!1,children:n?(0,q.jsx)(Xp.span,{animate:{opacity:1,width:`auto`},className:W(`min-w-0 overflow-hidden`,t),exit:r?{opacity:1}:{opacity:0,width:0},initial:r?!1:{opacity:0,width:0},transition:r?{duration:0}:{duration:.16,ease:[.32,.72,0,1]},children:e},`sidebar-text`):null})}function mT({activeView:e,activeWorkflowId:t,isOpen:n,onOpenChange:r,onWorkflowSelect:i,shouldReduceMotion:a,workflows:o}){return(0,q.jsxs)(Rw,{className:`max-[900px]:hidden`,open:n,onOpenChange:r,children:[(0,q.jsx)(zw,{asChild:!0,children:(0,q.jsxs)(X,{"aria-label":`Workflows`,className:W(`flowent-workflow-history-trigger mt-4 h-7 w-full cursor-pointer justify-between rounded-md border border-transparent bg-transparent px-2 py-0 text-[11px] leading-4 font-medium text-white/45 shadow-none transition-colors duration-100 hover:bg-transparent hover:text-white/70 aria-expanded:bg-transparent aria-expanded:text-white/45 dark:aria-expanded:bg-transparent dark:aria-expanded:text-white/45 max-[900px]:hidden`,Yw,e===`workflows`&&!!t&&!n&&`flowent-workflow-history-item-active`),type:`button`,variant:`ghost`,children:[(0,q.jsx)(`span`,{className:`flowent-navigation-text min-w-0 truncate`,children:`Workflows`}),(0,q.jsx)(pm,{"aria-hidden":`true`,className:W(`size-3 shrink-0 text-white/35 transition-transform`,n&&`rotate-90`)})]})}),(0,q.jsx)(Bw,{forceMount:!0,children:(0,q.jsx)($d,{initial:!1,children:n?(0,q.jsx)(Xp.div,{animate:a?{opacity:1}:{height:`auto`,opacity:1},className:`overflow-hidden`,exit:a?{opacity:1}:{height:0,opacity:0},initial:a?!1:{height:0,opacity:0},transition:a?{duration:0}:{duration:.18,ease:[.32,.72,0,1]},children:o.length===0?(0,q.jsx)(`div`,{className:`flowent-sidebar-section-label flex h-8 w-full items-center px-2 max-[900px]:hidden`,children:(0,q.jsx)(`span`,{children:`No workflow yet.`})}):o.map(n=>(0,q.jsx)(dT,{isActive:e===`workflows`&&t===n.id,onSelect:i,workflow:n},n.id))},`workflow-history`):null})})]})}function hT({className:e,type:t,...n}){return(0,q.jsx)(`input`,{type:t,"data-slot":`input`,className:W(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function gT({className:e,...t}){return(0,q.jsx)(cx,{"data-slot":`label`,className:W(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function _T({...e}){return(0,q.jsx)(CS,{"data-slot":`select`,...e})}function vT({...e}){return(0,q.jsx)(TS,{"data-slot":`select-value`,...e})}function yT({className:e,size:t=`default`,children:n,...r}){return(0,q.jsxs)(wS,{"data-slot":`select-trigger`,"data-size":t,className:W(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-base whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,q.jsx)(ES,{asChild:!0,children:(0,q.jsx)(fm,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function bT({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,q.jsx)(DS,{children:(0,q.jsxs)(OS,{"data-slot":`select-content`,"data-align-trigger":n===`item-aligned`,className:W(`relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,q.jsx)(ST,{}),(0,q.jsx)(kS,{"data-position":n,className:W(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,n===`popper`&&``),children:t}),(0,q.jsx)(CT,{})]})})}function xT({className:e,children:t,...n}){return(0,q.jsxs)(AS,{"data-slot":`select-item`,className:W(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-base outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,q.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:(0,q.jsx)(MS,{children:(0,q.jsx)(dm,{className:`pointer-events-none`})})}),(0,q.jsx)(jS,{children:t})]})}function ST({className:e,...t}){return(0,q.jsx)(NS,{"data-slot":`select-scroll-up-button`,className:W(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,q.jsx)(mm,{})})}function CT({className:e,...t}){return(0,q.jsx)(PS,{"data-slot":`select-scroll-down-button`,className:W(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,q.jsx)(fm,{})})}function wT({onApproveSession:e,onSaveTelegramBot:t,onUpdateTelegramBot:n,telegramBot:r}){let i=r.sessions.filter(e=>e.status===`pending`),a=r.sessions.filter(e=>e.status===`approved`);return(0,q.jsx)(`section`,{className:`grid h-full min-h-0 bg-black`,"aria-label":`Channels`,children:(0,q.jsxs)(`form`,{className:W(`grid min-h-0 w-full content-start gap-7 overflow-auto px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,Xw),"aria-label":`Telegram Bot`,onSubmit:e=>{e.preventDefault(),t()},children:[(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Telegram Bot`}),(0,q.jsxs)(`div`,{className:Zw,children:[(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`telegram-status`,children:`Status`}),(0,q.jsx)(`div`,{className:W(`text-base leading-5 text-white`,qw),id:`telegram-status`,children:OT(r.status)})]}),(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`telegram-enabled`,children:`Enabled`}),(0,q.jsxs)(_T,{value:r.enabled?`true`:`false`,onValueChange:e=>n({enabled:e===`true`}),children:[(0,q.jsx)(yT,{className:iT,id:`telegram-enabled`,"aria-label":`Enabled`,children:(0,q.jsx)(vT,{})}),(0,q.jsxs)(bT,{children:[(0,q.jsx)(xT,{value:`false`,children:`Off`}),(0,q.jsx)(xT,{value:`true`,children:`On`})]})]})]}),(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`telegram-bot-secret`,children:`Bot secret`}),(0,q.jsx)(hT,{className:rT,id:`telegram-bot-secret`,onChange:e=>n({botSecret:e.target.value}),type:`password`,value:r.botSecret})]})]}),r.error?(0,q.jsx)(`p`,{className:`m-0 text-xs leading-[1.4] text-destructive`,children:r.error}):null,(0,q.jsx)(`div`,{className:W(aT,`mt-0`),children:(0,q.jsx)(X,{type:`submit`,children:`Save`})})]}),(0,q.jsx)(TT,{emptyText:`No requests`,onApproveSession:e,sessions:i,title:`Pending`}),(0,q.jsx)(TT,{emptyText:`No conversations`,sessions:a,title:`Approved`})]})})}function TT({emptyText:e,onApproveSession:t,sessions:n,title:r}){return(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:r}),n.length===0?(0,q.jsx)(`p`,{className:eT,children:e}):(0,q.jsx)(`div`,{className:Zw,children:n.map(e=>(0,q.jsx)(ET,{onApproveSession:t,session:e},e.chatId))})]})}function ET({onApproveSession:e,session:t}){return(0,q.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] gap-3 border-b border-white/10 px-3 py-3 last:border-b-0 max-[640px]:grid-cols-1`,children:[(0,q.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-base font-medium text-white`,children:[(0,q.jsx)(Dm,{className:`size-4 shrink-0 text-[#9b9b9b]`}),(0,q.jsx)(`span`,{className:`truncate`,children:DT(t)})]}),(0,q.jsxs)(`p`,{className:W(`m-0 text-xs leading-[1.4]`,qw),children:[`Chat `,t.chatId,t.userId?` · User ${t.userId}`:``,t.username?` · @${t.username}`:``]}),t.recentMessage?(0,q.jsx)(`p`,{className:`m-0 max-w-3xl truncate text-base leading-[1.45] text-white`,children:t.recentMessage}):null]}),t.status===`pending`&&e?(0,q.jsxs)(X,{className:W(oT,`shrink-0`),onClick:()=>e(t.chatId),size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(dm,{"aria-hidden":`true`}),`Approve`]}):(0,q.jsx)(`span`,{className:W(`flex h-8 items-center text-xs leading-none`,qw),children:`Approved`})]})}function DT(e){return e.displayName?e.displayName:e.username?`@${e.username}`:e.chatId}function OT(e){return e===`running`?`Running`:e===`starting`?`Starting`:e===`error`?`Error`:`Disabled`}function kT({activeServer:e,isCreatingServer:t,isImportOpen:n,importPreview:r,importSource:i,importingServerId:a,isPreviewing:o,onNewServer:s,onImport:c,onImportServer:l,onImportSourceChange:u,onReconnectServer:d,onRemoveServer:f,onSaveServer:p,onServerSelect:m,onUpdateServer:h,servers:g}){return(0,q.jsx)(`section`,{className:`grid h-full min-h-0 bg-black`,"aria-label":`MCP`,children:(0,q.jsxs)(`div`,{className:`grid h-full min-h-0 grid-cols-[232px_minmax(0,1fr)] max-[900px]:grid-cols-1 max-[900px]:grid-rows-[auto_minmax(0,1fr)]`,children:[(0,q.jsx)(AT,{activeServer:e,isCreatingServer:t,onImport:c,onNewServer:s,onServerSelect:m,servers:g}),(0,q.jsx)(jT,{activeServer:e,isCreatingServer:t,isImportOpen:n,importPreview:r,importSource:i,importingServerId:a,isPreviewing:o,onImportServer:l,onImportSourceChange:u,onReconnectServer:d,onRemoveServer:f,onSaveServer:p,onUpdateServer:h,servers:g})]})})}function AT({activeServer:e,isCreatingServer:t,onImport:n,onNewServer:r,onServerSelect:i,servers:a}){return(0,q.jsxs)(`aside`,{className:W(`flex min-h-0 min-w-0 flex-col overflow-auto border-r border-white/10 bg-black p-3 max-[900px]:max-h-64 max-[900px]:border-r-0 max-[900px]:border-b`,Xw),"aria-label":`MCP servers`,children:[(0,q.jsxs)(X,{"aria-pressed":t,className:`h-8 w-full border-dashed border-white/20 bg-input/30 text-base text-white shadow-none hover:bg-input/50`,onClick:r,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(Pm,{"aria-hidden":`true`}),`New`]}),(0,q.jsxs)(X,{className:`mt-2 h-8 w-full border-dashed border-white/20 bg-input/30 text-base text-white shadow-none hover:bg-input/50`,onClick:n,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(Zm,{"aria-hidden":`true`}),`Import`]}),(0,q.jsxs)(`div`,{className:`mt-4 -mx-1 grid gap-0`,children:[a.length===0?(0,q.jsx)(`p`,{className:eT,children:`No servers`}):null,a.map(n=>{let r=!t&&e.id===n.id;return(0,q.jsx)(X,{"aria-label":n.name,"aria-pressed":r,className:W(`flowent-navigation-item grid w-full cursor-pointer justify-start rounded-lg border border-transparent bg-transparent px-2 py-1 text-left text-white/90 shadow-none transition-colors duration-100 hover:bg-[#151515] hover:text-white`,Yw,r&&`bg-[#202020] text-white`),onClick:()=>i(n),size:`sm`,type:`button`,variant:`ghost`,children:(0,q.jsxs)(`span`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:n.name}),(0,q.jsx)(LT,{status:n.status})]})},n.id)})]})]})}function jT({activeServer:e,isCreatingServer:t,isImportOpen:n,importPreview:r,importSource:i,importingServerId:a,isPreviewing:o,onImportServer:s,onImportSourceChange:c,onReconnectServer:l,onRemoveServer:u,onSaveServer:d,onUpdateServer:f,servers:p}){return n?(0,q.jsx)(`section`,{className:W(`grid min-h-0 w-full content-start gap-7 overflow-auto px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,Xw),"aria-label":`MCP import`,children:(0,q.jsx)(MT,{importPreview:r,importSource:i,importingServerId:a,isPreviewing:o,servers:p,onImportServer:s,onImportSourceChange:c})}):(0,q.jsxs)(`form`,{className:W(`grid min-h-0 w-full content-start gap-7 overflow-auto px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,Xw),"aria-label":`MCP server`,onSubmit:e=>{e.preventDefault(),d()},children:[(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Details`}),(0,q.jsx)(`div`,{className:Zw,children:(0,q.jsx)(NT,{activeServer:e,onUpdateServer:f})})]}),(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Tools`}),(0,q.jsx)(PT,{server:e})]}),e.error?(0,q.jsx)(`p`,{className:`m-0 text-xs leading-[1.4] text-destructive`,children:e.error}):null,(0,q.jsxs)(`div`,{className:W(aT,`mt-0`),children:[t?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(X,{className:oT,onClick:l,type:`button`,variant:`outline`,children:[(0,q.jsx)(Lm,{"aria-hidden":`true`}),`Reconnect`]}),(0,q.jsxs)(X,{className:oT,onClick:u,type:`button`,variant:`outline`,children:[(0,q.jsx)(Jm,{"aria-hidden":`true`}),`Remove`]})]}),(0,q.jsx)(X,{type:`submit`,children:`Save`})]})]})}function MT({importPreview:e,importSource:t,importingServerId:n,isPreviewing:r,servers:i,onImportServer:a,onImportSourceChange:o}){let s=new Set(i.map(e=>e.id));return(0,q.jsxs)(`section`,{className:`grid gap-7`,children:[(0,q.jsx)(`section`,{className:`grid gap-3`,children:(0,q.jsxs)(`div`,{className:`grid grid-cols-[repeat(2,minmax(0,160px))] gap-2 max-[640px]:grid-cols-1`,children:[(0,q.jsx)(X,{"aria-pressed":t===`claude_code`,className:W(oT,t===`claude_code`&&`bg-input/50`),disabled:r||n!==``,onClick:()=>o(`claude_code`),type:`button`,variant:`outline`,children:`Claude Code`}),(0,q.jsx)(X,{"aria-pressed":t===`codex`,className:W(oT,t===`codex`&&`bg-input/50`),disabled:r||n!==``,onClick:()=>o(`codex`),type:`button`,variant:`outline`,children:`Codex`})]})}),(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Servers`}),e.length>0?(0,q.jsx)(`div`,{className:Zw,children:e.map(e=>{let t=n===e.id;return(0,q.jsxs)(`div`,{"aria-label":e.name,className:`grid grid-cols-[minmax(0,1fr)_auto_auto] items-start gap-3 border-b border-white/10 px-3 py-2 last:border-b-0 max-[640px]:grid-cols-[minmax(0,1fr)_auto]`,role:`listitem`,children:[(0,q.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`text-base text-white`,children:e.name}),s.has(e.id)?(0,q.jsx)(`span`,{className:`rounded-md border border-white/10 bg-input/30 px-2 py-0.5 text-xs text-white`,children:`Existing`}):null]}),(0,q.jsx)(`p`,{className:W(`m-0 break-all text-xs`,qw),children:e.type===`url`?e.url:[e.command,...e.args].filter(Boolean).join(` `)})]}),(0,q.jsx)(`span`,{className:W(`text-xs`,qw),children:e.type===`url`?`URL`:`Command`}),(0,q.jsx)(X,{className:oT,disabled:n!==``,onClick:()=>a(e.id),size:`sm`,type:`button`,variant:`outline`,children:t?`Importing`:`Import`})]},e.id)})}):(0,q.jsx)(`p`,{className:eT,children:r?`Scanning`:`No servers`})]})]})}function NT({activeServer:e,onUpdateServer:t}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`mcp-name`,children:`Name`}),(0,q.jsx)(hT,{className:rT,id:`mcp-name`,onChange:e=>t({name:e.target.value}),value:e.name})]}),(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`mcp-type`,children:`Type`}),(0,q.jsxs)(_T,{value:e.type,onValueChange:e=>t({type:e}),children:[(0,q.jsx)(yT,{className:iT,id:`mcp-type`,"aria-label":`Type`,children:(0,q.jsx)(vT,{})}),(0,q.jsxs)(bT,{children:[(0,q.jsx)(xT,{value:`command`,children:`Command`}),(0,q.jsx)(xT,{value:`url`,children:`URL`})]})]})]}),e.type===`command`?(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`mcp-command-line`,children:`Command line`}),(0,q.jsx)(hT,{className:rT,id:`mcp-command-line`,onChange:e=>t({commandLine:e.target.value}),value:e.commandLine})]}):(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`mcp-url`,children:`URL`}),(0,q.jsx)(hT,{className:rT,id:`mcp-url`,onChange:e=>t({url:e.target.value}),value:e.url})]}),(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`mcp-enabled`,children:`Enabled`}),(0,q.jsxs)(_T,{value:e.enabled?`true`:`false`,onValueChange:e=>t({enabled:e===`true`}),children:[(0,q.jsx)(yT,{className:iT,id:`mcp-enabled`,"aria-label":`Enabled`,children:(0,q.jsx)(vT,{})}),(0,q.jsxs)(bT,{children:[(0,q.jsx)(xT,{value:`true`,children:`On`}),(0,q.jsx)(xT,{value:`false`,children:`Off`})]})]})]}),(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`mcp-status`,children:`Status`}),(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,id:`mcp-status`,children:[(0,q.jsx)(IT,{status:e.status}),e.status===`ready`?(0,q.jsxs)(`span`,{className:W(`text-xs leading-5`,qw),children:[e.tools.length,` `,e.tools.length===1?`tool`:`tools`]}):null]})]})]})}function PT({server:e}){return e.tools.length===0?(0,q.jsx)(`p`,{className:eT,children:`No tools`}):(0,q.jsx)(`div`,{className:Zw,children:e.tools.map(e=>(0,q.jsxs)(`div`,{className:`grid min-h-10 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-b border-white/10 px-3 py-2 text-base leading-5 text-white last:border-b-0 max-[640px]:grid-cols-1`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(Nm,{className:`size-4 shrink-0 text-[#9b9b9b]`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`truncate`,children:e.name})]}),e.description?(0,q.jsx)(`span`,{className:W(`min-w-0 truncate text-xs leading-5`,qw),children:e.description}):null]},e.name))})}function FT(e){return e===`ready`?`Ready`:e===`starting`?`Starting`:e===`error`?`Error`:`Disabled`}function IT({status:e}){let t=RT(e);return(0,q.jsxs)(`span`,{className:W(`inline-flex shrink-0 items-center gap-1.5 rounded-md border bg-black`,`px-2 py-1 text-xs`,t.className),children:[(0,q.jsx)(`span`,{className:W(`size-1.5 rounded-full`,e===`starting`&&`animate-pulse`,t.dotClassName),"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`leading-none`,children:FT(e)})]})}function LT({status:e}){let t=RT(e);return(0,q.jsx)(`span`,{"aria-hidden":`true`,className:W(`size-2 rounded-full`,e===`starting`&&`animate-pulse`,t.dotClassName)})}function RT(e){return e===`ready`?{className:`border-emerald-400/20 text-emerald-200`,dotClassName:`bg-emerald-300`}:e===`starting`?{className:`border-sky-400/20 text-sky-200`,dotClassName:`bg-sky-300`}:e===`error`?{className:`border-red-400/25 text-red-200`,dotClassName:`bg-red-300`}:{className:`border-white/10 text-white/55`,dotClassName:`bg-white/35`}}var zT=(0,b.createContext)(null);function BT(){let e=(0,b.useContext)(zT);if(!e)throw Error(`useFlowentToast must be used within FlowentToastProvider`);return e}function VT({onAddWritablePath:e,onRemoveWritablePath:t,writablePaths:n}){let r=BT(),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(``),c=i.trim(),l=async()=>{if(c){if(n.some(e=>e.path===c)){s(`Path already exists`);return}try{await e(c),a(``),s(``)}catch{r.error(`Directory could not be added.`)}}};return(0,q.jsx)(`section`,{"aria-label":`Permissions`,className:W(`grid h-full min-h-0 content-start gap-7 overflow-auto bg-black px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,Xw),children:(0,q.jsxs)(`section`,{className:`grid max-w-4xl gap-3`,children:[(0,q.jsx)(`h3`,{className:Jw,children:`Writable paths`}),(0,q.jsxs)(`form`,{"aria-label":`Add directory`,className:`grid gap-1.5`,onSubmit:e=>{e.preventDefault(),l()},children:[(0,q.jsx)(`label`,{className:nT,htmlFor:`writable-path-input`,children:`Directory path`}),(0,q.jsxs)(`div`,{className:`flex gap-2 max-[640px]:flex-col`,children:[(0,q.jsx)(hT,{"aria-invalid":o?!0:void 0,className:W(rT,`flex-1`),id:`writable-path-input`,onChange:e=>{a(e.target.value),s(``)},placeholder:`Enter a directory path`,type:`text`,value:i}),(0,q.jsxs)(X,{className:W(oT,`shrink-0`),disabled:!c,size:`sm`,type:`submit`,variant:`outline`,children:[(0,q.jsx)(Pm,{"aria-hidden":`true`}),`Add`]})]}),o?(0,q.jsx)(`p`,{className:`m-0 text-xs leading-[1.4] text-destructive`,children:o}):null]}),n.length===0?(0,q.jsx)(`p`,{className:eT,children:`No paths`}):(0,q.jsx)(`div`,{className:Zw,children:n.map(e=>(0,q.jsx)(HT,{onRemoveWritablePath:t,writablePath:e},e.path))})]})})}function HT({onRemoveWritablePath:e,writablePath:t}){return(0,q.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-b border-white/10 px-3 py-3 last:border-b-0 max-[640px]:grid-cols-1`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(Um,{"aria-hidden":`true`,className:`size-4 shrink-0 text-white/60`}),(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`p`,{className:`m-0 truncate font-mono text-base leading-5 text-white`,children:t.path}),(0,q.jsx)(`p`,{className:W(`m-0 text-xs leading-[1.4]`,qw),children:`Always allowed`})]})]}),(0,q.jsxs)(X,{className:W(oT,`shrink-0`),onClick:()=>e(t.path),size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(Jm,{"aria-hidden":`true`}),`Remove`]})]})}function UT({activeProvider:e,isFetchingModels:t,isCreatingProvider:n,onFetchModels:r,onNewProvider:i,onProviderSelect:a,onRemoveProvider:o,onSaveProvider:s,onUpdateProvider:c,providers:l}){return(0,q.jsx)(`section`,{className:`grid h-full min-h-0 bg-black`,"aria-label":`Providers`,children:(0,q.jsxs)(`div`,{className:`grid h-full min-h-0 grid-cols-[232px_minmax(0,1fr)] max-[900px]:grid-cols-1 max-[900px]:grid-rows-[auto_minmax(0,1fr)]`,children:[(0,q.jsx)(WT,{activeProvider:e,isCreatingProvider:n,onNewProvider:i,onProviderSelect:a,providers:l}),(0,q.jsx)(GT,{activeProvider:e,isFetchingModels:t,isCreatingProvider:n,onFetchModels:r,onRemoveProvider:o,onSaveProvider:s,onUpdateProvider:c})]})})}function WT({activeProvider:e,isCreatingProvider:t,onNewProvider:n,onProviderSelect:r,providers:i}){return(0,q.jsxs)(`aside`,{className:W(`flex min-h-0 min-w-0 flex-col overflow-auto border-r border-white/10 bg-black p-3 max-[900px]:max-h-64 max-[900px]:border-r-0 max-[900px]:border-b`,Xw),"aria-label":`Provider list`,children:[(0,q.jsxs)(X,{"aria-pressed":t,className:`h-8 w-full border-dashed border-white/20 bg-input/30 text-base text-white shadow-none hover:bg-input/50`,onClick:n,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(Pm,{"aria-hidden":`true`}),`New`]}),(0,q.jsxs)(`div`,{className:`mt-4 -mx-1 grid gap-0`,children:[i.length===0?(0,q.jsx)(`p`,{className:eT,children:`No providers`}):null,i.map(n=>{let i=!t&&e.id===n.id;return(0,q.jsx)(X,{"aria-label":n.name,"aria-pressed":i,className:W(`flowent-navigation-item grid w-full cursor-pointer justify-start rounded-lg border border-transparent bg-transparent px-2 py-1 text-left text-white/90 shadow-none transition-colors duration-100 hover:bg-[#151515] hover:text-white`,Yw,i&&`bg-[#202020] text-white`),onClick:()=>r(n),size:`sm`,type:`button`,variant:`ghost`,children:(0,q.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:n.name})},n.id)})]})]})}function GT({activeProvider:e,isFetchingModels:t,isCreatingProvider:n,onFetchModels:r,onRemoveProvider:i,onSaveProvider:a,onUpdateProvider:o}){return(0,q.jsxs)(`form`,{className:W(`grid min-h-0 w-full content-start gap-7 overflow-auto px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,Xw),"aria-label":`Provider details`,onSubmit:e=>{e.preventDefault(),a()},children:[(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Details`}),(0,q.jsx)(`div`,{className:Zw,children:(0,q.jsx)(KT,{activeProvider:e,onUpdateProvider:o})})]}),(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Models`}),(0,q.jsx)(qT,{models:e.models})]}),(0,q.jsxs)(`div`,{className:W(aT,`mt-0`),children:[(0,q.jsx)(X,{className:oT,disabled:t,onClick:r,type:`button`,variant:`outline`,children:t?`Fetching`:`Fetch`}),n?null:(0,q.jsxs)(X,{className:oT,onClick:i,type:`button`,variant:`outline`,children:[(0,q.jsx)(Jm,{"aria-hidden":`true`}),`Remove`]}),(0,q.jsx)(X,{type:`submit`,children:`Save`})]})]})}function KT({activeProvider:e,onUpdateProvider:t}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`provider-name`,children:`Provider name`}),(0,q.jsx)(hT,{className:rT,id:`provider-name`,onChange:e=>t({name:e.target.value}),value:e.name})]}),(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`provider-type`,children:`Provider type`}),(0,q.jsxs)(_T,{value:e.type,onValueChange:e=>t({models:[],type:e}),children:[(0,q.jsx)(yT,{className:iT,id:`provider-type`,"aria-label":`Provider type`,children:(0,q.jsx)(vT,{})}),(0,q.jsx)(bT,{children:hn.map(e=>(0,q.jsx)(xT,{value:e.id,children:e.label},e.id))})]})]}),(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`provider-base-url`,children:`Base URL`}),(0,q.jsx)(hT,{className:rT,id:`provider-base-url`,onChange:e=>t({baseUrl:e.target.value}),value:e.baseUrl})]}),(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`provider-api-key`,children:`API key`}),(0,q.jsx)(hT,{className:rT,id:`provider-api-key`,onChange:e=>t({apiKey:e.target.value}),type:`password`,value:e.apiKey})]})]})}function qT({models:e}){return(0,q.jsx)(`div`,{className:tT,children:e.length===0?(0,q.jsx)(`p`,{className:eT,children:`No models`}):(0,q.jsx)(`div`,{className:Zw,children:e.map(e=>(0,q.jsx)(`div`,{className:W(`min-h-10 border-b border-white/10 px-3 py-2 text-base leading-5 text-white last:border-b-0`,qw),children:e},e))})})}function JT({className:e,...t}){return(0,q.jsx)(`textarea`,{"data-slot":`textarea`,className:W(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}var YT=[{label:`Default`,value:`default`},{label:`Low`,value:`low`},{label:`Medium`,value:`medium`},{label:`High`,value:`high`},{label:`XHigh`,value:`xhigh`}];function XT({agentPrompt:e,appVersion:t,contextWindowLimit:n,modelOptions:r,onModelChange:i,onProviderChange:a,onReasoningEffortChange:o,onRuntimeSettingsSave:s,providers:c,reasoningEffort:l,selectedModel:u,selectedProviderId:d}){let[f,p]=(0,b.useState)(e),[m,h]=(0,b.useState)(n===null?`auto`:`manual`),[g,_]=(0,b.useState)(n===null?``:String(n));(0,b.useEffect)(()=>{p(e)},[e]),(0,b.useEffect)(()=>{h(n===null?`auto`:`manual`),_(n===null?``:String(n))},[n]);let v=g.trim(),y=Number(v),x=m===`auto`||/^\d+$/.test(v)&&y>0;return(0,q.jsxs)(`section`,{className:W(`flex h-full min-h-0 flex-col overflow-auto bg-black`,Xw),"aria-label":`Settings`,children:[(0,q.jsxs)(`form`,{className:`m-8 grid gap-5 bg-black max-[900px]:m-5`,"aria-label":`Runtime settings`,onSubmit:e=>{e.preventDefault(),x&&s({agentPrompt:f,contextWindowLimit:m===`manual`?y:null,reasoningEffort:l,selectedModel:u,selectedProviderId:d})},children:[(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Model routing`}),(0,q.jsx)(`div`,{className:Zw,children:(0,q.jsxs)(`div`,{className:`grid gap-0`,children:[c.length===0?(0,q.jsx)(`div`,{className:`p-3`,children:(0,q.jsx)(`p`,{className:eT,children:`No providers`})}):null,(0,q.jsx)(QT,{onProviderChange:a,providers:c,selectedProviderId:d}),(0,q.jsx)(eE,{modelOptions:r,onModelChange:i,selectedModel:u,selectedProviderId:d}),(0,q.jsx)($T,{onReasoningEffortChange:o,reasoningEffort:l}),(0,q.jsx)(ZT,{contextLimitDraft:g,contextLimitMode:m,isValid:x,onContextLimitDraftChange:_,onContextLimitModeChange:h})]})})]}),(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`div`,{className:`grid gap-1`,children:(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Agent prompt`})}),(0,q.jsxs)(`div`,{className:W(Zw,`p-3`),children:[(0,q.jsx)(gT,{className:`sr-only`,htmlFor:`agent-prompt`,children:`Agent prompt`}),(0,q.jsx)(JT,{className:`min-h-48 resize-y rounded-md border-white/10 bg-input/30 px-3 py-2 text-base leading-5 text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`agent-prompt`,value:f,onChange:e=>p(e.target.value),placeholder:`Add Flowent-specific instructions for the agent.`,"aria-label":`Agent prompt`})]})]}),(0,q.jsx)(`div`,{className:W(aT,`mt-0`),children:(0,q.jsx)(X,{type:`submit`,disabled:!x,children:`Save`})})]}),t?(0,q.jsxs)(`p`,{className:`mx-8 mt-auto pb-6 text-center text-xs leading-5 text-white/30 max-[900px]:mx-5`,children:[`Flowent v`,t]}):null]})}function ZT({contextLimitDraft:e,contextLimitMode:t,isValid:n,onContextLimitDraftChange:r,onContextLimitModeChange:i}){let a=`context-limit-error`,o=t===`manual`&&!n;return(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`context-limit-mode`,children:`Context window`}),(0,q.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 gap-2 max-[640px]:flex-col`,children:[(0,q.jsxs)(_T,{value:t,onValueChange:e=>i(e),children:[(0,q.jsx)(yT,{className:W(iT,`w-36 max-[640px]:w-full`),id:`context-limit-mode`,"aria-label":`Context window`,children:(0,q.jsx)(vT,{})}),(0,q.jsxs)(bT,{children:[(0,q.jsx)(xT,{value:`auto`,children:`Auto`}),(0,q.jsx)(xT,{value:`manual`,children:`Manual`})]})]}),t===`manual`?(0,q.jsx)(hT,{"aria-describedby":o?a:void 0,"aria-invalid":o,"aria-label":`Context size`,className:rT,inputMode:`numeric`,placeholder:`e.g. 128000`,value:e,onChange:e=>r(e.target.value)}):null]}),o?(0,q.jsx)(`p`,{className:`m-0 text-xs leading-4 text-red-400`,id:a,children:`Enter a positive integer`}):null]})]})}function QT({onProviderChange:e,providers:t,selectedProviderId:n}){return(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`active-provider`,children:`Provider`}),(0,q.jsxs)(_T,{value:n,onValueChange:e,children:[(0,q.jsx)(yT,{className:iT,disabled:t.length===0,id:`active-provider`,"aria-label":`Provider`,children:(0,q.jsx)(vT,{placeholder:`No providers`})}),(0,q.jsxs)(bT,{children:[t.length===0?(0,q.jsx)(xT,{value:`none`,disabled:!0,children:`No providers`}):null,t.map(e=>(0,q.jsx)(xT,{value:e.id,children:e.name},e.id))]})]})]})}function $T({onReasoningEffortChange:e,reasoningEffort:t}){return(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`reasoning-effort`,children:`Reasoning`}),(0,q.jsxs)(_T,{value:t,onValueChange:e,children:[(0,q.jsx)(yT,{className:iT,id:`reasoning-effort`,"aria-label":`Reasoning`,children:(0,q.jsx)(vT,{})}),(0,q.jsx)(bT,{children:YT.map(e=>(0,q.jsx)(xT,{value:e.value,children:e.label},e.value))})]})]})}function eE({modelOptions:e,onModelChange:t,selectedModel:n,selectedProviderId:r}){return(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(gT,{className:W(nT,$w),htmlFor:`active-model`,children:`Model`}),(0,q.jsxs)(_T,{value:n,onValueChange:t,children:[(0,q.jsx)(yT,{className:iT,disabled:e.length===0,id:`active-model`,"aria-label":`Model`,children:(0,q.jsx)(vT,{placeholder:`No models`})}),(0,q.jsx)(bT,{children:e.map(e=>(0,q.jsx)(xT,{value:e,children:e},e))})]},`settings-model-${r}`)]})}function tE({activeSkill:e,onReloadSkills:t,onSkillSelect:n,onSkillToggle:r,skills:i}){return(0,q.jsx)(`section`,{className:`grid h-full min-h-0 bg-black`,"aria-label":`Skills`,children:(0,q.jsxs)(`div`,{className:`grid h-full min-h-0 grid-cols-[232px_minmax(0,1fr)] max-[900px]:grid-cols-1 max-[900px]:grid-rows-[auto_minmax(0,1fr)]`,children:[(0,q.jsx)(nE,{activeSkill:e,onReloadSkills:t,onSkillSelect:n,skills:i}),(0,q.jsx)(rE,{activeSkill:e,onSkillToggle:r})]})})}function nE({activeSkill:e,onReloadSkills:t,onSkillSelect:n,skills:r}){return(0,q.jsxs)(`aside`,{className:W(`flex min-h-0 min-w-0 flex-col overflow-auto border-r border-white/10 bg-black p-3 max-[900px]:max-h-64 max-[900px]:border-r-0 max-[900px]:border-b`,Xw),"aria-label":`Skills list`,children:[(0,q.jsxs)(X,{className:`h-8 w-full border-dashed border-white/20 bg-input/30 text-base text-white shadow-none hover:bg-input/50`,onClick:t,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(Lm,{"aria-hidden":`true`}),`Reload`]}),(0,q.jsxs)(`div`,{className:`mt-4 -mx-1 grid gap-0`,children:[r.length===0?(0,q.jsx)(`p`,{className:eT,children:`No skills`}):null,r.map(t=>{let r=e?.id===t.id;return(0,q.jsx)(X,{"aria-label":t.name,"aria-pressed":r,className:W(`grid h-auto min-h-[34px] w-full cursor-pointer justify-start rounded-lg border border-transparent bg-transparent px-2 py-1 text-left text-white/90 shadow-none transition-colors duration-100 hover:bg-[#151515] hover:text-white`,Yw,r&&`bg-[#202020] text-white`),onClick:()=>n(t),size:`sm`,type:`button`,variant:`ghost`,children:(0,q.jsx)(`span`,{className:`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap`,children:t.name})},t.id)})]})]})}function rE({activeSkill:e,onSkillToggle:t}){return e?(0,q.jsxs)(`div`,{className:W(`grid min-h-0 w-full content-start gap-7 overflow-auto px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,Xw),"aria-label":`Skill`,children:[(0,q.jsx)(`section`,{className:`grid gap-3`,children:(0,q.jsxs)(`div`,{className:Zw,children:[(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(`div`,{className:W(nT,$w),children:`Name`}),(0,q.jsx)(`div`,{className:`min-w-0 text-base leading-5 text-white`,children:e.name})]}),(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(`div`,{className:W(nT,$w),children:`Call`}),(0,q.jsxs)(`div`,{className:`min-w-0 font-mono text-base leading-5 text-white`,children:[`$`,e.slug]})]}),(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(`div`,{className:W(nT,$w),children:`Scope`}),(0,q.jsx)(`div`,{className:`min-w-0 text-base leading-5 text-white`,children:iE(e.scope)})]}),(0,q.jsxs)(`div`,{className:Qw,children:[(0,q.jsx)(`div`,{className:W(nT,$w),children:`Status`}),(0,q.jsx)(`div`,{className:`min-w-0 text-base leading-5 text-white`,children:e.enabled?`On`:`Off`})]})]})}),(0,q.jsxs)(`section`,{className:`grid gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-white`,children:[(0,q.jsx)(Wm,{"aria-hidden":`true`,className:`size-4 text-white/70`}),`Description`]}),e.description?(0,q.jsx)(`p`,{className:W(`m-0 text-sm leading-6`,qw),children:e.description}):(0,q.jsx)(`p`,{className:eT,children:`No description`})]}),e.error?(0,q.jsxs)(`section`,{className:`flex items-start gap-2 rounded-lg border border-red-300/20 bg-black p-3 text-sm leading-5 text-red-200`,children:[(0,q.jsx)(hm,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0`}),(0,q.jsx)(`span`,{children:e.error})]}):null,(0,q.jsx)(`div`,{className:`flex justify-end`,children:(0,q.jsx)(X,{className:oT,onClick:()=>t(e,!e.enabled),type:`button`,variant:`outline`,children:e.enabled?`Off`:`On`})})]}):(0,q.jsx)(`div`,{className:`grid min-h-0 content-start overflow-auto px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,children:(0,q.jsx)(`p`,{className:eT,children:`No skills`})})}function iE(e){return e===`project`?`Project`:`User`}var aE=3,oE=4e3,sE=2147483647,cE=0,lE=[],uE=new Set,dE=e=>typeof e==`string`?{message:e}:e,fE=()=>(cE+=1,`flowent-toast-${cE}`),pE=()=>{for(let e of uE)e()},mE=e=>{lE=e(lE),pE()},hE=e=>(uE.add(e),()=>{uE.delete(e)}),gE=e=>{mE(t=>t.filter(t=>t.id!==e))},_E=(e,t)=>{let n=dE(t),r=n.message.trim();if(!r)return``;let i={description:n.description?.trim()||void 0,duration:n.duration??oE,id:fE(),message:r,tone:e};return mE(e=>[...e,i].slice(-aE)),i.id},vE={dismiss:gE,error:e=>_E(`error`,e),info:e=>_E(`info`,e),success:e=>_E(`success`,e)};function yE({children:e}){let[t,n]=(0,b.useState)(lE);return(0,b.useEffect)(()=>{let e=()=>n(lE),t=hE(e);return e(),()=>{t(),uE.size===0&&(lE=[])}},[]),(0,q.jsx)(zT.Provider,{value:vE,children:(0,q.jsxs)(HC,{duration:oE,label:`Notification`,swipeDirection:`right`,children:[e,(0,q.jsx)(bE,{onDismiss:gE,toasts:t})]})})}function bE({onDismiss:e,toasts:t}){let[n,r]=(0,b.useState)(!1);return(0,q.jsx)(UC,{"aria-label":`Notifications`,className:`fixed right-4 bottom-4 z-[80] m-0 flex w-[calc(100vw-2rem)] max-w-72 list-none flex-col items-end gap-2 p-0 outline-none max-[640px]:right-3 max-[640px]:bottom-3 max-[640px]:w-[calc(100vw-1.5rem)] max-[640px]:max-w-none`,onBlur:e=>{let t=e.relatedTarget;if(!(t instanceof Node)){r(!1);return}e.currentTarget.contains(t)||r(!1)},onFocus:()=>r(!0),onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:t.map(t=>(0,q.jsx)(xE,{isPaused:n,onDismiss:e,toast:t},t.id))})}function xE({isPaused:e,onDismiss:t,toast:n}){let r=Zp(),i=(0,b.useRef)(n.duration),a=(0,b.useRef)(0),o=(0,b.useRef)(null),s=SE[n.tone],c=(0,b.useCallback)(()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)},[]);return(0,b.useEffect)(()=>{i.current=n.duration,a.current=0,c()},[c,n.duration,n.id]),(0,b.useEffect)(()=>{if(!(n.duration<=0)){if(e){a.current&&=(i.current=Math.max(0,i.current-(Date.now()-a.current)),0),c();return}if(i.current<=0){t(n.id);return}return a.current=Date.now(),o.current=window.setTimeout(()=>{t(n.id)},i.current),()=>{a.current&&=(i.current=Math.max(0,i.current-(Date.now()-a.current)),0),c()}}},[c,e,t,n.duration,n.id]),(0,q.jsx)(WC,{className:`w-full max-w-72 list-none outline-none max-[640px]:max-w-none`,duration:sE,forceMount:!0,open:!0,role:n.tone===`error`?`alert`:`status`,type:n.tone===`error`?`foreground`:`background`,children:(0,q.jsxs)(Xp.div,{animate:r?{opacity:1}:{opacity:1,x:0},className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-2 rounded-lg border border-white/10 bg-black p-3 text-white shadow-[0_14px_34px_rgba(0,0,0,0.48)] ring-1 ring-white/5`,initial:r?{opacity:1}:{opacity:1,x:20},layout:!0,transition:{duration:.2,ease:`easeOut`},children:[(0,q.jsx)(s,{"aria-hidden":`true`,className:W(`mt-0.5 size-4 shrink-0`,CE[n.tone])}),(0,q.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,q.jsx)(GC,{className:`text-xs leading-4 font-medium text-white`,children:n.message}),n.description?(0,q.jsx)(KC,{className:W(`text-[11px] leading-[1.35]`,qw),children:n.description}):null]}),(0,q.jsx)(qC,{"aria-label":`Dismiss notification`,className:W(Lw({size:`icon-xs`,variant:`ghost`}),`-mt-1 -mr-1 size-6 p-0 text-white/55 hover:text-white`),onClick:()=>t(n.id),type:`button`,children:(0,q.jsx)(Qm,{"aria-hidden":`true`})})]})})}var SE={error:hm,info:Cm,success:gm},CE={error:`text-destructive`,info:`text-white/70`,success:`text-emerald-300`};function wE(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=wE(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var TE={value:()=>{}};function EE(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new DE(n)}function DE(e){this._=e}function OE(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}DE.prototype=EE.prototype={constructor:DE,on:function(e,t){var n=this._,r=OE(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=kE(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=AE(n[i],e.name,t);else if(t==null)for(i in n)n[i]=AE(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new DE(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function kE(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function AE(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=TE,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var jE={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function ME(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),jE.hasOwnProperty(t)?{space:jE[t],local:e}:e}function NE(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function PE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function FE(e){var t=ME(e);return(t.local?PE:NE)(t)}function IE(){}function LE(e){return e==null?IE:function(){return this.querySelector(e)}}function RE(e){typeof e!=`function`&&(e=LE(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new EO(r,this._parents)}function zE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function BE(){return[]}function VE(e){return e==null?BE:function(){return this.querySelectorAll(e)}}function HE(e){return function(){return zE(e.apply(this,arguments))}}function UE(e){e=typeof e==`function`?HE(e):VE(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new EO(r,i)}function WE(e){return function(){return this.matches(e)}}function GE(e){return function(t){return t.matches(e)}}var KE=Array.prototype.find;function qE(e){return function(){return KE.call(this.children,e)}}function JE(){return this.firstElementChild}function YE(e){return this.select(e==null?JE:qE(typeof e==`function`?e:GE(e)))}var XE=Array.prototype.filter;function ZE(){return Array.from(this.children)}function QE(e){return function(){return XE.call(this.children,e)}}function $E(e){return this.selectAll(e==null?ZE:QE(typeof e==`function`?e:GE(e)))}function eD(e){typeof e!=`function`&&(e=WE(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new EO(r,this._parents)}function tD(e){return Array(e.length)}function nD(){return new EO(this._enter||this._groups.map(tD),this._parents)}function rD(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}rD.prototype={constructor:rD,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function iD(e){return function(){return e}}function aD(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new rD(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function oD(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new rD(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function sD(e){return e.__data__}function cD(e,t){if(!arguments.length)return Array.from(this,sD);var n=t?oD:aD,r=this._parents,i=this._groups;typeof e!=`function`&&(e=iD(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=lD(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new EO(o,r),o._enter=s,o._exit=c,o}function lD(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function uD(){return new EO(this._exit||this._groups.map(tD),this._parents)}function dD(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function fD(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new EO(s,this._parents)}function pD(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function mD(e){e||=hD;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new EO(i,this._parents).order()}function hD(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function gD(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function _D(){return Array.from(this)}function vD(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function yD(){let e=0;for(let t of this)++e;return e}function bD(){return!this.node()}function xD(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function SD(e){return function(){this.removeAttribute(e)}}function CD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wD(e,t){return function(){this.setAttribute(e,t)}}function TD(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ED(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function DD(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function OD(e,t){var n=ME(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?CD:SD:typeof t==`function`?n.local?DD:ED:n.local?TD:wD)(n,t))}function kD(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function AD(e){return function(){this.style.removeProperty(e)}}function jD(e,t,n){return function(){this.style.setProperty(e,t,n)}}function MD(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function ND(e,t,n){return arguments.length>1?this.each((t==null?AD:typeof t==`function`?MD:jD)(e,t,n??``)):PD(this.node(),e)}function PD(e,t){return e.style.getPropertyValue(t)||kD(e).getComputedStyle(e,null).getPropertyValue(t)}function FD(e){return function(){delete this[e]}}function ID(e,t){return function(){this[e]=t}}function LD(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function RD(e,t){return arguments.length>1?this.each((t==null?FD:typeof t==`function`?LD:ID)(e,t)):this.node()[e]}function zD(e){return e.trim().split(/^|\s+/)}function BD(e){return e.classList||new VD(e)}function VD(e){this._node=e,this._names=zD(e.getAttribute(`class`)||``)}VD.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function HD(e,t){for(var n=BD(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function UD(e,t){for(var n=BD(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function WD(e){return function(){HD(this,e)}}function GD(e){return function(){UD(this,e)}}function KD(e,t){return function(){(t.apply(this,arguments)?HD:UD)(this,e)}}function qD(e,t){var n=zD(e+``);if(arguments.length<2){for(var r=BD(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?KD:t?WD:GD)(n,t))}function JD(){this.textContent=``}function YD(e){return function(){this.textContent=e}}function XD(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function ZD(e){return arguments.length?this.each(e==null?JD:(typeof e==`function`?XD:YD)(e)):this.node().textContent}function QD(){this.innerHTML=``}function $D(e){return function(){this.innerHTML=e}}function eO(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function tO(e){return arguments.length?this.each(e==null?QD:(typeof e==`function`?eO:$D)(e)):this.node().innerHTML}function nO(){this.nextSibling&&this.parentNode.appendChild(this)}function rO(){return this.each(nO)}function iO(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function aO(){return this.each(iO)}function oO(e){var t=typeof e==`function`?e:FE(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function sO(){return null}function cO(e,t){var n=typeof e==`function`?e:FE(e),r=t==null?sO:typeof t==`function`?t:LE(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function lO(){var e=this.parentNode;e&&e.removeChild(this)}function uO(){return this.each(lO)}function dO(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fO(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function pO(e){return this.select(e?fO:dO)}function mO(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function hO(e){return function(t){e.call(this,t,this.__data__)}}function gO(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function _O(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function vO(e,t,n){return function(){var r=this.__on,i,a=hO(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function yO(e,t,n){var r=gO(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?vO:_O,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function bO(e,t,n){var r=kD(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function xO(e,t){return function(){return bO(this,e,t)}}function SO(e,t){return function(){return bO(this,e,t.apply(this,arguments))}}function CO(e,t){return this.each((typeof t==`function`?SO:xO)(e,t))}function*wO(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var TO=[null];function EO(e,t){this._groups=e,this._parents=t}function DO(){return new EO([[document.documentElement]],TO)}function OO(){return this}EO.prototype=DO.prototype={constructor:EO,select:RE,selectAll:UE,selectChild:YE,selectChildren:$E,filter:eD,data:cD,enter:nD,exit:uD,join:dD,merge:fD,selection:OO,order:pD,sort:mD,call:gD,nodes:_D,node:vD,size:yD,empty:bD,each:xD,attr:OD,style:ND,property:RD,classed:qD,text:ZD,html:tO,raise:rO,lower:aO,append:oO,insert:cO,remove:uO,clone:pO,datum:mO,on:yO,dispatch:CO,[Symbol.iterator]:wO};function kO(e){return typeof e==`string`?new EO([[document.querySelector(e)]],[document.documentElement]):new EO([[e]],TO)}function AO(e){let t;for(;t=e.sourceEvent;)e=t;return e}function jO(e,t){if(e=AO(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var MO={passive:!1},NO={capture:!0,passive:!1};function PO(e){e.stopImmediatePropagation()}function FO(e){e.preventDefault(),e.stopImmediatePropagation()}function IO(e){var t=e.document.documentElement,n=kO(e).on(`dragstart.drag`,FO,NO);`onselectstart`in t?n.on(`selectstart.drag`,FO,NO):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function LO(e,t){var n=e.document.documentElement,r=kO(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,FO,NO),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var RO=e=>()=>e;function zO(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}zO.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function BO(e){return!e.ctrlKey&&!e.button}function VO(){return this.parentNode}function HO(e,t){return t??{x:e.x,y:e.y}}function UO(){return navigator.maxTouchPoints||`ontouchstart`in this}function WO(){var e=BO,t=VO,n=HO,r=UO,i={},a=EE(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,MO).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(kO(n.view).on(`mousemove.drag`,m,NO).on(`mouseup.drag`,h,NO),IO(n.view),PO(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(FO(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){kO(e.view).on(`mousemove.drag mouseup.drag`,null),LO(e.view,l),FO(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(PO(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(FO(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(PO(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=jO(l||r,t),p,m,h;if((h=n.call(e,new zO(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=jO(l||a,t),_=o;break}u.call(r,e,new zO(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:RO(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:RO(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:RO(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:RO(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function GO(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function KO(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function qO(){}var JO=.7,YO=1/JO,XO=`\\s*([+-]?\\d+)\\s*`,ZO=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,QO=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,$O=/^#([0-9a-f]{3,8})$/,ek=RegExp(`^rgb\\(${XO},${XO},${XO}\\)$`),tk=RegExp(`^rgb\\(${QO},${QO},${QO}\\)$`),nk=RegExp(`^rgba\\(${XO},${XO},${XO},${ZO}\\)$`),rk=RegExp(`^rgba\\(${QO},${QO},${QO},${ZO}\\)$`),ik=RegExp(`^hsl\\(${ZO},${QO},${QO}\\)$`),ak=RegExp(`^hsla\\(${ZO},${QO},${QO},${ZO}\\)$`),ok={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};GO(qO,dk,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:sk,formatHex:sk,formatHex8:ck,formatHsl:lk,formatRgb:uk,toString:uk});function sk(){return this.rgb().formatHex()}function ck(){return this.rgb().formatHex8()}function lk(){return wk(this).formatHsl()}function uk(){return this.rgb().formatRgb()}function dk(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=$O.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?fk(t):n===3?new gk(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?pk(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?pk(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ek.exec(e))?new gk(t[1],t[2],t[3],1):(t=tk.exec(e))?new gk(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nk.exec(e))?pk(t[1],t[2],t[3],t[4]):(t=rk.exec(e))?pk(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ik.exec(e))?Ck(t[1],t[2]/100,t[3]/100,1):(t=ak.exec(e))?Ck(t[1],t[2]/100,t[3]/100,t[4]):ok.hasOwnProperty(e)?fk(ok[e]):e===`transparent`?new gk(NaN,NaN,NaN,0):null}function fk(e){return new gk(e>>16&255,e>>8&255,e&255,1)}function pk(e,t,n,r){return r<=0&&(e=t=n=NaN),new gk(e,t,n,r)}function mk(e){return e instanceof qO||(e=dk(e)),e?(e=e.rgb(),new gk(e.r,e.g,e.b,e.opacity)):new gk}function hk(e,t,n,r){return arguments.length===1?mk(e):new gk(e,t,n,r??1)}function gk(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}GO(gk,hk,KO(qO,{brighter(e){return e=e==null?YO:YO**+e,new gk(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?JO:JO**+e,new gk(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new gk(xk(this.r),xk(this.g),xk(this.b),bk(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:_k,formatHex:_k,formatHex8:vk,formatRgb:yk,toString:yk}));function _k(){return`#${Sk(this.r)}${Sk(this.g)}${Sk(this.b)}`}function vk(){return`#${Sk(this.r)}${Sk(this.g)}${Sk(this.b)}${Sk((isNaN(this.opacity)?1:this.opacity)*255)}`}function yk(){let e=bk(this.opacity);return`${e===1?`rgb(`:`rgba(`}${xk(this.r)}, ${xk(this.g)}, ${xk(this.b)}${e===1?`)`:`, ${e})`}`}function bk(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xk(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sk(e){return e=xk(e),(e<16?`0`:``)+e.toString(16)}function Ck(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ek(e,t,n,r)}function wk(e){if(e instanceof Ek)return new Ek(e.h,e.s,e.l,e.opacity);if(e instanceof qO||(e=dk(e)),!e)return new Ek;if(e instanceof Ek)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Ek(o,s,c,e.opacity)}function Tk(e,t,n,r){return arguments.length===1?wk(e):new Ek(e,t,n,r??1)}function Ek(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}GO(Ek,Tk,KO(qO,{brighter(e){return e=e==null?YO:YO**+e,new Ek(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?JO:JO**+e,new Ek(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new gk(kk(e>=240?e-240:e+120,i,r),kk(e,i,r),kk(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ek(Dk(this.h),Ok(this.s),Ok(this.l),bk(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=bk(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Dk(this.h)}, ${Ok(this.s)*100}%, ${Ok(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Dk(e){return e=(e||0)%360,e<0?e+360:e}function Ok(e){return Math.max(0,Math.min(1,e||0))}function kk(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Ak=e=>()=>e;function jk(e,t){return function(n){return e+n*t}}function Mk(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Nk(e){return(e=+e)==1?Pk:function(t,n){return n-t?Mk(t,n,e):Ak(isNaN(t)?n:t)}}function Pk(e,t){var n=t-e;return n?jk(e,n):Ak(isNaN(e)?t:e)}var Fk=(function e(t){var n=Nk(t);function r(e,t){var r=n((e=hk(e)).r,(t=hk(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Pk(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Ik(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Lk(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Rk(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=qk(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function zk(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Bk(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Vk(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=qk(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Hk=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Uk=new RegExp(Hk.source,`g`);function Wk(e){return function(){return e}}function Gk(e){return function(t){return e(t)+``}}function Kk(e,t){var n=Hk.lastIndex=Uk.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Hk.exec(e))&&(i=Uk.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Bk(r,i)})),n=Uk.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Gk(c[0].x):Wk(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function qk(e,t){var n=typeof t,r;return t==null||n===`boolean`?Ak(t):(n===`number`?Bk:n===`string`?(r=dk(t))?(t=r,Fk):Kk:t instanceof dk?Fk:t instanceof Date?zk:Lk(t)?Ik:Array.isArray(t)?Rk:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Vk:Bk)(e,t)}var Jk=180/Math.PI,Yk={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xk(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Jk,skewX:Math.atan(c)*Jk,scaleX:o,scaleY:s}}var Zk;function Qk(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Yk:Xk(t.a,t.b,t.c,t.d,t.e,t.f)}function $k(e){return e==null||(Zk||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Zk.setAttribute(`transform`,e),!(e=Zk.transform.baseVal.consolidate()))?Yk:(e=e.matrix,Xk(e.a,e.b,e.c,e.d,e.e,e.f))}function eA(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:Bk(e,i)},{i:c-2,x:Bk(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Bk(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Bk(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Bk(e,n)},{i:s-2,x:Bk(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var tA=eA(Qk,`px, `,`px)`,`deg)`),nA=eA($k,`, `,`)`,`)`),rA=1e-12;function iA(e){return((e=Math.exp(e))+1/e)/2}function aA(e){return((e=Math.exp(e))-1/e)/2}function oA(e){return((e=Math.exp(2*e))-1)/(e+1)}var sA=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<rA)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=iA(y),c=s/(n*g)*(i*oA(t*r+y)-aA(y));return[a+c*d,o+c*f,s*i/iA(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),cA=0,lA=0,uA=0,dA=1e3,fA,pA,mA=0,hA=0,gA=0,_A=typeof performance==`object`&&performance.now?performance:Date,vA=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function yA(){return hA||=(vA(bA),_A.now()+gA)}function bA(){hA=0}function xA(){this._call=this._time=this._next=null}xA.prototype=SA.prototype={constructor:xA,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?yA():+n)+(t==null?0:+t),!this._next&&pA!==this&&(pA?pA._next=this:fA=this,pA=this),this._call=e,this._time=n,DA()},stop:function(){this._call&&(this._call=null,this._time=1/0,DA())}};function SA(e,t,n){var r=new xA;return r.restart(e,t,n),r}function CA(){yA(),++cA;for(var e=fA,t;e;)(t=hA-e._time)>=0&&e._call.call(void 0,t),e=e._next;--cA}function wA(){hA=(mA=_A.now())+gA,cA=lA=0;try{CA()}finally{cA=0,EA(),hA=0}}function TA(){var e=_A.now(),t=e-mA;t>dA&&(gA-=t,mA=e)}function EA(){for(var e,t=fA,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:fA=n);pA=e,DA(r)}function DA(e){cA||(lA&&=clearTimeout(lA),e-hA>24?(e<1/0&&(lA=setTimeout(wA,e-_A.now()-gA)),uA&&=clearInterval(uA)):(uA||=(mA=_A.now(),setInterval(TA,dA)),cA=1,vA(wA)))}function OA(e,t,n){var r=new xA;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var kA=EE(`start`,`end`,`cancel`,`interrupt`),AA=[];function jA(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;FA(e,n,{name:t,index:r,group:i,on:kA,tween:AA,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function MA(e,t){var n=PA(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function NA(e,t){var n=PA(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function PA(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function FA(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=SA(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return OA(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(OA(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function IA(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function LA(e){return this.each(function(){IA(this,e)})}function RA(e,t){var n,r;return function(){var i=NA(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function zA(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=NA(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function BA(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=PA(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?RA:zA)(n,e,t))}function VA(e,t,n){var r=e._id;return e.each(function(){var e=NA(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return PA(e,r).value[t]}}function HA(e,t){var n;return(typeof t==`number`?Bk:t instanceof dk?Fk:(n=dk(t))?(t=n,Fk):Kk)(e,t)}function UA(e){return function(){this.removeAttribute(e)}}function WA(e){return function(){this.removeAttributeNS(e.space,e.local)}}function GA(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function KA(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function qA(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function JA(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function YA(e,t){var n=ME(e),r=n===`transform`?nA:HA;return this.attrTween(e,typeof t==`function`?(n.local?JA:qA)(n,r,VA(this,`attr.`+e,t)):t==null?(n.local?WA:UA)(n):(n.local?KA:GA)(n,r,t))}function XA(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ZA(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function QA(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ZA(e,i)),n}return i._value=t,i}function $A(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&XA(e,i)),n}return i._value=t,i}function ej(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=ME(e);return this.tween(n,(r.local?QA:$A)(r,t))}function tj(e,t){return function(){MA(this,e).delay=+t.apply(this,arguments)}}function nj(e,t){return t=+t,function(){MA(this,e).delay=t}}function rj(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?tj:nj)(t,e)):PA(this.node(),t).delay}function ij(e,t){return function(){NA(this,e).duration=+t.apply(this,arguments)}}function aj(e,t){return t=+t,function(){NA(this,e).duration=t}}function oj(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?ij:aj)(t,e)):PA(this.node(),t).duration}function sj(e,t){if(typeof t!=`function`)throw Error();return function(){NA(this,e).ease=t}}function cj(e){var t=this._id;return arguments.length?this.each(sj(t,e)):PA(this.node(),t).ease}function lj(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();NA(this,e).ease=n}}function uj(e){if(typeof e!=`function`)throw Error();return this.each(lj(this._id,e))}function dj(e){typeof e!=`function`&&(e=WE(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Bj(r,this._parents,this._name,this._id)}function fj(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Bj(o,this._parents,this._name,this._id)}function pj(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function mj(e,t,n){var r,i,a=pj(t)?MA:NA;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function hj(e,t){var n=this._id;return arguments.length<2?PA(this.node(),n).on.on(e):this.each(mj(n,e,t))}function gj(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _j(){return this.on(`end.remove`,gj(this._id))}function vj(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=LE(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,jA(l[f],t,n,f,l,PA(u,n)));return new Bj(a,this._parents,t,n)}function yj(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=VE(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=PA(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&jA(p,t,n,h,f,m);a.push(f),o.push(u)}return new Bj(a,o,t,n)}var bj=DO.prototype.constructor;function xj(){return new bj(this._groups,this._parents)}function Sj(e,t){var n,r,i;return function(){var a=PD(this,e),o=(this.style.removeProperty(e),PD(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Cj(e){return function(){this.style.removeProperty(e)}}function wj(e,t,n){var r,i=n+``,a;return function(){var o=PD(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Tj(e,t,n){var r,i,a;return function(){var o=PD(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),PD(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Ej(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=NA(this,e),l=c.on,u=c.value[a]==null?s||=Cj(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Dj(e,t,n){var r=(e+=``)==`transform`?tA:HA;return t==null?this.styleTween(e,Sj(e,r)).on(`end.style.`+e,Cj(e)):typeof t==`function`?this.styleTween(e,Tj(e,r,VA(this,`style.`+e,t))).each(Ej(this._id,e)):this.styleTween(e,wj(e,r,t),n).on(`end.style.`+e,null)}function Oj(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function kj(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Oj(e,a,n)),r}return a._value=t,a}function Aj(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,kj(e,t,n??``))}function jj(e){return function(){this.textContent=e}}function Mj(e){return function(){var t=e(this);this.textContent=t??``}}function Nj(e){return this.tween(`text`,typeof e==`function`?Mj(VA(this,`text`,e)):jj(e==null?``:e+``))}function Pj(e){return function(t){this.textContent=e.call(this,t)}}function Fj(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Pj(r)),t}return r._value=e,r}function Ij(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Fj(e))}function Lj(){for(var e=this._name,t=this._id,n=Hj(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=PA(c,t);jA(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Bj(r,this._parents,e,n)}function Rj(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=NA(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var zj=0;function Bj(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Vj(e){return DO().transition(e)}function Hj(){return++zj}var Uj=DO.prototype;Bj.prototype=Vj.prototype={constructor:Bj,select:vj,selectAll:yj,selectChild:Uj.selectChild,selectChildren:Uj.selectChildren,filter:dj,merge:fj,selection:xj,transition:Lj,call:Uj.call,nodes:Uj.nodes,node:Uj.node,size:Uj.size,empty:Uj.empty,each:Uj.each,on:hj,attr:YA,attrTween:ej,style:Dj,styleTween:Aj,text:Nj,textTween:Ij,remove:_j,tween:BA,delay:rj,duration:oj,ease:cj,easeVarying:uj,end:Rj,[Symbol.iterator]:Uj[Symbol.iterator]};function Wj(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Gj={time:null,delay:0,duration:250,ease:Wj};function Kj(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function qj(e){var t,n;e instanceof Bj?(t=e._id,e=e._name):(t=Hj(),(n=Gj).time=yA(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&jA(c,e,t,l,o,n||Kj(c,t));return new Bj(r,this._parents,e,t)}DO.prototype.interrupt=LA,DO.prototype.transition=qj;var Jj=e=>()=>e;function Yj(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Xj(e,t,n){this.k=e,this.x=t,this.y=n}Xj.prototype={constructor:Xj,scale:function(e){return e===1?this:new Xj(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Xj(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Zj=new Xj(1,0,0);Qj.prototype=Xj.prototype;function Qj(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Zj;return e.__zoom}function $j(e){e.stopImmediatePropagation()}function eM(e){e.preventDefault(),e.stopImmediatePropagation()}function tM(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function nM(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function rM(){return this.__zoom||Zj}function iM(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function aM(){return navigator.maxTouchPoints||`ontouchstart`in this}function oM(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function sM(){var e=tM,t=nM,n=oM,r=iM,i=aM,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=sA,l=EE(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,rM).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,rM),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Zj.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Xj(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Xj(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Xj(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=kO(this.that).datum();l.call(e,this.that,new Yj(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=jO(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],IA(this),s.start();eM(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=kO(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=jO(t,i),l=t.clientX,u=t.clientY;IO(t.view),$j(t),a.mouse=[c,this.__zoom.invert(c)],IA(this),a.start();function d(e){if(eM(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=jO(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),LO(e.view,a.moved),eM(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=jO(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);eM(r),s>0?kO(this).transition().duration(s).call(x,d,c,r):kO(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for($j(t),s=0;s<i;++s)c=r[s],l=jO(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),IA(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(eM(e),s=0;s<a;++s)c=i[s],l=jO(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for($j(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=jO(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=kO(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Jj(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Jj(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Jj(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Jj([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var cM={error001:(e=`react`)=>`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},lM=[[-1/0,-1/0],[1/0,1/0]],uM=[`Enter`,` `,`Escape`],dM={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},fM;(function(e){e.Strict=`strict`,e.Loose=`loose`})(fM||={});var pM;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(pM||={});var mM;(function(e){e.Partial=`partial`,e.Full=`full`})(mM||={});var hM={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},gM;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(gM||={});var _M;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(_M||={});var Z;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(Z||={});var vM={[Z.Left]:Z.Right,[Z.Right]:Z.Left,[Z.Top]:Z.Bottom,[Z.Bottom]:Z.Top};function yM(e){return e===null?null:e?`valid`:`invalid`}var bM=e=>`id`in e&&`source`in e&&`target`in e,xM=e=>`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),SM=e=>`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),CM=(e,t=[0,0])=>{let{width:n,height:r}=nN(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},wM=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:zM(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):SM(n)?n:t.nodeLookup.get(n.id)),LM(e,i?VM(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),TM=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=LM(n,VM(e)),r=!0)}),r?zM(n):{x:0,y:0,width:0,height:0}},EM=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s={...JM(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??null,l=e.height??t.height??t.initialHeight??null,u=UM(s,BM(t)),d=(i??0)*(l??0),f=a&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&c.push(t)}return c},DM=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function OM(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{e.measured.width&&e.measured.height&&(t?.includeHiddenNodes||!e.hidden)&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function kM({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=$M(TM(OM(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function AM({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent)if(!s)a?.(`005`,cM.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&tN(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=tN(d)?NM(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,cM.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function jM({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=DM(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var MM=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),NM=(e={x:0,y:0},t,n)=>({x:MM(e.x,t[0][0],t[1][0]-(n?.width??0)),y:MM(e.y,t[0][1],t[1][1]-(n?.height??0))});function PM(e,t,n){let{width:r,height:i}=nN(n),{x:a,y:o}=n.internals.positionAbsolute;return NM(e,[[a,o],[a+r,o+i]],t)}var FM=(e,t,n)=>e<t?MM(Math.abs(e-t),1,t)/t:e>n?-MM(Math.abs(e-n),1,t)/t:0,IM=(e,t,n=15,r=40)=>[FM(e.x,r,t.width-r)*n,FM(e.y,r,t.height-r)*n],LM=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),RM=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),zM=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),BM=(e,t=[0,0])=>{let{x:n,y:r}=SM(e)?e.internals.positionAbsolute:CM(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},VM=(e,t=[0,0])=>{let{x:n,y:r}=SM(e)?e.internals.positionAbsolute:CM(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},HM=(e,t)=>zM(LM(RM(e),RM(t))),UM=(e,t)=>{let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},WM=e=>GM(e.width)&&GM(e.height)&&GM(e.x)&&GM(e.y),GM=e=>!isNaN(e)&&isFinite(e),KM=(e,t)=>(e,t)=>{},qM=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),JM=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?qM(s,o):s},YM=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function XM(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ZM(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=XM(e,n),i=XM(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=XM(e.top??e.y??0,n),i=XM(e.bottom??e.y??0,n),a=XM(e.left??e.x??0,t),o=XM(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function QM(e,t,n,r,i,a){let{x:o,y:s}=YM(e,[t,n,r]),{x:c,y:l}=YM({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var $M=(e,t,n,r,i,a)=>{let o=ZM(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=MM(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=QM(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},eN=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function tN(e){return e!=null&&e!==`parent`}function nN(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function rN(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function iN(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function aN(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function oN(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function sN(e){return{...dM,...e||{}}}function cN(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=mN(e),s=JM({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?qM(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var lN=e=>({width:e.offsetWidth,height:e.offsetHeight}),uN=e=>e?.getRootNode?.()||window?.document,dN=[`INPUT`,`SELECT`,`TEXTAREA`];function fN(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?dN.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var pN=e=>`clientX`in e,mN=(e,t)=>{let n=pN(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},hN=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...lN(t)}})};function gN({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function _N(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function vN({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Z.Left:return[t-_N(t-r,a),n];case Z.Right:return[t+_N(r-t,a),n];case Z.Top:return[t,n-_N(n-i,a)];case Z.Bottom:return[t,n+_N(i-n,a)]}}function yN({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:a=Z.Top,curvature:o=.25}){let[s,c]=vN({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=vN({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=gN({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function bN({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function xN({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function SN({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=LM(VM(e),VM(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),UM({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},zM(a))>0}var CN=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,wN=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),TN=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,cM.error006()),t;let r=n.getEdgeId||CN,i;return i=bM(e)?{...e}:{...e,id:r(e)},wN(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function EN({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=bN({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var DN={[Z.Left]:{x:-1,y:0},[Z.Right]:{x:1,y:0},[Z.Top]:{x:0,y:-1},[Z.Bottom]:{x:0,y:1}},ON=({source:e,sourcePosition:t=Z.Bottom,target:n})=>t===Z.Left||t===Z.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},kN=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function AN({source:e,sourcePosition:t=Z.Bottom,target:n,targetPosition:r=Z.Top,center:i,offset:a,stepPosition:o}){let s=DN[t],c=DN[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=ON({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=bN({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function jN(e,t,n,r){let i=Math.min(kN(e,t)/2,kN(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function MN({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:a=Z.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=AN({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=jN(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function NN(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function PN(e){let{sourceNode:t,targetNode:n}=e;if(!NN(t)||!NN(n))return null;let r=t.internals.handleBounds||FN(t.handles),i=n.internals.handleBounds||FN(n.handles),a=LN(r?.source??[],e.sourceHandle),o=LN(e.connectionMode===fM.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,cM.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||Z.Bottom,c=o?.position||Z.Top,l=IN(t,a,s),u=IN(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function FN(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function IN(e,t,n=Z.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??nN(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case Z.Top:return{x:i+o/2,y:a};case Z.Right:return{x:i+o,y:a+s/2};case Z.Bottom:return{x:i+o/2,y:a+s};case Z.Left:return{x:i,y:a+s/2}}}function LN(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function RN(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function zN(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=RN(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var BN=1e3,VN=10,HN={nodeOrigin:[0,0],nodeExtent:lM,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},UN={...HN,checkEquality:!0};function WN(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function GN(e,t,n){let r=WN(HN,n);for(let n of e.values())if(n.parentId)XN(n,e,t,r);else{let e=NM(CM(n,r.nodeOrigin),tN(n.extent)?n.extent:r.nodeExtent,nN(n));n.internals.positionAbsolute=e}}function KN(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function qN(e){return e===`manual`}function JN(e,t,n,r={}){let i=WN(UN,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!qN(i.zIndexMode)?BN:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=NM(CM(u,i.nodeOrigin),tN(u.extent)?u.extent:i.nodeExtent,nN(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:KN(u,e),z:ZN(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&XN(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function YN(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function XN(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=WN(HN,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}YN(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*VN),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=QN(e,u,o,s,a&&!qN(c)?BN:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function ZN(e,t,n){let r=GM(e.zIndex)?e.zIndex:0;return qN(n)?r:r+(e.selected?t:0)}function QN(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=nN(e),l=CM(e,n),u=tN(e.extent)?NM(l,e.extent,c):l,d=NM({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=PM(d,c,t));let f=ZN(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function $N(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=HM(a.get(n.parentId)?.expandedRect??BM(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=nN(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function eP(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=lN(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=tN(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;e.parentId&&e.extent===`parent`?h=PM(h,s,t.get(e.parentId)):m&&(h=NM(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:hN(`source`,r.nodeElement,p,d,e.id),target:hN(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&XN(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:BM(g,i)}))}}if(f.length>0){let e=$N(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function tP({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function nP(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function rP(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;nP(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),nP(`target`,s,c,e,i,o),t.set(r.id,r)}}function iP(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:iP(n,t):!1}function aP(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function oP(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!iP(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function sP({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function cP({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=qM(a,t);return{x:o.x-a.x,y:o.y-a.y}}function lP({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=kO(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?RM(TM(s)):null,x=v&&l?cP({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:qM(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=AM({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=sP({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=IM(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=cN(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=oP(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=sP({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=WO().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=cN(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=mN(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=cN(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=mN(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=mN(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=sP({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!aP(t,`.${g}`,v))&&(!_||aP(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function uP(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())UM(i,BM(e))>0&&r.push(e);return r}var dP=250;function fP(e,t,n,r){let i=[],a=1/0,o=uP(e,n,t+dP);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=IN(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function pP(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...IN(o,c,c.position,!0)}:c}function mP(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function hP(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var gP=()=>!0;function _P(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=gP,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=uN(e.target),E=0,D,{x:O,y:k}=mN(e),A=mP(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=pP(i,A,r,c,t);if(!N)return;let P=mN(e,j),F=!1,I=null,L=!1,ee=null;function te(){if(!u||!j)return;let[e,t]=IM(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(te)}let ne={...N,nodeId:i,type:A,position:N.position},R=c.get(i),z={inProgress:!0,isValid:null,from:IN(R,ne,Z.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:R,to:P,toHandle:null,toPosition:vM[ne.position],toNode:null,pointer:P};function B(){M=!0,y(z),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&B();function re(e){if(!M){let{x:t,y:n}=mN(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;B()}if(!x()||!ne){ie(e);return}let a=b();P=mN(e,j),D=fP(JM(P,a,!1,[1,1]),n,c,ne),F||=(te(),!0);let s=vP(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});ee=s.handleDomNode,I=s.connection,L=hP(!!D,s.isValid);let u=c.get(i),f=u?IN(u,ne,Z.Left,!0):z.from,p={...z,from:f,isValid:L,to:s.toHandle&&L?YM({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:vM[ne.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),z=p}function ie(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||ee)&&I&&L&&h?.(I);let{inProgress:t,...n}=z,r={...n,toPosition:z.toHandle?z.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,L=!1,I=null,ee=null,T.removeEventListener(`mousemove`,re),T.removeEventListener(`mouseup`,ie),T.removeEventListener(`touchmove`,re),T.removeEventListener(`touchend`,ie)}}T.addEventListener(`mousemove`,re),T.addEventListener(`mouseup`,ie),T.addEventListener(`touchmove`,re),T.addEventListener(`touchend`,ie)}function vP(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=gP,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=mN(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=mP(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===fM.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=pP(t,e,a,u,n,!0)}return _}var yP={onPointerDown:_P,isValid:vP};function bP({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=kO(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&eN()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=sM().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:jO}}var xP=e=>({x:e.x,y:e.y,zoom:e.k}),SP=({x:e,y:t,zoom:n})=>Zj.translate(e,t).scale(n),CP=(e,t)=>e.target.closest(`.${t}`),wP=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),TP=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,EP=(e,t=0,n=TP,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},DP=e=>{let t=e.ctrlKey&&eN()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function OP({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(CP(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=jO(u),t=d*2**DP(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===pM.Vertical?0:u.deltaX*f,m=i===pM.Horizontal?0:u.deltaY*f;!eN()&&u.shiftKey&&i!==pM.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=xP(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c?.(u,h),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,s?.(u,h))}}function kP({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=CP(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function AP({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=xP(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function jP({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&wP(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,xP(a.transform))}}function MP({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&wP(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=xP(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function NP({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(CP(d,`${l}-flow__node`)||CP(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||CP(d,s)&&m||CP(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function PP({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=sM().scaleExtent([t,n]).translateExtent(r),f=kO(e).call(d);v({x:i.x,y:i.y,zoom:MM(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let p=f.on(`wheel.zoom`),m=f.on(`dblclick.zoom`);d.wheelDelta(DP);async function h(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?qk:sA).transform(EP(f,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function g({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:h,panOnScrollSpeed:g,preventScrolling:v,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&_();let O=i&&!S&&!r;d.clickDistance(D?1/0:!GM(E)||E<0?0:E);let k=O?OP({zoomPanValues:l,noWheelClassName:e,d3Selection:f,d3Zoom:d,panOnScrollMode:h,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):kP({noWheelClassName:e,preventScrolling:v,d3ZoomHandler:p});f.on(`wheel.zoom`,k,{passive:!1});let A=AP({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});d.on(`start`,A);let j=jP({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});d.on(`zoom`,j);let M=MP({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});d.on(`end`,M);let N=NP({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});d.filter(N),x?f.on(`dblclick.zoom`,m):f.on(`dblclick.zoom`,null)}function _(){d.on(`zoom`,null)}async function v(e,t,n){let r=SP(e),i=d?.constrain()(r,t,n);return i&&await h(i),i}async function y(e,t){let n=SP(e);return await h(n,t),n}function b(e){if(f){let t=SP(e),n=f.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&d?.transform(f,t,null,{sync:!0})}}function x(){let e=f?Qj(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function S(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?qk:sA).scaleTo(EP(f,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function C(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?qk:sA).scaleBy(EP(f,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function w(e){d?.scaleExtent(e)}function T(e){d?.translateExtent(e)}function E(e){let t=!GM(e)||e<0?0:e;d?.clickDistance(t)}return{update:g,destroy:_,setViewport:y,setViewportConstrained:v,getViewport:x,scaleTo:S,scaleBy:C,setScaleExtent:w,setTranslateExtent:T,syncViewport:b,setClickDistance:E}}var FP;(function(e){e.Line=`line`,e.Handle=`handle`})(FP||={});function IP({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function LP(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function RP(e,t){return Math.max(0,t-e)}function zP(e,t){return Math.max(0,e-t)}function BP(e,t,n){return Math.max(0,t-e,e-n)}function VP(e,t){return e?!t:t}function HP(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=BP(E,h,g),j=BP(D,_,v);if(o){let e=0,t=0;c&&w<0?e=RP(y+w+O,o[0][0]):!c&&w>0&&(e=zP(y+E+O,o[1][0])),l&&T<0?t=RP(b+T+k,o[0][1]):!l&&T>0&&(t=zP(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=zP(y+w,s[0][0]):!c&&w<0&&(e=RP(y+E,s[1][0])),l&&T>0?t=zP(b+T,s[0][1]):!l&&T<0&&(t=RP(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=BP(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?zP(b+k+E/C,o[1][1])*C:RP(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?RP(b+E/C,s[1][1])*C:zP(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=BP(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?zP(y+D*C+O,o[1][0])/C:RP(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?RP(y+D*C,s[1][0])/C:zP(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(VP(c,l)?-w:w)/C:w=(VP(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var UP={width:0,height:0,x:0,y:0},WP={...UP,pointerX:0,pointerY:0,aspectRatio:1};function GP(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function KP({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=kO(e),o={controlDirection:LP(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...UP},h={...WP};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:LP(e)};let g,_=null,v=[],y,b,x,S=!1,C=WO().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=cN(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=tN(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=GP(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=cN(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=HP(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,P=A!==f&&M;if(!N&&!P&&!j&&!M)return;if((N||P||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=P?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||M)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=M&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let F=IP({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),I={...m,direction:F};p?.(e,I)!==!1&&(S=!0,d?.(e,I),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var qP=s((e=>{var t=p(),n=$_();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),JP=u(s(((e,t)=>{t.exports=qP()}))(),1),YP=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)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},XP=e=>e?YP(e):YP,{useDebugValue:ZP}=b.default,{useSyncExternalStoreWithSelector:QP}=JP.default,$P=e=>e;function eF(e,t=$P,n){let r=QP(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return ZP(r),r}var tF=(e,t)=>{let n=XP(e),r=(e,r=t)=>eF(n,e,r);return Object.assign(r,n),r},nF=(e,t)=>e?tF(e,t):tF;function rF(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var iF=(0,b.createContext)(null),aF=iF.Provider,oF=cM.error001(`react`);function sF(e,t){let n=(0,b.useContext)(iF);if(n===null)throw Error(oF);return eF(n,e,t)}function cF(){let e=(0,b.useContext)(iF);if(e===null)throw Error(oF);return(0,b.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var lF={display:`none`},uF={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},dF=`react-flow__node-desc`,fF=`react-flow__edge-desc`,pF=`react-flow__aria-live`,mF=e=>e.ariaLiveMessage,hF=e=>e.ariaLabelConfig;function gF({rfId:e}){let t=sF(mF);return(0,q.jsx)(`div`,{id:`${pF}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:uF,children:t})}function _F({rfId:e,disableKeyboardA11y:t}){let n=sF(hF);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{id:`${dF}-${e}`,style:lF,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,q.jsx)(`div`,{id:`${fF}-${e}`,style:lF,children:n[`edge.a11yDescription.default`]}),!t&&(0,q.jsx)(gF,{rfId:e})]})}var vF=(0,b.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>(0,q.jsx)(`div`,{className:wE([`react-flow__panel`,n,...`${e}`.split(`-`)]),style:r,ref:a,...i,children:t}));vF.displayName=`Panel`;function yF({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,q.jsx)(vF,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev`,children:(0,q.jsx)(`a`,{href:`https://reactflow.dev`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var bF=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},xF=e=>e.id;function SF(e,t){return rF(e.selectedNodes.map(xF),t.selectedNodes.map(xF))&&rF(e.selectedEdges.map(xF),t.selectedEdges.map(xF))}function CF({onSelectionChange:e}){let t=cF(),{selectedNodes:n,selectedEdges:r}=sF(bF,SF);return(0,b.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var wF=e=>!!e.onSelectionChangeHandlers;function TF({onSelectionChange:e}){let t=sF(wF);return e||t?(0,q.jsx)(CF,{onSelectionChange:e}):null}var EF=[0,0],DF={x:0,y:0,zoom:1},OF=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],kF=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),AF={translateExtent:lM,nodeOrigin:EF,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function jF(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=sF(kF,rF),l=cF();(0,b.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=AF,s()}),[]);let u=(0,b.useRef)(AF);return(0,b.useEffect)(()=>{for(let s of OF){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:sN(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},OF.map(t=>e[t])),null}function MF(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function NF(e){let[t,n]=(0,b.useState)(e===`system`?null:e);return(0,b.useEffect)(()=>{if(e!==`system`){n(e);return}let t=MF(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?MF()?.matches?`dark`:`light`:t}var PF=typeof document<`u`?document:null;function FF(e=null,t={target:PF,actInsideInputWithModifier:!0}){let[n,r]=(0,b.useState)(!1),i=(0,b.useRef)(!1),a=(0,b.useRef)(new Set([])),[o,s]=(0,b.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
|
|
60
|
+
`},V_=0,H_=[];function U_(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(V_++)[0],a=b.useState(d_)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Bg([e.lockRef.current],(e.shards||[]).map(R_),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=b.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=I_(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=k_(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=k_(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return F_(h,t,e,h===`h`?s:c,!0)},[]),c=b.useCallback(function(e){var n=e;if(!(!H_.length||H_[H_.length-1]!==a)){var r=`deltaY`in n?L_(n):I_(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&z_(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(R_).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=b.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:W_(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=b.useCallback(function(e){n.current=I_(e),r.current=void 0},[]),d=b.useCallback(function(t){l(t.type,L_(t),t.target,s(t,e.lockRef.current))},[]),f=b.useCallback(function(t){l(t.type,I_(t),t.target,s(t,e.lockRef.current))},[]);b.useEffect(function(){return H_.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,w_),document.addEventListener(`touchmove`,c,w_),document.addEventListener(`touchstart`,u,w_),function(){H_=H_.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,w_),document.removeEventListener(`touchmove`,c,w_),document.removeEventListener(`touchstart`,u,w_)}},[]);var p=e.removeScrollBar,m=e.inert;return b.createElement(b.Fragment,null,m?b.createElement(a,{styles:B_(i)}):null,p?b.createElement(x_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function W_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var G_=e_(t_,U_),K_=b.forwardRef(function(e,t){return b.createElement(r_,Rg({},e,{ref:t,sideCar:G_}))});K_.classNames=r_.classNames;var q_=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},J_=new WeakMap,Y_=new WeakMap,X_={},Z_=0,Q_=function(e){return e&&(e.host||Q_(e.parentNode))},$_=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Q_(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ev=function(e,t,n,r){var i=$_(t,Array.isArray(e)?e:[e]);X_[n]||(X_[n]=new WeakMap);var a=X_[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(J_.get(e)||0)+1,l=(a.get(e)||0)+1;J_.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Y_.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Z_++,function(){o.forEach(function(e){var t=J_.get(e)-1,i=a.get(e)-1;J_.set(e,t),a.set(e,i),t||(Y_.has(e)||e.removeAttribute(r),Y_.delete(e)),i||e.removeAttribute(n)}),Z_--,Z_||(J_=new WeakMap,J_=new WeakMap,Y_=new WeakMap,X_={})}},tv=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||q_(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ev(r,i,n,`aria-hidden`)):function(){return null}},nv=s((e=>{var t=p();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),rv=s(((e,t)=>{t.exports=nv()}));function iv(e){let t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function av(e){let[t,n]=b.useState(void 0);return Eh(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var ov=[`top`,`right`,`bottom`,`left`],sv=Math.min,cv=Math.max,lv=Math.round,uv=Math.floor,dv=e=>({x:e,y:e}),fv={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function pv(e,t,n){return cv(e,sv(t,n))}function mv(e,t){return typeof e==`function`?e(t):e}function hv(e){return e.split(`-`)[0]}function gv(e){return e.split(`-`)[1]}function _v(e){return e===`x`?`y`:`x`}function vv(e){return e===`y`?`height`:`width`}function yv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function bv(e){return _v(yv(e))}function xv(e,t,n){n===void 0&&(n=!1);let r=gv(e),i=bv(e),a=vv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Av(o)),[o,Av(o)]}function Sv(e){let t=Av(e);return[Cv(e),t,Cv(t)]}function Cv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var wv=[`left`,`right`],Tv=[`right`,`left`],Ev=[`top`,`bottom`],Dv=[`bottom`,`top`];function Ov(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Tv:wv:t?wv:Tv;case`left`:case`right`:return t?Ev:Dv;default:return[]}}function kv(e,t,n,r){let i=gv(e),a=Ov(hv(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Cv)))),a}function Av(e){let t=hv(e);return fv[t]+e.slice(t.length)}function jv(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}:jv(e)}function Nv(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}}function Pv(e,t,n){let{reference:r,floating:i}=e,a=yv(t),o=bv(t),s=vv(o),c=hv(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(gv(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 Fv(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}=mv(t,e),p=Mv(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Nv(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=Nv(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 Iv=50,Lv=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Fv},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Pv(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<Iv&&(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}=Pv(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Rv=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}=mv(e,t)||{};if(l==null)return{};let d=Mv(u),f={x:n,y:r},p=bv(i),m=vv(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=sv(d[_],T),D=sv(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=pv(O,A,k),M=!c.arrow&&gv(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),zv=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}=mv(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=hv(r),_=yv(o),v=hv(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Av(o)]:Sv(o)),x=p!==`none`;!d&&x&&b.push(...kv(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=xv(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`&&_!==yv(t))||T.every(e=>yv(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=yv(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 Bv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Vv(e){return ov.some(t=>e[t]>=0)}var Hv=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=mv(e,t);switch(i){case`referenceHidden`:{let e=Bv(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Vv(e)}}}case`escaped`:{let e=Bv(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Vv(e)}}}default:return{}}}}},Uv=new Set([`left`,`top`]);async function Wv(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=hv(n),s=gv(n),c=yv(n)===`y`,l=Uv.has(o)?-1:1,u=a&&c?-1:1,d=mv(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 Gv=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 Wv(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}}}}},Kv=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}=mv(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=yv(hv(i)),p=_v(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=pv(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=pv(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}}}}}},qv=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}=mv(e,t),u={x:n,y:r},d=yv(i),f=_v(d),p=u[f],m=u[d],h=mv(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=Uv.has(hv(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}}}},Jv=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}=mv(e,t),u=await o.detectOverflow(t,l),d=hv(i),f=gv(i),p=yv(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=sv(h-u[g],v),x=sv(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=cv(u.left,0),t=cv(u.right,0),n=cv(u.top,0),r=cv(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:cv(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:cv(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 Yv(){return typeof window<`u`}function Xv(e){return $v(e)?(e.nodeName||``).toLowerCase():`#document`}function Zv(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qv(e){return(($v(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function $v(e){return Yv()?e instanceof Node||e instanceof Zv(e).Node:!1}function ey(e){return Yv()?e instanceof Element||e instanceof Zv(e).Element:!1}function ty(e){return Yv()?e instanceof HTMLElement||e instanceof Zv(e).HTMLElement:!1}function ny(e){return!Yv()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Zv(e).ShadowRoot}function ry(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=my(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function iy(e){return/^(table|td|th)$/.test(Xv(e))}function ay(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var oy=/transform|translate|scale|rotate|perspective|filter/,sy=/paint|layout|strict|content/,cy=e=>!!e&&e!==`none`,ly;function uy(e){let t=ey(e)?my(e):e;return cy(t.transform)||cy(t.translate)||cy(t.scale)||cy(t.rotate)||cy(t.perspective)||!fy()&&(cy(t.backdropFilter)||cy(t.filter))||oy.test(t.willChange||``)||sy.test(t.contain||``)}function dy(e){let t=gy(e);for(;ty(t)&&!py(t);){if(uy(t))return t;if(ay(t))return null;t=gy(t)}return null}function fy(){return ly??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ly}function py(e){return/^(html|body|#document)$/.test(Xv(e))}function my(e){return Zv(e).getComputedStyle(e)}function hy(e){return ey(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gy(e){if(Xv(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ny(e)&&e.host||Qv(e);return ny(t)?t.host:t}function _y(e){let t=gy(e);return py(t)?e.ownerDocument?e.ownerDocument.body:e.body:ty(t)&&ry(t)?t:_y(t)}function vy(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=_y(e),i=r===e.ownerDocument?.body,a=Zv(r);if(i){let e=yy(a);return t.concat(a,a.visualViewport||[],ry(r)?r:[],e&&n?vy(e):[])}else return t.concat(r,vy(r,[],n))}function yy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function by(e){let t=my(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ty(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=lv(n)!==a||lv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function xy(e){return ey(e)?e:e.contextElement}function Sy(e){let t=xy(e);if(!ty(t))return dv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=by(t),o=(a?lv(n.width):n.width)/r,s=(a?lv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Cy=dv(0);function wy(e){let t=Zv(e);return!fy()||!t.visualViewport?Cy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ty(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zv(e)?!1:t}function Ey(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=xy(e),o=dv(1);t&&(r?ey(r)&&(o=Sy(r)):o=Sy(e));let s=Ty(a,n,r)?wy(a):dv(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=Zv(a),t=r&&ey(r)?Zv(r):r,n=e,i=yy(n);for(;i&&r&&t!==n;){let e=Sy(i),t=i.getBoundingClientRect(),r=my(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=Zv(i),i=yy(n)}}return Nv({width:u,height:d,x:c,y:l})}function Dy(e,t){let n=hy(e).scrollLeft;return t?t.left+n:Ey(Qv(e)).left+n}function Oy(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Dy(e,n),y:n.top+t.scrollTop}}function ky(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Qv(r),s=t?ay(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=dv(1),u=dv(0),d=ty(r);if((d||!d&&!a)&&((Xv(r)!==`body`||ry(o))&&(c=hy(r)),d)){let e=Ey(r);l=Sy(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Oy(o,c):dv(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 Ay(e){return Array.from(e.getClientRects())}function jy(e){let t=Qv(e),n=hy(e),r=e.ownerDocument.body,i=cv(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=cv(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Dy(e),s=-n.scrollTop;return my(r).direction===`rtl`&&(o+=cv(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var My=25;function Ny(e,t){let n=Zv(e),r=Qv(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=fy();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Dy(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<=My&&(a-=o)}else l<=My&&(a+=l);return{width:a,height:o,x:s,y:c}}function Py(e,t){let n=Ey(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ty(e)?Sy(e):dv(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Fy(e,t,n){let r;if(t===`viewport`)r=Ny(e,n);else if(t===`document`)r=jy(Qv(e));else if(ey(t))r=Py(t,n);else{let n=wy(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Nv(r)}function Iy(e,t){let n=gy(e);return n===t||!ey(n)||py(n)?!1:my(n).position===`fixed`||Iy(n,t)}function Ly(e,t){let n=t.get(e);if(n)return n;let r=vy(e,[],!1).filter(e=>ey(e)&&Xv(e)!==`body`),i=null,a=my(e).position===`fixed`,o=a?gy(e):e;for(;ey(o)&&!py(o);){let t=my(o),n=uy(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||ry(o)&&!n&&Iy(e,o))?r=r.filter(e=>e!==o):i=t,o=gy(o)}return t.set(e,r),r}function Ry(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ay(t)?[]:Ly(t,this._c):[].concat(n),r],o=Fy(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=Fy(t,a[e],i);s=cv(n.top,s),c=sv(n.right,c),l=sv(n.bottom,l),u=cv(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function zy(e){let{width:t,height:n}=by(e);return{width:t,height:n}}function By(e,t,n){let r=ty(t),i=Qv(t),a=n===`fixed`,o=Ey(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=dv(0);function l(){c.x=Dy(i)}if(r||!r&&!a)if((Xv(t)!==`body`||ry(i))&&(s=hy(t)),r){let e=Ey(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?Oy(i,s):dv(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 Vy(e){return my(e).position===`static`}function Hy(e,t){if(!ty(e)||my(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Qv(e)===n&&(n=n.ownerDocument.body),n}function Uy(e,t){let n=Zv(e);if(ay(e))return n;if(!ty(e)){let t=gy(e);for(;t&&!py(t);){if(ey(t)&&!Vy(t))return t;t=gy(t)}return n}let r=Hy(e,t);for(;r&&iy(r)&&Vy(r);)r=Hy(r,t);return r&&py(r)&&Vy(r)&&!uy(r)?n:r||dy(e)||n}var Wy=async function(e){let t=this.getOffsetParent||Uy,n=this.getDimensions,r=await n(e.floating);return{reference:By(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Gy(e){return my(e).direction===`rtl`}var Ky={convertOffsetParentRelativeRectToViewportRelativeRect:ky,getDocumentElement:Qv,getClippingRect:Ry,getOffsetParent:Uy,getElementRects:Wy,getClientRects:Ay,getDimensions:zy,getScale:Sy,isElement:ey,isRTL:Gy};function qy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Jy(e,t){let n=null,r,i=Qv(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=uv(d),h=uv(i.clientWidth-(u+f)),g=uv(i.clientHeight-(d+p)),_=uv(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:cv(0,sv(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&&!qy(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 Yy(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=xy(e),u=i||a?[...l?vy(l):[],...t?vy(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Jy(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?Ey(e):null;c&&g();function g(){let t=Ey(e);h&&!qy(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 Xy=Gv,Zy=Kv,Qy=zv,$y=Jv,eb=Hv,tb=Rv,nb=qv,rb=(e,t,n)=>{let r=new Map,i={platform:Ky,...n},a={...i.platform,_c:r};return Lv(e,t,{...i,platform:a})},ib=typeof document<`u`?b.useLayoutEffect:function(){};function ab(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(!ab(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)&&!ab(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ob(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sb(e,t){let n=ob(e);return Math.round(t*n)/n}function cb(e){let t=b.useRef(e);return ib(()=>{t.current=e}),t}function lb(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]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);ab(f,r)||p(r);let[m,h]=b.useState(null),[g,_]=b.useState(null),v=b.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=b.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=b.useRef(null),w=b.useRef(null),T=b.useRef(u),E=c!=null,D=cb(c),O=cb(i),k=cb(l),A=b.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),rb(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!ab(T.current,t)&&(T.current=t,gh.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);ib(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=b.useRef(!1);ib(()=>(j.current=!0,()=>{j.current=!1}),[]),ib(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=b.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),N=b.useMemo(()=>({reference:x,floating:S}),[x,S]),P=b.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=sb(N.floating,u.x),r=sb(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ob(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var ub=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:tb({element:r.current,padding:i}).fn(n):r?tb({element:r,padding:i}).fn(n):{}}}},db=(e,t)=>{let n=Xy(e);return{name:n.name,fn:n.fn,options:[e,t]}},fb=(e,t)=>{let n=Zy(e);return{name:n.name,fn:n.fn,options:[e,t]}},pb=(e,t)=>({fn:nb(e).fn,options:[e,t]}),mb=(e,t)=>{let n=Qy(e);return{name:n.name,fn:n.fn,options:[e,t]}},hb=(e,t)=>{let n=$y(e);return{name:n.name,fn:n.fn,options:[e,t]}},gb=(e,t)=>{let n=eb(e);return{name:n.name,fn:n.fn,options:[e,t]}},_b=(e,t)=>{let n=ub(e);return{name:n.name,fn:n.fn,options:[e,t]}},vb=`Arrow`,yb=b.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,q.jsx)(_h.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,q.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});yb.displayName=vb;var bb=yb,xb=`Popper`,[Sb,Cb]=Ch(xb),[wb,Tb]=Sb(xb),Eb=e=>{let{__scopePopper:t,children:n}=e,[r,i]=b.useState(null);return(0,q.jsx)(wb,{scope:t,anchor:r,onAnchorChange:i,children:n})};Eb.displayName=xb;var Db=`PopperAnchor`,Ob=b.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Tb(Db,n),o=b.useRef(null),s=sh(t,o),c=b.useRef(null);return b.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,q.jsx)(_h.div,{...i,ref:s})});Ob.displayName=Db;var kb=`PopperContent`,[Ab,jb]=Sb(kb),Mb=b.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Tb(kb,n),[_,v]=b.useState(null),y=sh(t,e=>v(e)),[x,S]=b.useState(null),C=av(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Ib),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=lb({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>Yy(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[db({mainAxis:i+T,alignmentAxis:o}),c&&fb({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?pb():void 0,...A}),c&&mb({...A}),hb({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&_b({element:x,padding:s}),Lb({arrowWidth:w,arrowHeight:T}),f&&gb({strategy:`referenceHidden`,...A})]}),[I,L]=Rb(N),ee=eg(m);Eh(()=>{P&&ee?.()},[P,ee]);let te=F.arrow?.x,ne=F.arrow?.y,R=F.arrow?.centerOffset!==0,[z,B]=b.useState();return Eh(()=>{_&&B(window.getComputedStyle(_).zIndex)},[_]),(0,q.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:z,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,q.jsx)(Ab,{scope:n,placedSide:I,onArrowChange:S,arrowX:te,arrowY:ne,shouldHideArrow:R,children:(0,q.jsx)(_h.div,{"data-side":I,"data-align":L,...h,ref:y,style:{...h.style,animation:P?void 0:`none`}})})})});Mb.displayName=kb;var Nb=`PopperArrow`,Pb={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Fb=b.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=jb(Nb,n),a=Pb[i.placedSide];return(0,q.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,q.jsx)(bb,{...r,ref:t,style:{...r.style,display:`block`}})})});Fb.displayName=Nb;function Ib(e){return e!==null}var Lb=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Rb(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Rb(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var zb=Eb,Bb=Ob,Vb=Mb,Hb=Fb,Ub=`rovingFocusGroup.onEntryFocus`,Wb={bubbles:!1,cancelable:!0},Gb=`RovingFocusGroup`,[Kb,qb,Jb]=Th(Gb),[Yb,Xb]=Ch(Gb,[Jb]),[Zb,Qb]=Yb(Gb),$b=b.forwardRef((e,t)=>(0,q.jsx)(Kb.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,q.jsx)(Kb.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,q.jsx)(ex,{...e,ref:t})})}));$b.displayName=Gb;var ex=b.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=b.useRef(null),p=sh(t,f),m=$h(a),[h,g]=Oh({prop:o,defaultProp:s??null,onChange:c,caller:Gb}),[_,v]=b.useState(!1),y=eg(l),x=qb(n),S=b.useRef(!1),[C,w]=b.useState(0);return b.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Ub,y),()=>e.removeEventListener(Ub,y)},[y]),(0,q.jsx)(Zb,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:b.useCallback(e=>g(e),[g]),onItemShiftTab:b.useCallback(()=>v(!0),[]),onFocusableItemAdd:b.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:b.useCallback(()=>w(e=>e-1),[]),children:(0,q.jsx)(_h.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:Y(e.onMouseDown,()=>{S.current=!0}),onFocus:Y(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Ub,Wb);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);ox([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:Y(e.onBlur,()=>v(!1))})})}),tx=`RovingFocusGroupItem`,nx=b.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Rh(),l=a||c,u=Qb(tx,n),d=u.currentTabStopId===l,f=qb(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return b.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,q.jsx)(Kb.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,q.jsx)(_h.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Y(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Y(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Y(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ax(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?sx(n,r+1):n.slice(r+1)}setTimeout(()=>ox(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});nx.displayName=tx;var rx={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ix(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function ax(e,t,n){let r=ix(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return rx[r]}function ox(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function sx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var cx=$b,lx=nx,ux=[`Enter`,` `],dx=[`ArrowDown`,`PageUp`,`Home`],fx=[`ArrowUp`,`PageDown`,`End`],px=[...dx,...fx],mx={ltr:[...ux,`ArrowRight`],rtl:[...ux,`ArrowLeft`]},hx={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},gx=`Menu`,[_x,vx,yx]=Th(gx),[bx,xx]=Ch(gx,[yx,Cb,Xb]),Sx=Cb(),Cx=Xb(),[wx,Tx]=bx(gx),[Ex,Dx]=bx(gx),Ox=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Sx(t),[c,l]=b.useState(null),u=b.useRef(!1),d=eg(a),f=$h(i);return b.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,q.jsx)(zb,{...s,children:(0,q.jsx)(wx,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,q.jsx)(Ex,{scope:t,onClose:b.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Ox.displayName=gx;var kx=`MenuAnchor`,Ax=b.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Sx(n);return(0,q.jsx)(Bb,{...i,...r,ref:t})});Ax.displayName=kx;var jx=`MenuPortal`,[Mx,Nx]=bx(jx,{forceMount:void 0}),Px=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Tx(jx,t);return(0,q.jsx)(Mx,{scope:t,forceMount:n,children:(0,q.jsx)(Mh,{present:n||a.open,children:(0,q.jsx)(Pg,{asChild:!0,container:i,children:r})})})};Px.displayName=jx;var Fx=`MenuContent`,[Ix,Lx]=bx(Fx),Rx=b.forwardRef((e,t)=>{let n=Nx(Fx,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Tx(Fx,e.__scopeMenu),o=Dx(Fx,e.__scopeMenu);return(0,q.jsx)(_x.Provider,{scope:e.__scopeMenu,children:(0,q.jsx)(Mh,{present:r||a.open,children:(0,q.jsx)(_x.Slot,{scope:e.__scopeMenu,children:o.modal?(0,q.jsx)(zx,{...i,ref:t}):(0,q.jsx)(Bx,{...i,ref:t})})})})}),zx=b.forwardRef((e,t)=>{let n=Tx(Fx,e.__scopeMenu),r=b.useRef(null),i=sh(t,r);return b.useEffect(()=>{let e=r.current;if(e)return tv(e)},[]),(0,q.jsx)(Hx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Bx=b.forwardRef((e,t)=>{let n=Tx(Fx,e.__scopeMenu);return(0,q.jsx)(Hx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Vx=ch(`MenuContent.ScrollLock`),Hx=b.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Tx(Fx,n),_=Dx(Fx,n),v=Sx(n),y=Cx(n),x=vx(n),[S,C]=b.useState(null),w=b.useRef(null),T=sh(t,w,g.onContentChange),E=b.useRef(0),D=b.useRef(``),O=b.useRef(0),k=b.useRef(null),A=b.useRef(`right`),j=b.useRef(0),M=m?K_:b.Fragment,N=m?{as:Vx,allowPinchZoom:!0}:void 0,P=e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ES(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};b.useEffect(()=>()=>window.clearTimeout(E.current),[]),Ig();let F=b.useCallback(e=>A.current===k.current?.side&&OS(e,k.current?.area),[]);return(0,q.jsx)(Ix,{scope:n,searchRef:D,onItemEnter:b.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:b.useCallback(e=>{F(e)||(w.current?.focus(),C(null))},[F]),onTriggerLeave:b.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:O,onPointerGraceIntentChange:b.useCallback(e=>{k.current=e},[]),children:(0,q.jsx)(M,{...N,children:(0,q.jsx)(xg,{asChild:!0,trapped:i,onMountAutoFocus:Y(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,q.jsx)(cg,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,q.jsx)(cx,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Y(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,q.jsx)(Vb,{role:`menu`,"aria-orientation":`vertical`,"data-state":xS(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:Y(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&P(e.key));let i=w.current;if(e.target!==i||!px.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);fx.includes(e.key)&&a.reverse(),wS(a)}),onBlur:Y(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:Y(e.onPointerMove,kS(e=>{let t=e.target,n=j.current!==e.clientX;e.currentTarget.contains(t)&&n&&(A.current=e.clientX>j.current?`right`:`left`,j.current=e.clientX)}))})})})})})})});Rx.displayName=Fx;var Ux=`MenuGroup`,Wx=b.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,q.jsx)(_h.div,{role:`group`,...r,ref:t})});Wx.displayName=Ux;var Gx=`MenuLabel`,Kx=b.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,q.jsx)(_h.div,{...r,ref:t})});Kx.displayName=Gx;var qx=`MenuItem`,Jx=`menu.itemSelect`,Yx=b.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=b.useRef(null),o=Dx(qx,e.__scopeMenu),s=Lx(qx,e.__scopeMenu),c=sh(t,a),l=b.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Jx,{bubbles:!0,cancelable:!0});e.addEventListener(Jx,e=>r?.(e),{once:!0}),vh(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,q.jsx)(Xx,{...i,ref:c,disabled:n,onClick:Y(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:Y(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:Y(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||ux.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Yx.displayName=qx;var Xx=b.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Lx(qx,n),s=Cx(n),c=b.useRef(null),l=sh(t,c),[u,d]=b.useState(!1),[f,p]=b.useState(``);return b.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,q.jsx)(_x.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,q.jsx)(lx,{asChild:!0,...s,focusable:!r,children:(0,q.jsx)(_h.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:Y(e.onPointerMove,kS(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Y(e.onPointerLeave,kS(e=>o.onItemLeave(e))),onFocus:Y(e.onFocus,()=>d(!0)),onBlur:Y(e.onBlur,()=>d(!1))})})})}),Zx=`MenuCheckboxItem`,Qx=b.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,q.jsx)(oS,{scope:e.__scopeMenu,checked:n,children:(0,q.jsx)(Yx,{role:`menuitemcheckbox`,"aria-checked":SS(n)?`mixed`:n,...i,ref:t,"data-state":CS(n),onSelect:Y(i.onSelect,()=>r?.(SS(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Qx.displayName=Zx;var $x=`MenuRadioGroup`,[eS,tS]=bx($x,{value:void 0,onValueChange:()=>{}}),nS=b.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=eg(r);return(0,q.jsx)(eS,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,q.jsx)(Wx,{...i,ref:t})})});nS.displayName=$x;var rS=`MenuRadioItem`,iS=b.forwardRef((e,t)=>{let{value:n,...r}=e,i=tS(rS,e.__scopeMenu),a=n===i.value;return(0,q.jsx)(oS,{scope:e.__scopeMenu,checked:a,children:(0,q.jsx)(Yx,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":CS(a),onSelect:Y(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});iS.displayName=rS;var aS=`MenuItemIndicator`,[oS,sS]=bx(aS,{checked:!1}),cS=b.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=sS(aS,n);return(0,q.jsx)(Mh,{present:r||SS(a.checked)||a.checked===!0,children:(0,q.jsx)(_h.span,{...i,ref:t,"data-state":CS(a.checked)})})});cS.displayName=aS;var lS=`MenuSeparator`,uS=b.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,q.jsx)(_h.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});uS.displayName=lS;var dS=`MenuArrow`,fS=b.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Sx(n);return(0,q.jsx)(Hb,{...i,...r,ref:t})});fS.displayName=dS;var pS=`MenuSub`,[mS,hS]=bx(pS),gS=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Tx(pS,t),o=Sx(t),[s,c]=b.useState(null),[l,u]=b.useState(null),d=eg(i);return b.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,q.jsx)(zb,{...o,children:(0,q.jsx)(wx,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,q.jsx)(mS,{scope:t,contentId:Rh(),triggerId:Rh(),trigger:s,onTriggerChange:c,children:n})})})};gS.displayName=pS;var _S=`MenuSubTrigger`,vS=b.forwardRef((e,t)=>{let n=Tx(_S,e.__scopeMenu),r=Dx(_S,e.__scopeMenu),i=hS(_S,e.__scopeMenu),a=Lx(_S,e.__scopeMenu),o=b.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=b.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return b.useEffect(()=>u,[u]),b.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,q.jsx)(Ax,{asChild:!0,...l,children:(0,q.jsx)(Xx,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":xS(n.open),...e,ref:oh(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Y(e.onPointerMove,kS(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Y(e.onPointerLeave,kS(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Y(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||mx[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});vS.displayName=_S;var yS=`MenuSubContent`,bS=b.forwardRef((e,t)=>{let n=Nx(Fx,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Tx(Fx,e.__scopeMenu),o=Dx(Fx,e.__scopeMenu),s=hS(yS,e.__scopeMenu),c=b.useRef(null),l=sh(t,c);return(0,q.jsx)(_x.Provider,{scope:e.__scopeMenu,children:(0,q.jsx)(Mh,{present:r||a.open,children:(0,q.jsx)(_x.Slot,{scope:e.__scopeMenu,children:(0,q.jsx)(Hx,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Y(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Y(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:Y(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=hx[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});bS.displayName=yS;function xS(e){return e?`open`:`closed`}function SS(e){return e===`indeterminate`}function CS(e){return SS(e)?`indeterminate`:e?`checked`:`unchecked`}function wS(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function TS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ES(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=TS(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function DS(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function OS(e,t){return t?DS({x:e.clientX,y:e.clientY},t):!1}function kS(e){return t=>t.pointerType===`mouse`?e(t):void 0}var AS=Ox,jS=Ax,MS=Px,NS=Rx,PS=Wx,FS=Kx,IS=Yx,LS=Qx,RS=nS,zS=iS,BS=cS,VS=uS,HS=fS,US=vS,WS=bS,GS=`DropdownMenu`,[KS,qS]=Ch(GS,[xx]),JS=xx(),[YS,XS]=KS(GS),ZS=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=JS(t),l=b.useRef(null),[u,d]=Oh({prop:i,defaultProp:a??!1,onChange:o,caller:GS});return(0,q.jsx)(YS,{scope:t,triggerId:Rh(),triggerRef:l,contentId:Rh(),open:u,onOpenChange:d,onOpenToggle:b.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,q.jsx)(AS,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};ZS.displayName=GS;var QS=`DropdownMenuTrigger`,$S=b.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=XS(QS,n),o=JS(n);return(0,q.jsx)(jS,{asChild:!0,...o,children:(0,q.jsx)(_h.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:oh(t,a.triggerRef),onPointerDown:Y(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Y(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});$S.displayName=QS;var eC=`DropdownMenuPortal`,tC=e=>{let{__scopeDropdownMenu:t,...n}=e,r=JS(t);return(0,q.jsx)(MS,{...r,...n})};tC.displayName=eC;var nC=`DropdownMenuContent`,rC=b.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=XS(nC,n),a=JS(n),o=b.useRef(!1);return(0,q.jsx)(NS,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:Y(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});rC.displayName=nC;var iC=`DropdownMenuGroup`,aC=b.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JS(n);return(0,q.jsx)(PS,{...i,...r,ref:t})});aC.displayName=iC;var oC=`DropdownMenuLabel`,sC=b.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JS(n);return(0,q.jsx)(FS,{...i,...r,ref:t})});sC.displayName=oC;var cC=`DropdownMenuItem`,lC=b.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JS(n);return(0,q.jsx)(IS,{...i,...r,ref:t})});lC.displayName=cC;var uC=`DropdownMenuCheckboxItem`,dC=b.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JS(n);return(0,q.jsx)(LS,{...i,...r,ref:t})});dC.displayName=uC;var fC=`DropdownMenuRadioGroup`,pC=b.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JS(n);return(0,q.jsx)(RS,{...i,...r,ref:t})});pC.displayName=fC;var mC=`DropdownMenuRadioItem`,hC=b.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JS(n);return(0,q.jsx)(zS,{...i,...r,ref:t})});hC.displayName=mC;var gC=`DropdownMenuItemIndicator`,_C=b.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JS(n);return(0,q.jsx)(BS,{...i,...r,ref:t})});_C.displayName=gC;var vC=`DropdownMenuSeparator`,yC=b.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JS(n);return(0,q.jsx)(VS,{...i,...r,ref:t})});yC.displayName=vC;var bC=`DropdownMenuArrow`,xC=b.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JS(n);return(0,q.jsx)(HS,{...i,...r,ref:t})});xC.displayName=bC;var SC=`DropdownMenuSubTrigger`,CC=b.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JS(n);return(0,q.jsx)(US,{...i,...r,ref:t})});CC.displayName=SC;var wC=`DropdownMenuSubContent`,TC=b.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=JS(n);return(0,q.jsx)(WS,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});TC.displayName=wC;var EC=ZS,DC=$S,OC=tC,kC=rC,AC=lC,jC=`Label`,MC=b.forwardRef((e,t)=>(0,q.jsx)(_h.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));MC.displayName=jC;var NC=MC;function PC(e,[t,n]){return Math.min(n,Math.max(t,e))}var FC=[` `,`Enter`,`ArrowUp`,`ArrowDown`],IC=[` `,`Enter`],LC=`Select`,[RC,zC,BC]=Th(LC),[VC,HC]=Ch(LC,[BC,Cb]),UC=Cb(),[WC,GC]=VC(LC),[KC,qC]=VC(LC),JC=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=UC(t),[g,_]=b.useState(null),[v,y]=b.useState(null),[x,S]=b.useState(!1),C=$h(l),[w,T]=Oh({prop:r,defaultProp:i??!1,onChange:a,caller:LC}),[E,D]=Oh({prop:o,defaultProp:s,onChange:c,caller:LC}),O=b.useRef(null),k=g?m||!!g.closest(`form`):!0,[A,j]=b.useState(new Set),M=Array.from(A).map(e=>e.props.value).join(`;`);return(0,q.jsx)(zb,{...h,children:(0,q.jsxs)(WC,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:Rh(),value:E,onValueChange:D,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:f,children:[(0,q.jsx)(RC.Provider,{scope:t,children:(0,q.jsx)(KC,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(e=>{j(t=>new Set(t).add(e))},[]),onNativeOptionRemove:b.useCallback(e=>{j(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),k?(0,q.jsxs)(Uw,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:E,onChange:e=>D(e.target.value),disabled:f,form:m,children:[E===void 0?(0,q.jsx)(`option`,{value:``}):null,Array.from(A)]},M):null]})})};JC.displayName=LC;var YC=`SelectTrigger`,XC=b.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=UC(n),o=GC(YC,n),s=o.disabled||r,c=sh(t,o.onTriggerChange),l=zC(n),u=b.useRef(`touch`),[d,f,p]=Gw(e=>{let t=l().filter(e=>!e.disabled),n=Kw(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,q.jsx)(Bb,{asChild:!0,...a,children:(0,q.jsx)(_h.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Ww(o.value)?``:void 0,...i,ref:c,onClick:Y(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:Y(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:Y(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&FC.includes(e.key)&&(m(),e.preventDefault())})})})});XC.displayName=YC;var ZC=`SelectValue`,QC=b.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=GC(ZC,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=sh(t,c.onValueNodeChange);return Eh(()=>{l(u)},[l,u]),(0,q.jsx)(_h.span,{...s,ref:d,style:{pointerEvents:`none`},children:Ww(c.value)?(0,q.jsx)(q.Fragment,{children:o}):a})});QC.displayName=ZC;var $C=`SelectIcon`,ew=b.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,q.jsx)(_h.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});ew.displayName=$C;var tw=`SelectPortal`,nw=e=>(0,q.jsx)(Pg,{asChild:!0,...e});nw.displayName=tw;var rw=`SelectContent`,iw=b.forwardRef((e,t)=>{let n=GC(rw,e.__scopeSelect),[r,i]=b.useState();if(Eh(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?gh.createPortal((0,q.jsx)(ow,{scope:e.__scopeSelect,children:(0,q.jsx)(RC.Slot,{scope:e.__scopeSelect,children:(0,q.jsx)(`div`,{children:e.children})})}),t):null}return(0,q.jsx)(uw,{...e,ref:t})});iw.displayName=rw;var aw=10,[ow,sw]=VC(rw),cw=`SelectContentImpl`,lw=ch(`SelectContent.RemoveScroll`),uw=b.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=GC(rw,n),[y,x]=b.useState(null),[S,C]=b.useState(null),w=sh(t,e=>x(e)),[T,E]=b.useState(null),[D,O]=b.useState(null),k=zC(n),[A,j]=b.useState(!1),M=b.useRef(!1);b.useEffect(()=>{if(y)return tv(y)},[y]),Ig();let N=b.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),P=b.useCallback(()=>N([T,y]),[N,T,y]);b.useEffect(()=>{A&&P()},[A,P]);let{onOpenChange:F,triggerPointerDownPosRef:I}=v;b.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||F(!1),document.removeEventListener(`pointermove`,t),I.current=null};return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,F,I]),b.useEffect(()=>{let e=()=>F(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[L,ee]=Gw(e=>{let t=k().filter(e=>!e.disabled),n=Kw(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),te=b.useCallback((e,t,n)=>{let r=!M.current&&!n;(v.value!==void 0&&v.value===t||r)&&(E(e),r&&(M.current=!0))},[v.value]),ne=b.useCallback(()=>y?.focus(),[y]),R=b.useCallback((e,t,n)=>{let r=!M.current&&!n;(v.value!==void 0&&v.value===t||r)&&O(e)},[v.value]),z=r===`popper`?mw:fw,B=z===mw?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,q.jsx)(ow,{scope:n,content:y,viewport:S,onViewportChange:C,itemRefCallback:te,selectedItem:T,onItemLeave:ne,itemTextRefCallback:R,focusSelectedItem:P,selectedItemText:D,position:r,isPositioned:A,searchRef:L,children:(0,q.jsx)(K_,{as:lw,allowPinchZoom:!0,children:(0,q.jsx)(xg,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Y(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,q.jsx)(cg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,q.jsx)(z,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...B,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:Y(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ee(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})});uw.displayName=cw;var dw=`SelectItemAlignedPosition`,fw=b.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=GC(rw,n),o=sw(rw,n),[s,c]=b.useState(null),[l,u]=b.useState(null),d=sh(t,e=>u(e)),f=zC(n),p=b.useRef(!1),m=b.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=b.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-aw,d=PC(a,[aw,Math.max(aw,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-aw,d=PC(a,[aw,Math.max(aw,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-aw*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-aw,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${aw}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Eh(()=>y(),[y]);let[x,S]=b.useState();return Eh(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,q.jsx)(hw,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:b.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,q.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,q.jsx)(_h.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});fw.displayName=dw;var pw=`SelectPopperPosition`,mw=b.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=aw,...a}=e,o=UC(n);return(0,q.jsx)(Vb,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});mw.displayName=pw;var[hw,gw]=VC(rw,{}),_w=`SelectViewport`,vw=b.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=sw(_w,n),o=gw(_w,n),s=sh(t,a.onViewportChange),c=b.useRef(0);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,q.jsx)(RC.Slot,{scope:n,children:(0,q.jsx)(_h.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:Y(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-aw*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});vw.displayName=_w;var yw=`SelectGroup`,[bw,xw]=VC(yw),Sw=b.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Rh();return(0,q.jsx)(bw,{scope:n,id:i,children:(0,q.jsx)(_h.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Sw.displayName=yw;var Cw=`SelectLabel`,ww=b.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=xw(Cw,n);return(0,q.jsx)(_h.div,{id:i.id,...r,ref:t})});ww.displayName=Cw;var Tw=`SelectItem`,[Ew,Dw]=VC(Tw),Ow=b.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=GC(Tw,n),c=sw(Tw,n),l=s.value===r,[u,d]=b.useState(a??``),[f,p]=b.useState(!1),m=sh(t,e=>c.itemRefCallback?.(e,r,i)),h=Rh(),g=b.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,q.jsx)(Ew,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:b.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,q.jsx)(RC.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,q.jsx)(_h.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:Y(o.onFocus,()=>p(!0)),onBlur:Y(o.onBlur,()=>p(!1)),onClick:Y(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:Y(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:Y(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:Y(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Y(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Y(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(IC.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});Ow.displayName=Tw;var kw=`SelectItemText`,Aw=b.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=GC(kw,n),s=sw(kw,n),c=Dw(kw,n),l=qC(kw,n),[u,d]=b.useState(null),f=sh(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=b.useMemo(()=>(0,q.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return Eh(()=>(h(m),()=>g(m)),[h,g,m]),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(_h.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?gh.createPortal(a.children,o.valueNode):null]})});Aw.displayName=kw;var jw=`SelectItemIndicator`,Mw=b.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Dw(jw,n).isSelected?(0,q.jsx)(_h.span,{"aria-hidden":!0,...r,ref:t}):null});Mw.displayName=jw;var Nw=`SelectScrollUpButton`,Pw=b.forwardRef((e,t)=>{let n=sw(Nw,e.__scopeSelect),r=gw(Nw,e.__scopeSelect),[i,a]=b.useState(!1),o=sh(t,r.onScrollButtonChange);return Eh(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,q.jsx)(Lw,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Pw.displayName=Nw;var Fw=`SelectScrollDownButton`,Iw=b.forwardRef((e,t)=>{let n=sw(Fw,e.__scopeSelect),r=gw(Fw,e.__scopeSelect),[i,a]=b.useState(!1),o=sh(t,r.onScrollButtonChange);return Eh(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,q.jsx)(Lw,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Iw.displayName=Fw;var Lw=b.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=sw(`SelectScrollButton`,n),o=b.useRef(null),s=zC(n),c=b.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),Eh(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,q.jsx)(_h.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Y(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Y(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Y(i.onPointerLeave,()=>{c()})})}),Rw=`SelectSeparator`,zw=b.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,q.jsx)(_h.div,{"aria-hidden":!0,...r,ref:t})});zw.displayName=Rw;var Bw=`SelectArrow`,Vw=b.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=UC(n),a=GC(Bw,n),o=sw(Bw,n);return a.open&&o.position===`popper`?(0,q.jsx)(Hb,{...i,...r,ref:t}):null});Vw.displayName=Bw;var Hw=`SelectBubbleInput`,Uw=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=b.useRef(null),a=sh(r,i),o=iv(t);return b.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,q.jsx)(_h.select,{...n,style:{...yh,...n.style},ref:a,defaultValue:t})});Uw.displayName=Hw;function Ww(e){return e===``||e===void 0}function Gw(e){let t=eg(e),n=b.useRef(``),r=b.useRef(0),i=b.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=b.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Kw(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=qw(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function qw(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Jw=JC,Yw=XC,Xw=QC,Zw=ew,Qw=nw,$w=iw,eT=vw,tT=Ow,nT=Aw,rT=Mw,iT=Pw,aT=Iw,oT=`Tabs`,[sT,cT]=Ch(oT,[Xb]),lT=Xb(),[uT,dT]=sT(oT),fT=b.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=$h(s),[d,f]=Oh({prop:r,onChange:i,defaultProp:a??``,caller:oT});return(0,q.jsx)(uT,{scope:n,baseId:Rh(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,q.jsx)(_h.div,{dir:u,"data-orientation":o,...l,ref:t})})});fT.displayName=oT;var pT=`TabsList`,mT=b.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=dT(pT,n),o=lT(n);return(0,q.jsx)(cx,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,q.jsx)(_h.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});mT.displayName=pT;var hT=`TabsTrigger`,gT=b.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=dT(hT,n),s=lT(n),c=yT(o.baseId,r),l=bT(o.baseId,r),u=r===o.value;return(0,q.jsx)(lx,{asChild:!0,...s,focusable:!i,active:u,children:(0,q.jsx)(_h.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Y(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:Y(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:Y(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});gT.displayName=hT;var _T=`TabsContent`,vT=b.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=dT(_T,n),c=yT(s.baseId,r),l=bT(s.baseId,r),u=r===s.value,d=b.useRef(u);return b.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,q.jsx)(Mh,{present:i||u,children:({present:n})=>(0,q.jsx)(_h.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});vT.displayName=_T;function yT(e,t){return`${e}-trigger-${t}`}function bT(e,t){return`${e}-content-${t}`}var xT=fT,ST=mT,CT=gT,wT=vT,TT=`ToastProvider`,[ET,DT,OT]=Th(`Toast`),[kT,AT]=Ch(`Toast`,[OT]),[jT,MT]=kT(TT),NT=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=b.useState(null),[l,u]=b.useState(0),d=b.useRef(!1),f=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${TT}\`. Expected non-empty \`string\`.`),(0,q.jsx)(ET.Provider,{scope:t,children:(0,q.jsx)(jT,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:b.useCallback(()=>u(e=>e+1),[]),onToastRemove:b.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};NT.displayName=TT;var PT=`ToastViewport`,FT=[`F8`],IT=`toast.viewportPause`,LT=`toast.viewportResume`,RT=b.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=FT,label:i=`Notifications ({hotkey})`,...a}=e,o=MT(PT,n),s=DT(n),c=b.useRef(null),l=b.useRef(null),u=b.useRef(null),d=b.useRef(null),f=sh(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;b.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),b.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(IT);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(LT);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=b.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...dE(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return b.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);fE(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,q.jsxs)(gg,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,q.jsx)(BT,{ref:l,onFocusFromOutsideViewport:()=>{fE(h({tabbingDirection:`forwards`}))}}),(0,q.jsx)(ET.Slot,{scope:n,children:(0,q.jsx)(_h.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,q.jsx)(BT,{ref:u,onFocusFromOutsideViewport:()=>{fE(h({tabbingDirection:`backwards`}))}})]})});RT.displayName=PT;var zT=`ToastFocusProxy`,BT=b.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=MT(zT,n);return(0,q.jsx)(xh,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});BT.displayName=zT;var VT=`Toast`,HT=`toast.swipeStart`,UT=`toast.swipeMove`,WT=`toast.swipeCancel`,GT=`toast.swipeEnd`,KT=b.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Oh({prop:r,defaultProp:i??!0,onChange:a,caller:VT});return(0,q.jsx)(Mh,{present:n||s,children:(0,q.jsx)(YT,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:eg(e.onPause),onResume:eg(e.onResume),onSwipeStart:Y(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:Y(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:Y(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:Y(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});KT.displayName=VT;var[qT,JT]=kT(VT,{onClose(){}}),YT=b.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=MT(VT,n),[g,_]=b.useState(null),v=sh(t,e=>_(e)),y=b.useRef(null),x=b.useRef(null),S=i||h.duration,C=b.useRef(0),w=b.useRef(S),T=b.useRef(0),{onToastAdd:E,onToastRemove:D}=h,O=eg(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),k=b.useCallback(e=>{!e||e===1/0||(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(O,e))},[O]);b.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{k(w.current),l?.()},n=()=>{let e=new Date().getTime()-C.current;w.current-=e,window.clearTimeout(T.current),c?.()};return e.addEventListener(IT,n),e.addEventListener(LT,t),()=>{e.removeEventListener(IT,n),e.removeEventListener(LT,t)}}},[h.viewport,S,c,l,k]),b.useEffect(()=>{a&&!h.isClosePausedRef.current&&k(S)},[a,S,h.isClosePausedRef,k]),b.useEffect(()=>(E(),()=>D()),[E,D]);let A=b.useMemo(()=>g?oE(g):null,[g]);return h.viewport?(0,q.jsxs)(q.Fragment,{children:[A&&(0,q.jsx)(XT,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:A}),(0,q.jsx)(qT,{scope:n,onClose:O,children:gh.createPortal((0,q.jsx)(ET.ItemSlot,{scope:n,children:(0,q.jsx)(hg,{asChild:!0,onEscapeKeyDown:Y(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||O(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,q.jsx)(_h.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:v,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:Y(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:Y(e.onPointerDown,e=>{e.button===0&&(y.current={x:e.clientX,y:e.clientY})}),onPointerMove:Y(e.onPointerMove,e=>{if(!y.current)return;let t=e.clientX-y.current.x,n=e.clientY-y.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,sE(UT,d,f,{discrete:!1})):cE(l,h.swipeDirection,c)?(x.current=l,sE(HT,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(y.current=null)}),onPointerUp:Y(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,y.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};cE(t,h.swipeDirection,h.swipeThreshold)?sE(GT,p,r,{discrete:!0}):sE(WT,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),XT=e=>{let{__scopeToast:t,children:n,...r}=e,i=MT(VT,t),[a,o]=b.useState(!1),[s,c]=b.useState(!1);return lE(()=>o(!0)),b.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,q.jsx)(Pg,{asChild:!0,children:(0,q.jsx)(xh,{...r,children:a&&(0,q.jsxs)(q.Fragment,{children:[i.label,` `,n]})})})},ZT=`ToastTitle`,QT=b.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,q.jsx)(_h.div,{...r,ref:t})});QT.displayName=ZT;var $T=`ToastDescription`,eE=b.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,q.jsx)(_h.div,{...r,ref:t})});eE.displayName=$T;var tE=`ToastAction`,nE=b.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,q.jsx)(aE,{altText:n,asChild:!0,children:(0,q.jsx)(iE,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${tE}\`. Expected non-empty \`string\`.`),null)});nE.displayName=tE;var rE=`ToastClose`,iE=b.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=JT(rE,n);return(0,q.jsx)(aE,{asChild:!0,children:(0,q.jsx)(_h.button,{type:`button`,...r,ref:t,onClick:Y(e.onClick,i.onClose)})})});iE.displayName=rE;var aE=b.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,q.jsx)(_h.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function oE(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),uE(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...oE(e))}}),t}function sE(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?vh(i,a):i.dispatchEvent(a)}var cE=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function lE(e=()=>{}){let t=eg(e);Eh(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function uE(e){return e.nodeType===e.ELEMENT_NODE}function dE(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function fE(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var pE=NT,mE=RT,hE=KT,gE=QT,_E=eE,vE=iE,[yE,bE]=Ch(`Tooltip`,[Cb]),xE=Cb(),SE=`TooltipProvider`,CE=700,wE=`tooltip.open`,[TE,EE]=yE(SE),DE=e=>{let{__scopeTooltip:t,delayDuration:n=CE,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=b.useRef(!0),s=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,q.jsx)(TE,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:b.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};DE.displayName=SE;var OE=`Tooltip`,[kE,AE]=yE(OE),jE=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=EE(OE,e.__scopeTooltip),l=xE(t),[u,d]=b.useState(null),f=Rh(),p=b.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=b.useRef(!1),[_,v]=Oh({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(wE))):c.onClose(),a?.(e)},caller:OE}),y=b.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),x=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),S=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),C=b.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return b.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,q.jsx)(zb,{...l,children:(0,q.jsx)(kE,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:b.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};jE.displayName=OE;var ME=`TooltipTrigger`,NE=b.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=AE(ME,n),a=EE(ME,n),o=xE(n),s=sh(t,b.useRef(null),i.onTriggerChange),c=b.useRef(!1),l=b.useRef(!1),u=b.useCallback(()=>c.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,q.jsx)(Bb,{asChild:!0,...o,children:(0,q.jsx)(_h.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Y(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Y(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Y(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Y(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Y(e.onBlur,i.onClose),onClick:Y(e.onClick,i.onClose)})})});NE.displayName=ME;var PE=`TooltipPortal`,[FE,IE]=yE(PE,{forceMount:void 0}),LE=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=AE(PE,t);return(0,q.jsx)(FE,{scope:t,forceMount:n,children:(0,q.jsx)(Mh,{present:n||a.open,children:(0,q.jsx)(Pg,{asChild:!0,container:i,children:r})})})};LE.displayName=PE;var RE=`TooltipContent`,zE=b.forwardRef((e,t)=>{let n=IE(RE,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=AE(RE,e.__scopeTooltip);return(0,q.jsx)(Mh,{present:r||o.open,children:o.disableHoverableContent?(0,q.jsx)(WE,{side:i,...a,ref:t}):(0,q.jsx)(BE,{side:i,...a,ref:t})})}),BE=b.forwardRef((e,t)=>{let n=AE(RE,e.__scopeTooltip),r=EE(RE,e.__scopeTooltip),i=b.useRef(null),a=sh(t,i),[o,s]=b.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=b.useCallback(()=>{s(null),d(!1)},[d]),p=b.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=JE(r,qE(r,n.getBoundingClientRect())),a=YE(t.getBoundingClientRect());s(ZE([...i,...a])),d(!0)},[d]);return b.useEffect(()=>()=>f(),[f]),b.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),b.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!XE(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,q.jsx)(WE,{...e,ref:a})}),[VE,HE]=yE(OE,{isInside:!1}),UE=fh(`TooltipContent`),WE=b.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=AE(RE,n),l=xE(n),{onClose:u}=c;return b.useEffect(()=>(document.addEventListener(wE,u),()=>document.removeEventListener(wE,u)),[u]),b.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,q.jsx)(cg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,q.jsxs)(Vb,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,q.jsx)(UE,{children:r}),(0,q.jsx)(VE,{scope:n,isInside:!0,children:(0,q.jsx)(Sh,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});zE.displayName=RE;var GE=`TooltipArrow`,KE=b.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=xE(n);return HE(GE,n).isInside?null:(0,q.jsx)(Hb,{...i,...r,ref:t})});KE.displayName=GE;function qE(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function JE(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function YE(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function XE(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function ZE(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),QE(t)}function QE(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var $E=DE,eD=jE,tD=NE,nD=LE,rD=zE,iD=KE,aD=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,oD=C,sD=(e,t)=>n=>{if(t?.variants==null)return oD(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=aD(t)||aD(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 oD(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)},cD=sD(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-base font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function X({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,q.jsx)(r?lh:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:W(cD({variant:t,size:n,className:e})),...i})}function lD({...e}){return(0,q.jsx)(Zh,{"data-slot":`collapsible`,...e})}function uD({...e}){return(0,q.jsx)(Kh,{"data-slot":`collapsible-trigger`,...e})}function dD({...e}){return(0,q.jsx)(Jh,{"data-slot":`collapsible-content`,...e})}function fD({...e}){return(0,q.jsx)(EC,{"data-slot":`dropdown-menu`,...e})}function pD({...e}){return(0,q.jsx)(DC,{"data-slot":`dropdown-menu-trigger`,...e})}function mD({align:e=`end`,className:t,sideOffset:n=2,...r}){return(0,q.jsx)(OC,{children:(0,q.jsx)(kC,{align:e,className:W(`z-[150] min-w-36 overflow-auto rounded-2xl border border-white/10 bg-[#161616] p-1 text-white shadow-md shadow-black/20 outline-none duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,t),"data-slot":`dropdown-menu-content`,sideOffset:n,...r})})}function hD({className:e,variant:t,...n}){return(0,q.jsx)(AC,{className:W(`relative flex h-[33px] cursor-pointer select-none items-center gap-2 rounded-xl px-2 py-1.5 text-sm leading-[21px] text-white outline-none transition-colors duration-100 focus:bg-white/[0.08] data-disabled:pointer-events-none data-disabled:opacity-50`,t===`destructive`&&`text-[#f2787e] focus:text-[#f2787e]`,e),"data-slot":`dropdown-menu-item`,"data-variant":t,...n})}function gD({className:e,type:t,...n}){return(0,q.jsx)(`input`,{type:t,"data-slot":`input`,className:W(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}var _D=sD(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function vD({className:e,orientation:t=`horizontal`,...n}){return(0,q.jsx)(xT,{"data-slot":`tabs`,"data-orientation":t,className:W(`group/tabs flex gap-2 data-horizontal:flex-col`,e),orientation:t,...n})}function yD({className:e,variant:t=`default`,...n}){return(0,q.jsx)(ST,{"data-slot":`tabs-list`,"data-variant":t,className:W(_D({variant:t}),e),...n})}function bD({className:e,...t}){return(0,q.jsx)(CT,{"data-slot":`tabs-trigger`,className:W(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-base font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function xD({className:e,...t}){return(0,q.jsx)(wT,{"data-slot":`tabs-content`,className:W(`flex-1 text-base outline-none`,e),...t})}var SD=`h-full min-h-0 min-w-0 overflow-hidden`,CD=`text-[#9b9b9b]`,wD=`text-base font-semibold text-white`,TD=`flowent-navigation-label`,ED=`[scrollbar-gutter:stable]`,DD=`overflow-hidden rounded-lg border border-dashed border-white/10 bg-black`,OD=`grid min-h-11 grid-cols-[132px_minmax(0,1fr)] items-center gap-3 border-b border-white/10 px-3 py-2 last:border-b-0 max-[640px]:grid-cols-1 max-[640px]:gap-1`,kD=`text-xs text-[#9b9b9b]`,AD=`m-0 rounded-lg border border-dashed border-white/10 bg-black px-3 py-2.5 text-xs leading-[1.4] text-[#9b9b9b]`,jD=`grid gap-1.5`,MD=`text-xs font-medium text-[#dedede]`,ND=`h-8 rounded-md border-white/10 bg-input/30 px-2.5 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,PD=`h-8 w-full rounded-md border-white/10 bg-input/30 px-2.5 text-base text-white shadow-none focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,FD=`mt-4 flex justify-end gap-2 max-[900px]:flex-col max-[900px]:items-stretch`,ID=`h-8 border-dashed border-white/20 bg-input/30 text-base text-white shadow-none hover:bg-input/50`,LD={icon:Mm,id:`workspace`,label:`Workspace`},RD={icon:ym,id:`workflows`,label:`Workflows`},zD=[{label:`Tools`,items:[{id:`skills`,label:`Skills`,icon:Jm},{id:`mcp`,label:`MCP`,icon:Lm}]},{label:`Setup`,items:[{id:`providers`,label:`Providers`,icon:Om},{id:`channels`,label:`Channels`,icon:zm},{id:`permissions`,label:`Permissions`,icon:qm},{id:`settings`,label:`Settings`,icon:Km}]}],BD=`[transition-timing-function:cubic-bezier(0.22,1,0.36,1)]`,VD={duration:.28,ease:[.22,1,.36,1]},HD=`flowent:pinned-workflows`;function UD({isSidebarCollapsed:e,item:t,onClick:n,shouldReduceMotion:r,suppressActiveStyle:i=!1}){let a=t.icon;return(0,q.jsxs)(bD,{"aria-label":e?t.label:void 0,title:e?t.label:void 0,value:t.id,onClick:n,className:W(`flowent-navigation-item cursor-pointer justify-start gap-2 rounded-lg border border-transparent bg-transparent px-2 py-1 shadow-none transition-[width,height,padding,color,background-color] duration-300 hover:bg-[#151515] data-[state=active]:bg-[#202020] max-[900px]:justify-center max-[560px]:min-w-fit max-[560px]:flex-none max-[560px]:px-2 max-[560px]:[&_svg]:hidden`,TD,BD,`dark:hover:bg-[#151515] dark:data-[state=active]:border-transparent dark:data-[state=active]:bg-[#202020]`,i&&`data-[state=active]:!bg-transparent data-[state=active]:!text-white dark:data-[state=active]:!bg-transparent`),children:[(0,q.jsx)(a,{"aria-hidden":`true`}),(0,q.jsx)(KD,{className:`flowent-navigation-text`,isVisible:!e,shouldReduceMotion:r,children:t.label})]})}function WD({isActive:e,isPinned:t,isRenaming:n,onDelete:r,onOpenNewTab:i,onRenameCancel:a,onRenameCommit:o,onRenameStart:s,onSelect:c,onTogglePin:l,workflow:u}){let[d,f]=(0,b.useState)(u.name);return(0,b.useEffect)(()=>{n&&f(u.name)},[n,u.name]),n?(0,q.jsx)(`div`,{className:`h-8 px-1 py-0.5`,children:(0,q.jsx)(gD,{"aria-label":`Rename ${u.name}`,autoFocus:!0,className:W(ND,`h-7 w-full rounded-lg px-2 text-sm leading-[21px]`),onBlur:()=>{o(u.id,d)},onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(e.preventDefault(),a())},value:d})}):(0,q.jsxs)(`div`,{className:`group/workflow-menu-item relative h-8`,children:[(0,q.jsx)(X,{className:W(`flowent-workflow-history-item h-8 w-full cursor-pointer justify-start rounded-lg border border-transparent bg-transparent px-2 py-1 pr-8 text-left shadow-none transition-[width,height,padding,color,background-color] duration-300 hover:bg-[#151515] max-[900px]:justify-center max-[560px]:min-w-fit max-[560px]:flex-none max-[560px]:px-2`,TD,BD,e&&`flowent-workflow-history-item-active bg-[#202020]`),onClick:()=>c(u.id),title:u.name,type:`button`,variant:`ghost`,children:(0,q.jsx)(`span`,{className:`flowent-navigation-text min-w-0 truncate`,children:u.name})}),(0,q.jsxs)(fD,{children:[(0,q.jsx)(pD,{asChild:!0,children:(0,q.jsx)(X,{"aria-label":`Options`,className:`absolute top-1 right-1 hidden size-6 cursor-pointer rounded-md border border-transparent bg-transparent p-0 text-white shadow-none hover:bg-white/[0.08] focus-visible:flex data-[state=open]:flex data-[state=open]:bg-white/[0.08] group-hover/workflow-menu-item:flex group-focus-within/workflow-menu-item:flex`,onClick:e=>e.stopPropagation(),size:`icon`,title:`Options`,type:`button`,variant:`ghost`,children:(0,q.jsx)(wm,{className:`size-4`,"aria-hidden":`true`})})}),(0,q.jsxs)(mD,{align:`end`,alignOffset:-84,sideOffset:2,children:[(0,q.jsxs)(hD,{onSelect:()=>i(u.id),children:[(0,q.jsx)(Tm,{className:`size-4 shrink-0`,"aria-hidden":`true`}),`Open new tab`]}),(0,q.jsxs)(hD,{onSelect:()=>s(u.id),children:[(0,q.jsx)(Nm,{className:`size-4 shrink-0`,"aria-hidden":`true`}),`Rename`]}),(0,q.jsxs)(hD,{onSelect:()=>l(u.id),children:[t?(0,q.jsx)(Pm,{className:`size-4 shrink-0`,"aria-hidden":`true`}):(0,q.jsx)(Fm,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t?`Unpin`:`Pin`]}),(0,q.jsxs)(hD,{onSelect:()=>r(u.id),variant:`destructive`,children:[(0,q.jsx)(Qm,{className:`size-4 shrink-0`,"aria-hidden":`true`}),`Delete`]})]})]})]})}function GD({activeProviderName:e,activeView:t,activeWorkflowId:n,children:r,onNewWorkflow:i,onWorkflowDelete:a,onWorkflowRename:o,onViewChange:s,onWorkflowSelect:c,workflows:l}){let[u,d]=(0,b.useState)(!1),[f,p]=(0,b.useState)(!0),m=Zp()??!1,h=(0,b.useCallback)(()=>{d(e=>!e)},[]);return(0,b.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(max-width: 900px)`),t=()=>{e.matches&&d(!1)};return t(),e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}},[]),(0,b.useEffect)(()=>{let e=e=>{!e.ctrlKey||e.metaKey||e.altKey||e.code===`KeyB`&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[h]),(0,q.jsxs)(vD,{value:t,onValueChange:e=>s(e),orientation:`vertical`,className:W(`grid h-[var(--flowent-viewport-height)] min-h-0 gap-0 overflow-hidden bg-black pt-[var(--flowent-safe-area-top)] pr-[var(--flowent-safe-area-right)] pb-[var(--flowent-safe-area-bottom)] pl-[var(--flowent-safe-area-left)] text-white transition-[grid-template-columns] max-[900px]:grid-cols-1 max-[900px]:grid-rows-[auto_minmax(0,1fr)]`,m?`duration-0`:W(`duration-300`,BD),u?`grid-cols-[64px_minmax(0,1fr)]`:`grid-cols-[232px_minmax(0,1fr)]`),children:[(0,q.jsxs)(`aside`,{className:W(`relative flex min-h-0 flex-col border-r border-white/10 bg-black px-3 py-3 max-[900px]:min-h-auto max-[900px]:border-r-0 max-[900px]:border-b max-[900px]:px-3 max-[900px]:py-3`,m?`duration-0`:W(`duration-300`,BD)),children:[(0,q.jsxs)(`div`,{className:W(`flex h-10 min-h-10 items-center bg-black px-1 transition-[gap] max-[560px]:min-h-10`,m?`duration-0`:W(`duration-300`,BD),`gap-2.5`),children:[(0,q.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center overflow-hidden rounded-md border border-white/10 bg-input/30`,children:(0,q.jsx)(`img`,{alt:``,className:`size-full object-cover`,src:`/flowent.png`})}),(0,q.jsx)(KD,{className:`min-w-0 flex-1 self-center`,isVisible:!u,shouldReduceMotion:m,children:(0,q.jsx)(`div`,{className:`flowent-sidebar-brand truncate`,children:`Flowent`})}),(0,q.jsx)($d,{initial:!1,children:u?null:(0,q.jsx)(Xp.div,{animate:{opacity:1},exit:{opacity:0},initial:m?!1:{opacity:0},transition:m?{duration:0}:VD,children:(0,q.jsx)(X,{"aria-label":`Collapse sidebar`,className:`flowent-sidebar-chrome-button size-10 cursor-pointer rounded-xl border border-transparent bg-transparent p-0 shadow-none hover:bg-white/[0.08] max-[900px]:hidden`,onClick:h,size:`icon`,title:`Collapse sidebar`,type:`button`,variant:`ghost`,children:(0,q.jsx)(hm,{"aria-hidden":`true`})})},`collapse-sidebar-button`)})]}),(0,q.jsx)(`nav`,{"aria-label":`Primary navigation`,children:(0,q.jsxs)(yD,{className:W(`mt-4 flex w-auto flex-none flex-col items-stretch gap-0 p-0 max-[900px]:mt-3 max-[900px]:mx-0 max-[900px]:flex-row max-[560px]:justify-start max-[560px]:overflow-x-auto`,`-mx-1`),variant:`line`,children:[(0,q.jsx)(UD,{isSidebarCollapsed:u,item:LD,shouldReduceMotion:m}),(0,q.jsx)(UD,{isSidebarCollapsed:u,item:RD,onClick:t===`workflows`&&n?i:void 0,shouldReduceMotion:m,suppressActiveStyle:t===`workflows`&&!!n}),zD.map(e=>(0,q.jsxs)(b.Fragment,{children:[(0,q.jsx)(qD,{className:`flowent-sidebar-section-label mt-4 mb-1 px-2 max-[900px]:hidden`,isDecorative:!0,isVisible:!u,shouldReduceMotion:m,children:e.label}),e.items.map(e=>(0,q.jsx)(UD,{isSidebarCollapsed:u,item:e,shouldReduceMotion:m},e.id))]},e.label)),(0,q.jsx)(qD,{isVisible:!u,shouldReduceMotion:m,children:(0,q.jsx)(JD,{activeView:t,activeWorkflowId:n,isOpen:f,onOpenChange:p,onWorkflowDelete:a,onWorkflowRename:o,onWorkflowSelect:c,shouldReduceMotion:m,workflows:l})})]})}),(0,q.jsxs)(`div`,{className:`mt-auto flex flex-col gap-2 max-[900px]:hidden`,children:[(0,q.jsx)($d,{initial:!1,children:u?(0,q.jsx)(Xp.div,{animate:{opacity:1},className:`-mx-1`,exit:{opacity:0},initial:m?!1:{opacity:0},transition:m?{duration:0}:{...VD,delay:.08},children:(0,q.jsx)(X,{"aria-label":`Expand sidebar`,className:`flowent-sidebar-chrome-button size-10 cursor-pointer rounded-xl border border-transparent bg-transparent p-0 shadow-none hover:bg-white/[0.08]`,onClick:h,size:`icon`,title:`Expand sidebar`,type:`button`,variant:`ghost`,children:(0,q.jsx)(gm,{"aria-hidden":`true`})})},`expand-sidebar-button`):null}),(0,q.jsxs)(`div`,{className:W(`flowent-sidebar-status -mx-1 flex h-8 items-center gap-2 px-2`),title:e??`No provider`,children:[(0,q.jsx)(`div`,{className:`size-1.5 rounded-full bg-[#7ddf89]`,"aria-hidden":`true`}),(0,q.jsx)(KD,{isVisible:!u,shouldReduceMotion:m,children:(0,q.jsx)(`span`,{children:e??`No provider`})})]})]}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`absolute top-0 right-[-4px] z-10 hidden h-full w-2 cursor-ew-resize outline-none transition-colors hover:bg-white/10 focus-visible:bg-white/10 max-[900px]:hidden sm:block`,onDoubleClick:h,title:`Double-click to toggle sidebar`})]}),(0,q.jsx)(`main`,{className:`min-h-0 min-w-0 overflow-hidden bg-black`,children:r})]})}function KD({children:e,className:t,isVisible:n,shouldReduceMotion:r}){return(0,q.jsx)($d,{initial:!1,children:n?(0,q.jsx)(Xp.span,{animate:{opacity:1},className:W(`min-w-0 overflow-hidden`,t),exit:r?{opacity:1}:{opacity:0},initial:r?!1:{opacity:0},transition:r?{duration:0}:{...VD,duration:.24},children:e},`sidebar-text`):null})}function qD({children:e,className:t,isDecorative:n=!1,isVisible:r,shouldReduceMotion:i}){return(0,q.jsx)($d,{initial:!1,children:r?(0,q.jsx)(Xp.div,{animate:{height:`auto`,opacity:1},"aria-hidden":n?!0:void 0,className:W(`min-w-0 overflow-hidden`,t),exit:i?{opacity:1}:{height:0,opacity:0},initial:i?!1:{height:0,opacity:0},transition:i?{duration:0}:{...VD,duration:.24},children:e},`sidebar-block`):null})}function JD({activeView:e,activeWorkflowId:t,isOpen:n,onOpenChange:r,onWorkflowDelete:i,onWorkflowRename:a,onWorkflowSelect:o,shouldReduceMotion:s,workflows:c}){let[l,u]=(0,b.useState)(()=>YD()),[d,f]=(0,b.useState)(``),p=e===`workflows`&&!!t,m=new Set(c.map(e=>e.id)),h=l.filter(e=>m.has(e)),g=new Set(h),_=[...c.filter(e=>g.has(e.id)),...c.filter(e=>!g.has(e.id))].sort((e,t)=>{let n=h.indexOf(e.id),r=h.indexOf(t.id);return n>=0&&r>=0?n-r:0});(0,b.useEffect)(()=>{h.length!==l.length&&(u(h),XD(h))},[h,l.length]);let v=e=>{u(e),XD(e)},y=e=>{if(g.has(e)){v(h.filter(t=>t!==e));return}v([e,...h])},x=(e,t)=>{f(``);let n=t.trim(),r=c.find(t=>t.id===e);!r||!n||n===r.name||a(e,n)};return(0,q.jsxs)(lD,{className:`max-[900px]:hidden`,open:n,onOpenChange:r,children:[(0,q.jsx)(uD,{asChild:!0,children:(0,q.jsxs)(X,{"aria-label":`Workflows`,className:W(`flowent-workflow-history-trigger mt-4 h-7 w-full cursor-pointer justify-between rounded-md border border-transparent bg-transparent px-2 py-0 text-[11px] leading-4 font-medium text-white/45 shadow-none transition-colors duration-100 hover:bg-transparent hover:text-white/70 aria-expanded:bg-transparent aria-expanded:text-white/45 dark:aria-expanded:bg-transparent dark:aria-expanded:text-white/45 max-[900px]:hidden`,TD,p&&!n&&`flowent-workflow-history-item-active`),type:`button`,variant:`ghost`,children:[(0,q.jsx)(`span`,{className:`flowent-navigation-text min-w-0 truncate`,children:`Workflows`}),(0,q.jsx)(pm,{"aria-hidden":`true`,className:W(`size-3 shrink-0 text-white/35 transition-transform`,n&&`rotate-90`)})]})}),(0,q.jsx)(dD,{forceMount:!0,children:(0,q.jsx)($d,{initial:!1,children:n?(0,q.jsx)(Xp.div,{animate:s?{opacity:1}:{height:`auto`,opacity:1},className:`overflow-hidden`,exit:s?{opacity:1}:{height:0,opacity:0},initial:s?!1:{height:0,opacity:0},transition:s?{duration:0}:{...VD,duration:.24},children:c.length===0?(0,q.jsx)(`div`,{className:`flowent-sidebar-section-label flex h-8 w-full items-center px-2 max-[900px]:hidden`,children:(0,q.jsx)(`span`,{children:`No workflow yet.`})}):_.map(n=>(0,q.jsx)(WD,{isActive:e===`workflows`&&t===n.id,isPinned:g.has(n.id),isRenaming:d===n.id,onDelete:i,onOpenNewTab:e=>{window.open(`/workflows/${encodeURIComponent(e)}`,`_blank`,`noopener,noreferrer`)},onRenameCancel:()=>f(``),onRenameCommit:x,onRenameStart:f,onSelect:o,onTogglePin:y,workflow:n},n.id))},`workflow-history`):null})})]})}function YD(){if(typeof window>`u`)return[];try{let e=window.localStorage.getItem(HD);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function XD(e){typeof window>`u`||window.localStorage.setItem(HD,JSON.stringify(e))}function ZD({className:e,...t}){return(0,q.jsx)(NC,{"data-slot":`label`,className:W(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function QD({...e}){return(0,q.jsx)(Jw,{"data-slot":`select`,...e})}function $D({...e}){return(0,q.jsx)(Xw,{"data-slot":`select-value`,...e})}function eO({className:e,size:t=`default`,children:n,...r}){return(0,q.jsxs)(Yw,{"data-slot":`select-trigger`,"data-size":t,className:W(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-base whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,q.jsx)(Zw,{asChild:!0,children:(0,q.jsx)(fm,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function tO({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,q.jsx)(Qw,{children:(0,q.jsxs)($w,{"data-slot":`select-content`,"data-align-trigger":n===`item-aligned`,className:W(`relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,q.jsx)(rO,{}),(0,q.jsx)(eT,{"data-position":n,className:W(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,n===`popper`&&``),children:t}),(0,q.jsx)(iO,{})]})})}function nO({className:e,children:t,...n}){return(0,q.jsxs)(tT,{"data-slot":`select-item`,className:W(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-base outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,q.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:(0,q.jsx)(rT,{children:(0,q.jsx)(dm,{className:`pointer-events-none`})})}),(0,q.jsx)(nT,{children:t})]})}function rO({className:e,...t}){return(0,q.jsx)(iT,{"data-slot":`select-scroll-up-button`,className:W(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,q.jsx)(mm,{})})}function iO({className:e,...t}){return(0,q.jsx)(aT,{"data-slot":`select-scroll-down-button`,className:W(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,q.jsx)(fm,{})})}function aO({onApproveSession:e,onSaveTelegramBot:t,onUpdateTelegramBot:n,telegramBot:r}){let i=r.sessions.filter(e=>e.status===`pending`),a=r.sessions.filter(e=>e.status===`approved`);return(0,q.jsx)(`section`,{className:`grid h-full min-h-0 bg-black`,"aria-label":`Channels`,children:(0,q.jsxs)(`form`,{className:W(`grid min-h-0 w-full content-start gap-7 overflow-auto px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,ED),"aria-label":`Telegram Bot`,onSubmit:e=>{e.preventDefault(),t()},children:[(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Telegram Bot`}),(0,q.jsxs)(`div`,{className:DD,children:[(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`telegram-status`,children:`Status`}),(0,q.jsx)(`div`,{className:W(`text-base leading-5 text-white`,CD),id:`telegram-status`,children:lO(r.status)})]}),(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`telegram-enabled`,children:`Enabled`}),(0,q.jsxs)(QD,{value:r.enabled?`true`:`false`,onValueChange:e=>n({enabled:e===`true`}),children:[(0,q.jsx)(eO,{className:PD,id:`telegram-enabled`,"aria-label":`Enabled`,children:(0,q.jsx)($D,{})}),(0,q.jsxs)(tO,{children:[(0,q.jsx)(nO,{value:`false`,children:`Off`}),(0,q.jsx)(nO,{value:`true`,children:`On`})]})]})]}),(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`telegram-bot-secret`,children:`Bot secret`}),(0,q.jsx)(gD,{className:ND,id:`telegram-bot-secret`,onChange:e=>n({botSecret:e.target.value}),type:`password`,value:r.botSecret})]})]}),r.error?(0,q.jsx)(`p`,{className:`m-0 text-xs leading-[1.4] text-destructive`,children:r.error}):null,(0,q.jsx)(`div`,{className:W(FD,`mt-0`),children:(0,q.jsx)(X,{type:`submit`,children:`Save`})})]}),(0,q.jsx)(oO,{emptyText:`No requests`,onApproveSession:e,sessions:i,title:`Pending`}),(0,q.jsx)(oO,{emptyText:`No conversations`,sessions:a,title:`Approved`})]})})}function oO({emptyText:e,onApproveSession:t,sessions:n,title:r}){return(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:r}),n.length===0?(0,q.jsx)(`p`,{className:AD,children:e}):(0,q.jsx)(`div`,{className:DD,children:n.map(e=>(0,q.jsx)(sO,{onApproveSession:t,session:e},e.chatId))})]})}function sO({onApproveSession:e,session:t}){return(0,q.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] gap-3 border-b border-white/10 px-3 py-3 last:border-b-0 max-[640px]:grid-cols-1`,children:[(0,q.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-base font-medium text-white`,children:[(0,q.jsx)(jm,{className:`size-4 shrink-0 text-[#9b9b9b]`}),(0,q.jsx)(`span`,{className:`truncate`,children:cO(t)})]}),(0,q.jsxs)(`p`,{className:W(`m-0 text-xs leading-[1.4]`,CD),children:[`Chat `,t.chatId,t.userId?` · User ${t.userId}`:``,t.username?` · @${t.username}`:``]}),t.recentMessage?(0,q.jsx)(`p`,{className:`m-0 max-w-3xl truncate text-base leading-[1.45] text-white`,children:t.recentMessage}):null]}),t.status===`pending`&&e?(0,q.jsxs)(X,{className:W(ID,`shrink-0`),onClick:()=>e(t.chatId),size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(dm,{"aria-hidden":`true`}),`Approve`]}):(0,q.jsx)(`span`,{className:W(`flex h-8 items-center text-xs leading-none`,CD),children:`Approved`})]})}function cO(e){return e.displayName?e.displayName:e.username?`@${e.username}`:e.chatId}function lO(e){return e===`running`?`Running`:e===`starting`?`Starting`:e===`error`?`Error`:`Disabled`}function uO({activeServer:e,isCreatingServer:t,isImportOpen:n,importPreview:r,importSource:i,importingServerId:a,isPreviewing:o,onNewServer:s,onImport:c,onImportServer:l,onImportSourceChange:u,onReconnectServer:d,onRemoveServer:f,onSaveServer:p,onServerSelect:m,onUpdateServer:h,servers:g}){return(0,q.jsx)(`section`,{className:`grid h-full min-h-0 bg-black`,"aria-label":`MCP`,children:(0,q.jsxs)(`div`,{className:`grid h-full min-h-0 grid-cols-[232px_minmax(0,1fr)] max-[900px]:grid-cols-1 max-[900px]:grid-rows-[auto_minmax(0,1fr)]`,children:[(0,q.jsx)(dO,{activeServer:e,isCreatingServer:t,onImport:c,onNewServer:s,onServerSelect:m,servers:g}),(0,q.jsx)(fO,{activeServer:e,isCreatingServer:t,isImportOpen:n,importPreview:r,importSource:i,importingServerId:a,isPreviewing:o,onImportServer:l,onImportSourceChange:u,onReconnectServer:d,onRemoveServer:f,onSaveServer:p,onUpdateServer:h,servers:g})]})})}function dO({activeServer:e,isCreatingServer:t,onImport:n,onNewServer:r,onServerSelect:i,servers:a}){return(0,q.jsxs)(`aside`,{className:W(`flex min-h-0 min-w-0 flex-col overflow-auto border-r border-white/10 bg-black p-3 max-[900px]:max-h-64 max-[900px]:border-r-0 max-[900px]:border-b`,ED),"aria-label":`MCP servers`,children:[(0,q.jsxs)(X,{"aria-pressed":t,className:`h-8 w-full border-dashed border-white/20 bg-input/30 text-base text-white shadow-none hover:bg-input/50`,onClick:r,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(Rm,{"aria-hidden":`true`}),`New`]}),(0,q.jsxs)(X,{className:`mt-2 h-8 w-full border-dashed border-white/20 bg-input/30 text-base text-white shadow-none hover:bg-input/50`,onClick:n,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(th,{"aria-hidden":`true`}),`Import`]}),(0,q.jsxs)(`div`,{className:`mt-4 -mx-1 grid gap-0`,children:[a.length===0?(0,q.jsx)(`p`,{className:AD,children:`No servers`}):null,a.map(n=>{let r=!t&&e.id===n.id;return(0,q.jsx)(X,{"aria-label":n.name,"aria-pressed":r,className:W(`flowent-navigation-item grid w-full cursor-pointer justify-start rounded-lg border border-transparent bg-transparent px-2 py-1 text-left text-white/90 shadow-none transition-colors duration-100 hover:bg-[#151515] hover:text-white`,TD,r&&`bg-[#202020] text-white`),onClick:()=>i(n),size:`sm`,type:`button`,variant:`ghost`,children:(0,q.jsxs)(`span`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:n.name}),(0,q.jsx)(vO,{status:n.status})]})},n.id)})]})]})}function fO({activeServer:e,isCreatingServer:t,isImportOpen:n,importPreview:r,importSource:i,importingServerId:a,isPreviewing:o,onImportServer:s,onImportSourceChange:c,onReconnectServer:l,onRemoveServer:u,onSaveServer:d,onUpdateServer:f,servers:p}){return n?(0,q.jsx)(`section`,{className:W(`grid min-h-0 w-full content-start gap-7 overflow-auto px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,ED),"aria-label":`MCP import`,children:(0,q.jsx)(pO,{importPreview:r,importSource:i,importingServerId:a,isPreviewing:o,servers:p,onImportServer:s,onImportSourceChange:c})}):(0,q.jsxs)(`form`,{className:W(`grid min-h-0 w-full content-start gap-7 overflow-auto px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,ED),"aria-label":`MCP server`,onSubmit:e=>{e.preventDefault(),d()},children:[(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Details`}),(0,q.jsx)(`div`,{className:DD,children:(0,q.jsx)(mO,{activeServer:e,onUpdateServer:f})})]}),(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Tools`}),(0,q.jsx)(hO,{server:e})]}),e.error?(0,q.jsx)(`p`,{className:`m-0 text-xs leading-[1.4] text-destructive`,children:e.error}):null,(0,q.jsxs)(`div`,{className:W(FD,`mt-0`),children:[t?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(X,{className:ID,onClick:l,type:`button`,variant:`outline`,children:[(0,q.jsx)(Vm,{"aria-hidden":`true`}),`Reconnect`]}),(0,q.jsxs)(X,{className:ID,onClick:u,type:`button`,variant:`outline`,children:[(0,q.jsx)(Qm,{"aria-hidden":`true`}),`Remove`]})]}),(0,q.jsx)(X,{type:`submit`,children:`Save`})]})]})}function pO({importPreview:e,importSource:t,importingServerId:n,isPreviewing:r,servers:i,onImportServer:a,onImportSourceChange:o}){let s=new Set(i.map(e=>e.id));return(0,q.jsxs)(`section`,{className:`grid gap-7`,children:[(0,q.jsx)(`section`,{className:`grid gap-3`,children:(0,q.jsxs)(`div`,{className:`grid grid-cols-[repeat(2,minmax(0,160px))] gap-2 max-[640px]:grid-cols-1`,children:[(0,q.jsx)(X,{"aria-pressed":t===`claude_code`,className:W(ID,t===`claude_code`&&`bg-input/50`),disabled:r||n!==``,onClick:()=>o(`claude_code`),type:`button`,variant:`outline`,children:`Claude Code`}),(0,q.jsx)(X,{"aria-pressed":t===`codex`,className:W(ID,t===`codex`&&`bg-input/50`),disabled:r||n!==``,onClick:()=>o(`codex`),type:`button`,variant:`outline`,children:`Codex`})]})}),(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Servers`}),e.length>0?(0,q.jsx)(`div`,{className:DD,children:e.map(e=>{let t=n===e.id;return(0,q.jsxs)(`div`,{"aria-label":e.name,className:`grid grid-cols-[minmax(0,1fr)_auto_auto] items-start gap-3 border-b border-white/10 px-3 py-2 last:border-b-0 max-[640px]:grid-cols-[minmax(0,1fr)_auto]`,role:`listitem`,children:[(0,q.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`text-base text-white`,children:e.name}),s.has(e.id)?(0,q.jsx)(`span`,{className:`rounded-md border border-white/10 bg-input/30 px-2 py-0.5 text-xs text-white`,children:`Existing`}):null]}),(0,q.jsx)(`p`,{className:W(`m-0 break-all text-xs`,CD),children:e.type===`url`?e.url:[e.command,...e.args].filter(Boolean).join(` `)})]}),(0,q.jsx)(`span`,{className:W(`text-xs`,CD),children:e.type===`url`?`URL`:`Command`}),(0,q.jsx)(X,{className:ID,disabled:n!==``,onClick:()=>a(e.id),size:`sm`,type:`button`,variant:`outline`,children:t?`Importing`:`Import`})]},e.id)})}):(0,q.jsx)(`p`,{className:AD,children:r?`Scanning`:`No servers`})]})]})}function mO({activeServer:e,onUpdateServer:t}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`mcp-name`,children:`Name`}),(0,q.jsx)(gD,{className:ND,id:`mcp-name`,onChange:e=>t({name:e.target.value}),value:e.name})]}),(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`mcp-type`,children:`Type`}),(0,q.jsxs)(QD,{value:e.type,onValueChange:e=>t({type:e}),children:[(0,q.jsx)(eO,{className:PD,id:`mcp-type`,"aria-label":`Type`,children:(0,q.jsx)($D,{})}),(0,q.jsxs)(tO,{children:[(0,q.jsx)(nO,{value:`command`,children:`Command`}),(0,q.jsx)(nO,{value:`url`,children:`URL`})]})]})]}),e.type===`command`?(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`mcp-command-line`,children:`Command line`}),(0,q.jsx)(gD,{className:ND,id:`mcp-command-line`,onChange:e=>t({commandLine:e.target.value}),value:e.commandLine})]}):(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`mcp-url`,children:`URL`}),(0,q.jsx)(gD,{className:ND,id:`mcp-url`,onChange:e=>t({url:e.target.value}),value:e.url})]}),(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`mcp-enabled`,children:`Enabled`}),(0,q.jsxs)(QD,{value:e.enabled?`true`:`false`,onValueChange:e=>t({enabled:e===`true`}),children:[(0,q.jsx)(eO,{className:PD,id:`mcp-enabled`,"aria-label":`Enabled`,children:(0,q.jsx)($D,{})}),(0,q.jsxs)(tO,{children:[(0,q.jsx)(nO,{value:`true`,children:`On`}),(0,q.jsx)(nO,{value:`false`,children:`Off`})]})]})]}),(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`mcp-status`,children:`Status`}),(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,id:`mcp-status`,children:[(0,q.jsx)(_O,{status:e.status}),e.status===`ready`?(0,q.jsxs)(`span`,{className:W(`text-xs leading-5`,CD),children:[e.tools.length,` `,e.tools.length===1?`tool`:`tools`]}):null]})]})]})}function hO({server:e}){return e.tools.length===0?(0,q.jsx)(`p`,{className:AD,children:`No tools`}):(0,q.jsx)(`div`,{className:DD,children:e.tools.map(e=>(0,q.jsxs)(`div`,{className:`grid min-h-10 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-b border-white/10 px-3 py-2 text-base leading-5 text-white last:border-b-0 max-[640px]:grid-cols-1`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(Lm,{className:`size-4 shrink-0 text-[#9b9b9b]`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`truncate`,children:e.name})]}),e.description?(0,q.jsx)(`span`,{className:W(`min-w-0 truncate text-xs leading-5`,CD),children:e.description}):null]},e.name))})}function gO(e){return e===`ready`?`Ready`:e===`starting`?`Starting`:e===`error`?`Error`:`Disabled`}function _O({status:e}){let t=yO(e);return(0,q.jsxs)(`span`,{className:W(`inline-flex shrink-0 items-center gap-1.5 rounded-md border bg-black`,`px-2 py-1 text-xs`,t.className),children:[(0,q.jsx)(`span`,{className:W(`size-1.5 rounded-full`,e===`starting`&&`animate-pulse`,t.dotClassName),"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`leading-none`,children:gO(e)})]})}function vO({status:e}){let t=yO(e);return(0,q.jsx)(`span`,{"aria-hidden":`true`,className:W(`size-2 rounded-full`,e===`starting`&&`animate-pulse`,t.dotClassName)})}function yO(e){return e===`ready`?{className:`border-emerald-400/20 text-emerald-200`,dotClassName:`bg-emerald-300`}:e===`starting`?{className:`border-sky-400/20 text-sky-200`,dotClassName:`bg-sky-300`}:e===`error`?{className:`border-red-400/25 text-red-200`,dotClassName:`bg-red-300`}:{className:`border-white/10 text-white/55`,dotClassName:`bg-white/35`}}var bO=(0,b.createContext)(null);function xO(){let e=(0,b.useContext)(bO);if(!e)throw Error(`useFlowentToast must be used within FlowentToastProvider`);return e}function SO({onAddWritablePath:e,onRemoveWritablePath:t,writablePaths:n}){let r=xO(),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(``),c=i.trim(),l=async()=>{if(c){if(n.some(e=>e.path===c)){s(`Path already exists`);return}try{await e(c),a(``),s(``)}catch{r.error(`Directory could not be added.`)}}};return(0,q.jsx)(`section`,{"aria-label":`Permissions`,className:W(`grid h-full min-h-0 content-start gap-7 overflow-auto bg-black px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,ED),children:(0,q.jsxs)(`section`,{className:`grid max-w-4xl gap-3`,children:[(0,q.jsx)(`h3`,{className:wD,children:`Writable paths`}),(0,q.jsxs)(`form`,{"aria-label":`Add directory`,className:`grid gap-1.5`,onSubmit:e=>{e.preventDefault(),l()},children:[(0,q.jsx)(`label`,{className:MD,htmlFor:`writable-path-input`,children:`Directory path`}),(0,q.jsxs)(`div`,{className:`flex gap-2 max-[640px]:flex-col`,children:[(0,q.jsx)(gD,{"aria-invalid":o?!0:void 0,className:W(ND,`flex-1`),id:`writable-path-input`,onChange:e=>{a(e.target.value),s(``)},placeholder:`Enter a directory path`,type:`text`,value:i}),(0,q.jsxs)(X,{className:W(ID,`shrink-0`),disabled:!c,size:`sm`,type:`submit`,variant:`outline`,children:[(0,q.jsx)(Rm,{"aria-hidden":`true`}),`Add`]})]}),o?(0,q.jsx)(`p`,{className:`m-0 text-xs leading-[1.4] text-destructive`,children:o}):null]}),n.length===0?(0,q.jsx)(`p`,{className:AD,children:`No paths`}):(0,q.jsx)(`div`,{className:DD,children:n.map(e=>(0,q.jsx)(CO,{onRemoveWritablePath:t,writablePath:e},e.path))})]})})}function CO({onRemoveWritablePath:e,writablePath:t}){return(0,q.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-b border-white/10 px-3 py-3 last:border-b-0 max-[640px]:grid-cols-1`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(qm,{"aria-hidden":`true`,className:`size-4 shrink-0 text-white/60`}),(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`p`,{className:`m-0 truncate font-mono text-base leading-5 text-white`,children:t.path}),(0,q.jsx)(`p`,{className:W(`m-0 text-xs leading-[1.4]`,CD),children:`Always allowed`})]})]}),(0,q.jsxs)(X,{className:W(ID,`shrink-0`),onClick:()=>e(t.path),size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(Qm,{"aria-hidden":`true`}),`Remove`]})]})}function wO({activeProvider:e,isFetchingModels:t,isCreatingProvider:n,onFetchModels:r,onNewProvider:i,onProviderSelect:a,onRemoveProvider:o,onSaveProvider:s,onUpdateProvider:c,providers:l}){return(0,q.jsx)(`section`,{className:`grid h-full min-h-0 bg-black`,"aria-label":`Providers`,children:(0,q.jsxs)(`div`,{className:`grid h-full min-h-0 grid-cols-[232px_minmax(0,1fr)] max-[900px]:grid-cols-1 max-[900px]:grid-rows-[auto_minmax(0,1fr)]`,children:[(0,q.jsx)(TO,{activeProvider:e,isCreatingProvider:n,onNewProvider:i,onProviderSelect:a,providers:l}),(0,q.jsx)(EO,{activeProvider:e,isFetchingModels:t,isCreatingProvider:n,onFetchModels:r,onRemoveProvider:o,onSaveProvider:s,onUpdateProvider:c})]})})}function TO({activeProvider:e,isCreatingProvider:t,onNewProvider:n,onProviderSelect:r,providers:i}){return(0,q.jsxs)(`aside`,{className:W(`flex min-h-0 min-w-0 flex-col overflow-auto border-r border-white/10 bg-black p-3 max-[900px]:max-h-64 max-[900px]:border-r-0 max-[900px]:border-b`,ED),"aria-label":`Provider list`,children:[(0,q.jsxs)(X,{"aria-pressed":t,className:`h-8 w-full border-dashed border-white/20 bg-input/30 text-base text-white shadow-none hover:bg-input/50`,onClick:n,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(Rm,{"aria-hidden":`true`}),`New`]}),(0,q.jsxs)(`div`,{className:`mt-4 -mx-1 grid gap-0`,children:[i.length===0?(0,q.jsx)(`p`,{className:AD,children:`No providers`}):null,i.map(n=>{let i=!t&&e.id===n.id;return(0,q.jsx)(X,{"aria-label":n.name,"aria-pressed":i,className:W(`flowent-navigation-item grid w-full cursor-pointer justify-start rounded-lg border border-transparent bg-transparent px-2 py-1 text-left text-white/90 shadow-none transition-colors duration-100 hover:bg-[#151515] hover:text-white`,TD,i&&`bg-[#202020] text-white`),onClick:()=>r(n),size:`sm`,type:`button`,variant:`ghost`,children:(0,q.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:n.name})},n.id)})]})]})}function EO({activeProvider:e,isFetchingModels:t,isCreatingProvider:n,onFetchModels:r,onRemoveProvider:i,onSaveProvider:a,onUpdateProvider:o}){return(0,q.jsxs)(`form`,{className:W(`grid min-h-0 w-full content-start gap-7 overflow-auto px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,ED),"aria-label":`Provider details`,onSubmit:e=>{e.preventDefault(),a()},children:[(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Details`}),(0,q.jsx)(`div`,{className:DD,children:(0,q.jsx)(DO,{activeProvider:e,onUpdateProvider:o})})]}),(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Models`}),(0,q.jsx)(OO,{models:e.models})]}),(0,q.jsxs)(`div`,{className:W(FD,`mt-0`),children:[(0,q.jsx)(X,{className:ID,disabled:t,onClick:r,type:`button`,variant:`outline`,children:t?`Fetching`:`Fetch`}),n?null:(0,q.jsxs)(X,{className:ID,onClick:i,type:`button`,variant:`outline`,children:[(0,q.jsx)(Qm,{"aria-hidden":`true`}),`Remove`]}),(0,q.jsx)(X,{type:`submit`,children:`Save`})]})]})}function DO({activeProvider:e,onUpdateProvider:t}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`provider-name`,children:`Provider name`}),(0,q.jsx)(gD,{className:ND,id:`provider-name`,onChange:e=>t({name:e.target.value}),value:e.name})]}),(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`provider-type`,children:`Provider type`}),(0,q.jsxs)(QD,{value:e.type,onValueChange:e=>t({models:[],type:e}),children:[(0,q.jsx)(eO,{className:PD,id:`provider-type`,"aria-label":`Provider type`,children:(0,q.jsx)($D,{})}),(0,q.jsx)(tO,{children:hn.map(e=>(0,q.jsx)(nO,{value:e.id,children:e.label},e.id))})]})]}),(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`provider-base-url`,children:`Base URL`}),(0,q.jsx)(gD,{className:ND,id:`provider-base-url`,onChange:e=>t({baseUrl:e.target.value}),value:e.baseUrl})]}),(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`provider-api-key`,children:`API key`}),(0,q.jsx)(gD,{className:ND,id:`provider-api-key`,onChange:e=>t({apiKey:e.target.value}),type:`password`,value:e.apiKey})]})]})}function OO({models:e}){return(0,q.jsx)(`div`,{className:jD,children:e.length===0?(0,q.jsx)(`p`,{className:AD,children:`No models`}):(0,q.jsx)(`div`,{className:DD,children:e.map(e=>(0,q.jsx)(`div`,{className:W(`min-h-10 border-b border-white/10 px-3 py-2 text-base leading-5 text-white last:border-b-0`,CD),children:e},e))})})}function kO({className:e,...t}){return(0,q.jsx)(`textarea`,{"data-slot":`textarea`,className:W(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}var AO=[{label:`Default`,value:`default`},{label:`Low`,value:`low`},{label:`Medium`,value:`medium`},{label:`High`,value:`high`},{label:`XHigh`,value:`xhigh`}];function jO({agentPrompt:e,appVersion:t,contextWindowLimit:n,modelOptions:r,onModelChange:i,onProviderChange:a,onReasoningEffortChange:o,onRuntimeSettingsSave:s,providers:c,reasoningEffort:l,selectedModel:u,selectedProviderId:d}){let[f,p]=(0,b.useState)(e),[m,h]=(0,b.useState)(n===null?`auto`:`manual`),[g,_]=(0,b.useState)(n===null?``:String(n));(0,b.useEffect)(()=>{p(e)},[e]),(0,b.useEffect)(()=>{h(n===null?`auto`:`manual`),_(n===null?``:String(n))},[n]);let v=g.trim(),y=Number(v),x=m===`auto`||/^\d+$/.test(v)&&y>0;return(0,q.jsxs)(`section`,{className:W(`flex h-full min-h-0 flex-col overflow-auto bg-black`,ED),"aria-label":`Settings`,children:[(0,q.jsxs)(`form`,{className:`m-8 grid gap-5 bg-black max-[900px]:m-5`,"aria-label":`Runtime settings`,onSubmit:e=>{e.preventDefault(),x&&s({agentPrompt:f,contextWindowLimit:m===`manual`?y:null,reasoningEffort:l,selectedModel:u,selectedProviderId:d})},children:[(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Model routing`}),(0,q.jsx)(`div`,{className:DD,children:(0,q.jsxs)(`div`,{className:`grid gap-0`,children:[c.length===0?(0,q.jsx)(`div`,{className:`p-3`,children:(0,q.jsx)(`p`,{className:AD,children:`No providers`})}):null,(0,q.jsx)(NO,{onProviderChange:a,providers:c,selectedProviderId:d}),(0,q.jsx)(FO,{modelOptions:r,onModelChange:i,selectedModel:u,selectedProviderId:d}),(0,q.jsx)(PO,{onReasoningEffortChange:o,reasoningEffort:l}),(0,q.jsx)(MO,{contextLimitDraft:g,contextLimitMode:m,isValid:x,onContextLimitDraftChange:_,onContextLimitModeChange:h})]})})]}),(0,q.jsxs)(`section`,{className:`grid gap-3`,children:[(0,q.jsx)(`div`,{className:`grid gap-1`,children:(0,q.jsx)(`h3`,{className:`text-base font-semibold text-white`,children:`Agent prompt`})}),(0,q.jsxs)(`div`,{className:W(DD,`p-3`),children:[(0,q.jsx)(ZD,{className:`sr-only`,htmlFor:`agent-prompt`,children:`Agent prompt`}),(0,q.jsx)(kO,{className:`min-h-48 resize-y rounded-md border-white/10 bg-input/30 px-3 py-2 text-base leading-5 text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`agent-prompt`,value:f,onChange:e=>p(e.target.value),placeholder:`Add Flowent-specific instructions for the agent.`,"aria-label":`Agent prompt`})]})]}),(0,q.jsx)(`div`,{className:W(FD,`mt-0`),children:(0,q.jsx)(X,{type:`submit`,disabled:!x,children:`Save`})})]}),t?(0,q.jsxs)(`p`,{className:`mx-8 mt-auto pb-6 text-center text-xs leading-5 text-white/30 max-[900px]:mx-5`,children:[`Flowent v`,t]}):null]})}function MO({contextLimitDraft:e,contextLimitMode:t,isValid:n,onContextLimitDraftChange:r,onContextLimitModeChange:i}){let a=`context-limit-error`,o=t===`manual`&&!n;return(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`context-limit-mode`,children:`Context window`}),(0,q.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 gap-2 max-[640px]:flex-col`,children:[(0,q.jsxs)(QD,{value:t,onValueChange:e=>i(e),children:[(0,q.jsx)(eO,{className:W(PD,`w-36 max-[640px]:w-full`),id:`context-limit-mode`,"aria-label":`Context window`,children:(0,q.jsx)($D,{})}),(0,q.jsxs)(tO,{children:[(0,q.jsx)(nO,{value:`auto`,children:`Auto`}),(0,q.jsx)(nO,{value:`manual`,children:`Manual`})]})]}),t===`manual`?(0,q.jsx)(gD,{"aria-describedby":o?a:void 0,"aria-invalid":o,"aria-label":`Context size`,className:ND,inputMode:`numeric`,placeholder:`e.g. 128000`,value:e,onChange:e=>r(e.target.value)}):null]}),o?(0,q.jsx)(`p`,{className:`m-0 text-xs leading-4 text-red-400`,id:a,children:`Enter a positive integer`}):null]})]})}function NO({onProviderChange:e,providers:t,selectedProviderId:n}){return(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`active-provider`,children:`Provider`}),(0,q.jsxs)(QD,{value:n,onValueChange:e,children:[(0,q.jsx)(eO,{className:PD,disabled:t.length===0,id:`active-provider`,"aria-label":`Provider`,children:(0,q.jsx)($D,{placeholder:`No providers`})}),(0,q.jsxs)(tO,{children:[t.length===0?(0,q.jsx)(nO,{value:`none`,disabled:!0,children:`No providers`}):null,t.map(e=>(0,q.jsx)(nO,{value:e.id,children:e.name},e.id))]})]})]})}function PO({onReasoningEffortChange:e,reasoningEffort:t}){return(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`reasoning-effort`,children:`Reasoning`}),(0,q.jsxs)(QD,{value:t,onValueChange:e,children:[(0,q.jsx)(eO,{className:PD,id:`reasoning-effort`,"aria-label":`Reasoning`,children:(0,q.jsx)($D,{})}),(0,q.jsx)(tO,{children:AO.map(e=>(0,q.jsx)(nO,{value:e.value,children:e.label},e.value))})]})]})}function FO({modelOptions:e,onModelChange:t,selectedModel:n,selectedProviderId:r}){return(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(ZD,{className:W(MD,kD),htmlFor:`active-model`,children:`Model`}),(0,q.jsxs)(QD,{value:n,onValueChange:t,children:[(0,q.jsx)(eO,{className:PD,disabled:e.length===0,id:`active-model`,"aria-label":`Model`,children:(0,q.jsx)($D,{placeholder:`No models`})}),(0,q.jsx)(tO,{children:e.map(e=>(0,q.jsx)(nO,{value:e,children:e},e))})]},`settings-model-${r}`)]})}function IO({activeSkill:e,onReloadSkills:t,onSkillSelect:n,onSkillToggle:r,skills:i}){return(0,q.jsx)(`section`,{className:`grid h-full min-h-0 bg-black`,"aria-label":`Skills`,children:(0,q.jsxs)(`div`,{className:`grid h-full min-h-0 grid-cols-[232px_minmax(0,1fr)] max-[900px]:grid-cols-1 max-[900px]:grid-rows-[auto_minmax(0,1fr)]`,children:[(0,q.jsx)(LO,{activeSkill:e,onReloadSkills:t,onSkillSelect:n,skills:i}),(0,q.jsx)(RO,{activeSkill:e,onSkillToggle:r})]})})}function LO({activeSkill:e,onReloadSkills:t,onSkillSelect:n,skills:r}){return(0,q.jsxs)(`aside`,{className:W(`flex min-h-0 min-w-0 flex-col overflow-auto border-r border-white/10 bg-black p-3 max-[900px]:max-h-64 max-[900px]:border-r-0 max-[900px]:border-b`,ED),"aria-label":`Skills list`,children:[(0,q.jsxs)(X,{className:`h-8 w-full border-dashed border-white/20 bg-input/30 text-base text-white shadow-none hover:bg-input/50`,onClick:t,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(Vm,{"aria-hidden":`true`}),`Reload`]}),(0,q.jsxs)(`div`,{className:`mt-4 -mx-1 grid gap-0`,children:[r.length===0?(0,q.jsx)(`p`,{className:AD,children:`No skills`}):null,r.map(t=>{let r=e?.id===t.id;return(0,q.jsx)(X,{"aria-label":t.name,"aria-pressed":r,className:W(`grid h-auto min-h-[34px] w-full cursor-pointer justify-start rounded-lg border border-transparent bg-transparent px-2 py-1 text-left text-white/90 shadow-none transition-colors duration-100 hover:bg-[#151515] hover:text-white`,TD,r&&`bg-[#202020] text-white`),onClick:()=>n(t),size:`sm`,type:`button`,variant:`ghost`,children:(0,q.jsx)(`span`,{className:`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap`,children:t.name})},t.id)})]})]})}function RO({activeSkill:e,onSkillToggle:t}){return e?(0,q.jsxs)(`div`,{className:W(`grid min-h-0 w-full content-start gap-7 overflow-auto px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,ED),"aria-label":`Skill`,children:[(0,q.jsx)(`section`,{className:`grid gap-3`,children:(0,q.jsxs)(`div`,{className:DD,children:[(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(`div`,{className:W(MD,kD),children:`Name`}),(0,q.jsx)(`div`,{className:`min-w-0 text-base leading-5 text-white`,children:e.name})]}),(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(`div`,{className:W(MD,kD),children:`Call`}),(0,q.jsxs)(`div`,{className:`min-w-0 font-mono text-base leading-5 text-white`,children:[`$`,e.slug]})]}),(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(`div`,{className:W(MD,kD),children:`Scope`}),(0,q.jsx)(`div`,{className:`min-w-0 text-base leading-5 text-white`,children:zO(e.scope)})]}),(0,q.jsxs)(`div`,{className:OD,children:[(0,q.jsx)(`div`,{className:W(MD,kD),children:`Status`}),(0,q.jsx)(`div`,{className:`min-w-0 text-base leading-5 text-white`,children:e.enabled?`On`:`Off`})]})]})}),(0,q.jsxs)(`section`,{className:`grid gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-white`,children:[(0,q.jsx)(Jm,{"aria-hidden":`true`,className:`size-4 text-white/70`}),`Description`]}),e.description?(0,q.jsx)(`p`,{className:W(`m-0 text-sm leading-6`,CD),children:e.description}):(0,q.jsx)(`p`,{className:AD,children:`No description`})]}),e.error?(0,q.jsxs)(`section`,{className:`flex items-start gap-2 rounded-lg border border-red-300/20 bg-black p-3 text-sm leading-5 text-red-200`,children:[(0,q.jsx)(_m,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0`}),(0,q.jsx)(`span`,{children:e.error})]}):null,(0,q.jsx)(`div`,{className:`flex justify-end`,children:(0,q.jsx)(X,{className:ID,onClick:()=>t(e,!e.enabled),type:`button`,variant:`outline`,children:e.enabled?`Off`:`On`})})]}):(0,q.jsx)(`div`,{className:`grid min-h-0 content-start overflow-auto px-12 py-8 max-[900px]:px-5 max-[900px]:py-5`,children:(0,q.jsx)(`p`,{className:AD,children:`No skills`})})}function zO(e){return e===`project`?`Project`:`User`}var BO=3,VO=4e3,HO=2147483647,UO=0,WO=[],GO=new Set,KO=e=>typeof e==`string`?{message:e}:e,qO=()=>(UO+=1,`flowent-toast-${UO}`),JO=()=>{for(let e of GO)e()},YO=e=>{WO=e(WO),JO()},XO=e=>(GO.add(e),()=>{GO.delete(e)}),ZO=e=>{YO(t=>t.filter(t=>t.id!==e))},QO=(e,t)=>{let n=KO(t),r=n.message.trim();if(!r)return``;let i={description:n.description?.trim()||void 0,duration:n.duration??VO,id:qO(),message:r,tone:e};return YO(e=>[...e,i].slice(-BO)),i.id},$O={dismiss:ZO,error:e=>QO(`error`,e),info:e=>QO(`info`,e),success:e=>QO(`success`,e)};function ek({children:e}){let[t,n]=(0,b.useState)(WO);return(0,b.useEffect)(()=>{let e=()=>n(WO),t=XO(e);return e(),()=>{t(),GO.size===0&&(WO=[])}},[]),(0,q.jsx)(bO.Provider,{value:$O,children:(0,q.jsxs)(pE,{duration:VO,label:`Notification`,swipeDirection:`right`,children:[e,(0,q.jsx)(tk,{onDismiss:ZO,toasts:t})]})})}function tk({onDismiss:e,toasts:t}){let[n,r]=(0,b.useState)(!1);return(0,q.jsx)(mE,{"aria-label":`Notifications`,className:`fixed right-4 bottom-4 z-[80] m-0 flex w-[calc(100vw-2rem)] max-w-72 list-none flex-col items-end gap-2 p-0 outline-none max-[640px]:right-3 max-[640px]:bottom-3 max-[640px]:w-[calc(100vw-1.5rem)] max-[640px]:max-w-none`,onBlur:e=>{let t=e.relatedTarget;if(!(t instanceof Node)){r(!1);return}e.currentTarget.contains(t)||r(!1)},onFocus:()=>r(!0),onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:t.map(t=>(0,q.jsx)(nk,{isPaused:n,onDismiss:e,toast:t},t.id))})}function nk({isPaused:e,onDismiss:t,toast:n}){let r=Zp(),i=(0,b.useRef)(n.duration),a=(0,b.useRef)(0),o=(0,b.useRef)(null),s=rk[n.tone],c=(0,b.useCallback)(()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)},[]);return(0,b.useEffect)(()=>{i.current=n.duration,a.current=0,c()},[c,n.duration,n.id]),(0,b.useEffect)(()=>{if(!(n.duration<=0)){if(e){a.current&&=(i.current=Math.max(0,i.current-(Date.now()-a.current)),0),c();return}if(i.current<=0){t(n.id);return}return a.current=Date.now(),o.current=window.setTimeout(()=>{t(n.id)},i.current),()=>{a.current&&=(i.current=Math.max(0,i.current-(Date.now()-a.current)),0),c()}}},[c,e,t,n.duration,n.id]),(0,q.jsx)(hE,{className:`w-full max-w-72 list-none outline-none max-[640px]:max-w-none`,duration:HO,forceMount:!0,open:!0,role:n.tone===`error`?`alert`:`status`,type:n.tone===`error`?`foreground`:`background`,children:(0,q.jsxs)(Xp.div,{animate:r?{opacity:1}:{opacity:1,x:0},className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-2 rounded-lg border border-white/10 bg-black p-3 text-white shadow-[0_14px_34px_rgba(0,0,0,0.48)] ring-1 ring-white/5`,initial:r?{opacity:1}:{opacity:1,x:20},layout:!0,transition:{duration:.2,ease:`easeOut`},children:[(0,q.jsx)(s,{"aria-hidden":`true`,className:W(`mt-0.5 size-4 shrink-0`,ik[n.tone])}),(0,q.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,q.jsx)(gE,{className:`text-xs leading-4 font-medium text-white`,children:n.message}),n.description?(0,q.jsx)(_E,{className:W(`text-[11px] leading-[1.35]`,CD),children:n.description}):null]}),(0,q.jsx)(vE,{"aria-label":`Dismiss notification`,className:W(cD({size:`icon-xs`,variant:`ghost`}),`-mt-1 -mr-1 size-6 p-0 text-white/55 hover:text-white`),onClick:()=>t(n.id),type:`button`,children:(0,q.jsx)(nh,{"aria-hidden":`true`})})]})})}var rk={error:_m,info:Dm,success:vm},ik={error:`text-destructive`,info:`text-white/70`,success:`text-emerald-300`};function ak(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=ak(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var ok={value:()=>{}};function sk(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new ck(n)}function ck(e){this._=e}function lk(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}ck.prototype=sk.prototype={constructor:ck,on:function(e,t){var n=this._,r=lk(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=uk(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=dk(n[i],e.name,t);else if(t==null)for(i in n)n[i]=dk(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ck(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function uk(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function dk(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=ok,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var fk={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function pk(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),fk.hasOwnProperty(t)?{space:fk[t],local:e}:e}function mk(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function hk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gk(e){var t=pk(e);return(t.local?hk:mk)(t)}function _k(){}function vk(e){return e==null?_k:function(){return this.querySelector(e)}}function yk(e){typeof e!=`function`&&(e=vk(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new sj(r,this._parents)}function bk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function xk(){return[]}function Sk(e){return e==null?xk:function(){return this.querySelectorAll(e)}}function Ck(e){return function(){return bk(e.apply(this,arguments))}}function wk(e){e=typeof e==`function`?Ck(e):Sk(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new sj(r,i)}function Tk(e){return function(){return this.matches(e)}}function Ek(e){return function(t){return t.matches(e)}}var Dk=Array.prototype.find;function Ok(e){return function(){return Dk.call(this.children,e)}}function kk(){return this.firstElementChild}function Ak(e){return this.select(e==null?kk:Ok(typeof e==`function`?e:Ek(e)))}var jk=Array.prototype.filter;function Mk(){return Array.from(this.children)}function Nk(e){return function(){return jk.call(this.children,e)}}function Pk(e){return this.selectAll(e==null?Mk:Nk(typeof e==`function`?e:Ek(e)))}function Fk(e){typeof e!=`function`&&(e=Tk(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new sj(r,this._parents)}function Ik(e){return Array(e.length)}function Lk(){return new sj(this._enter||this._groups.map(Ik),this._parents)}function Rk(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Rk.prototype={constructor:Rk,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function zk(e){return function(){return e}}function Bk(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new Rk(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Vk(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new Rk(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Hk(e){return e.__data__}function Uk(e,t){if(!arguments.length)return Array.from(this,Hk);var n=t?Vk:Bk,r=this._parents,i=this._groups;typeof e!=`function`&&(e=zk(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Wk(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new sj(o,r),o._enter=s,o._exit=c,o}function Wk(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Gk(){return new sj(this._exit||this._groups.map(Ik),this._parents)}function Kk(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function qk(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new sj(s,this._parents)}function Jk(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Yk(e){e||=Xk;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new sj(i,this._parents).order()}function Xk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Zk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Qk(){return Array.from(this)}function $k(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function eA(){let e=0;for(let t of this)++e;return e}function tA(){return!this.node()}function nA(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function rA(e){return function(){this.removeAttribute(e)}}function iA(e){return function(){this.removeAttributeNS(e.space,e.local)}}function aA(e,t){return function(){this.setAttribute(e,t)}}function oA(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function sA(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function cA(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function lA(e,t){var n=pk(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?iA:rA:typeof t==`function`?n.local?cA:sA:n.local?oA:aA)(n,t))}function uA(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function dA(e){return function(){this.style.removeProperty(e)}}function fA(e,t,n){return function(){this.style.setProperty(e,t,n)}}function pA(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function mA(e,t,n){return arguments.length>1?this.each((t==null?dA:typeof t==`function`?pA:fA)(e,t,n??``)):hA(this.node(),e)}function hA(e,t){return e.style.getPropertyValue(t)||uA(e).getComputedStyle(e,null).getPropertyValue(t)}function gA(e){return function(){delete this[e]}}function _A(e,t){return function(){this[e]=t}}function vA(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function yA(e,t){return arguments.length>1?this.each((t==null?gA:typeof t==`function`?vA:_A)(e,t)):this.node()[e]}function bA(e){return e.trim().split(/^|\s+/)}function xA(e){return e.classList||new SA(e)}function SA(e){this._node=e,this._names=bA(e.getAttribute(`class`)||``)}SA.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function CA(e,t){for(var n=xA(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function wA(e,t){for(var n=xA(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function TA(e){return function(){CA(this,e)}}function EA(e){return function(){wA(this,e)}}function DA(e,t){return function(){(t.apply(this,arguments)?CA:wA)(this,e)}}function OA(e,t){var n=bA(e+``);if(arguments.length<2){for(var r=xA(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?DA:t?TA:EA)(n,t))}function kA(){this.textContent=``}function AA(e){return function(){this.textContent=e}}function jA(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function MA(e){return arguments.length?this.each(e==null?kA:(typeof e==`function`?jA:AA)(e)):this.node().textContent}function NA(){this.innerHTML=``}function PA(e){return function(){this.innerHTML=e}}function FA(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function IA(e){return arguments.length?this.each(e==null?NA:(typeof e==`function`?FA:PA)(e)):this.node().innerHTML}function LA(){this.nextSibling&&this.parentNode.appendChild(this)}function RA(){return this.each(LA)}function zA(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function BA(){return this.each(zA)}function VA(e){var t=typeof e==`function`?e:gk(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function HA(){return null}function UA(e,t){var n=typeof e==`function`?e:gk(e),r=t==null?HA:typeof t==`function`?t:vk(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function WA(){var e=this.parentNode;e&&e.removeChild(this)}function GA(){return this.each(WA)}function KA(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qA(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function JA(e){return this.select(e?qA:KA)}function YA(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function XA(e){return function(t){e.call(this,t,this.__data__)}}function ZA(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function QA(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function $A(e,t,n){return function(){var r=this.__on,i,a=XA(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function ej(e,t,n){var r=ZA(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?$A:QA,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function tj(e,t,n){var r=uA(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function nj(e,t){return function(){return tj(this,e,t)}}function rj(e,t){return function(){return tj(this,e,t.apply(this,arguments))}}function ij(e,t){return this.each((typeof t==`function`?rj:nj)(e,t))}function*aj(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var oj=[null];function sj(e,t){this._groups=e,this._parents=t}function cj(){return new sj([[document.documentElement]],oj)}function lj(){return this}sj.prototype=cj.prototype={constructor:sj,select:yk,selectAll:wk,selectChild:Ak,selectChildren:Pk,filter:Fk,data:Uk,enter:Lk,exit:Gk,join:Kk,merge:qk,selection:lj,order:Jk,sort:Yk,call:Zk,nodes:Qk,node:$k,size:eA,empty:tA,each:nA,attr:lA,style:mA,property:yA,classed:OA,text:MA,html:IA,raise:RA,lower:BA,append:VA,insert:UA,remove:GA,clone:JA,datum:YA,on:ej,dispatch:ij,[Symbol.iterator]:aj};function uj(e){return typeof e==`string`?new sj([[document.querySelector(e)]],[document.documentElement]):new sj([[e]],oj)}function dj(e){let t;for(;t=e.sourceEvent;)e=t;return e}function fj(e,t){if(e=dj(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var pj={passive:!1},mj={capture:!0,passive:!1};function hj(e){e.stopImmediatePropagation()}function gj(e){e.preventDefault(),e.stopImmediatePropagation()}function _j(e){var t=e.document.documentElement,n=uj(e).on(`dragstart.drag`,gj,mj);`onselectstart`in t?n.on(`selectstart.drag`,gj,mj):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function vj(e,t){var n=e.document.documentElement,r=uj(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,gj,mj),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var yj=e=>()=>e;function bj(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}bj.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function xj(e){return!e.ctrlKey&&!e.button}function Sj(){return this.parentNode}function Cj(e,t){return t??{x:e.x,y:e.y}}function wj(){return navigator.maxTouchPoints||`ontouchstart`in this}function Tj(){var e=xj,t=Sj,n=Cj,r=wj,i={},a=sk(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,pj).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(uj(n.view).on(`mousemove.drag`,m,mj).on(`mouseup.drag`,h,mj),_j(n.view),hj(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(gj(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){uj(e.view).on(`mousemove.drag mouseup.drag`,null),vj(e.view,l),gj(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(hj(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(gj(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(hj(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=fj(l||r,t),p,m,h;if((h=n.call(e,new bj(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=fj(l||a,t),_=o;break}u.call(r,e,new bj(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:yj(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:yj(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:yj(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:yj(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Ej(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Dj(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Oj(){}var kj=.7,Aj=1/kj,jj=`\\s*([+-]?\\d+)\\s*`,Mj=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Nj=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Pj=/^#([0-9a-f]{3,8})$/,Fj=RegExp(`^rgb\\(${jj},${jj},${jj}\\)$`),Ij=RegExp(`^rgb\\(${Nj},${Nj},${Nj}\\)$`),Lj=RegExp(`^rgba\\(${jj},${jj},${jj},${Mj}\\)$`),Rj=RegExp(`^rgba\\(${Nj},${Nj},${Nj},${Mj}\\)$`),zj=RegExp(`^hsl\\(${Mj},${Nj},${Nj}\\)$`),Bj=RegExp(`^hsla\\(${Mj},${Nj},${Nj},${Mj}\\)$`),Vj={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ej(Oj,Kj,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Hj,formatHex:Hj,formatHex8:Uj,formatHsl:Wj,formatRgb:Gj,toString:Gj});function Hj(){return this.rgb().formatHex()}function Uj(){return this.rgb().formatHex8()}function Wj(){return aM(this).formatHsl()}function Gj(){return this.rgb().formatRgb()}function Kj(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Pj.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?qj(t):n===3?new Zj(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Jj(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Jj(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Fj.exec(e))?new Zj(t[1],t[2],t[3],1):(t=Ij.exec(e))?new Zj(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Lj.exec(e))?Jj(t[1],t[2],t[3],t[4]):(t=Rj.exec(e))?Jj(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=zj.exec(e))?iM(t[1],t[2]/100,t[3]/100,1):(t=Bj.exec(e))?iM(t[1],t[2]/100,t[3]/100,t[4]):Vj.hasOwnProperty(e)?qj(Vj[e]):e===`transparent`?new Zj(NaN,NaN,NaN,0):null}function qj(e){return new Zj(e>>16&255,e>>8&255,e&255,1)}function Jj(e,t,n,r){return r<=0&&(e=t=n=NaN),new Zj(e,t,n,r)}function Yj(e){return e instanceof Oj||(e=Kj(e)),e?(e=e.rgb(),new Zj(e.r,e.g,e.b,e.opacity)):new Zj}function Xj(e,t,n,r){return arguments.length===1?Yj(e):new Zj(e,t,n,r??1)}function Zj(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ej(Zj,Xj,Dj(Oj,{brighter(e){return e=e==null?Aj:Aj**+e,new Zj(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kj:kj**+e,new Zj(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zj(nM(this.r),nM(this.g),nM(this.b),tM(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Qj,formatHex:Qj,formatHex8:$j,formatRgb:eM,toString:eM}));function Qj(){return`#${rM(this.r)}${rM(this.g)}${rM(this.b)}`}function $j(){return`#${rM(this.r)}${rM(this.g)}${rM(this.b)}${rM((isNaN(this.opacity)?1:this.opacity)*255)}`}function eM(){let e=tM(this.opacity);return`${e===1?`rgb(`:`rgba(`}${nM(this.r)}, ${nM(this.g)}, ${nM(this.b)}${e===1?`)`:`, ${e})`}`}function tM(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nM(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rM(e){return e=nM(e),(e<16?`0`:``)+e.toString(16)}function iM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new sM(e,t,n,r)}function aM(e){if(e instanceof sM)return new sM(e.h,e.s,e.l,e.opacity);if(e instanceof Oj||(e=Kj(e)),!e)return new sM;if(e instanceof sM)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new sM(o,s,c,e.opacity)}function oM(e,t,n,r){return arguments.length===1?aM(e):new sM(e,t,n,r??1)}function sM(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ej(sM,oM,Dj(Oj,{brighter(e){return e=e==null?Aj:Aj**+e,new sM(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kj:kj**+e,new sM(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Zj(uM(e>=240?e-240:e+120,i,r),uM(e,i,r),uM(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new sM(cM(this.h),lM(this.s),lM(this.l),tM(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=tM(this.opacity);return`${e===1?`hsl(`:`hsla(`}${cM(this.h)}, ${lM(this.s)*100}%, ${lM(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function cM(e){return e=(e||0)%360,e<0?e+360:e}function lM(e){return Math.max(0,Math.min(1,e||0))}function uM(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var dM=e=>()=>e;function fM(e,t){return function(n){return e+n*t}}function pM(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function mM(e){return(e=+e)==1?hM:function(t,n){return n-t?pM(t,n,e):dM(isNaN(t)?n:t)}}function hM(e,t){var n=t-e;return n?fM(e,n):dM(isNaN(e)?t:e)}var gM=(function e(t){var n=mM(t);function r(e,t){var r=n((e=Xj(e)).r,(t=Xj(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=hM(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function _M(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function vM(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function yM(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=OM(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function bM(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xM(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function SM(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=OM(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var CM=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wM=new RegExp(CM.source,`g`);function TM(e){return function(){return e}}function EM(e){return function(t){return e(t)+``}}function DM(e,t){var n=CM.lastIndex=wM.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=CM.exec(e))&&(i=wM.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:xM(r,i)})),n=wM.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?EM(c[0].x):TM(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function OM(e,t){var n=typeof t,r;return t==null||n===`boolean`?dM(t):(n===`number`?xM:n===`string`?(r=Kj(t))?(t=r,gM):DM:t instanceof Kj?gM:t instanceof Date?bM:vM(t)?_M:Array.isArray(t)?yM:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?SM:xM)(e,t)}var kM=180/Math.PI,AM={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function jM(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*kM,skewX:Math.atan(c)*kM,scaleX:o,scaleY:s}}var MM;function NM(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?AM:jM(t.a,t.b,t.c,t.d,t.e,t.f)}function PM(e){return e==null||(MM||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),MM.setAttribute(`transform`,e),!(e=MM.transform.baseVal.consolidate()))?AM:(e=e.matrix,jM(e.a,e.b,e.c,e.d,e.e,e.f))}function FM(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:xM(e,i)},{i:c-2,x:xM(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:xM(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:xM(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:xM(e,n)},{i:s-2,x:xM(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var IM=FM(NM,`px, `,`px)`,`deg)`),LM=FM(PM,`, `,`)`,`)`),RM=1e-12;function zM(e){return((e=Math.exp(e))+1/e)/2}function BM(e){return((e=Math.exp(e))-1/e)/2}function VM(e){return((e=Math.exp(2*e))-1)/(e+1)}var HM=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<RM)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=zM(y),c=s/(n*g)*(i*VM(t*r+y)-BM(y));return[a+c*d,o+c*f,s*i/zM(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),UM=0,WM=0,GM=0,KM=1e3,qM,JM,YM=0,XM=0,ZM=0,QM=typeof performance==`object`&&performance.now?performance:Date,$M=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function eN(){return XM||=($M(tN),QM.now()+ZM)}function tN(){XM=0}function nN(){this._call=this._time=this._next=null}nN.prototype=rN.prototype={constructor:nN,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?eN():+n)+(t==null?0:+t),!this._next&&JM!==this&&(JM?JM._next=this:qM=this,JM=this),this._call=e,this._time=n,cN()},stop:function(){this._call&&(this._call=null,this._time=1/0,cN())}};function rN(e,t,n){var r=new nN;return r.restart(e,t,n),r}function iN(){eN(),++UM;for(var e=qM,t;e;)(t=XM-e._time)>=0&&e._call.call(void 0,t),e=e._next;--UM}function aN(){XM=(YM=QM.now())+ZM,UM=WM=0;try{iN()}finally{UM=0,sN(),XM=0}}function oN(){var e=QM.now(),t=e-YM;t>KM&&(ZM-=t,YM=e)}function sN(){for(var e,t=qM,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:qM=n);JM=e,cN(r)}function cN(e){UM||(WM&&=clearTimeout(WM),e-XM>24?(e<1/0&&(WM=setTimeout(aN,e-QM.now()-ZM)),GM&&=clearInterval(GM)):(GM||=(YM=QM.now(),setInterval(oN,KM)),UM=1,$M(aN)))}function lN(e,t,n){var r=new nN;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var uN=sk(`start`,`end`,`cancel`,`interrupt`),dN=[];function fN(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;gN(e,n,{name:t,index:r,group:i,on:uN,tween:dN,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function pN(e,t){var n=hN(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function mN(e,t){var n=hN(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function hN(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function gN(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=rN(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return lN(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(lN(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function _N(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function vN(e){return this.each(function(){_N(this,e)})}function yN(e,t){var n,r;return function(){var i=mN(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function bN(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=mN(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function xN(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=hN(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?yN:bN)(n,e,t))}function SN(e,t,n){var r=e._id;return e.each(function(){var e=mN(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return hN(e,r).value[t]}}function CN(e,t){var n;return(typeof t==`number`?xM:t instanceof Kj?gM:(n=Kj(t))?(t=n,gM):DM)(e,t)}function wN(e){return function(){this.removeAttribute(e)}}function TN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function EN(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function DN(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function ON(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function kN(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function AN(e,t){var n=pk(e),r=n===`transform`?LM:CN;return this.attrTween(e,typeof t==`function`?(n.local?kN:ON)(n,r,SN(this,`attr.`+e,t)):t==null?(n.local?TN:wN)(n):(n.local?DN:EN)(n,r,t))}function jN(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function MN(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function NN(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&MN(e,i)),n}return i._value=t,i}function PN(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&jN(e,i)),n}return i._value=t,i}function FN(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=pk(e);return this.tween(n,(r.local?NN:PN)(r,t))}function IN(e,t){return function(){pN(this,e).delay=+t.apply(this,arguments)}}function LN(e,t){return t=+t,function(){pN(this,e).delay=t}}function RN(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?IN:LN)(t,e)):hN(this.node(),t).delay}function zN(e,t){return function(){mN(this,e).duration=+t.apply(this,arguments)}}function BN(e,t){return t=+t,function(){mN(this,e).duration=t}}function VN(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?zN:BN)(t,e)):hN(this.node(),t).duration}function HN(e,t){if(typeof t!=`function`)throw Error();return function(){mN(this,e).ease=t}}function UN(e){var t=this._id;return arguments.length?this.each(HN(t,e)):hN(this.node(),t).ease}function WN(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();mN(this,e).ease=n}}function GN(e){if(typeof e!=`function`)throw Error();return this.each(WN(this._id,e))}function KN(e){typeof e!=`function`&&(e=Tk(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new xP(r,this._parents,this._name,this._id)}function qN(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new xP(o,this._parents,this._name,this._id)}function JN(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function YN(e,t,n){var r,i,a=JN(t)?pN:mN;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function XN(e,t){var n=this._id;return arguments.length<2?hN(this.node(),n).on.on(e):this.each(YN(n,e,t))}function ZN(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function QN(){return this.on(`end.remove`,ZN(this._id))}function $N(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=vk(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,fN(l[f],t,n,f,l,hN(u,n)));return new xP(a,this._parents,t,n)}function eP(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Sk(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=hN(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&fN(p,t,n,h,f,m);a.push(f),o.push(u)}return new xP(a,o,t,n)}var tP=cj.prototype.constructor;function nP(){return new tP(this._groups,this._parents)}function rP(e,t){var n,r,i;return function(){var a=hA(this,e),o=(this.style.removeProperty(e),hA(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function iP(e){return function(){this.style.removeProperty(e)}}function aP(e,t,n){var r,i=n+``,a;return function(){var o=hA(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function oP(e,t,n){var r,i,a;return function(){var o=hA(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),hA(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function sP(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=mN(this,e),l=c.on,u=c.value[a]==null?s||=iP(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function cP(e,t,n){var r=(e+=``)==`transform`?IM:CN;return t==null?this.styleTween(e,rP(e,r)).on(`end.style.`+e,iP(e)):typeof t==`function`?this.styleTween(e,oP(e,r,SN(this,`style.`+e,t))).each(sP(this._id,e)):this.styleTween(e,aP(e,r,t),n).on(`end.style.`+e,null)}function lP(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function uP(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&lP(e,a,n)),r}return a._value=t,a}function dP(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,uP(e,t,n??``))}function fP(e){return function(){this.textContent=e}}function pP(e){return function(){var t=e(this);this.textContent=t??``}}function mP(e){return this.tween(`text`,typeof e==`function`?pP(SN(this,`text`,e)):fP(e==null?``:e+``))}function hP(e){return function(t){this.textContent=e.call(this,t)}}function gP(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&hP(r)),t}return r._value=e,r}function _P(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,gP(e))}function vP(){for(var e=this._name,t=this._id,n=CP(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=hN(c,t);fN(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new xP(r,this._parents,e,n)}function yP(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=mN(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var bP=0;function xP(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function SP(e){return cj().transition(e)}function CP(){return++bP}var wP=cj.prototype;xP.prototype=SP.prototype={constructor:xP,select:$N,selectAll:eP,selectChild:wP.selectChild,selectChildren:wP.selectChildren,filter:KN,merge:qN,selection:nP,transition:vP,call:wP.call,nodes:wP.nodes,node:wP.node,size:wP.size,empty:wP.empty,each:wP.each,on:XN,attr:AN,attrTween:FN,style:cP,styleTween:dP,text:mP,textTween:_P,remove:QN,tween:xN,delay:RN,duration:VN,ease:UN,easeVarying:GN,end:yP,[Symbol.iterator]:wP[Symbol.iterator]};function TP(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var EP={time:null,delay:0,duration:250,ease:TP};function DP(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function OP(e){var t,n;e instanceof xP?(t=e._id,e=e._name):(t=CP(),(n=EP).time=eN(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&fN(c,e,t,l,o,n||DP(c,t));return new xP(r,this._parents,e,t)}cj.prototype.interrupt=vN,cj.prototype.transition=OP;var kP=e=>()=>e;function AP(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function jP(e,t,n){this.k=e,this.x=t,this.y=n}jP.prototype={constructor:jP,scale:function(e){return e===1?this:new jP(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new jP(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var MP=new jP(1,0,0);NP.prototype=jP.prototype;function NP(e){for(;!e.__zoom;)if(!(e=e.parentNode))return MP;return e.__zoom}function PP(e){e.stopImmediatePropagation()}function FP(e){e.preventDefault(),e.stopImmediatePropagation()}function IP(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function LP(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function RP(){return this.__zoom||MP}function zP(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function BP(){return navigator.maxTouchPoints||`ontouchstart`in this}function VP(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function HP(){var e=IP,t=LP,n=VP,r=zP,i=BP,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=HM,l=sk(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,RP).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,RP),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(MP.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new jP(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new jP(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new jP(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=uj(this.that).datum();l.call(e,this.that,new AP(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=fj(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],_N(this),s.start();FP(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=uj(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=fj(t,i),l=t.clientX,u=t.clientY;_j(t.view),PP(t),a.mouse=[c,this.__zoom.invert(c)],_N(this),a.start();function d(e){if(FP(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=fj(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),vj(e.view,a.moved),FP(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=fj(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);FP(r),s>0?uj(this).transition().duration(s).call(x,d,c,r):uj(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(PP(t),s=0;s<i;++s)c=r[s],l=fj(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),_N(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(FP(e),s=0;s<a;++s)c=i[s],l=fj(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(PP(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=fj(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=uj(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:kP(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:kP(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:kP(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:kP([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var UP={error001:(e=`react`)=>`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},WP=[[-1/0,-1/0],[1/0,1/0]],GP=[`Enter`,` `,`Escape`],KP={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},qP;(function(e){e.Strict=`strict`,e.Loose=`loose`})(qP||={});var JP;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(JP||={});var YP;(function(e){e.Partial=`partial`,e.Full=`full`})(YP||={});var XP={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},ZP;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(ZP||={});var QP;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(QP||={});var Z;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(Z||={});var $P={[Z.Left]:Z.Right,[Z.Right]:Z.Left,[Z.Top]:Z.Bottom,[Z.Bottom]:Z.Top};function eF(e){return e===null?null:e?`valid`:`invalid`}var tF=e=>`id`in e&&`source`in e&&`target`in e,nF=e=>`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),rF=e=>`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),iF=(e,t=[0,0])=>{let{width:n,height:r}=LF(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},aF=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:bF(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):rF(n)?n:t.nodeLookup.get(n.id)),vF(e,i?SF(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),oF=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=vF(n,SF(e)),r=!0)}),r?bF(n):{x:0,y:0,width:0,height:0}},sF=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s={...kF(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??null,l=e.height??t.height??t.initialHeight??null,u=wF(s,xF(t)),d=(i??0)*(l??0),f=a&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&c.push(t)}return c},cF=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function lF(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{e.measured.width&&e.measured.height&&(t?.includeHiddenNodes||!e.hidden)&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function uF({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=PF(oF(lF(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function dF({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent)if(!s)a?.(`005`,UP.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&IF(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=IF(d)?mF(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,UP.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function fF({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=cF(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var pF=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),mF=(e={x:0,y:0},t,n)=>({x:pF(e.x,t[0][0],t[1][0]-(n?.width??0)),y:pF(e.y,t[0][1],t[1][1]-(n?.height??0))});function hF(e,t,n){let{width:r,height:i}=LF(n),{x:a,y:o}=n.internals.positionAbsolute;return mF(e,[[a,o],[a+r,o+i]],t)}var gF=(e,t,n)=>e<t?pF(Math.abs(e-t),1,t)/t:e>n?-pF(Math.abs(e-n),1,t)/t:0,_F=(e,t,n=15,r=40)=>[gF(e.x,r,t.width-r)*n,gF(e.y,r,t.height-r)*n],vF=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),yF=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),bF=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),xF=(e,t=[0,0])=>{let{x:n,y:r}=rF(e)?e.internals.positionAbsolute:iF(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},SF=(e,t=[0,0])=>{let{x:n,y:r}=rF(e)?e.internals.positionAbsolute:iF(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},CF=(e,t)=>bF(vF(yF(e),yF(t))),wF=(e,t)=>{let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},TF=e=>EF(e.width)&&EF(e.height)&&EF(e.x)&&EF(e.y),EF=e=>!isNaN(e)&&isFinite(e),DF=(e,t)=>(e,t)=>{},OF=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),kF=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?OF(s,o):s},AF=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function jF(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function MF(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=jF(e,n),i=jF(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=jF(e.top??e.y??0,n),i=jF(e.bottom??e.y??0,n),a=jF(e.left??e.x??0,t),o=jF(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function NF(e,t,n,r,i,a){let{x:o,y:s}=AF(e,[t,n,r]),{x:c,y:l}=AF({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var PF=(e,t,n,r,i,a)=>{let o=MF(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=pF(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=NF(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},FF=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function IF(e){return e!=null&&e!==`parent`}function LF(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function RF(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function zF(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function BF(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function VF(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function HF(e){return{...KP,...e||{}}}function UF(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=YF(e),s=kF({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?OF(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var WF=e=>({width:e.offsetWidth,height:e.offsetHeight}),GF=e=>e?.getRootNode?.()||window?.document,KF=[`INPUT`,`SELECT`,`TEXTAREA`];function qF(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?KF.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var JF=e=>`clientX`in e,YF=(e,t)=>{let n=JF(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},XF=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...WF(t)}})};function ZF({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function QF(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function $F({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Z.Left:return[t-QF(t-r,a),n];case Z.Right:return[t+QF(r-t,a),n];case Z.Top:return[t,n-QF(n-i,a)];case Z.Bottom:return[t,n+QF(i-n,a)]}}function eI({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:a=Z.Top,curvature:o=.25}){let[s,c]=$F({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=$F({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=ZF({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function tI({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function nI({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function rI({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=vF(SF(e),SF(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),wF({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},bF(a))>0}var iI=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,aI=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),oI=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,UP.error006()),t;let r=n.getEdgeId||iI,i;return i=tF(e)?{...e}:{...e,id:r(e)},aI(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function sI({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=tI({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var cI={[Z.Left]:{x:-1,y:0},[Z.Right]:{x:1,y:0},[Z.Top]:{x:0,y:-1},[Z.Bottom]:{x:0,y:1}},lI=({source:e,sourcePosition:t=Z.Bottom,target:n})=>t===Z.Left||t===Z.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},uI=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function dI({source:e,sourcePosition:t=Z.Bottom,target:n,targetPosition:r=Z.Top,center:i,offset:a,stepPosition:o}){let s=cI[t],c=cI[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=lI({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=tI({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function fI(e,t,n,r){let i=Math.min(uI(e,t)/2,uI(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function pI({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:a=Z.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=dI({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=fI(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function mI(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function hI(e){let{sourceNode:t,targetNode:n}=e;if(!mI(t)||!mI(n))return null;let r=t.internals.handleBounds||gI(t.handles),i=n.internals.handleBounds||gI(n.handles),a=vI(r?.source??[],e.sourceHandle),o=vI(e.connectionMode===qP.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,UP.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||Z.Bottom,c=o?.position||Z.Top,l=_I(t,a,s),u=_I(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function gI(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function _I(e,t,n=Z.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??LF(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case Z.Top:return{x:i+o/2,y:a};case Z.Right:return{x:i+o,y:a+s/2};case Z.Bottom:return{x:i+o/2,y:a+s};case Z.Left:return{x:i,y:a+s/2}}}function vI(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function yI(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function bI(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=yI(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var xI=1e3,SI=10,CI={nodeOrigin:[0,0],nodeExtent:WP,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},wI={...CI,checkEquality:!0};function TI(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function EI(e,t,n){let r=TI(CI,n);for(let n of e.values())if(n.parentId)jI(n,e,t,r);else{let e=mF(iF(n,r.nodeOrigin),IF(n.extent)?n.extent:r.nodeExtent,LF(n));n.internals.positionAbsolute=e}}function DI(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function OI(e){return e===`manual`}function kI(e,t,n,r={}){let i=TI(wI,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!OI(i.zIndexMode)?xI:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=mF(iF(u,i.nodeOrigin),IF(u.extent)?u.extent:i.nodeExtent,LF(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:DI(u,e),z:MI(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&jI(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function AI(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function jI(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=TI(CI,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}AI(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*SI),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=NI(e,u,o,s,a&&!OI(c)?xI:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function MI(e,t,n){let r=EF(e.zIndex)?e.zIndex:0;return OI(n)?r:r+(e.selected?t:0)}function NI(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=LF(e),l=iF(e,n),u=IF(e.extent)?mF(l,e.extent,c):l,d=mF({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=hF(d,c,t));let f=MI(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function PI(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=CF(a.get(n.parentId)?.expandedRect??xF(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=LF(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function FI(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=WF(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=IF(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;e.parentId&&e.extent===`parent`?h=hF(h,s,t.get(e.parentId)):m&&(h=mF(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:XF(`source`,r.nodeElement,p,d,e.id),target:XF(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&jI(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:xF(g,i)}))}}if(f.length>0){let e=PI(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function II({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function LI(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function RI(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;LI(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),LI(`target`,s,c,e,i,o),t.set(r.id,r)}}function zI(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:zI(n,t):!1}function BI(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function VI(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!zI(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function HI({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function UI({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=OF(a,t);return{x:o.x-a.x,y:o.y-a.y}}function WI({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=uj(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?yF(oF(s)):null,x=v&&l?UI({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:OF(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=dF({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=HI({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=_F(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=UF(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=VI(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=HI({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=Tj().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=UF(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=YF(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=UF(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=YF(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=YF(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=HI({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!BI(t,`.${g}`,v))&&(!_||BI(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function GI(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())wF(i,xF(e))>0&&r.push(e);return r}var KI=250;function qI(e,t,n,r){let i=[],a=1/0,o=GI(e,n,t+KI);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=_I(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function JI(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,..._I(o,c,c.position,!0)}:c}function YI(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function XI(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var ZI=()=>!0;function QI(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=ZI,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=GF(e.target),E=0,D,{x:O,y:k}=YF(e),A=YI(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=JI(i,A,r,c,t);if(!N)return;let P=YF(e,j),F=!1,I=null,L=!1,ee=null;function te(){if(!u||!j)return;let[e,t]=_F(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(te)}let ne={...N,nodeId:i,type:A,position:N.position},R=c.get(i),z={inProgress:!0,isValid:null,from:_I(R,ne,Z.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:R,to:P,toHandle:null,toPosition:$P[ne.position],toNode:null,pointer:P};function B(){M=!0,y(z),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&B();function re(e){if(!M){let{x:t,y:n}=YF(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;B()}if(!x()||!ne){ie(e);return}let a=b();P=YF(e,j),D=qI(kF(P,a,!1,[1,1]),n,c,ne),F||=(te(),!0);let s=$I(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});ee=s.handleDomNode,I=s.connection,L=XI(!!D,s.isValid);let u=c.get(i),f=u?_I(u,ne,Z.Left,!0):z.from,p={...z,from:f,isValid:L,to:s.toHandle&&L?AF({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:$P[ne.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),z=p}function ie(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||ee)&&I&&L&&h?.(I);let{inProgress:t,...n}=z,r={...n,toPosition:z.toHandle?z.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,L=!1,I=null,ee=null,T.removeEventListener(`mousemove`,re),T.removeEventListener(`mouseup`,ie),T.removeEventListener(`touchmove`,re),T.removeEventListener(`touchend`,ie)}}T.addEventListener(`mousemove`,re),T.addEventListener(`mouseup`,ie),T.addEventListener(`touchmove`,re),T.addEventListener(`touchend`,ie)}function $I(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=ZI,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=YF(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=YI(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===qP.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=JI(t,e,a,u,n,!0)}return _}var eL={onPointerDown:QI,isValid:$I};function tL({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=uj(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&FF()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=HP().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:fj}}var nL=e=>({x:e.x,y:e.y,zoom:e.k}),rL=({x:e,y:t,zoom:n})=>MP.translate(e,t).scale(n),iL=(e,t)=>e.target.closest(`.${t}`),aL=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),oL=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,sL=(e,t=0,n=oL,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},cL=e=>{let t=e.ctrlKey&&FF()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function lL({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(iL(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=fj(u),t=d*2**cL(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===JP.Vertical?0:u.deltaX*f,m=i===JP.Horizontal?0:u.deltaY*f;!FF()&&u.shiftKey&&i!==JP.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=nL(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c?.(u,h),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,s?.(u,h))}}function uL({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=iL(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function dL({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=nL(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function fL({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&aL(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,nL(a.transform))}}function pL({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&aL(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=nL(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function mL({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(iL(d,`${l}-flow__node`)||iL(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||iL(d,s)&&m||iL(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function hL({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=HP().scaleExtent([t,n]).translateExtent(r),f=uj(e).call(d);v({x:i.x,y:i.y,zoom:pF(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let p=f.on(`wheel.zoom`),m=f.on(`dblclick.zoom`);d.wheelDelta(cL);async function h(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?OM:HM).transform(sL(f,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function g({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:h,panOnScrollSpeed:g,preventScrolling:v,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&_();let O=i&&!S&&!r;d.clickDistance(D?1/0:!EF(E)||E<0?0:E);let k=O?lL({zoomPanValues:l,noWheelClassName:e,d3Selection:f,d3Zoom:d,panOnScrollMode:h,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):uL({noWheelClassName:e,preventScrolling:v,d3ZoomHandler:p});f.on(`wheel.zoom`,k,{passive:!1});let A=dL({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});d.on(`start`,A);let j=fL({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});d.on(`zoom`,j);let M=pL({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});d.on(`end`,M);let N=mL({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});d.filter(N),x?f.on(`dblclick.zoom`,m):f.on(`dblclick.zoom`,null)}function _(){d.on(`zoom`,null)}async function v(e,t,n){let r=rL(e),i=d?.constrain()(r,t,n);return i&&await h(i),i}async function y(e,t){let n=rL(e);return await h(n,t),n}function b(e){if(f){let t=rL(e),n=f.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&d?.transform(f,t,null,{sync:!0})}}function x(){let e=f?NP(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function S(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?OM:HM).scaleTo(sL(f,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function C(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?OM:HM).scaleBy(sL(f,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function w(e){d?.scaleExtent(e)}function T(e){d?.translateExtent(e)}function E(e){let t=!EF(e)||e<0?0:e;d?.clickDistance(t)}return{update:g,destroy:_,setViewport:y,setViewportConstrained:v,getViewport:x,scaleTo:S,scaleBy:C,setScaleExtent:w,setTranslateExtent:T,syncViewport:b,setClickDistance:E}}var gL;(function(e){e.Line=`line`,e.Handle=`handle`})(gL||={});function _L({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function vL(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function yL(e,t){return Math.max(0,t-e)}function bL(e,t){return Math.max(0,e-t)}function xL(e,t,n){return Math.max(0,t-e,e-n)}function SL(e,t){return e?!t:t}function CL(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=xL(E,h,g),j=xL(D,_,v);if(o){let e=0,t=0;c&&w<0?e=yL(y+w+O,o[0][0]):!c&&w>0&&(e=bL(y+E+O,o[1][0])),l&&T<0?t=yL(b+T+k,o[0][1]):!l&&T>0&&(t=bL(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=bL(y+w,s[0][0]):!c&&w<0&&(e=yL(y+E,s[1][0])),l&&T>0?t=bL(b+T,s[0][1]):!l&&T<0&&(t=yL(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=xL(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?bL(b+k+E/C,o[1][1])*C:yL(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?yL(b+E/C,s[1][1])*C:bL(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=xL(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?bL(y+D*C+O,o[1][0])/C:yL(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?yL(y+D*C,s[1][0])/C:bL(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(SL(c,l)?-w:w)/C:w=(SL(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var wL={width:0,height:0,x:0,y:0},TL={...wL,pointerX:0,pointerY:0,aspectRatio:1};function EL(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function DL({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=uj(e),o={controlDirection:vL(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...wL},h={...TL};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:vL(e)};let g,_=null,v=[],y,b,x,S=!1,C=Tj().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=UF(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=IF(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=EL(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=UF(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=CL(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,P=A!==f&&M;if(!N&&!P&&!j&&!M)return;if((N||P||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=P?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||M)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=M&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let F=_L({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),I={...m,direction:F};p?.(e,I)!==!1&&(S=!0,d?.(e,I),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var OL=s((e=>{var t=p(),n=rv();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),kL=u(s(((e,t)=>{t.exports=OL()}))(),1),AL=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)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},jL=e=>e?AL(e):AL,{useDebugValue:ML}=b.default,{useSyncExternalStoreWithSelector:NL}=kL.default,PL=e=>e;function FL(e,t=PL,n){let r=NL(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return ML(r),r}var IL=(e,t)=>{let n=jL(e),r=(e,r=t)=>FL(n,e,r);return Object.assign(r,n),r},LL=(e,t)=>e?IL(e,t):IL;function RL(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var zL=(0,b.createContext)(null),BL=zL.Provider,VL=UP.error001(`react`);function HL(e,t){let n=(0,b.useContext)(zL);if(n===null)throw Error(VL);return FL(n,e,t)}function UL(){let e=(0,b.useContext)(zL);if(e===null)throw Error(VL);return(0,b.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var WL={display:`none`},GL={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},KL=`react-flow__node-desc`,qL=`react-flow__edge-desc`,JL=`react-flow__aria-live`,YL=e=>e.ariaLiveMessage,XL=e=>e.ariaLabelConfig;function ZL({rfId:e}){let t=HL(YL);return(0,q.jsx)(`div`,{id:`${JL}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:GL,children:t})}function QL({rfId:e,disableKeyboardA11y:t}){let n=HL(XL);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{id:`${KL}-${e}`,style:WL,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,q.jsx)(`div`,{id:`${qL}-${e}`,style:WL,children:n[`edge.a11yDescription.default`]}),!t&&(0,q.jsx)(ZL,{rfId:e})]})}var $L=(0,b.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>(0,q.jsx)(`div`,{className:ak([`react-flow__panel`,n,...`${e}`.split(`-`)]),style:r,ref:a,...i,children:t}));$L.displayName=`Panel`;function eR({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,q.jsx)($L,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev`,children:(0,q.jsx)(`a`,{href:`https://reactflow.dev`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var tR=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},nR=e=>e.id;function rR(e,t){return RL(e.selectedNodes.map(nR),t.selectedNodes.map(nR))&&RL(e.selectedEdges.map(nR),t.selectedEdges.map(nR))}function iR({onSelectionChange:e}){let t=UL(),{selectedNodes:n,selectedEdges:r}=HL(tR,rR);return(0,b.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var aR=e=>!!e.onSelectionChangeHandlers;function oR({onSelectionChange:e}){let t=HL(aR);return e||t?(0,q.jsx)(iR,{onSelectionChange:e}):null}var sR=[0,0],cR={x:0,y:0,zoom:1},lR=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],uR=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),dR={translateExtent:WP,nodeOrigin:sR,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function fR(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=HL(uR,RL),l=UL();(0,b.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=dR,s()}),[]);let u=(0,b.useRef)(dR);return(0,b.useEffect)(()=>{for(let s of lR){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:HF(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},lR.map(t=>e[t])),null}function pR(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function mR(e){let[t,n]=(0,b.useState)(e===`system`?null:e);return(0,b.useEffect)(()=>{if(e!==`system`){n(e);return}let t=pR(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?pR()?.matches?`dark`:`light`:t}var hR=typeof document<`u`?document:null;function gR(e=null,t={target:hR,actInsideInputWithModifier:!0}){let[n,r]=(0,b.useState)(!1),i=(0,b.useRef)(!1),a=(0,b.useRef)(new Set([])),[o,s]=(0,b.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
|
|
61
61
|
`).replace(`
|
|
62
62
|
|
|
63
63
|
`,`
|
|
64
64
|
+`).split(`
|
|
65
|
-
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,b.useEffect)(()=>{let n=t?.target??PF,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&fN(e))return!1;let n=LF(e.code,s);if(a.current.add(e[n]),IF(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=LF(e.code,s);IF(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function IF(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function LF(e,t){return t.includes(e)?`code`:`key`}var RF=()=>{let e=cF();return(0,b.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=$M(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return JM(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=YM(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function zF(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)BF(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function BF(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing);break}}function VF(e,t){return zF(e,t)}function HF(e,t){return zF(e,t)}function UF(e,t){return{id:e,type:`select`,selected:t}}function WF(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);!(a.selected===void 0&&!e)&&a.selected!==e&&(n&&(a.selected=e),r.push(UF(a.id,e)))}return r}function GF({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function KF(e){return{id:e.id,type:`remove`}}var qF=KM(`React Flow`,`https://reactflow.dev/`);function JF(e,t,n={}){return TN(e,t,{...n,onError:n.onError??qF})}var YF=e=>xM(e),XF=e=>bM(e);function ZF(e){return(0,b.forwardRef)(e)}var QF=typeof window<`u`?b.useLayoutEffect:b.useEffect;function $F(e){let[t,n]=(0,b.useState)(BigInt(0)),[r]=(0,b.useState)(()=>eI(()=>n(e=>e+BigInt(1))));return QF(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function eI(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var tI=(0,b.createContext)(null);function nI({children:e}){let t=cF(),n=$F((0,b.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=GF({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=$F((0,b.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(GF({items:s,lookup:o}))},[])),i=(0,b.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,q.jsx)(tI.Provider,{value:i,children:e})}function rI(){let e=(0,b.useContext)(tI);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var iI=e=>!!e.panZoom;function aI(){let e=RF(),t=cF(),n=rI(),r=sF(iI),i=(0,b.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=YF(e)?e:n.get(e.id),a=i.parentId?iN(i.position,i.measured,i.parentId,n,r):i.position;return BM({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&YF(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&XF(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await jM({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(KF);o?.(f),c(e)}if(m){let e=d.map(KF);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=WM(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=BM(s?r:a),l=UM(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=WM(e)?e:a(e);if(!r)return!1;let i=UM(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return wM(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??oN();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,b.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var oI=e=>e.selected,sI=typeof window<`u`?window:void 0;function cI({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=cF(),{deleteElements:r}=aI(),i=FF(e,{actInsideInputWithModifier:!1}),a=FF(t,{target:sI});(0,b.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(oI),edges:e.filter(oI)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,b.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function lI(e){let t=cF();(0,b.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=lN(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,cM.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var uI={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},dI=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function fI({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=pM.Free,zoomOnDoubleClick:o=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:m,noWheelClassName:h,noPanClassName:g,onViewportChange:_,isControlledViewport:v,paneClickDistance:y,selectionOnDrag:x}){let S=cF(),C=(0,b.useRef)(null),{userSelectionActive:w,lib:T,connectionInProgress:E}=sF(dI,rF),D=FF(f),O=(0,b.useRef)();lI(C);let k=(0,b.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),v||S.setState({transform:e})},[_,v]);return(0,b.useEffect)(()=>{if(C.current){O.current=PP({domNode:C.current,minZoom:u,maxZoom:d,translateExtent:l,viewport:c,onDraggingChange:e=>S.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=S.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=S.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=S.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=O.current.getViewport();return S.setState({panZoom:O.current,transform:[e,t,n],domNode:C.current.closest(`.react-flow`)}),()=>{O.current?.destroy()}}},[]),(0,b.useEffect)(()=>{O.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:s,zoomActivationKeyPressed:D,preventScrolling:p,noPanClassName:g,userSelectionActive:w,noWheelClassName:h,lib:T,onTransformChange:k,connectionInProgress:E,selectionOnDrag:x,paneClickDistance:y})},[e,t,n,r,i,a,o,s,D,p,g,w,h,T,k,E,x,y]),(0,q.jsx)(`div`,{className:`react-flow__renderer`,ref:C,style:uI,children:m})}var pI=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function mI(){let{userSelectionActive:e,userSelectionRect:t}=sF(pI,rF);return e&&t?(0,q.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var hI=(e,t)=>n=>{n.target===t.current&&e?.(n)},gI=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function _I({isSelecting:e,selectionKeyPressed:t,selectionMode:n=mM.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,b.useRef)(0),_=cF(),{userSelectionActive:v,elementsSelectable:y,dragging:x,connectionInProgress:S,panBy:C,autoPanSpeed:w}=sF(gI,rF),T=y&&(e||v),E=(0,b.useRef)(null),D=(0,b.useRef)(),O=(0,b.useRef)(new Set),k=(0,b.useRef)(new Set),A=(0,b.useRef)(!1),j=(0,b.useRef)({x:0,y:0}),M=(0,b.useRef)(!1),N=e=>{if(A.current||S){A.current=!1;return}l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},P=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},F=d?e=>d(e):void 0,I=e=>{A.current&&=(e.stopPropagation(),!1)},L=n=>{let{domNode:r,transform:i}=_.getState();if(D.current=r?.getBoundingClientRect(),!D.current)return;let a=n.target===E.current;if(!a&&n.target.closest(`.nokey`)||!e||!(o&&a||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),A.current=!1;let{x:s,y:c}=mN(n.nativeEvent,D.current),l=JM({x:s,y:c},i);_.setState({userSelectionRect:{width:0,height:0,startX:l.x,startY:l.y,x:s,y:c}}),a||(n.stopPropagation(),n.preventDefault())};function ee(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=YM(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=O.current,g=k.current;O.current=new Set(EM(a,m,i,n===mM.Partial,!0).map(e=>e.id)),k.current=new Set;let v=u?.selectable??!0;for(let e of O.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&k.current.add(e)}}aN(h,O.current)||c(WF(a,O.current,!0)),aN(g,k.current)||l(WF(o,k.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function te(){if(!i||!D.current)return;let[e,t]=IM(j.current,D.current,w);C({x:e,y:t}).then(e=>{if(!A.current||!e){g.current=requestAnimationFrame(te);return}let{x:t,y:n}=j.current;ee(t,n),g.current=requestAnimationFrame(te)})}let ne=()=>{cancelAnimationFrame(g.current),g.current=0,M.current=!1};return(0,b.useEffect)(()=>()=>ne(),[]),(0,q.jsxs)(`div`,{className:wE([`react-flow__pane`,{draggable:r===!0||Array.isArray(r)&&r.includes(0),dragging:x,selection:e}]),onClick:T?void 0:hI(N,E),onContextMenu:hI(P,E),onWheel:hI(F,E),onPointerEnter:T?void 0:f,onPointerMove:T?e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!D.current||!n)return;let{x:o,y:c}=mN(e.nativeEvent,D.current);j.current={x:o,y:c};let l=YM({x:n.startX,y:n.startY},r);if(!A.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}A.current=!0,M.current||=(te(),!0),ee(o,c)}:p,onPointerUp:T?e=>{e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===E.current&&_.getState().userSelectionRect&&N?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),A.current&&(c?.(e),_.setState({nodesSelectionActive:O.current.size>0})),ne())}:void 0,onPointerCancel:T?e=>{e.target?.releasePointerCapture?.(e.pointerId),ne()}:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?I:void 0,onPointerLeave:m,ref:E,style:uI,children:[h,(0,q.jsx)(mI,{})]})}function vI({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,cM.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function yI({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=cF(),[c,l]=(0,b.useState)(!1),u=(0,b.useRef)();return(0,b.useEffect)(()=>{u.current=lP({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{vI({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}})},[]),(0,b.useEffect)(()=>{if(!(t||!e.current||!u.current))return u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{u.current?.destroy()}},[n,r,t,a,e,i,o]),c}var bI=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function xI(){let e=cF();return(0,b.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=bI(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=qM(t,i));let{position:a,positionAbsolute:s}=AM({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var SI=(0,b.createContext)(null),CI=SI.Provider;SI.Consumer;var wI=()=>(0,b.useContext)(SI),TI=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),EI=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o,u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===fM.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function DI({type:e=`source`,position:t=Z.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=cF(),_=wI(),{connectOnClick:v,noPanClassName:y,rfId:b}=sF(TI,rF),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=sF(EI(_,m,e),rF);_||g.getState().onError?.(`010`,cM.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(JF(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=pN(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();yP.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,q.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:wE([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=uN(t.target),h=n||c,{connection:v,isValid:y}=yP.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var OI=(0,b.memo)(ZF(DI));function kI({data:e,isConnectable:t,sourcePosition:n=Z.Bottom}){return(0,q.jsxs)(q.Fragment,{children:[e?.label,(0,q.jsx)(OI,{type:`source`,position:n,isConnectable:t})]})}function AI({data:e,isConnectable:t,targetPosition:n=Z.Top,sourcePosition:r=Z.Bottom}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(OI,{type:`target`,position:n,isConnectable:t}),e?.label,(0,q.jsx)(OI,{type:`source`,position:r,isConnectable:t})]})}function jI(){return null}function MI({data:e,isConnectable:t,targetPosition:n=Z.Top}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(OI,{type:`target`,position:n,isConnectable:t}),e?.label]})}var NI={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},PI={input:kI,default:AI,output:MI,group:jI};function FI(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var II=e=>{let{width:t,height:n,x:r,y:i}=TM(e.nodeLookup,{filter:e=>!!e.selected});return{width:GM(t)?t:null,height:GM(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function LI({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=cF(),{width:i,height:a,transformString:o,userSelectionActive:s}=sF(II,rF),c=xI(),l=(0,b.useRef)(null);(0,b.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(yI({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,q.jsx)(`div`,{className:wE([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,q.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(NI,e.key)&&(e.preventDefault(),c({direction:NI[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var RI=typeof window<`u`?window:void 0,zI=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function BI({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,preventScrolling:A,onSelectionContextMenu:j,noWheelClassName:M,noPanClassName:N,disableKeyboardA11y:P,onViewportChange:F,isControlledViewport:I}){let{nodesSelectionActive:L,userSelectionActive:ee}=sF(zI,rF),te=FF(l,{target:RI}),ne=FF(h,{target:RI}),R=ne||w,z=ne||b,B=u&&R!==!0,re=te||ee||B;return cI({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,q.jsx)(fI,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:z,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!te&&R,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:M,noPanClassName:N,onViewportChange:F,isControlledViewport:I,paneClickDistance:s,selectionOnDrag:B,children:(0,q.jsxs)(_I,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:R,autoPanOnSelection:T,isSelecting:!!re,selectionMode:d,selectionKeyPressed:te,paneClickDistance:s,selectionOnDrag:B,children:[e,L&&(0,q.jsx)(LI,{onSelectionContextMenu:j,noPanClassName:N,disableKeyboardA11y:P})]})})}BI.displayName=`FlowRenderer`;var VI=(0,b.memo)(BI),HI=e=>t=>e?EM(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function UI(e){return sF((0,b.useCallback)(HI(e),[e]),rF)}var WI=e=>e.updateNodeInternals;function GI(){let e=sF(WI),[t]=(0,b.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,b.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function KI({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=cF(),a=(0,b.useRef)(null),o=(0,b.useRef)(null),s=(0,b.useRef)(e.sourcePosition),c=(0,b.useRef)(e.targetPosition),l=(0,b.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,b.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,b.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,b.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function qI({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=sF(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},rF),S=y.type||`default`,C=g?.[S]||PI[S];C===void 0&&(v?.(`003`,cM.error003(S)),S=`default`,C=g?.default||PI.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=cF(),k=rN(y),A=KI({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=yI({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=xI();if(y.hidden)return null;let N=nN(y),P=FI(y),F=T||w||t||n||r||i,I=n?e=>n(e,{...b.userNode}):void 0,L=r?e=>r(e,{...b.userNode}):void 0,ee=i?e=>i(e,{...b.userNode}):void 0,te=a?e=>a(e,{...b.userNode}):void 0,ne=o?e=>o(e,{...b.userNode}):void 0,R=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&vI({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},z=t=>{if(!(fN(t.nativeEvent)||m)){if(uM.includes(t.key)&&T)vI({id:e,store:O,unselect:t.key===`Escape`,nodeRef:A});else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(NI,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),M({direction:NI[t.key],factor:t.shiftKey?4:1})}}},B=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(EM(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+N.width/2,y.position.y+N.height/2,{zoom:t[2]}))};return(0,q.jsx)(`div`,{className:wE([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:F?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:L,onMouseLeave:ee,onContextMenu:te,onClick:R,onDoubleClick:ne,onKeyDown:D?z:void 0,tabIndex:D?0:void 0,onFocus:D?B:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${dF}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,q.jsx)(CI,{value:e,children:(0,q.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...N})})})}var JI=(0,b.memo)(qI),YI=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function XI(e){let{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=sF(YI,rF),o=UI(e.onlyRenderVisibleElements),s=GI();return(0,q.jsx)(`div`,{className:`react-flow__nodes`,style:uI,children:o.map(o=>(0,q.jsx)(JI,{id:o,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},o))})}XI.displayName=`NodeRenderer`;var ZI=(0,b.memo)(XI);function QI(e){return sF((0,b.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&SN({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),rF)}var $I=({color:e=`none`,strokeWidth:t=1})=>(0,q.jsx)(`polyline`,{className:`arrow`,style:{strokeWidth:t,...e&&{stroke:e}},strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`}),eL=({color:e=`none`,strokeWidth:t=1})=>(0,q.jsx)(`polyline`,{className:`arrowclosed`,style:{strokeWidth:t,...e&&{stroke:e,fill:e}},strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`}),tL={[_M.Arrow]:$I,[_M.ArrowClosed]:eL};function nL(e){let t=cF();return(0,b.useMemo)(()=>Object.prototype.hasOwnProperty.call(tL,e)?tL[e]:(t.getState().onError?.(`009`,cM.error009(e)),null),[e])}var rL=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=nL(t);return c?(0,q.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,q.jsx)(c,{color:n,strokeWidth:o})}):null},iL=({defaultColor:e,rfId:t})=>{let n=sF(e=>e.edges),r=sF(e=>e.defaultEdgeOptions),i=(0,b.useMemo)(()=>zN(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,q.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,q.jsx)(`defs`,{children:i.map(e=>(0,q.jsx)(rL,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};iL.displayName=`MarkerDefinitions`;var aL=(0,b.memo)(iL);function oL({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,b.useState)({x:1,y:0,width:0,height:0}),p=wE([`react-flow__edge-textwrapper`,l]),m=(0,b.useRef)(null);return(0,b.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,q.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,q.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,q.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}oL.displayName=`EdgeText`;var sL=(0,b.memo)(oL);function cL({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`path`,{...u,d:e,fill:`none`,className:wE([`react-flow__edge-path`,u.className])}),l?(0,q.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&GM(t)&&GM(n)?(0,q.jsx)(sL,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function lL({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Z.Left||e===Z.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function uL({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:a=Z.Top}){let[o,s]=lL({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=lL({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=gN({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function dL(e){return(0,b.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=uL({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s});return(0,q.jsx)(cL,{id:e.isInternal?void 0:t,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var fL=dL({isInternal:!1}),pL=dL({isInternal:!0});fL.displayName=`SimpleBezierEdge`,pL.displayName=`SimpleBezierEdgeInternal`;function mL(e){return(0,b.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=Z.Bottom,targetPosition:m=Z.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=MN({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition});return(0,q.jsx)(cL,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var hL=mL({isInternal:!1}),gL=mL({isInternal:!0});hL.displayName=`SmoothStepEdge`,gL.displayName=`SmoothStepEdgeInternal`;function _L(e){return(0,b.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,q.jsx)(hL,{...n,id:r,pathOptions:(0,b.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var vL=_L({isInternal:!1}),yL=_L({isInternal:!0});vL.displayName=`StepEdge`,yL.displayName=`StepEdgeInternal`;function bL(e){return(0,b.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=EN({sourceX:n,sourceY:r,targetX:i,targetY:a});return(0,q.jsx)(cL,{id:e.isInternal?void 0:t,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var xL=bL({isInternal:!1}),SL=bL({isInternal:!0});xL.displayName=`StraightEdge`,SL.displayName=`StraightEdgeInternal`;function CL(e){return(0,b.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Z.Bottom,targetPosition:s=Z.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=yN({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature});return(0,q.jsx)(cL,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var wL=CL({isInternal:!1}),TL=CL({isInternal:!0});wL.displayName=`BezierEdge`,TL.displayName=`BezierEdgeInternal`;var EL={default:TL,straight:SL,step:yL,smoothstep:gL,simplebezier:pL},DL={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},OL=(e,t,n)=>n===Z.Left?e-t:n===Z.Right?e+t:e,kL=(e,t,n)=>n===Z.Top?e-t:n===Z.Bottom?e+t:e,AL=`react-flow__edgeupdater`;function jL({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,q.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:wE([AL,`${AL}-${s}`]),cx:OL(t,r,e),cy:kL(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function ML({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=cF(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;yP.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,q.jsxs)(q.Fragment,{children:[(e===!0||e===`source`)&&(0,q.jsx)(jL,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,q.jsx)(jL,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function NL({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let y=sF(t=>t.edgeLookup.get(e)),x=sF(e=>e.defaultEdgeOptions);y=x?{...x,...y}:y;let S=y.type||`default`,C=h?.[S]||EL[S];C===void 0&&(_?.(`011`,cM.error011(S)),S=`default`,C=h?.default||EL.default);let w=!!(y.focusable||t&&y.focusable===void 0),T=d!==void 0&&(y.reconnectable||n&&y.reconnectable===void 0),E=!!(y.selectable||r&&y.selectable===void 0),D=(0,b.useRef)(null),[O,k]=(0,b.useState)(!1),[A,j]=(0,b.useState)(!1),M=cF(),{zIndex:N,sourceX:P,sourceY:F,targetX:I,targetY:L,sourcePosition:ee,targetPosition:te}=sF((0,b.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return{zIndex:y.zIndex,...DL};let i=PN({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_});return{zIndex:xN({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode}),...i||DL}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),rF),ne=(0,b.useMemo)(()=>y.markerStart?`url('#${RN(y.markerStart,m)}')`:void 0,[y.markerStart,m]),R=(0,b.useMemo)(()=>y.markerEnd?`url('#${RN(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||P===null||F===null||I===null||L===null)return null;let z=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=M.getState();E&&(M.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),D.current?.blur()):n([e])),i&&i(t,y)},B=a?e=>{a(e,{...y})}:void 0,re=o?e=>{o(e,{...y})}:void 0,ie=s?e=>{s(e,{...y})}:void 0,ae=c?e=>{c(e,{...y})}:void 0,oe=l?e=>{l(e,{...y})}:void 0;return(0,q.jsx)(`svg`,{style:{zIndex:N},children:(0,q.jsxs)(`g`,{className:wE([`react-flow__edge`,`react-flow__edge-${S}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!E&&!i,updating:O,selectable:E}]),onClick:z,onDoubleClick:B,onContextMenu:re,onMouseEnter:ie,onMouseMove:ae,onMouseLeave:oe,onKeyDown:w?t=>{if(!v&&uM.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=M.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[y]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:y.ariaRole??(w?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":w?`${fF}-${m}`:void 0,ref:D,...y.domAttributes,children:[!A&&(0,q.jsx)(C,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:E,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:P,sourceY:F,targetX:I,targetY:L,sourcePosition:ee,targetPosition:te,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:ne,markerEnd:R,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),T&&(0,q.jsx)(ML,{edge:y,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:P,sourceY:F,targetX:I,targetY:L,sourcePosition:ee,targetPosition:te,setUpdateHover:k,setReconnecting:j})]})})}var PL=(0,b.memo)(NL),FL=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function IL({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=sF(FL,rF),b=QI(t);return(0,q.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,q.jsx)(aL,{defaultColor:e,rfId:n}),b.map(e=>(0,q.jsx)(PL,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}IL.displayName=`EdgeRenderer`;var LL=(0,b.memo)(IL),RL=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function zL({children:e}){return(0,q.jsx)(`div`,{className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:sF(RL)},children:e})}function BL(e){let t=aI(),n=(0,b.useRef)(!1);(0,b.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var VL=e=>e.panZoom?.syncViewport;function HL(e){let t=sF(VL),n=cF();return(0,b.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function UL(e){return e.connection.inProgress?{...e.connection,to:JM(e.connection.to,e.transform)}:{...e.connection}}function WL(e){return e?t=>e(UL(t)):UL}function GL(e){return sF(WL(e),rF)}var KL=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function qL({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=sF(KL,rF);return a&&i&&c?(0,q.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,q.jsx)(`g`,{className:wE([`react-flow__connection`,yM(s)]),children:(0,q.jsx)(JL,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var JL=({style:e,type:t=gM.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=GL();if(!i)return;if(n)return(0,q.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:yM(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case gM.Bezier:[m]=yN(h);break;case gM.SimpleBezier:[m]=uL(h);break;case gM.Step:[m]=MN({...h,borderRadius:0});break;case gM.SmoothStep:[m]=MN(h);break;default:[m]=EN(h)}return(0,q.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};JL.displayName=`ConnectionLine`;var YL={};function XL(e=YL){(0,b.useRef)(e),cF(),(0,b.useEffect)(()=>{},[e])}function ZL(){cF(),(0,b.useRef)(!1),(0,b.useEffect)(()=>{},[])}function QL({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:M,zoomOnScroll:N,zoomOnPinch:P,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:ee,panOnDrag:te,autoPanOnSelection:ne,onPaneClick:R,onPaneMouseEnter:z,onPaneMouseMove:B,onPaneMouseLeave:re,onPaneScroll:ie,onPaneContextMenu:ae,paneClickDistance:oe,nodeClickDistance:se,onEdgeContextMenu:ce,onEdgeMouseEnter:le,onEdgeMouseMove:ue,onEdgeMouseLeave:de,reconnectRadius:fe,onReconnect:pe,onReconnectStart:me,onReconnectEnd:he,noDragClassName:ge,noWheelClassName:_e,noPanClassName:ve,disableKeyboardA11y:ye,nodeExtent:be,rfId:xe,viewport:Se,onViewportChange:Ce}){return XL(e),XL(t),ZL(),BL(n),HL(Se),(0,q.jsx)(VI,{onPaneClick:R,onPaneMouseEnter:z,onPaneMouseMove:B,onPaneMouseLeave:re,onPaneContextMenu:ae,onPaneScroll:ie,paneClickDistance:oe,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:N,zoomOnPinch:P,zoomOnDoubleClick:ee,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,panOnDrag:te,autoPanOnSelection:ne,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:ge,noWheelClassName:_e,noPanClassName:ve,disableKeyboardA11y:ye,onViewportChange:Ce,isControlledViewport:!!Se,children:(0,q.jsxs)(zL,{children:[(0,q.jsx)(LL,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:pe,onReconnectStart:me,onReconnectEnd:he,onlyRenderVisibleElements:T,onEdgeContextMenu:ce,onEdgeMouseEnter:le,onEdgeMouseMove:ue,onEdgeMouseLeave:de,reconnectRadius:fe,defaultMarkerColor:M,noPanClassName:ve,disableKeyboardA11y:ye,rfId:xe}),(0,q.jsx)(qL,{style:h,type:m,component:g,containerStyle:_}),(0,q.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,q.jsx)(ZI,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:se,onlyRenderVisibleElements:T,noPanClassName:ve,noDragClassName:ge,disableKeyboardA11y:ye,nodeExtent:be,rfId:xe}),(0,q.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}QL.displayName=`GraphView`;var $L=(0,b.memo)(QL),eR=KM(`React Flow`,`https://reactflow.dev/`),tR=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??lM;rP(h,g,_);let{nodesInitialized:x}=JN(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=$M(TM(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:lM,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:fM.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...hM},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:eR,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:dM,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},nR=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>nF((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await kM({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...tR({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:i,fitViewQueued:a,zIndexMode:o,nodesSelectionActive:s}=m(),{nodesInitialized:c,hasSelectedNodes:l}=JN(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:i,checkEquality:!0,zIndexMode:o}),u=s&&l;a&&c?(h(),p({nodes:e,nodesInitialized:c,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):p({nodes:e,nodesInitialized:c,nodesSelectionActive:u})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();rP(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=eP(e,n,r,i,a,o,l);d&&(GN(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=IN(e,o.fromHandle,Z.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=$N(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(VF(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(HF(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>UF(e,!0)));return}i(WF(r,new Set([...e]),!0)),a(WF(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>UF(e,!0)));return}a(WF(n,new Set([...e]))),i(WF(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(UF(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(UF(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,UF(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,UF(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();e[0][0]===o[0][0]&&e[0][1]===o[0][1]&&e[1][0]===o[1][0]&&e[1][1]===o[1][1]||(JN(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return tP({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...hM}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...tR()})}},Object.is);function rR({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,b.useState)(()=>nR({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,q.jsx)(aF,{value:m,children:(0,q.jsx)(nI,{children:p})})}function iR({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,b.useContext)(iF)?(0,q.jsx)(q.Fragment,{children:e}):(0,q.jsx)(rR,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var aR={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function oR({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onSelectionChange:A,onSelectionDragStart:j,onSelectionDrag:M,onSelectionDragStop:N,onSelectionContextMenu:P,onSelectionStart:F,onSelectionEnd:I,onBeforeDelete:L,connectionMode:ee,connectionLineType:te=gM.Bezier,connectionLineStyle:ne,connectionLineComponent:R,connectionLineContainerStyle:z,deleteKeyCode:B=`Backspace`,selectionKeyCode:re=`Shift`,selectionOnDrag:ie=!1,selectionMode:ae=mM.Full,panActivationKeyCode:oe=`Space`,multiSelectionKeyCode:se=eN()?`Meta`:`Control`,zoomActivationKeyCode:ce=eN()?`Meta`:`Control`,snapToGrid:le,snapGrid:ue,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:fe,nodesDraggable:pe,autoPanOnNodeFocus:me,nodesConnectable:he,nodesFocusable:ge,nodeOrigin:_e=EF,edgesFocusable:ve,edgesReconnectable:ye,elementsSelectable:be=!0,defaultViewport:xe=DF,minZoom:Se=.5,maxZoom:Ce=2,translateExtent:we=lM,preventScrolling:Te=!0,nodeExtent:V,defaultMarkerColor:Ee=`#b1b1b7`,zoomOnScroll:De=!0,zoomOnPinch:Oe=!0,panOnScroll:ke=!1,panOnScrollSpeed:Ae=.5,panOnScrollMode:je=pM.Free,zoomOnDoubleClick:Me=!0,panOnDrag:Ne=!0,onPaneClick:Pe,onPaneMouseEnter:Fe,onPaneMouseMove:Ie,onPaneMouseLeave:H,onPaneScroll:Le,onPaneContextMenu:Re,paneClickDistance:ze=1,nodeClickDistance:Be=0,children:Ve,onReconnect:He,onReconnectStart:Ue,onReconnectEnd:U,onEdgeContextMenu:We,onEdgeDoubleClick:Ge,onEdgeMouseEnter:Ke,onEdgeMouseMove:qe,onEdgeMouseLeave:Je,reconnectRadius:Ye=10,onNodesChange:Xe,onEdgesChange:Ze,noDragClassName:Qe=`nodrag`,noWheelClassName:$e=`nowheel`,noPanClassName:et=`nopan`,fitView:tt,fitViewOptions:nt,connectOnClick:rt,attributionPosition:it,proOptions:at,defaultEdgeOptions:ot,elevateNodesOnSelect:st=!0,elevateEdgesOnSelect:ct=!1,disableKeyboardA11y:W=!1,autoPanOnConnect:lt,autoPanOnNodeDrag:ut,autoPanOnSelection:dt=!0,autoPanSpeed:ft,connectionRadius:pt,isValidConnection:mt,onError:ht,style:gt,id:_t,nodeDragThreshold:vt,connectionDragThreshold:yt,viewport:bt,onViewportChange:xt,width:St,height:Ct,colorMode:wt=`light`,debug:Tt,onScroll:Et,ariaLabelConfig:Dt,zIndexMode:Ot=`basic`,...kt},At){let jt=_t||`1`,Mt=NF(wt),Nt=(0,b.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Et?.(e)},[Et]);return(0,q.jsx)(`div`,{"data-testid":`rf__wrapper`,...kt,onScroll:Nt,style:{...gt,...aR},ref:At,className:wE([`react-flow`,i,Mt]),id:_t,role:`application`,children:(0,q.jsxs)(iR,{nodes:e,edges:t,width:St,height:Ct,fitView:tt,fitViewOptions:nt,minZoom:Se,maxZoom:Ce,nodeOrigin:_e,nodeExtent:V,zIndexMode:Ot,children:[(0,q.jsx)(jF,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:pe,autoPanOnNodeFocus:me,nodesConnectable:he,nodesFocusable:ge,edgesFocusable:ve,edgesReconnectable:ye,elementsSelectable:be,elevateNodesOnSelect:st,elevateEdgesOnSelect:ct,minZoom:Se,maxZoom:Ce,nodeExtent:V,onNodesChange:Xe,onEdgesChange:Ze,snapToGrid:le,snapGrid:ue,connectionMode:ee,translateExtent:we,connectOnClick:rt,defaultEdgeOptions:ot,fitView:tt,fitViewOptions:nt,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onSelectionDrag:M,onSelectionDragStart:j,onSelectionDragStop:N,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:et,nodeOrigin:_e,rfId:jt,autoPanOnConnect:lt,autoPanOnNodeDrag:ut,autoPanSpeed:ft,onError:ht,connectionRadius:pt,isValidConnection:mt,selectNodesOnDrag:fe,nodeDragThreshold:vt,connectionDragThreshold:yt,onBeforeDelete:L,debug:Tt,ariaLabelConfig:Dt,zIndexMode:Ot}),(0,q.jsx)($L,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,nodeTypes:a,edgeTypes:o,connectionLineType:te,connectionLineStyle:ne,connectionLineComponent:R,connectionLineContainerStyle:z,selectionKeyCode:re,selectionOnDrag:ie,selectionMode:ae,deleteKeyCode:B,multiSelectionKeyCode:se,panActivationKeyCode:oe,zoomActivationKeyCode:ce,onlyRenderVisibleElements:de,defaultViewport:xe,translateExtent:we,minZoom:Se,maxZoom:Ce,preventScrolling:Te,zoomOnScroll:De,zoomOnPinch:Oe,zoomOnDoubleClick:Me,panOnScroll:ke,panOnScrollSpeed:Ae,panOnScrollMode:je,panOnDrag:Ne,autoPanOnSelection:dt,onPaneClick:Pe,onPaneMouseEnter:Fe,onPaneMouseMove:Ie,onPaneMouseLeave:H,onPaneScroll:Le,onPaneContextMenu:Re,paneClickDistance:ze,nodeClickDistance:Be,onSelectionContextMenu:P,onSelectionStart:F,onSelectionEnd:I,onReconnect:He,onReconnectStart:Ue,onReconnectEnd:U,onEdgeContextMenu:We,onEdgeDoubleClick:Ge,onEdgeMouseEnter:Ke,onEdgeMouseMove:qe,onEdgeMouseLeave:Je,reconnectRadius:Ye,defaultMarkerColor:Ee,noDragClassName:Qe,noWheelClassName:$e,noPanClassName:et,rfId:jt,disableKeyboardA11y:W,nodeExtent:V,viewport:bt,onViewportChange:xt}),(0,q.jsx)(TF,{onSelectionChange:A}),Ve,(0,q.jsx)(yF,{proOptions:at,position:it}),(0,q.jsx)(_F,{rfId:jt,disableKeyboardA11y:W})]})})}var sR=ZF(oR);function cR(e){let[t,n]=(0,b.useState)(e);return[t,n,(0,b.useCallback)(e=>n(t=>VF(e,t)),[])]}function lR(e){let[t,n]=(0,b.useState)(e);return[t,n,(0,b.useCallback)(e=>n(t=>HF(e,t)),[])]}cM.error014();function uR({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,q.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:wE([`react-flow__background-pattern`,n,r])})}function dR({radius:e,className:t}){return(0,q.jsx)(`circle`,{cx:e,cy:e,r:e,className:wE([`react-flow__background-pattern`,`dots`,t])})}var fR;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(fR||={});var pR={[fR.Dots]:1,[fR.Lines]:1,[fR.Cross]:6},mR=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function hR({id:e,variant:t=fR.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,b.useRef)(null),{transform:f,patternId:p}=sF(mR,rF),m=r||pR[t],h=t===fR.Dots,g=t===fR.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],y=m*f[2],x=Array.isArray(a)?a:[a,a],S=g?[y,y]:v,C=[x[0]*f[2]||1+S[0]/2,x[1]*f[2]||1+S[1]/2],w=`${p}${e||``}`;return(0,q.jsxs)(`svg`,{className:wE([`react-flow__background`,l]),style:{...c,...uI,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,q.jsx)(`pattern`,{id:w,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${C[0]},-${C[1]})`,children:h?(0,q.jsx)(dR,{radius:y/2,className:u}):(0,q.jsx)(uR,{dimensions:S,lineWidth:i,variant:t,className:u})}),(0,q.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}hR.displayName=`Background`;var gR=(0,b.memo)(hR);function _R(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,q.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function vR(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,q.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function yR(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,q.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function bR(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,q.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function xR(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,q.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function SR({children:e,className:t,...n}){return(0,q.jsx)(`button`,{type:`button`,className:wE([`react-flow__controls-button`,t]),...n,children:e})}var CR=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function wR({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=cF(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=sF(CR,rF),{zoomIn:y,zoomOut:b,fitView:x}=aI();return(0,q.jsxs)(vF,{className:wE([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(SR,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,q.jsx)(_R,{})}),(0,q.jsx)(SR,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,q.jsx)(vR,{})})]}),n&&(0,q.jsx)(SR,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,q.jsx)(yR,{})}),r&&(0,q.jsx)(SR,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,q.jsx)(xR,{}):(0,q.jsx)(bR,{})}),u]})}wR.displayName=`Controls`,(0,b.memo)(wR);function TR({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,q.jsx)(`rect`,{className:wE([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var ER=(0,b.memo)(TR),DR=e=>e.nodes.map(e=>e.id),OR=e=>e instanceof Function?e:()=>e;function kR({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=ER,onClick:o}){let s=sF(DR,rF),c=OR(t),l=OR(e),u=OR(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,q.jsx)(q.Fragment,{children:s.map(e=>(0,q.jsx)(jR,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function AR({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=sF(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=nN(r);return{node:r,x:i,y:a,width:o,height:s}},rF);return!l||l.hidden||!rN(l)?null:(0,q.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var jR=(0,b.memo)(AR),MR=(0,b.memo)(kR),NR=200,PR=150,FR=e=>!e.hidden,IR=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?HM(TM(e.nodeLookup,{filter:FR}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},LR=`react-flow__minimap-desc`;function RR({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:y=1,offsetScale:x=5}){let S=cF(),C=(0,b.useRef)(null),{boundingRect:w,viewBB:T,rfId:E,panZoom:D,translateExtent:O,flowWidth:k,flowHeight:A,ariaLabelConfig:j}=sF(IR,rF),M=e?.width??NR,N=e?.height??PR,P=w.width/M,F=w.height/N,I=Math.max(P,F),L=I*M,ee=I*N,te=x*I,ne=w.x-(L-w.width)/2-te,R=w.y-(ee-w.height)/2-te,z=L+te*2,B=ee+te*2,re=`${LR}-${E}`,ie=(0,b.useRef)(0),ae=(0,b.useRef)();ie.current=I,(0,b.useEffect)(()=>{if(C.current&&D)return ae.current=bP({domNode:C.current,panZoom:D,getTransform:()=>S.getState().transform,getViewScale:()=>ie.current}),()=>{ae.current?.destroy()}},[D]),(0,b.useEffect)(()=>{ae.current?.update({translateExtent:O,width:k,height:A,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,O,k,A]);let oe=p?e=>{let[t,n]=ae.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,se=m?(0,b.useCallback)((e,t)=>{let n=S.getState().nodeLookup.get(t).internals.userNode;m(e,n)},[]):void 0,ce=_??j[`minimap.ariaLabel`];return(0,q.jsx)(vF,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*I:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:wE([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,q.jsxs)(`svg`,{width:M,height:N,viewBox:`${ne} ${R} ${z} ${B}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":re,ref:C,onClick:oe,children:[ce&&(0,q.jsx)(`title`,{id:re,children:ce}),(0,q.jsx)(MR,{onClick:se,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,q.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${ne-te},${R-te}h${z+te*2}v${B+te*2}h${-z-te*2}z
|
|
66
|
-
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}RR.displayName=`MiniMap`,(0,b.memo)(RR);var zR=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,BR={[FP.Line]:`right`,[FP.Handle]:`bottom-right`};function VR({nodeId:e,position:t,variant:n=FP.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=wI(),y=typeof e==`string`?e:v,x=cF(),S=(0,b.useRef)(null),C=n===FP.Handle,w=sF((0,b.useCallback)(zR(C&&p),[C,p]),rF),T=(0,b.useRef)(null),E=t??BR[n];return(0,b.useEffect)(()=>{if(!(!S.current||!y))return T.current||=KP({domNode:S.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=x.getState(),o=[],s={x:e.x,y:e.y},c=r.get(y);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=$N([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...iN({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:y,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:y,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:y,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,h,g,_,m]),(0,q.jsx)(`div`,{className:wE([`react-flow__resize-control`,`nodrag`,...E.split(`-`),n,r]),ref:S,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}(0,b.memo)(VR);var HR=e=>e.definition.nodes.filter(e=>e.type===`input`),UR=e=>e.definition.nodes.filter(e=>e.type===`timer`),WR=(e,t)=>{let n=new Set(e.map(e=>e.id));return Object.fromEntries(Object.entries(t).filter(([e,t])=>n.has(e)&&t!==``))},GR=e=>{let t=Number(e.data.interval_seconds??5);return!Number.isFinite(t)||t<1?1e3:t*1e3},KR=(e,t=new Date)=>String(e.data.mode??`interval`)===`cron`?qR(String(e.data.cron??`* * * * *`),t):GR(e),qR=(e,t=new Date)=>{let n=e.trim().split(/\s+/);if(n.length!==5)return 6e4;let[r,i,a,o,s]=n,c=ZR(r,0,59),l=ZR(i,0,23),u=ZR(a,1,31),d=ZR(o,1,12),f=ZR(s,0,7,e=>e===7?0:e);if(!c||!l||!u||!d||!f)return 6e4;let p=new Date(t);p.setSeconds(0,0),p.setMinutes(p.getMinutes()+1);for(let e=0;e<527040;e+=1){if($R(p,{day:u,hour:l,minute:c,month:d,weekday:f}))return Math.max(1e3,p.getTime()-t.getTime());p.setMinutes(p.getMinutes()+1)}return 6e4},JR=(e,t)=>new Promise((n,r)=>{if(t.aborted){r(new DOMException(`Run stopped.`,`AbortError`));return}let i=()=>{window.clearTimeout(a),r(new DOMException(`Run stopped.`,`AbortError`))},a=window.setTimeout(()=>{t.removeEventListener(`abort`,i),n()},e);t.addEventListener(`abort`,i,{once:!0})}),YR=e=>e instanceof DOMException&&e.name===`AbortError`,XR=e=>e.nodeResults.find(e=>e.status===`failed`)?.error||`Run could not be completed.`,ZR=(e,t,n,r=e=>e)=>{let i=new Set;for(let a of e.split(`,`)){let[e,o]=a.split(`/`),s=o?Number(o):1;if(!Number.isInteger(s)||s<1)return null;let c=QR(e,t,n);if(!c)return null;for(let e=c.start;e<=c.end;e+=s){let a=r(e);if(a<t||a>n)return null;i.add(a)}}return i.size>0?{values:i,wildcard:e===`*`}:null},QR=(e,t,n)=>{if(e===`*`)return{end:n,start:t};let[r,i]=e.split(`-`),a=Number(r),o=i===void 0?a:Number(i);return!Number.isInteger(a)||!Number.isInteger(o)||a<t||o>n||a>o?null:{end:o,start:a}},$R=(e,t)=>{let n=t.day.values.has(e.getDate()),r=t.weekday.values.has(e.getDay()),i=t.day.wildcard||t.weekday.wildcard?n&&r:n||r;return t.minute.values.has(e.getMinutes())&&t.hour.values.has(e.getHours())&&t.month.values.has(e.getMonth()+1)&&i},ez=[{description:`Data entry point`,icon:Gm,label:`Input`,type:`input`},{description:`Agent step`,icon:um,label:`Agent`,type:`agent`},{description:`Combine inputs`,icon:Sm,label:`Merge`,type:`merge`},{description:`Python step`,icon:bm,label:`Code`,type:`code`},{description:`Scheduled trigger`,icon:qm,label:`Timer`,type:`timer`},{description:`Final result`,icon:ym,label:`Output`,type:`output`}],tz={agent:um,code:bm,input:Gm,merge:Sm,output:ym,timer:qm},nz={failed:{border:`border-[#ff7474]/45`,dot:`bg-[#ff7474]`,ring:`flowent-workflow-node-ring-failed`},pending:{border:`border-white/10`,dot:`bg-[#777]`,ring:`flowent-workflow-node-ring-pending`},running:{border:`border-[#7ddf89]/35`,dot:`bg-[#7ddf89]`,ring:`flowent-workflow-node-ring-running`},success:{border:`border-[#7ddf89]/30`,dot:`bg-[#7ddf89]`,ring:`flowent-workflow-node-ring-success`}},rz=e=>e===`input`?{default_value:``,input_type:`text`}:e===`agent`?{agent:`Default agent`,prompt:`{{input.output}}`}:e===`merge`?{merge_strategy:`text`}:e===`code`?{code:`output = input`}:e===`timer`?{cron:`* * * * *`,interval_seconds:5,mode:`interval`,payload:`Timer fired.`}:{output_key:`final_result`,transform:``},iz=()=>({edges:[],nodes:[],version:1}),az=()=>({createdAt:0,definition:iz(),id:dt(),name:`Untitled Workflow`,updatedAt:0}),oz=e=>JSON.parse(JSON.stringify(e)),sz=e=>new Map((e?.nodeResults??[]).map(e=>[e.id,e])),cz=(e,t)=>{let n=sz(t);return e.definition.nodes.map(e=>({data:{description:e.description,label:e.name,result:n.get(e.id),workflowType:e.type},id:e.id,position:e.position,type:`workflowNode`}))},lz=e=>e.definition.edges.map(e=>({data:{label:e.label},id:e.id,label:e.label,markerEnd:{type:_M.ArrowClosed},source:e.source,sourceHandle:e.sourceHandle||void 0,target:e.target,targetHandle:e.targetHandle||void 0})),uz=e=>({id:e.id,label:String(e.label??e.data?.label??``),source:e.source,sourceHandle:e.sourceHandle??``,target:e.target,targetHandle:e.targetHandle??``});function dz({data:e,selected:t}){let n=tz[e.workflowType],r=e.result?.status??`pending`,i=r===`running`,a=(0,b.useRef)(null),o=nz[r],s=(e,t)=>{if(!a.current)return;let n=a.current.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2,o=e-r,s=t-i,c=Math.sqrt(o*o+s*s),l=Math.max(0,1-c/220),u=Math.atan2(s,o)*180/Math.PI+90;a.current.style.setProperty(`--mouse-angle`,`${u}deg`),a.current.style.setProperty(`--mouse-intensity`,l.toString())};return(0,q.jsxs)(`div`,{ref:a,className:W(`group relative isolate flex h-14 w-max min-w-[120px] max-w-[260px] items-center gap-2 overflow-visible rounded-[10px] border bg-[#111]/95 px-2.5 py-2.5 text-white shadow-[0_10px_24px_rgba(0,0,0,0.24)] transition-[border-color] duration-300`,t?`border-white/80 ring-1 ring-white/20`:W(o.border,`hover:border-white/25`)),onMouseEnter:e=>s(e.clientX,e.clientY),onMouseLeave:()=>{a.current&&(a.current.style.setProperty(`--mouse-angle`,`135deg`),a.current.style.setProperty(`--mouse-intensity`,`0`))},onMouseMove:e=>s(e.clientX,e.clientY),style:{"--mouse-angle":`135deg`,"--mouse-intensity":`0`},children:[(0,q.jsx)(`div`,{"aria-hidden":`true`,className:W(`flowent-workflow-node-ring`,o.ring)}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:W(`flowent-workflow-node-loading-border`,i&&`flowent-workflow-node-loading-border-active`)}),e.workflowType!==`input`&&e.workflowType!==`timer`?(0,q.jsx)(OI,{className:`!z-10 !size-3.5 !border !border-black/80 !bg-white/20 !opacity-0 transition-[opacity,transform,box-shadow] duration-150 group-hover:!opacity-100`,id:`in`,position:Z.Left,type:`target`}):null,(0,q.jsx)(`div`,{className:`relative z-10 grid size-8 shrink-0 place-items-center rounded-sm border border-white/10 bg-input/30 text-white`,children:(0,q.jsx)(n,{className:`size-4.5`,"aria-hidden":`true`})}),(0,q.jsxs)(`div`,{className:`relative z-10 flex min-w-0 flex-1 items-center justify-between gap-2`,children:[(0,q.jsx)(`span`,{className:`-translate-y-px truncate text-[13px] leading-5 font-semibold text-white`,title:e.description||e.label,children:e.label}),(0,q.jsx)(`div`,{className:`relative flex items-center pr-0.5`,title:r,"aria-label":r,children:(0,q.jsxs)(`span`,{className:`relative flex size-2.5`,children:[i?(0,q.jsx)(`span`,{className:W(`absolute inline-flex size-full animate-ping rounded-full opacity-40`,o.dot)}):null,(0,q.jsx)(`span`,{className:W(`relative inline-flex size-2.5 rounded-full border border-black/80 shadow-sm`,o.dot)})]})})]}),e.workflowType===`output`?null:(0,q.jsx)(OI,{className:`!z-10 !size-3.5 !border !border-black/80 !bg-white/20 !opacity-0 transition-[opacity,transform,box-shadow] duration-150 group-hover:!opacity-100`,id:`out`,position:Z.Right,type:`source`})]})}var fz={workflowNode:dz};function pz(){let{fitView:e,zoomIn:t,zoomOut:n}=aI();return(0,q.jsxs)(`div`,{className:`absolute top-3 right-3 z-10 flex gap-1 rounded-md border border-white/10 bg-black/80 p-1`,children:[(0,q.jsx)(X,{"aria-label":`Zoom in`,className:`size-7 p-0`,onClick:()=>{t()},size:`icon`,type:`button`,variant:`ghost`,children:(0,q.jsx)(eh,{className:`size-4`,"aria-hidden":`true`})}),(0,q.jsx)(X,{"aria-label":`Zoom out`,className:`size-7 p-0`,onClick:()=>{n()},size:`icon`,type:`button`,variant:`ghost`,children:(0,q.jsx)($m,{className:`size-4`,"aria-hidden":`true`})}),(0,q.jsx)(X,{"aria-label":`Fit view`,className:`size-7 p-0`,onClick:()=>{e({padding:.18})},size:`icon`,type:`button`,variant:`ghost`,children:(0,q.jsx)(Em,{className:`size-4`,"aria-hidden":`true`})})]})}function mz({draftWorkflow:e,isRunning:t,onChange:n,onDirty:r,runResult:i}){let a=(0,b.useRef)(null),{screenToFlowPosition:o}=aI(),s=(0,b.useRef)(e.id),[c,l]=(0,b.useState)(null),[u,d]=cR(cz(e,i)),[f,p]=lR(lz(e)),[m,h]=(0,b.useState)(``),g=(0,b.useRef)(u),_=(0,b.useRef)(f);(0,b.useEffect)(()=>{g.current=u},[u]),(0,b.useEffect)(()=>{_.current=f},[f]),(0,b.useEffect)(()=>{d(cz(e,i)),p(lz(e)),s.current!==e.id&&(s.current=e.id,l(null))},[e,i,p,d]);let v=(0,b.useMemo)(()=>c?.kind===`node`?e.definition.nodes.find(e=>e.id===c.id):null,[e.definition.nodes,c]),y=(0,b.useMemo)(()=>c?.kind===`edge`?e.definition.edges.find(e=>e.id===c.id):null,[e.definition.edges,c]),x=(0,b.useCallback)((t,i)=>{let a=new Map(e.definition.nodes.map(e=>[e.id,e]));n({...e,definition:{...e.definition,edges:i.map(uz),nodes:t.map(e=>{let t=a.get(e.id);return{data:t?.data??{},description:t?.description??``,id:e.id,name:t?.name??e.data.label,position:e.position,type:t?.type??e.data.workflowType}})}}),r()},[e,n,r]),S=(0,b.useCallback)(e=>{p(t=>{let n=JF({...e,data:{label:``},id:ft(`edge`),label:``,markerEnd:{type:_M.ArrowClosed}},t);return _.current=n,window.requestAnimationFrame(()=>{x(g.current,n)}),n})},[x,p]),C=(0,b.useCallback)(e=>{p(t=>{let n=HF(e,t);return _.current=n,e.some(e=>e.type!==`select`)&&window.requestAnimationFrame(()=>{x(g.current,n)}),n})},[x,p]),w=(0,b.useCallback)(e=>{d(t=>{let n=VF(e,t);return g.current=n,e.some(e=>e.type===`remove`||e.type===`add`||e.type===`replace`||e.type===`position`&&e.dragging!==!0)&&window.requestAnimationFrame(()=>{x(n,_.current)}),n})},[x,d]),T=(0,b.useCallback)((t,a={x:120,y:120})=>{let o=ez.find(e=>e.type===t);if(!o)return;let s=ft(t),c={data:rz(t),description:``,id:s,name:o.label,position:a,type:t};n({...e,definition:{...e.definition,nodes:[...e.definition.nodes,c]}}),r(),d(t=>[...t,...cz({...e,definition:{...e.definition,nodes:[c]}},i)]),l({id:s,kind:`node`})},[e,n,r,i,d]),E=(t,i)=>{n({...e,definition:{...e.definition,nodes:e.definition.nodes.map(e=>e.id===t?{...e,...i}:e)}}),r(),d(e=>e.map(e=>e.id===t?{...e,data:{...e.data,description:i.description??e.data.description,label:i.name??e.data.label}}:e))},D=(t,n,r)=>{E(t,{data:{...e.definition.nodes.find(e=>e.id===t)?.data??{},[n]:r}})},O=(t,i)=>{n({...e,definition:{...e.definition,edges:e.definition.edges.map(e=>e.id===t?{...e,...i}:e)}}),r(),p(e=>e.map(e=>e.id===t?{...e,data:{label:i.label??e.data?.label??``},label:i.label??e.label}:e))},k=()=>{if(c){if(c.kind===`node`){let e=u.filter(e=>e.id!==c.id),t=f.filter(e=>e.source!==c.id&&e.target!==c.id);d(e),p(t),x(e,t)}if(c.kind===`edge`){let e=f.filter(e=>e.id!==c.id);p(e),x(u,e)}l(null)}},A=ez.filter(e=>e.label.toLowerCase().includes(m.trim().toLowerCase()));return(0,q.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[200px_minmax(0,1fr)_300px] max-[1100px]:grid-cols-[180px_minmax(0,1fr)_280px] max-[860px]:grid-cols-1 max-[860px]:grid-rows-[auto_minmax(420px,1fr)_auto]`,children:[(0,q.jsxs)(`aside`,{className:`min-h-0 border-r border-white/10 bg-black p-3 max-[860px]:border-r-0 max-[860px]:border-b`,children:[(0,q.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,q.jsx)(`h3`,{className:Jw,children:`Nodes`})}),(0,q.jsxs)(`div`,{className:`relative mt-3`,children:[(0,q.jsx)(Bm,{className:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-[#777]`,"aria-hidden":`true`}),(0,q.jsx)(hT,{className:W(rT,`pl-8`),onChange:e=>h(e.target.value),placeholder:`Search nodes...`,value:m})]}),(0,q.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,q.jsx)(`div`,{className:`text-[11px] leading-4 font-medium text-white/45`,children:`Core`}),A.map(e=>{let t=e.icon;return(0,q.jsxs)(X,{"aria-label":`${e.label} ${e.description}`,className:`h-auto w-full justify-start gap-2 rounded-md border border-white/10 bg-input/30 px-2.5 py-2 text-left text-white shadow-none hover:bg-input/50`,draggable:!0,onClick:()=>T(e.type),onDragStart:t=>{t.dataTransfer.setData(`application/flowent-node`,e.type),t.dataTransfer.effectAllowed=`move`},type:`button`,variant:`ghost`,children:[(0,q.jsx)(t,{className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`min-w-0`,children:[(0,q.jsx)(`span`,{className:`block text-sm leading-5`,children:e.label}),(0,q.jsx)(`span`,{className:`block truncate text-xs leading-4 text-[#9b9b9b]`,children:e.description})]})]},e.type)})]})]}),(0,q.jsxs)(`section`,{className:`relative min-h-0 min-w-0 bg-black`,onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`},onDrop:e=>{e.preventDefault();let t=e.dataTransfer.getData(`application/flowent-node`);ez.some(e=>e.type===t)&&T(t,o({x:e.clientX,y:e.clientY}))},ref:a,children:[u.length===0?(0,q.jsx)(`div`,{className:`pointer-events-none absolute inset-0 z-10 grid place-items-center px-6 text-center text-sm text-[#9b9b9b]`,children:`Drag nodes from the palette to start building your workflow.`}):null,t?(0,q.jsxs)(`div`,{className:`absolute top-3 left-3 z-10 flex items-center gap-2 rounded-md border border-white/10 bg-black/80 px-2.5 py-1.5 text-xs text-[#dedede]`,children:[(0,q.jsx)(Tm,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),`Workflow running...`]}):null,(0,q.jsx)(pz,{}),(0,q.jsx)(sR,{className:`flowent-workflow-canvas`,deleteKeyCode:[`Backspace`,`Delete`],edges:f,fitView:!0,nodes:u,nodeTypes:fz,onConnect:S,onEdgesChange:C,onEdgeClick:(e,t)=>{l({id:t.id,kind:`edge`})},onNodeClick:(e,t)=>{l({id:t.id,kind:`node`})},onNodesChange:w,onPaneClick:()=>l(null),proOptions:{hideAttribution:!0},children:(0,q.jsx)(gR,{color:`rgba(255,255,255,0.08)`,gap:18})})]}),(0,q.jsxs)(`aside`,{className:`min-h-0 overflow-y-auto border-l border-white/10 bg-black p-3 max-[860px]:border-l-0 max-[860px]:border-t`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(`h3`,{className:Jw,children:`Properties`}),c?(0,q.jsx)(X,{"aria-label":`Remove selection`,className:`size-7 p-0 text-[#ff8a8a]`,onClick:k,size:`icon`,type:`button`,variant:`ghost`,children:(0,q.jsx)(Jm,{className:`size-4`,"aria-hidden":`true`})}):null]}),!v&&!y?(0,q.jsx)(`p`,{className:W(eT,`mt-3`),children:`Select a node or edge to view its properties.`}):null,v?(0,q.jsx)(hz,{node:v,onNodeChange:e=>E(v.id,e),onNodeDataChange:(e,t)=>D(v.id,e,t)}):null,y?(0,q.jsx)(gz,{edge:y,onEdgeChange:e=>O(y.id,e)}):null]})]})}function hz({node:e,onNodeChange:t,onNodeDataChange:n}){return(0,q.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,q.jsxs)(`div`,{className:`text-sm font-medium text-white`,children:[e.name,` Properties`]}),(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,htmlFor:`${e.id}-name`,children:`Name`}),(0,q.jsx)(hT,{className:rT,id:`${e.id}-name`,onChange:e=>t({name:e.target.value}),value:e.name})]}),(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,htmlFor:`${e.id}-description`,children:`Description`}),(0,q.jsx)(JT,{className:`min-h-20 rounded-md border-white/10 bg-input/30 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-description`,onChange:e=>t({description:e.target.value}),value:e.description})]}),e.type===`input`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,children:`Type`}),(0,q.jsxs)(_T,{onValueChange:e=>n(`input_type`,e),value:String(e.data.input_type??`text`),children:[(0,q.jsx)(yT,{className:iT,children:(0,q.jsx)(vT,{})}),(0,q.jsxs)(bT,{children:[(0,q.jsx)(xT,{value:`text`,children:`Text`}),(0,q.jsx)(xT,{value:`json`,children:`JSON`}),(0,q.jsx)(xT,{value:`file`,children:`File`})]})]})]}),(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,htmlFor:`${e.id}-default-value`,children:`Default Value`}),(0,q.jsx)(JT,{className:`min-h-24 rounded-md border-white/10 bg-input/30 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-default-value`,onChange:e=>n(`default_value`,e.target.value),value:String(e.data.default_value??``)})]})]}):null,e.type===`agent`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,children:`Agent`}),(0,q.jsxs)(_T,{onValueChange:e=>n(`agent`,e),value:String(e.data.agent??`Default agent`),children:[(0,q.jsx)(yT,{className:iT,children:(0,q.jsx)(vT,{})}),(0,q.jsx)(bT,{children:(0,q.jsx)(xT,{value:`Default agent`,children:`Default agent`})})]})]}),(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,htmlFor:`${e.id}-prompt`,children:`Prompt`}),(0,q.jsx)(JT,{className:`min-h-32 rounded-md border-white/10 bg-input/30 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-prompt`,onChange:e=>n(`prompt`,e.target.value),value:String(e.data.prompt??``)})]}),(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,children:`Parameters`}),(0,q.jsx)(`p`,{className:eT,children:`No parameters set.`})]})]}):null,e.type===`merge`?(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,children:`Merge Strategy`}),(0,q.jsxs)(_T,{onValueChange:e=>n(`merge_strategy`,e),value:String(e.data.merge_strategy??`text`),children:[(0,q.jsx)(yT,{className:iT,children:(0,q.jsx)(vT,{})}),(0,q.jsxs)(bT,{children:[(0,q.jsx)(xT,{value:`text`,children:`Concatenate Text`}),(0,q.jsx)(xT,{value:`json`,children:`JSON Merge`})]})]})]}):null,e.type===`code`?(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,htmlFor:`${e.id}-code`,children:`Python Code`}),(0,q.jsx)(JT,{className:`min-h-40 rounded-md border-white/10 bg-input/30 font-mono text-sm leading-5 text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-code`,onChange:e=>n(`code`,e.target.value),value:String(e.data.code??``)})]}):null,e.type===`timer`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,children:`Mode`}),(0,q.jsxs)(_T,{onValueChange:e=>n(`mode`,e),value:String(e.data.mode??`interval`),children:[(0,q.jsx)(yT,{className:iT,children:(0,q.jsx)(vT,{})}),(0,q.jsxs)(bT,{children:[(0,q.jsx)(xT,{value:`interval`,children:`Interval`}),(0,q.jsx)(xT,{value:`cron`,children:`Cron`})]})]})]}),String(e.data.mode??`interval`)===`cron`?(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,htmlFor:`${e.id}-cron`,children:`Cron`}),(0,q.jsx)(hT,{className:rT,id:`${e.id}-cron`,onChange:e=>n(`cron`,e.target.value),value:String(e.data.cron??``)})]}):(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,htmlFor:`${e.id}-interval`,children:`Interval Seconds`}),(0,q.jsx)(hT,{className:rT,id:`${e.id}-interval`,min:1,onChange:e=>n(`interval_seconds`,e.target.value),type:`number`,value:String(e.data.interval_seconds??`5`)})]}),(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,htmlFor:`${e.id}-payload`,children:`Payload`}),(0,q.jsx)(JT,{className:`min-h-24 rounded-md border-white/10 bg-input/30 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-payload`,onChange:e=>n(`payload`,e.target.value),value:String(e.data.payload??``)})]})]}):null,e.type===`output`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,htmlFor:`${e.id}-output-key`,children:`Output Key`}),(0,q.jsx)(hT,{className:rT,id:`${e.id}-output-key`,onChange:e=>n(`output_key`,e.target.value),value:String(e.data.output_key??``)})]}),(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,htmlFor:`${e.id}-transform`,children:`Transform`}),(0,q.jsx)(JT,{className:`min-h-24 rounded-md border-white/10 bg-input/30 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-transform`,onChange:e=>n(`transform`,e.target.value),value:String(e.data.transform??``)})]})]}):null]})}function gz({edge:e,onEdgeChange:t}){return(0,q.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,q.jsx)(`div`,{className:`text-sm font-medium text-white`,children:`Edge Properties`}),(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,htmlFor:`${e.id}-label`,children:`Label`}),(0,q.jsx)(hT,{className:rT,id:`${e.id}-label`,onChange:e=>t({label:e.target.value}),value:e.label})]})]})}function _z({draftWorkflow:e,inputValues:t,isInputFormOpen:n,isDirty:r,isRunning:i,onCancelInputForm:a,onClose:o,onConfirmInputForm:s,onDelete:c,onDraftChange:l,onInputValueChange:u,onMarkDirty:d,onRun:f,onSave:p,onStop:m,runResult:h}){let g=Object.entries(h?.outputs??{}),_=HR(e),v=UR(e).length>0,y=i&&v;return(0,q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-black`,children:[(0,q.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-2 border-b border-white/10 bg-black px-3`,children:[(0,q.jsx)(hT,{"aria-label":`Workflow name`,className:W(rT,`max-w-[360px]`),onChange:t=>{l({...e,name:t.target.value}),d()},value:e.name}),r?(0,q.jsx)(`span`,{className:`text-xs text-[#9b9b9b]`,children:`Unsaved`}):null,(0,q.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,q.jsxs)(X,{className:W(oT,`gap-1.5 px-2.5`),disabled:!0,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(Xm,{className:`size-4`,"aria-hidden":`true`}),`Undo`]}),(0,q.jsxs)(X,{className:W(oT,`gap-1.5 px-2.5`),disabled:!0,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(Im,{className:`size-4`,"aria-hidden":`true`}),`Redo`]}),(0,q.jsxs)(X,{className:W(oT,`gap-1.5 px-2.5`),onClick:p,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(zm,{className:`size-4`,"aria-hidden":`true`}),`Save`]}),(0,q.jsxs)(X,{className:`h-8 gap-1.5 px-2.5`,disabled:i&&!y,onClick:y?m:f,size:`sm`,type:`button`,variant:i?`outline`:`default`,children:[y?(0,q.jsx)(Gm,{className:`size-4`,"aria-hidden":`true`}):i?(0,q.jsx)(Tm,{className:`size-4 animate-spin`,"aria-hidden":`true`}):(0,q.jsx)(Mm,{className:`size-4`,"aria-hidden":`true`}),y?`Stop`:`Run`]}),(0,q.jsx)(X,{"aria-label":`Delete workflow`,className:`size-8 p-0 text-[#ff8a8a]`,onClick:c,size:`icon`,type:`button`,variant:`ghost`,children:(0,q.jsx)(Jm,{className:`size-4`,"aria-hidden":`true`})}),(0,q.jsx)(X,{"aria-label":`Close editor`,className:`size-8 p-0`,onClick:o,size:`icon`,type:`button`,variant:`ghost`,children:(0,q.jsx)(Qm,{className:`size-4`,"aria-hidden":`true`})})]})]}),n?(0,q.jsx)(vz,{inputNodes:_,inputValues:t,onCancel:a,onChange:u,onStart:s}):null,h?(0,q.jsxs)(`div`,{className:`grid shrink-0 gap-2 border-b border-white/10 px-3 py-2 text-xs text-[#dedede]`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(cm,{className:`size-4 text-[#7ddf89]`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:h.status===`success`?`Run completed.`:`Run failed.`})]}),g.length>0?(0,q.jsx)(`div`,{className:`grid gap-1`,children:g.map(([e,t])=>(0,q.jsxs)(`div`,{className:`grid grid-cols-[minmax(72px,140px)_minmax(0,1fr)] gap-2`,children:[(0,q.jsx)(`span`,{className:`truncate text-[#9b9b9b]`,children:e}),(0,q.jsx)(`span`,{className:`min-w-0 whitespace-pre-wrap break-words text-white`,children:t})]},e))}):null]}):null,(0,q.jsx)(rR,{children:(0,q.jsx)(mz,{draftWorkflow:e,isRunning:i,onChange:l,onDirty:d,runResult:h})})]})}function vz({inputNodes:e,inputValues:t,onCancel:n,onChange:r,onStart:i}){return(0,q.jsxs)(`div`,{className:`grid shrink-0 gap-3 border-b border-white/10 bg-black px-3 py-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`div`,{className:`text-sm font-medium text-white`,children:`Workflow Input`}),(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(X,{className:W(oT,`px-2.5`),onClick:n,size:`sm`,type:`button`,variant:`outline`,children:`Cancel`}),(0,q.jsx)(X,{className:`h-8 px-2.5`,onClick:i,size:`sm`,type:`button`,children:`Start`})]})]}),(0,q.jsx)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:e.map(e=>{let n=String(e.data.default_value??``);return(0,q.jsxs)(`div`,{className:tT,children:[(0,q.jsx)(gT,{className:nT,htmlFor:`${e.id}-run-input`,children:e.name}),(0,q.jsx)(JT,{className:`min-h-20 rounded-md border-white/10 bg-input/30 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-run-input`,onChange:t=>r(e.id,t.target.value),placeholder:n?`Default: ${n}`:`Use default value`,value:t[e.id]??``})]},e.id)})})]})}function yz({activeWorkflow:e,isRunningWorkflow:t,newWorkflowKey:n,onCloseEditor:r,onDeleteWorkflow:i,onFinishWorkflowRun:a,onRunWorkflow:o,onSaveWorkflow:s,runningWorkflowId:c,workflowRunResult:l}){let[u,d]=(0,b.useState)(()=>e?oz(e):az()),[f,p]=(0,b.useState)({}),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(!e),v=BT(),y=(0,b.useRef)(null),x=(0,b.useRef)({newWorkflowKey:n,workflowId:e?.id??``});(0,b.useEffect)(()=>{let t=e?.id??``;x.current.workflowId===t&&x.current.newWorkflowKey===n||(x.current={newWorkflowKey:n,workflowId:t},d(e?oz(e):az()),p({}),h(!1),_(!e))},[e,n]),(0,b.useEffect)(()=>()=>{y.current?.abort()},[]);let S=l?.workflowId===u.id?l:null,C=c===u.id&&t,w=()=>{g&&!window.confirm(`Unsaved changes will be lost. Continue?`)||r()},T=async()=>{let e=await s(u);return e.data?(d(e.data),_(!1),e.data):(v.error(e.error),null)},E=()=>{y.current?.abort(),y.current=null,a(u.id)},D=async(e,t)=>{let n=WR(HR(e),t),r=UR(e);if(r.length===0){let t=await o(e.id,{inputs:n});if(!t.data){v.error(t.error);return}t.data.status===`failed`&&v.error(XR(t.data));return}let i=new AbortController;y.current?.abort(),y.current=i;try{await O(e,r,n,i)}catch(e){YR(e)||v.error(e instanceof Error?e.message:`Run could not be completed.`)}finally{y.current===i&&(y.current=null),a(e.id)}},O=async(e,t,n,r)=>{let i=r.signal;for(let r of t){if(i.aborted)throw new DOMException(`Run stopped.`,`AbortError`);let t=await o(e.id,{inputs:n,signal:i,timerId:r.id});if(!t.data)throw Error(t.error);if(t.data.status===`failed`)throw Error(XR(t.data))}let a=t.map(e=>({nextAt:Date.now()+KR(e),timerNode:e}));for(;!i.aborted;){let t=a.sort((e,t)=>e.nextAt-t.nextAt)[0];if(!t)return;await JR(Math.max(0,t.nextAt-Date.now()),i);let r=await o(e.id,{inputs:n,signal:i,timerId:t.timerNode.id});if(!r.data)throw Error(r.error);if(r.data.status===`failed`)throw Error(XR(r.data));t.nextAt=Date.now()+KR(t.timerNode)}},k=async e=>{let t=await T();t&&(h(!1),await D(t,e))},A=async()=>{let e=HR(u);if(e.length>1){p(Object.fromEntries(e.map(e=>[e.id,f[e.id]??``]))),h(!0);return}await k(f)},j=async()=>{await i(u.id)&&r()};return(0,q.jsx)(_z,{draftWorkflow:u,inputValues:f,isInputFormOpen:m,isDirty:g,isRunning:C,onCancelInputForm:()=>h(!1),onClose:w,onConfirmInputForm:()=>{k(f)},onDelete:()=>{j()},onDraftChange:d,onInputValueChange:(e,t)=>p(n=>({...n,[e]:t})),onMarkDirty:()=>_(!0),onRun:()=>{A()},onSave:()=>{T()},onStop:E,runResult:S})}function bz({delayDuration:e=0,...t}){return(0,q.jsx)(Ow,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function xz({...e}){return(0,q.jsx)(kw,{"data-slot":`tooltip`,...e})}function Sz({...e}){return(0,q.jsx)(Aw,{"data-slot":`tooltip-trigger`,...e})}function Cz({className:e,sideOffset:t=0,children:n,...r}){return(0,q.jsx)(jw,{children:(0,q.jsxs)(Mw,{"data-slot":`tooltip-content`,sideOffset:t,className:W(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,q.jsx)(Nw,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function wz(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Tz=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ez=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dz={};function Oz(e,t){return((t||Dz).jsx?Ez:Tz).test(e)}var kz=/[ \t\n\f\r]/g;function Az(e){return typeof e==`object`?e.type===`text`?jz(e.value):!1:jz(e)}function jz(e){return e.replace(kz,``)===``}var Mz=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Mz.prototype.normal={},Mz.prototype.property={},Mz.prototype.space=void 0;function Nz(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Mz(n,r,t)}function Pz(e){return e.toLowerCase()}var Fz=class{constructor(e,t){this.attribute=t,this.property=e}};Fz.prototype.attribute=``,Fz.prototype.booleanish=!1,Fz.prototype.boolean=!1,Fz.prototype.commaOrSpaceSeparated=!1,Fz.prototype.commaSeparated=!1,Fz.prototype.defined=!1,Fz.prototype.mustUseProperty=!1,Fz.prototype.number=!1,Fz.prototype.overloadedBoolean=!1,Fz.prototype.property=``,Fz.prototype.spaceSeparated=!1,Fz.prototype.space=void 0;var Iz=c({boolean:()=>Rz,booleanish:()=>zz,commaOrSpaceSeparated:()=>Uz,commaSeparated:()=>Hz,number:()=>Q,overloadedBoolean:()=>Bz,spaceSeparated:()=>Vz}),Lz=0,Rz=Wz(),zz=Wz(),Bz=Wz(),Q=Wz(),Vz=Wz(),Hz=Wz(),Uz=Wz();function Wz(){return 2**++Lz}var Gz=Object.keys(Iz),Kz=class extends Fz{constructor(e,t,n,r){let i=-1;if(super(e,t),qz(this,`space`,r),typeof n==`number`)for(;++i<Gz.length;){let e=Gz[i];qz(this,Gz[i],(n&Iz[e])===Iz[e])}}};Kz.prototype.defined=!0;function qz(e,t,n){n&&(e[t]=n)}function Jz(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Kz(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Pz(r)]=r,n[Pz(a.attribute)]=r}return new Mz(t,n,e.space)}var Yz=Jz({properties:{ariaActiveDescendant:null,ariaAtomic:zz,ariaAutoComplete:null,ariaBusy:zz,ariaChecked:zz,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:Vz,ariaCurrent:null,ariaDescribedBy:Vz,ariaDetails:null,ariaDisabled:zz,ariaDropEffect:Vz,ariaErrorMessage:null,ariaExpanded:zz,ariaFlowTo:Vz,ariaGrabbed:zz,ariaHasPopup:null,ariaHidden:zz,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Vz,ariaLevel:Q,ariaLive:null,ariaModal:zz,ariaMultiLine:zz,ariaMultiSelectable:zz,ariaOrientation:null,ariaOwns:Vz,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:zz,ariaReadOnly:zz,ariaRelevant:null,ariaRequired:zz,ariaRoleDescription:Vz,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:zz,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Xz(e,t){return t in e?e[t]:t}function Zz(e,t){return Xz(e,t.toLowerCase())}var Qz=Jz({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Hz,acceptCharset:Vz,accessKey:Vz,action:null,allow:null,allowFullScreen:Rz,allowPaymentRequest:Rz,allowUserMedia:Rz,alt:null,as:null,async:Rz,autoCapitalize:null,autoComplete:Vz,autoFocus:Rz,autoPlay:Rz,blocking:Vz,capture:null,charSet:null,checked:Rz,cite:null,className:Vz,cols:Q,colSpan:null,content:null,contentEditable:zz,controls:Rz,controlsList:Vz,coords:Q|Hz,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Rz,defer:Rz,dir:null,dirName:null,disabled:Rz,download:Bz,draggable:zz,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Rz,formTarget:null,headers:Vz,height:Q,hidden:Bz,high:Q,href:null,hrefLang:null,htmlFor:Vz,httpEquiv:Vz,id:null,imageSizes:null,imageSrcSet:null,inert:Rz,inputMode:null,integrity:null,is:null,isMap:Rz,itemId:null,itemProp:Vz,itemRef:Vz,itemScope:Rz,itemType:Vz,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Rz,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Rz,muted:Rz,name:null,nonce:null,noModule:Rz,noValidate:Rz,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Rz,optimum:Q,pattern:null,ping:Vz,placeholder:null,playsInline:Rz,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Rz,referrerPolicy:null,rel:Vz,required:Rz,reversed:Rz,rows:Q,rowSpan:Q,sandbox:Vz,scope:null,scoped:Rz,seamless:Rz,selected:Rz,shadowRootClonable:Rz,shadowRootDelegatesFocus:Rz,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:zz,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Rz,useMap:null,value:zz,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Vz,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Rz,declare:Rz,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Rz,noHref:Rz,noShade:Rz,noWrap:Rz,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:zz,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Rz,disableRemotePlayback:Rz,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:Zz}),$z=Jz({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,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`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,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`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,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`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Uz,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:Vz,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Rz,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Hz,g2:Hz,glyphName:Hz,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:Uz,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Vz,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Uz,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Uz,rev:Uz,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Uz,requiredFeatures:Uz,requiredFonts:Uz,requiredFormats:Uz,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:Uz,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Uz,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Uz,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Xz}),eB=Jz({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),tB=Jz({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Zz}),nB=Jz({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),rB={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},iB=/[A-Z]/g,aB=/-[a-z]/g,oB=/^data[-\w.:]+$/i;function sB(e,t){let n=Pz(t),r=t,i=Fz;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&oB.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(aB,lB);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!aB.test(e)){let n=e.replace(iB,cB);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Kz}return new i(r,t)}function cB(e){return`-`+e.toLowerCase()}function lB(e){return e.charAt(1).toUpperCase()}var uB=Nz([Yz,Qz,eB,tB,nB],`html`),dB=Nz([Yz,$z,eB,tB,nB],`svg`);function fB(e){return e.join(` `).trim()}var pB=s(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
67
|
-
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),mB=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(pB());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),hB=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),gB=s(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(mB()),r=hB();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),_B=yB(`end`),vB=yB(`start`);function yB(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function bB(e){let t=vB(e),n=_B(e);if(t&&n)return{start:t,end:n}}function xB(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?CB(e.position):`start`in e||`end`in e?CB(e):`line`in e||`column`in e?SB(e):``}function SB(e){return wB(e&&e.line)+`:`+wB(e&&e.column)}function CB(e){return SB(e&&e.start)+`-`+SB(e&&e.end)}function wB(e){return e&&typeof e==`number`?e:1}var TB=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=xB(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};TB.prototype.file=``,TB.prototype.name=``,TB.prototype.reason=``,TB.prototype.message=``,TB.prototype.stack=``,TB.prototype.column=void 0,TB.prototype.line=void 0,TB.prototype.ancestors=void 0,TB.prototype.cause=void 0,TB.prototype.fatal=void 0,TB.prototype.place=void 0,TB.prototype.ruleId=void 0,TB.prototype.source=void 0;var EB=u(gB(),1),DB={}.hasOwnProperty,OB=new Map,kB=/[A-Z]/g,AB=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),jB=new Set([`td`,`th`]),MB=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function NB(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=WB(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=UB(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?dB:uB,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=PB(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function PB(e,t,n){if(t.type===`element`)return FB(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return IB(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return RB(e,t,n);if(t.type===`mdxjsEsm`)return LB(e,t);if(t.type===`root`)return zB(e,t,n);if(t.type===`text`)return BB(e,t)}function FB(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=dB,e.schema=i),e.ancestors.push(t);let a=XB(e,t.tagName,!1),o=GB(e,t),s=qB(e,t);return AB.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!Az(e):!0})),VB(e,o,a,t),HB(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function IB(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}ZB(e,t.position)}function LB(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ZB(e,t.position)}function RB(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=dB,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:XB(e,t.name,!0),o=KB(e,t),s=qB(e,t);return VB(e,o,a,t),HB(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function zB(e,t,n){let r={};return HB(r,qB(e,t)),e.create(t,e.Fragment,r,n)}function BB(e,t){return t.value}function VB(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function HB(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function UB(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function WB(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=vB(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function GB(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&DB.call(t.properties,i)){let a=JB(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&jB.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function KB(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ZB(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else ZB(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function qB(e,t){let n=[],r=-1,i=e.passKeys?new Map:OB;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=PB(e,a,o);s!==void 0&&n.push(s)}return n}function JB(e,t,n){let r=sB(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?wz(n):fB(n)),r.property===`style`){let t=typeof n==`object`?n:YB(e,String(n));return e.stylePropertyNameCase===`css`&&(t=QB(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?rB[r.property]||r.property:r.attribute,n]}}function YB(e,t){try{return(0,EB.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new TB("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=MB+`#cannot-parse-style-attribute`,r}}function XB(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Oz(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Oz(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return DB.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);ZB(e)}function ZB(e,t){let n=new TB("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=MB+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function QB(e){let t={},n;for(n in e)DB.call(e,n)&&(t[$B(n)]=e[n]);return t}function $B(e){let t=e.replace(kB,eV);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function eV(e){return`-`+e.toLowerCase()}var tV={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},nV={};function rV(e,t){let n=t||nV;return iV(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function iV(e,t,n){if(oV(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return aV(e.children,t,n)}return Array.isArray(e)?aV(e,t,n):``}function aV(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=iV(e[i],t,n);return r.join(``)}function oV(e){return!!(e&&typeof e==`object`)}var sV=document.createElement(`i`);function cV(e){let t=`&`+e+`;`;sV.innerHTML=t;let n=sV.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function lV(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function uV(e,t){return e.length>0?(lV(e,e.length,0,t),e):t}var dV={}.hasOwnProperty;function fV(e){let t={},n=-1;for(;++n<e.length;)pV(t,e[n]);return t}function pV(e,t){let n;for(n in t){let r=(dV.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){dV.call(r,a)||(r[a]=[]);let e=i[a];mV(r[a],Array.isArray(e)?e:e?[e]:[])}}}function mV(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);lV(e,0,0,r)}function hV(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function gV(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var _V=OV(/[A-Za-z]/),vV=OV(/[\dA-Za-z]/),yV=OV(/[#-'*+\--9=?A-Z^-~]/);function bV(e){return e!==null&&(e<32||e===127)}var xV=OV(/\d/),SV=OV(/[\dA-Fa-f]/),CV=OV(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function wV(e){return e!==null&&(e<0||e===32)}function TV(e){return e===-2||e===-1||e===32}var EV=OV(/\p{P}|\p{S}/u),DV=OV(/\s/);function OV(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function kV(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&vV(e.charCodeAt(n+1))&&vV(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function AV(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return TV(r)?(e.enter(n),s(r)):t(r)}function s(r){return TV(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var jV={tokenize:MV};function MV(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),AV(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return $(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var NV={tokenize:FV},PV={tokenize:IV};function FV(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return lV(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(PV,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(PV,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return $(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;lV(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function IV(e,t,n){return AV(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function LV(e){if(e===null||wV(e)||DV(e))return 1;if(EV(e))return 2}function RV(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var zV={name:`attention`,resolveAll:BV,tokenize:VV};function BV(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};HV(d,-c),HV(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=uV(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=uV(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=uV(l,RV(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=uV(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=uV(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,lV(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function VV(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=LV(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=LV(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function HV(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var UV={name:`autolink`,tokenize:WV};function WV(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return _V(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||vV(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||vV(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||bV(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):yV(t)?(e.consume(t),l):n(t)}function u(e){return vV(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||vV(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var GV={partial:!0,tokenize:KV};function KV(e,t,n){return r;function r(t){return TV(t)?AV(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||$(e)?t(e):n(e)}}var qV={continuation:{tokenize:YV},exit:XV,name:`blockQuote`,tokenize:JV};function JV(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return TV(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function YV(e,t,n){let r=this;return i;function i(t){return TV(t)?AV(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(qV,t,n)(r)}}function XV(e){e.exit(`blockQuote`)}var ZV={name:`characterEscape`,tokenize:QV};function QV(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return CV(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var $V={name:`characterReference`,tokenize:eH};function eH(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=vV,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=SV,u):(e.enter(`characterReferenceValue`),a=7,o=xV,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===vV&&!cV(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var tH={partial:!0,tokenize:iH},nH={concrete:!0,name:`codeFenced`,tokenize:rH};function rH(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),TV(t)?AV(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||$(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(tH,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):TV(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),AV(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||$(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&TV(t)?AV(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||$(t)?e.check(tH,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||$(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),TV(t)?AV(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),TV(t)?AV(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function iH(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var aH={name:`codeIndented`,tokenize:sH},oH={partial:!0,tokenize:cH};function sH(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),AV(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):$(t)?e.attempt(oH,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||$(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function cH(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):AV(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):$(e)?i(e):n(e)}}var lH={name:`codeText`,previous:dH,resolve:uH,tokenize:fH};function uH(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function dH(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function fH(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||$(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var pH=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&mH(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),mH(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),mH(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);mH(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);mH(this.left,t.reverse())}}};function mH(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function hH(e){let t={},n=-1,r,i,a,o,s,c,l,u=new pH(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,gH(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return lV(e,0,1/0,u.slice(0)),!l}function gH(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var _H={resolve:yH,tokenize:bH},vH={partial:!0,tokenize:xH};function yH(e){return hH(e),e}function bH(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):$(t)?e.check(vH,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function xH(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),AV(e,a,`linePrefix`)}function a(i){if(i===null||$(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function SH(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||bV(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||$(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||wV(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||bV(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function CH(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):$(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!TV(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function wH(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),AV(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||$(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function TH(e,t){let n;return r;function r(i){return $(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):TV(i)?AV(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var EH={name:`definition`,tokenize:OH},DH={partial:!0,tokenize:kH};function OH(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return CH.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=gV(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return wV(t)?TH(e,l)(t):l(t)}function l(t){return SH(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(DH,d,d)(t)}function d(t){return TV(t)?AV(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function kH(e,t,n){return r;function r(t){return wV(t)?TH(e,i)(t):n(t)}function i(t){return wH(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return TV(t)?AV(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||$(e)?t(e):n(e)}}var AH={name:`hardBreakEscape`,tokenize:jH};function jH(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return $(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var MH={name:`headingAtx`,resolve:NH,tokenize:PH};function NH(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},lV(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function PH(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||wV(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||$(n)?(e.exit(`atxHeading`),t(n)):TV(n)?AV(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||wV(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var FH=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),IH=[`pre`,`script`,`style`,`textarea`],LH={concrete:!0,name:`htmlFlow`,resolveTo:BH,tokenize:VH},RH={partial:!0,tokenize:UH},zH={partial:!0,tokenize:HH};function BH(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function VH(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):_V(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):_V(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return _V(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||wV(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&IH.includes(l)?(i=1,r.interrupt?t(s):O(s)):FH.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||vV(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return TV(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||_V(t)?(e.consume(t),b):TV(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||vV(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):TV(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):TV(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||$(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||wV(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||TV(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||$(t)?O(t):TV(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(RH,ee,k)(t)):t===null||$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(zH,A,ee)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||$(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return IH.includes(n)?(e.consume(t),L):O(t)}return _V(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||$(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),L)}function ee(n){return e.exit(`htmlFlow`),t(n)}}function HH(e,t,n){let r=this;return i;function i(t){return $(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function UH(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(GV,t,n)}}var WH={name:`htmlText`,tokenize:GH};function GH(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):_V(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):_V(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):$(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):$(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):$(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):$(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return _V(t)?(e.consume(t),S):n(t)}function S(t){return t===45||vV(t)?(e.consume(t),S):C(t)}function C(t){return $(t)?(o=C,N(t)):TV(t)?(e.consume(t),C):M(t)}function w(t){return t===45||vV(t)?(e.consume(t),w):t===47||t===62||wV(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||_V(t)?(e.consume(t),E):$(t)?(o=T,N(t)):TV(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||vV(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):$(t)?(o=D,N(t)):TV(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):$(t)?(o=O,N(t)):TV(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):$(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||wV(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||wV(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return TV(t)?AV(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var KH={name:`labelEnd`,resolveAll:XH,resolveTo:ZH,tokenize:QH},qH={tokenize:$H},JH={tokenize:eU},YH={tokenize:tU};function XH(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&lV(e,0,e.length,n),e}function ZH(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=uV(s,e.slice(a+1,a+r+3)),s=uV(s,[[`enter`,u,t]]),s=uV(s,RV(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=uV(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=uV(s,e.slice(o+1)),s=uV(s,[[`exit`,c,t]]),lV(e,a,e.length,s),e}function QH(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(gV(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(qH,u,o?u:d)(t):t===91?e.attempt(JH,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(YH,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function $H(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return wV(t)?TH(e,a)(t):a(t)}function a(t){return t===41?u(t):SH(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return wV(t)?TH(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?wH(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return wV(t)?TH(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function eU(e,t,n){let r=this;return i;function i(t){return CH.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(gV(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function tU(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var nU={name:`labelStartImage`,resolveAll:KH.resolveAll,tokenize:rU};function rU(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var iU={name:`labelStartLink`,resolveAll:KH.resolveAll,tokenize:aU};function aU(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var oU={name:`lineEnding`,tokenize:sU};function sU(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),AV(e,t,`linePrefix`)}}var cU={name:`thematicBreak`,tokenize:lU};function lU(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),TV(t)?AV(e,s,`whitespace`)(t):s(t))}}var uU={continuation:{tokenize:mU},exit:gU,name:`list`,tokenize:pU},dU={partial:!0,tokenize:_U},fU={partial:!0,tokenize:hU};function pU(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:xV(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(cU,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return xV(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(GV,r.interrupt?n:u,e.attempt(dU,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return TV(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function mU(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(GV,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,AV(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!TV(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(fU,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,AV(e,e.attempt(uU,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function hU(e,t,n){let r=this;return AV(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function gU(e){e.exit(this.containerState.type)}function _U(e,t,n){let r=this;return AV(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!TV(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var vU={name:`setextUnderline`,resolveTo:yU,tokenize:bU};function yU(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function bU(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),TV(t)?AV(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var xU={tokenize:SU};function SU(e){let t=this,n=e.attempt(GV,r,e.attempt(this.parser.constructs.flowInitial,i,AV(e,e.attempt(this.parser.constructs.flow,i,e.attempt(_H,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var CU={resolveAll:DU()},wU=EU(`string`),TU=EU(`text`);function EU(e){return{resolveAll:DU(e===`text`?OU:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function DU(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function OU(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var kU=c({attentionMarkers:()=>LU,contentInitial:()=>jU,disable:()=>RU,document:()=>AU,flow:()=>NU,flowInitial:()=>MU,insideSpan:()=>IU,string:()=>PU,text:()=>FU}),AU={42:uU,43:uU,45:uU,48:uU,49:uU,50:uU,51:uU,52:uU,53:uU,54:uU,55:uU,56:uU,57:uU,62:qV},jU={91:EH},MU={[-2]:aH,[-1]:aH,32:aH},NU={35:MH,42:cU,45:[vU,cU],60:LH,61:vU,95:cU,96:nH,126:nH},PU={38:$V,92:ZV},FU={[-5]:oU,[-4]:oU,[-3]:oU,33:nU,38:$V,42:zV,60:[UV,WH],91:iU,92:[AH,ZV],93:KH,95:zV,96:lH},IU={null:[zV,CU]},LU={null:[42,95]},RU={null:[]};function zU(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=uV(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=RV(a,l.events,l),l.events):[]}function f(e,t){return VU(p(e),t)}function p(e){return BU(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){$(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&lV(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function BU(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function VU(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
65
|
+
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,b.useEffect)(()=>{let n=t?.target??hR,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&qF(e))return!1;let n=vR(e.code,s);if(a.current.add(e[n]),_R(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=vR(e.code,s);_R(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function _R(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function vR(e,t){return t.includes(e)?`code`:`key`}var yR=()=>{let e=UL();return(0,b.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=PF(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return kF(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=AF(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function bR(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)xR(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function xR(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing);break}}function SR(e,t){return bR(e,t)}function CR(e,t){return bR(e,t)}function wR(e,t){return{id:e,type:`select`,selected:t}}function TR(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);!(a.selected===void 0&&!e)&&a.selected!==e&&(n&&(a.selected=e),r.push(wR(a.id,e)))}return r}function ER({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function DR(e){return{id:e.id,type:`remove`}}var OR=DF(`React Flow`,`https://reactflow.dev/`);function kR(e,t,n={}){return oI(e,t,{...n,onError:n.onError??OR})}var AR=e=>nF(e),jR=e=>tF(e);function MR(e){return(0,b.forwardRef)(e)}var NR=typeof window<`u`?b.useLayoutEffect:b.useEffect;function PR(e){let[t,n]=(0,b.useState)(BigInt(0)),[r]=(0,b.useState)(()=>FR(()=>n(e=>e+BigInt(1))));return NR(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function FR(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var IR=(0,b.createContext)(null);function LR({children:e}){let t=UL(),n=PR((0,b.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=ER({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=PR((0,b.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(ER({items:s,lookup:o}))},[])),i=(0,b.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,q.jsx)(IR.Provider,{value:i,children:e})}function RR(){let e=(0,b.useContext)(IR);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var zR=e=>!!e.panZoom;function BR(){let e=yR(),t=UL(),n=RR(),r=HL(zR),i=(0,b.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=AR(e)?e:n.get(e.id),a=i.parentId?zF(i.position,i.measured,i.parentId,n,r):i.position;return xF({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&AR(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&jR(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await fF({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(DR);o?.(f),c(e)}if(m){let e=d.map(DR);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=TF(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=xF(s?r:a),l=wF(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=TF(e)?e:a(e);if(!r)return!1;let i=wF(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return aF(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??VF();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,b.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var VR=e=>e.selected,HR=typeof window<`u`?window:void 0;function UR({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=UL(),{deleteElements:r}=BR(),i=gR(e,{actInsideInputWithModifier:!1}),a=gR(t,{target:HR});(0,b.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(VR),edges:e.filter(VR)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,b.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function WR(e){let t=UL();(0,b.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=WF(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,UP.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var GR={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},KR=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function qR({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=JP.Free,zoomOnDoubleClick:o=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:m,noWheelClassName:h,noPanClassName:g,onViewportChange:_,isControlledViewport:v,paneClickDistance:y,selectionOnDrag:x}){let S=UL(),C=(0,b.useRef)(null),{userSelectionActive:w,lib:T,connectionInProgress:E}=HL(KR,RL),D=gR(f),O=(0,b.useRef)();WR(C);let k=(0,b.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),v||S.setState({transform:e})},[_,v]);return(0,b.useEffect)(()=>{if(C.current){O.current=hL({domNode:C.current,minZoom:u,maxZoom:d,translateExtent:l,viewport:c,onDraggingChange:e=>S.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=S.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=S.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=S.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=O.current.getViewport();return S.setState({panZoom:O.current,transform:[e,t,n],domNode:C.current.closest(`.react-flow`)}),()=>{O.current?.destroy()}}},[]),(0,b.useEffect)(()=>{O.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:s,zoomActivationKeyPressed:D,preventScrolling:p,noPanClassName:g,userSelectionActive:w,noWheelClassName:h,lib:T,onTransformChange:k,connectionInProgress:E,selectionOnDrag:x,paneClickDistance:y})},[e,t,n,r,i,a,o,s,D,p,g,w,h,T,k,E,x,y]),(0,q.jsx)(`div`,{className:`react-flow__renderer`,ref:C,style:GR,children:m})}var JR=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function YR(){let{userSelectionActive:e,userSelectionRect:t}=HL(JR,RL);return e&&t?(0,q.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var XR=(e,t)=>n=>{n.target===t.current&&e?.(n)},ZR=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function QR({isSelecting:e,selectionKeyPressed:t,selectionMode:n=YP.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,b.useRef)(0),_=UL(),{userSelectionActive:v,elementsSelectable:y,dragging:x,connectionInProgress:S,panBy:C,autoPanSpeed:w}=HL(ZR,RL),T=y&&(e||v),E=(0,b.useRef)(null),D=(0,b.useRef)(),O=(0,b.useRef)(new Set),k=(0,b.useRef)(new Set),A=(0,b.useRef)(!1),j=(0,b.useRef)({x:0,y:0}),M=(0,b.useRef)(!1),N=e=>{if(A.current||S){A.current=!1;return}l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},P=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},F=d?e=>d(e):void 0,I=e=>{A.current&&=(e.stopPropagation(),!1)},L=n=>{let{domNode:r,transform:i}=_.getState();if(D.current=r?.getBoundingClientRect(),!D.current)return;let a=n.target===E.current;if(!a&&n.target.closest(`.nokey`)||!e||!(o&&a||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),A.current=!1;let{x:s,y:c}=YF(n.nativeEvent,D.current),l=kF({x:s,y:c},i);_.setState({userSelectionRect:{width:0,height:0,startX:l.x,startY:l.y,x:s,y:c}}),a||(n.stopPropagation(),n.preventDefault())};function ee(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=AF(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=O.current,g=k.current;O.current=new Set(sF(a,m,i,n===YP.Partial,!0).map(e=>e.id)),k.current=new Set;let v=u?.selectable??!0;for(let e of O.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&k.current.add(e)}}BF(h,O.current)||c(TR(a,O.current,!0)),BF(g,k.current)||l(TR(o,k.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function te(){if(!i||!D.current)return;let[e,t]=_F(j.current,D.current,w);C({x:e,y:t}).then(e=>{if(!A.current||!e){g.current=requestAnimationFrame(te);return}let{x:t,y:n}=j.current;ee(t,n),g.current=requestAnimationFrame(te)})}let ne=()=>{cancelAnimationFrame(g.current),g.current=0,M.current=!1};return(0,b.useEffect)(()=>()=>ne(),[]),(0,q.jsxs)(`div`,{className:ak([`react-flow__pane`,{draggable:r===!0||Array.isArray(r)&&r.includes(0),dragging:x,selection:e}]),onClick:T?void 0:XR(N,E),onContextMenu:XR(P,E),onWheel:XR(F,E),onPointerEnter:T?void 0:f,onPointerMove:T?e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!D.current||!n)return;let{x:o,y:c}=YF(e.nativeEvent,D.current);j.current={x:o,y:c};let l=AF({x:n.startX,y:n.startY},r);if(!A.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}A.current=!0,M.current||=(te(),!0),ee(o,c)}:p,onPointerUp:T?e=>{e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===E.current&&_.getState().userSelectionRect&&N?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),A.current&&(c?.(e),_.setState({nodesSelectionActive:O.current.size>0})),ne())}:void 0,onPointerCancel:T?e=>{e.target?.releasePointerCapture?.(e.pointerId),ne()}:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?I:void 0,onPointerLeave:m,ref:E,style:GR,children:[h,(0,q.jsx)(YR,{})]})}function $R({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,UP.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function ez({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=UL(),[c,l]=(0,b.useState)(!1),u=(0,b.useRef)();return(0,b.useEffect)(()=>{u.current=WI({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{$R({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}})},[]),(0,b.useEffect)(()=>{if(!(t||!e.current||!u.current))return u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{u.current?.destroy()}},[n,r,t,a,e,i,o]),c}var tz=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function nz(){let e=UL();return(0,b.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=tz(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=OF(t,i));let{position:a,positionAbsolute:s}=dF({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var rz=(0,b.createContext)(null),iz=rz.Provider;rz.Consumer;var az=()=>(0,b.useContext)(rz),oz=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),sz=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o,u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===qP.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function cz({type:e=`source`,position:t=Z.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=UL(),_=az(),{connectOnClick:v,noPanClassName:y,rfId:b}=HL(oz,RL),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=HL(sz(_,m,e),RL);_||g.getState().onError?.(`010`,UP.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(kR(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=JF(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();eL.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,q.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:ak([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=GF(t.target),h=n||c,{connection:v,isValid:y}=eL.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var lz=(0,b.memo)(MR(cz));function uz({data:e,isConnectable:t,sourcePosition:n=Z.Bottom}){return(0,q.jsxs)(q.Fragment,{children:[e?.label,(0,q.jsx)(lz,{type:`source`,position:n,isConnectable:t})]})}function dz({data:e,isConnectable:t,targetPosition:n=Z.Top,sourcePosition:r=Z.Bottom}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(lz,{type:`target`,position:n,isConnectable:t}),e?.label,(0,q.jsx)(lz,{type:`source`,position:r,isConnectable:t})]})}function fz(){return null}function pz({data:e,isConnectable:t,targetPosition:n=Z.Top}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(lz,{type:`target`,position:n,isConnectable:t}),e?.label]})}var mz={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},hz={input:uz,default:dz,output:pz,group:fz};function gz(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var _z=e=>{let{width:t,height:n,x:r,y:i}=oF(e.nodeLookup,{filter:e=>!!e.selected});return{width:EF(t)?t:null,height:EF(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function vz({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=UL(),{width:i,height:a,transformString:o,userSelectionActive:s}=HL(_z,RL),c=nz(),l=(0,b.useRef)(null);(0,b.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(ez({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,q.jsx)(`div`,{className:ak([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,q.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(mz,e.key)&&(e.preventDefault(),c({direction:mz[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var yz=typeof window<`u`?window:void 0,bz=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function xz({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,preventScrolling:A,onSelectionContextMenu:j,noWheelClassName:M,noPanClassName:N,disableKeyboardA11y:P,onViewportChange:F,isControlledViewport:I}){let{nodesSelectionActive:L,userSelectionActive:ee}=HL(bz,RL),te=gR(l,{target:yz}),ne=gR(h,{target:yz}),R=ne||w,z=ne||b,B=u&&R!==!0,re=te||ee||B;return UR({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,q.jsx)(qR,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:z,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!te&&R,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:M,noPanClassName:N,onViewportChange:F,isControlledViewport:I,paneClickDistance:s,selectionOnDrag:B,children:(0,q.jsxs)(QR,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:R,autoPanOnSelection:T,isSelecting:!!re,selectionMode:d,selectionKeyPressed:te,paneClickDistance:s,selectionOnDrag:B,children:[e,L&&(0,q.jsx)(vz,{onSelectionContextMenu:j,noPanClassName:N,disableKeyboardA11y:P})]})})}xz.displayName=`FlowRenderer`;var Sz=(0,b.memo)(xz),Cz=e=>t=>e?sF(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function wz(e){return HL((0,b.useCallback)(Cz(e),[e]),RL)}var Tz=e=>e.updateNodeInternals;function Ez(){let e=HL(Tz),[t]=(0,b.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,b.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function Dz({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=UL(),a=(0,b.useRef)(null),o=(0,b.useRef)(null),s=(0,b.useRef)(e.sourcePosition),c=(0,b.useRef)(e.targetPosition),l=(0,b.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,b.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,b.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,b.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function Oz({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=HL(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},RL),S=y.type||`default`,C=g?.[S]||hz[S];C===void 0&&(v?.(`003`,UP.error003(S)),S=`default`,C=g?.default||hz.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=UL(),k=RF(y),A=Dz({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=ez({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=nz();if(y.hidden)return null;let N=LF(y),P=gz(y),F=T||w||t||n||r||i,I=n?e=>n(e,{...b.userNode}):void 0,L=r?e=>r(e,{...b.userNode}):void 0,ee=i?e=>i(e,{...b.userNode}):void 0,te=a?e=>a(e,{...b.userNode}):void 0,ne=o?e=>o(e,{...b.userNode}):void 0,R=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&$R({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},z=t=>{if(!(qF(t.nativeEvent)||m)){if(GP.includes(t.key)&&T)$R({id:e,store:O,unselect:t.key===`Escape`,nodeRef:A});else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(mz,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),M({direction:mz[t.key],factor:t.shiftKey?4:1})}}},B=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(sF(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+N.width/2,y.position.y+N.height/2,{zoom:t[2]}))};return(0,q.jsx)(`div`,{className:ak([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:F?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:L,onMouseLeave:ee,onContextMenu:te,onClick:R,onDoubleClick:ne,onKeyDown:D?z:void 0,tabIndex:D?0:void 0,onFocus:D?B:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${KL}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,q.jsx)(iz,{value:e,children:(0,q.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...N})})})}var kz=(0,b.memo)(Oz),Az=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function jz(e){let{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=HL(Az,RL),o=wz(e.onlyRenderVisibleElements),s=Ez();return(0,q.jsx)(`div`,{className:`react-flow__nodes`,style:GR,children:o.map(o=>(0,q.jsx)(kz,{id:o,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},o))})}jz.displayName=`NodeRenderer`;var Mz=(0,b.memo)(jz);function Nz(e){return HL((0,b.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&rI({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),RL)}var Pz=({color:e=`none`,strokeWidth:t=1})=>(0,q.jsx)(`polyline`,{className:`arrow`,style:{strokeWidth:t,...e&&{stroke:e}},strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`}),Fz=({color:e=`none`,strokeWidth:t=1})=>(0,q.jsx)(`polyline`,{className:`arrowclosed`,style:{strokeWidth:t,...e&&{stroke:e,fill:e}},strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`}),Iz={[QP.Arrow]:Pz,[QP.ArrowClosed]:Fz};function Lz(e){let t=UL();return(0,b.useMemo)(()=>Object.prototype.hasOwnProperty.call(Iz,e)?Iz[e]:(t.getState().onError?.(`009`,UP.error009(e)),null),[e])}var Rz=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=Lz(t);return c?(0,q.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,q.jsx)(c,{color:n,strokeWidth:o})}):null},zz=({defaultColor:e,rfId:t})=>{let n=HL(e=>e.edges),r=HL(e=>e.defaultEdgeOptions),i=(0,b.useMemo)(()=>bI(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,q.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,q.jsx)(`defs`,{children:i.map(e=>(0,q.jsx)(Rz,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};zz.displayName=`MarkerDefinitions`;var Bz=(0,b.memo)(zz);function Vz({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,b.useState)({x:1,y:0,width:0,height:0}),p=ak([`react-flow__edge-textwrapper`,l]),m=(0,b.useRef)(null);return(0,b.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,q.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,q.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,q.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}Vz.displayName=`EdgeText`;var Hz=(0,b.memo)(Vz);function Uz({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`path`,{...u,d:e,fill:`none`,className:ak([`react-flow__edge-path`,u.className])}),l?(0,q.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&EF(t)&&EF(n)?(0,q.jsx)(Hz,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function Wz({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Z.Left||e===Z.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function Gz({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:a=Z.Top}){let[o,s]=Wz({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=Wz({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=ZF({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function Kz(e){return(0,b.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=Gz({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s});return(0,q.jsx)(Uz,{id:e.isInternal?void 0:t,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var qz=Kz({isInternal:!1}),Jz=Kz({isInternal:!0});qz.displayName=`SimpleBezierEdge`,Jz.displayName=`SimpleBezierEdgeInternal`;function Yz(e){return(0,b.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=Z.Bottom,targetPosition:m=Z.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=pI({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition});return(0,q.jsx)(Uz,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var Xz=Yz({isInternal:!1}),Zz=Yz({isInternal:!0});Xz.displayName=`SmoothStepEdge`,Zz.displayName=`SmoothStepEdgeInternal`;function Qz(e){return(0,b.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,q.jsx)(Xz,{...n,id:r,pathOptions:(0,b.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var $z=Qz({isInternal:!1}),eB=Qz({isInternal:!0});$z.displayName=`StepEdge`,eB.displayName=`StepEdgeInternal`;function tB(e){return(0,b.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=sI({sourceX:n,sourceY:r,targetX:i,targetY:a});return(0,q.jsx)(Uz,{id:e.isInternal?void 0:t,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var nB=tB({isInternal:!1}),rB=tB({isInternal:!0});nB.displayName=`StraightEdge`,rB.displayName=`StraightEdgeInternal`;function iB(e){return(0,b.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Z.Bottom,targetPosition:s=Z.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=eI({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature});return(0,q.jsx)(Uz,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var aB=iB({isInternal:!1}),oB=iB({isInternal:!0});aB.displayName=`BezierEdge`,oB.displayName=`BezierEdgeInternal`;var sB={default:oB,straight:rB,step:eB,smoothstep:Zz,simplebezier:Jz},cB={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},lB=(e,t,n)=>n===Z.Left?e-t:n===Z.Right?e+t:e,uB=(e,t,n)=>n===Z.Top?e-t:n===Z.Bottom?e+t:e,dB=`react-flow__edgeupdater`;function fB({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,q.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:ak([dB,`${dB}-${s}`]),cx:lB(t,r,e),cy:uB(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function pB({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=UL(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;eL.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,q.jsxs)(q.Fragment,{children:[(e===!0||e===`source`)&&(0,q.jsx)(fB,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,q.jsx)(fB,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function mB({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let y=HL(t=>t.edgeLookup.get(e)),x=HL(e=>e.defaultEdgeOptions);y=x?{...x,...y}:y;let S=y.type||`default`,C=h?.[S]||sB[S];C===void 0&&(_?.(`011`,UP.error011(S)),S=`default`,C=h?.default||sB.default);let w=!!(y.focusable||t&&y.focusable===void 0),T=d!==void 0&&(y.reconnectable||n&&y.reconnectable===void 0),E=!!(y.selectable||r&&y.selectable===void 0),D=(0,b.useRef)(null),[O,k]=(0,b.useState)(!1),[A,j]=(0,b.useState)(!1),M=UL(),{zIndex:N,sourceX:P,sourceY:F,targetX:I,targetY:L,sourcePosition:ee,targetPosition:te}=HL((0,b.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return{zIndex:y.zIndex,...cB};let i=hI({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_});return{zIndex:nI({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode}),...i||cB}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),RL),ne=(0,b.useMemo)(()=>y.markerStart?`url('#${yI(y.markerStart,m)}')`:void 0,[y.markerStart,m]),R=(0,b.useMemo)(()=>y.markerEnd?`url('#${yI(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||P===null||F===null||I===null||L===null)return null;let z=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=M.getState();E&&(M.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),D.current?.blur()):n([e])),i&&i(t,y)},B=a?e=>{a(e,{...y})}:void 0,re=o?e=>{o(e,{...y})}:void 0,ie=s?e=>{s(e,{...y})}:void 0,ae=c?e=>{c(e,{...y})}:void 0,oe=l?e=>{l(e,{...y})}:void 0;return(0,q.jsx)(`svg`,{style:{zIndex:N},children:(0,q.jsxs)(`g`,{className:ak([`react-flow__edge`,`react-flow__edge-${S}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!E&&!i,updating:O,selectable:E}]),onClick:z,onDoubleClick:B,onContextMenu:re,onMouseEnter:ie,onMouseMove:ae,onMouseLeave:oe,onKeyDown:w?t=>{if(!v&&GP.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=M.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[y]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:y.ariaRole??(w?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":w?`${qL}-${m}`:void 0,ref:D,...y.domAttributes,children:[!A&&(0,q.jsx)(C,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:E,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:P,sourceY:F,targetX:I,targetY:L,sourcePosition:ee,targetPosition:te,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:ne,markerEnd:R,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),T&&(0,q.jsx)(pB,{edge:y,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:P,sourceY:F,targetX:I,targetY:L,sourcePosition:ee,targetPosition:te,setUpdateHover:k,setReconnecting:j})]})})}var hB=(0,b.memo)(mB),gB=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function _B({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=HL(gB,RL),b=Nz(t);return(0,q.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,q.jsx)(Bz,{defaultColor:e,rfId:n}),b.map(e=>(0,q.jsx)(hB,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}_B.displayName=`EdgeRenderer`;var vB=(0,b.memo)(_B),yB=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function bB({children:e}){return(0,q.jsx)(`div`,{className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:HL(yB)},children:e})}function xB(e){let t=BR(),n=(0,b.useRef)(!1);(0,b.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var SB=e=>e.panZoom?.syncViewport;function CB(e){let t=HL(SB),n=UL();return(0,b.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function wB(e){return e.connection.inProgress?{...e.connection,to:kF(e.connection.to,e.transform)}:{...e.connection}}function TB(e){return e?t=>e(wB(t)):wB}function EB(e){return HL(TB(e),RL)}var DB=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function OB({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=HL(DB,RL);return a&&i&&c?(0,q.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,q.jsx)(`g`,{className:ak([`react-flow__connection`,eF(s)]),children:(0,q.jsx)(kB,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var kB=({style:e,type:t=ZP.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=EB();if(!i)return;if(n)return(0,q.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:eF(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case ZP.Bezier:[m]=eI(h);break;case ZP.SimpleBezier:[m]=Gz(h);break;case ZP.Step:[m]=pI({...h,borderRadius:0});break;case ZP.SmoothStep:[m]=pI(h);break;default:[m]=sI(h)}return(0,q.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};kB.displayName=`ConnectionLine`;var AB={};function jB(e=AB){(0,b.useRef)(e),UL(),(0,b.useEffect)(()=>{},[e])}function MB(){UL(),(0,b.useRef)(!1),(0,b.useEffect)(()=>{},[])}function NB({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:M,zoomOnScroll:N,zoomOnPinch:P,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:ee,panOnDrag:te,autoPanOnSelection:ne,onPaneClick:R,onPaneMouseEnter:z,onPaneMouseMove:B,onPaneMouseLeave:re,onPaneScroll:ie,onPaneContextMenu:ae,paneClickDistance:oe,nodeClickDistance:se,onEdgeContextMenu:ce,onEdgeMouseEnter:le,onEdgeMouseMove:ue,onEdgeMouseLeave:de,reconnectRadius:fe,onReconnect:pe,onReconnectStart:me,onReconnectEnd:he,noDragClassName:ge,noWheelClassName:_e,noPanClassName:ve,disableKeyboardA11y:ye,nodeExtent:be,rfId:xe,viewport:Se,onViewportChange:Ce}){return jB(e),jB(t),MB(),xB(n),CB(Se),(0,q.jsx)(Sz,{onPaneClick:R,onPaneMouseEnter:z,onPaneMouseMove:B,onPaneMouseLeave:re,onPaneContextMenu:ae,onPaneScroll:ie,paneClickDistance:oe,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:N,zoomOnPinch:P,zoomOnDoubleClick:ee,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,panOnDrag:te,autoPanOnSelection:ne,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:ge,noWheelClassName:_e,noPanClassName:ve,disableKeyboardA11y:ye,onViewportChange:Ce,isControlledViewport:!!Se,children:(0,q.jsxs)(bB,{children:[(0,q.jsx)(vB,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:pe,onReconnectStart:me,onReconnectEnd:he,onlyRenderVisibleElements:T,onEdgeContextMenu:ce,onEdgeMouseEnter:le,onEdgeMouseMove:ue,onEdgeMouseLeave:de,reconnectRadius:fe,defaultMarkerColor:M,noPanClassName:ve,disableKeyboardA11y:ye,rfId:xe}),(0,q.jsx)(OB,{style:h,type:m,component:g,containerStyle:_}),(0,q.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,q.jsx)(Mz,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:se,onlyRenderVisibleElements:T,noPanClassName:ve,noDragClassName:ge,disableKeyboardA11y:ye,nodeExtent:be,rfId:xe}),(0,q.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}NB.displayName=`GraphView`;var PB=(0,b.memo)(NB),FB=DF(`React Flow`,`https://reactflow.dev/`),IB=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??WP;RI(h,g,_);let{nodesInitialized:x}=kI(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=PF(oF(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:WP,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:qP.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...XP},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:FB,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:KP,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},LB=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>LL((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await uF({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...IB({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:i,fitViewQueued:a,zIndexMode:o,nodesSelectionActive:s}=m(),{nodesInitialized:c,hasSelectedNodes:l}=kI(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:i,checkEquality:!0,zIndexMode:o}),u=s&&l;a&&c?(h(),p({nodes:e,nodesInitialized:c,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):p({nodes:e,nodesInitialized:c,nodesSelectionActive:u})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();RI(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=FI(e,n,r,i,a,o,l);d&&(EI(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=_I(e,o.fromHandle,Z.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=PI(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(SR(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(CR(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>wR(e,!0)));return}i(TR(r,new Set([...e]),!0)),a(TR(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>wR(e,!0)));return}a(TR(n,new Set([...e]))),i(TR(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(wR(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(wR(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,wR(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,wR(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();e[0][0]===o[0][0]&&e[0][1]===o[0][1]&&e[1][0]===o[1][0]&&e[1][1]===o[1][1]||(kI(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return II({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...XP}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...IB()})}},Object.is);function RB({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,b.useState)(()=>LB({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,q.jsx)(BL,{value:m,children:(0,q.jsx)(LR,{children:p})})}function zB({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,b.useContext)(zL)?(0,q.jsx)(q.Fragment,{children:e}):(0,q.jsx)(RB,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var BB={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function VB({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onSelectionChange:A,onSelectionDragStart:j,onSelectionDrag:M,onSelectionDragStop:N,onSelectionContextMenu:P,onSelectionStart:F,onSelectionEnd:I,onBeforeDelete:L,connectionMode:ee,connectionLineType:te=ZP.Bezier,connectionLineStyle:ne,connectionLineComponent:R,connectionLineContainerStyle:z,deleteKeyCode:B=`Backspace`,selectionKeyCode:re=`Shift`,selectionOnDrag:ie=!1,selectionMode:ae=YP.Full,panActivationKeyCode:oe=`Space`,multiSelectionKeyCode:se=FF()?`Meta`:`Control`,zoomActivationKeyCode:ce=FF()?`Meta`:`Control`,snapToGrid:le,snapGrid:ue,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:fe,nodesDraggable:pe,autoPanOnNodeFocus:me,nodesConnectable:he,nodesFocusable:ge,nodeOrigin:_e=sR,edgesFocusable:ve,edgesReconnectable:ye,elementsSelectable:be=!0,defaultViewport:xe=cR,minZoom:Se=.5,maxZoom:Ce=2,translateExtent:we=WP,preventScrolling:Te=!0,nodeExtent:V,defaultMarkerColor:Ee=`#b1b1b7`,zoomOnScroll:De=!0,zoomOnPinch:Oe=!0,panOnScroll:ke=!1,panOnScrollSpeed:Ae=.5,panOnScrollMode:je=JP.Free,zoomOnDoubleClick:Me=!0,panOnDrag:Ne=!0,onPaneClick:Pe,onPaneMouseEnter:Fe,onPaneMouseMove:Ie,onPaneMouseLeave:H,onPaneScroll:Le,onPaneContextMenu:Re,paneClickDistance:ze=1,nodeClickDistance:Be=0,children:Ve,onReconnect:He,onReconnectStart:Ue,onReconnectEnd:U,onEdgeContextMenu:We,onEdgeDoubleClick:Ge,onEdgeMouseEnter:Ke,onEdgeMouseMove:qe,onEdgeMouseLeave:Je,reconnectRadius:Ye=10,onNodesChange:Xe,onEdgesChange:Ze,noDragClassName:Qe=`nodrag`,noWheelClassName:$e=`nowheel`,noPanClassName:et=`nopan`,fitView:tt,fitViewOptions:nt,connectOnClick:rt,attributionPosition:it,proOptions:at,defaultEdgeOptions:ot,elevateNodesOnSelect:st=!0,elevateEdgesOnSelect:ct=!1,disableKeyboardA11y:W=!1,autoPanOnConnect:lt,autoPanOnNodeDrag:ut,autoPanOnSelection:dt=!0,autoPanSpeed:ft,connectionRadius:pt,isValidConnection:mt,onError:ht,style:gt,id:_t,nodeDragThreshold:vt,connectionDragThreshold:yt,viewport:bt,onViewportChange:xt,width:St,height:Ct,colorMode:wt=`light`,debug:Tt,onScroll:Et,ariaLabelConfig:Dt,zIndexMode:Ot=`basic`,...kt},At){let jt=_t||`1`,Mt=mR(wt),Nt=(0,b.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Et?.(e)},[Et]);return(0,q.jsx)(`div`,{"data-testid":`rf__wrapper`,...kt,onScroll:Nt,style:{...gt,...BB},ref:At,className:ak([`react-flow`,i,Mt]),id:_t,role:`application`,children:(0,q.jsxs)(zB,{nodes:e,edges:t,width:St,height:Ct,fitView:tt,fitViewOptions:nt,minZoom:Se,maxZoom:Ce,nodeOrigin:_e,nodeExtent:V,zIndexMode:Ot,children:[(0,q.jsx)(fR,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:pe,autoPanOnNodeFocus:me,nodesConnectable:he,nodesFocusable:ge,edgesFocusable:ve,edgesReconnectable:ye,elementsSelectable:be,elevateNodesOnSelect:st,elevateEdgesOnSelect:ct,minZoom:Se,maxZoom:Ce,nodeExtent:V,onNodesChange:Xe,onEdgesChange:Ze,snapToGrid:le,snapGrid:ue,connectionMode:ee,translateExtent:we,connectOnClick:rt,defaultEdgeOptions:ot,fitView:tt,fitViewOptions:nt,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onSelectionDrag:M,onSelectionDragStart:j,onSelectionDragStop:N,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:et,nodeOrigin:_e,rfId:jt,autoPanOnConnect:lt,autoPanOnNodeDrag:ut,autoPanSpeed:ft,onError:ht,connectionRadius:pt,isValidConnection:mt,selectNodesOnDrag:fe,nodeDragThreshold:vt,connectionDragThreshold:yt,onBeforeDelete:L,debug:Tt,ariaLabelConfig:Dt,zIndexMode:Ot}),(0,q.jsx)(PB,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,nodeTypes:a,edgeTypes:o,connectionLineType:te,connectionLineStyle:ne,connectionLineComponent:R,connectionLineContainerStyle:z,selectionKeyCode:re,selectionOnDrag:ie,selectionMode:ae,deleteKeyCode:B,multiSelectionKeyCode:se,panActivationKeyCode:oe,zoomActivationKeyCode:ce,onlyRenderVisibleElements:de,defaultViewport:xe,translateExtent:we,minZoom:Se,maxZoom:Ce,preventScrolling:Te,zoomOnScroll:De,zoomOnPinch:Oe,zoomOnDoubleClick:Me,panOnScroll:ke,panOnScrollSpeed:Ae,panOnScrollMode:je,panOnDrag:Ne,autoPanOnSelection:dt,onPaneClick:Pe,onPaneMouseEnter:Fe,onPaneMouseMove:Ie,onPaneMouseLeave:H,onPaneScroll:Le,onPaneContextMenu:Re,paneClickDistance:ze,nodeClickDistance:Be,onSelectionContextMenu:P,onSelectionStart:F,onSelectionEnd:I,onReconnect:He,onReconnectStart:Ue,onReconnectEnd:U,onEdgeContextMenu:We,onEdgeDoubleClick:Ge,onEdgeMouseEnter:Ke,onEdgeMouseMove:qe,onEdgeMouseLeave:Je,reconnectRadius:Ye,defaultMarkerColor:Ee,noDragClassName:Qe,noWheelClassName:$e,noPanClassName:et,rfId:jt,disableKeyboardA11y:W,nodeExtent:V,viewport:bt,onViewportChange:xt}),(0,q.jsx)(oR,{onSelectionChange:A}),Ve,(0,q.jsx)(eR,{proOptions:at,position:it}),(0,q.jsx)(QL,{rfId:jt,disableKeyboardA11y:W})]})})}var HB=MR(VB);function UB(e){let[t,n]=(0,b.useState)(e);return[t,n,(0,b.useCallback)(e=>n(t=>SR(e,t)),[])]}function WB(e){let[t,n]=(0,b.useState)(e);return[t,n,(0,b.useCallback)(e=>n(t=>CR(e,t)),[])]}UP.error014();function GB({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,q.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ak([`react-flow__background-pattern`,n,r])})}function KB({radius:e,className:t}){return(0,q.jsx)(`circle`,{cx:e,cy:e,r:e,className:ak([`react-flow__background-pattern`,`dots`,t])})}var qB;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(qB||={});var JB={[qB.Dots]:1,[qB.Lines]:1,[qB.Cross]:6},YB=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function XB({id:e,variant:t=qB.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,b.useRef)(null),{transform:f,patternId:p}=HL(YB,RL),m=r||JB[t],h=t===qB.Dots,g=t===qB.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],y=m*f[2],x=Array.isArray(a)?a:[a,a],S=g?[y,y]:v,C=[x[0]*f[2]||1+S[0]/2,x[1]*f[2]||1+S[1]/2],w=`${p}${e||``}`;return(0,q.jsxs)(`svg`,{className:ak([`react-flow__background`,l]),style:{...c,...GR,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,q.jsx)(`pattern`,{id:w,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${C[0]},-${C[1]})`,children:h?(0,q.jsx)(KB,{radius:y/2,className:u}):(0,q.jsx)(GB,{dimensions:S,lineWidth:i,variant:t,className:u})}),(0,q.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}XB.displayName=`Background`;var ZB=(0,b.memo)(XB);function QB(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,q.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function $B(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,q.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function eV(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,q.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function tV(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,q.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function nV(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,q.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function rV({children:e,className:t,...n}){return(0,q.jsx)(`button`,{type:`button`,className:ak([`react-flow__controls-button`,t]),...n,children:e})}var iV=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function aV({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=UL(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=HL(iV,RL),{zoomIn:y,zoomOut:b,fitView:x}=BR();return(0,q.jsxs)($L,{className:ak([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(rV,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,q.jsx)(QB,{})}),(0,q.jsx)(rV,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,q.jsx)($B,{})})]}),n&&(0,q.jsx)(rV,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,q.jsx)(eV,{})}),r&&(0,q.jsx)(rV,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,q.jsx)(nV,{}):(0,q.jsx)(tV,{})}),u]})}aV.displayName=`Controls`,(0,b.memo)(aV);function oV({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,q.jsx)(`rect`,{className:ak([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var sV=(0,b.memo)(oV),cV=e=>e.nodes.map(e=>e.id),lV=e=>e instanceof Function?e:()=>e;function uV({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=sV,onClick:o}){let s=HL(cV,RL),c=lV(t),l=lV(e),u=lV(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,q.jsx)(q.Fragment,{children:s.map(e=>(0,q.jsx)(fV,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function dV({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=HL(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=LF(r);return{node:r,x:i,y:a,width:o,height:s}},RL);return!l||l.hidden||!RF(l)?null:(0,q.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var fV=(0,b.memo)(dV),pV=(0,b.memo)(uV),mV=200,hV=150,gV=e=>!e.hidden,_V=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?CF(oF(e.nodeLookup,{filter:gV}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},vV=`react-flow__minimap-desc`;function yV({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:y=1,offsetScale:x=5}){let S=UL(),C=(0,b.useRef)(null),{boundingRect:w,viewBB:T,rfId:E,panZoom:D,translateExtent:O,flowWidth:k,flowHeight:A,ariaLabelConfig:j}=HL(_V,RL),M=e?.width??mV,N=e?.height??hV,P=w.width/M,F=w.height/N,I=Math.max(P,F),L=I*M,ee=I*N,te=x*I,ne=w.x-(L-w.width)/2-te,R=w.y-(ee-w.height)/2-te,z=L+te*2,B=ee+te*2,re=`${vV}-${E}`,ie=(0,b.useRef)(0),ae=(0,b.useRef)();ie.current=I,(0,b.useEffect)(()=>{if(C.current&&D)return ae.current=tL({domNode:C.current,panZoom:D,getTransform:()=>S.getState().transform,getViewScale:()=>ie.current}),()=>{ae.current?.destroy()}},[D]),(0,b.useEffect)(()=>{ae.current?.update({translateExtent:O,width:k,height:A,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,O,k,A]);let oe=p?e=>{let[t,n]=ae.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,se=m?(0,b.useCallback)((e,t)=>{let n=S.getState().nodeLookup.get(t).internals.userNode;m(e,n)},[]):void 0,ce=_??j[`minimap.ariaLabel`];return(0,q.jsx)($L,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*I:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:ak([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,q.jsxs)(`svg`,{width:M,height:N,viewBox:`${ne} ${R} ${z} ${B}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":re,ref:C,onClick:oe,children:[ce&&(0,q.jsx)(`title`,{id:re,children:ce}),(0,q.jsx)(pV,{onClick:se,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,q.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${ne-te},${R-te}h${z+te*2}v${B+te*2}h${-z-te*2}z
|
|
66
|
+
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}yV.displayName=`MiniMap`,(0,b.memo)(yV);var bV=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,xV={[gL.Line]:`right`,[gL.Handle]:`bottom-right`};function SV({nodeId:e,position:t,variant:n=gL.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=az(),y=typeof e==`string`?e:v,x=UL(),S=(0,b.useRef)(null),C=n===gL.Handle,w=HL((0,b.useCallback)(bV(C&&p),[C,p]),RL),T=(0,b.useRef)(null),E=t??xV[n];return(0,b.useEffect)(()=>{if(!(!S.current||!y))return T.current||=DL({domNode:S.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=x.getState(),o=[],s={x:e.x,y:e.y},c=r.get(y);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=PI([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...zF({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:y,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:y,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:y,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,h,g,_,m]),(0,q.jsx)(`div`,{className:ak([`react-flow__resize-control`,`nodrag`,...E.split(`-`),n,r]),ref:S,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}(0,b.memo)(SV);var CV=[{description:`Data entry point`,icon:Ym,label:`Input`,type:`input`},{description:`Agent step`,icon:um,label:`Agent`,type:`agent`},{description:`Combine inputs`,icon:Em,label:`Merge`,type:`merge`},{description:`Python step`,icon:Sm,label:`Code`,type:`code`},{description:`Scheduled trigger`,icon:Zm,label:`Timer`,type:`timer`},{description:`Final result`,icon:xm,label:`Output`,type:`output`}],wV={agent:um,code:Sm,input:Ym,merge:Em,output:xm,timer:Zm},TV=e=>e===`input`?{default_value:``,input_type:`text`}:e===`agent`?{agent:`Default agent`,prompt:`{{input.output}}`}:e===`merge`?{merge_strategy:`text`}:e===`code`?{code:`output = input`}:e===`timer`?{cron:`* * * * *`,interval_seconds:5,mode:`interval`,payload:`Timer fired.`}:{output_key:`final_result`,transform:``},EV=()=>({edges:[],nodes:[],version:1}),DV=()=>({createdAt:0,definition:EV(),id:dt(),name:`Untitled Workflow`,updatedAt:0}),OV=e=>JSON.parse(JSON.stringify(e)),kV=e=>new Map((e?.nodeResults??[]).map(e=>[e.id,e])),AV=(e,t)=>{let n=kV(t);return e.definition.nodes.map(e=>({data:{description:e.description,label:e.name,result:n.get(e.id),workflowType:e.type},id:e.id,position:e.position,type:`workflowNode`}))},jV=e=>e.definition.edges.map(e=>({data:{label:e.label},id:e.id,label:e.label,markerEnd:{type:QP.ArrowClosed},source:e.source,sourceHandle:e.sourceHandle||void 0,target:e.target,targetHandle:e.targetHandle||void 0})),MV=e=>({id:e.id,label:String(e.label??e.data?.label??``),source:e.source,sourceHandle:e.sourceHandle??``,target:e.target,targetHandle:e.targetHandle??``});function NV({node:e,onNodeChange:t,onNodeDataChange:n}){return(0,q.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,q.jsxs)(`div`,{className:`text-sm font-medium text-white`,children:[e.name,` Properties`]}),(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,htmlFor:`${e.id}-name`,children:`Name`}),(0,q.jsx)(gD,{className:ND,id:`${e.id}-name`,onChange:e=>t({name:e.target.value}),value:e.name})]}),(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,htmlFor:`${e.id}-description`,children:`Description`}),(0,q.jsx)(kO,{className:`min-h-20 rounded-md border-white/10 bg-input/30 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-description`,onChange:e=>t({description:e.target.value}),value:e.description})]}),e.type===`input`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,children:`Type`}),(0,q.jsxs)(QD,{onValueChange:e=>n(`input_type`,e),value:String(e.data.input_type??`text`),children:[(0,q.jsx)(eO,{className:PD,children:(0,q.jsx)($D,{})}),(0,q.jsxs)(tO,{children:[(0,q.jsx)(nO,{value:`text`,children:`Text`}),(0,q.jsx)(nO,{value:`json`,children:`JSON`}),(0,q.jsx)(nO,{value:`file`,children:`File`})]})]})]}),(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,htmlFor:`${e.id}-default-value`,children:`Default Value`}),(0,q.jsx)(kO,{className:`min-h-24 rounded-md border-white/10 bg-input/30 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-default-value`,onChange:e=>n(`default_value`,e.target.value),value:String(e.data.default_value??``)})]})]}):null,e.type===`agent`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,children:`Agent`}),(0,q.jsxs)(QD,{onValueChange:e=>n(`agent`,e),value:String(e.data.agent??`Default agent`),children:[(0,q.jsx)(eO,{className:PD,children:(0,q.jsx)($D,{})}),(0,q.jsx)(tO,{children:(0,q.jsx)(nO,{value:`Default agent`,children:`Default agent`})})]})]}),(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,htmlFor:`${e.id}-prompt`,children:`Prompt`}),(0,q.jsx)(kO,{className:`min-h-32 rounded-md border-white/10 bg-input/30 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-prompt`,onChange:e=>n(`prompt`,e.target.value),value:String(e.data.prompt??``)})]}),(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,children:`Parameters`}),(0,q.jsx)(`p`,{className:AD,children:`No parameters set.`})]})]}):null,e.type===`merge`?(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,children:`Merge Strategy`}),(0,q.jsxs)(QD,{onValueChange:e=>n(`merge_strategy`,e),value:String(e.data.merge_strategy??`text`),children:[(0,q.jsx)(eO,{className:PD,children:(0,q.jsx)($D,{})}),(0,q.jsxs)(tO,{children:[(0,q.jsx)(nO,{value:`text`,children:`Concatenate Text`}),(0,q.jsx)(nO,{value:`json`,children:`JSON Merge`})]})]})]}):null,e.type===`code`?(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,htmlFor:`${e.id}-code`,children:`Python Code`}),(0,q.jsx)(kO,{className:`min-h-40 rounded-md border-white/10 bg-input/30 font-mono text-sm leading-5 text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-code`,onChange:e=>n(`code`,e.target.value),value:String(e.data.code??``)})]}):null,e.type===`timer`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,children:`Mode`}),(0,q.jsxs)(QD,{onValueChange:e=>n(`mode`,e),value:String(e.data.mode??`interval`),children:[(0,q.jsx)(eO,{className:PD,children:(0,q.jsx)($D,{})}),(0,q.jsxs)(tO,{children:[(0,q.jsx)(nO,{value:`interval`,children:`Interval`}),(0,q.jsx)(nO,{value:`cron`,children:`Cron`})]})]})]}),String(e.data.mode??`interval`)===`cron`?(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,htmlFor:`${e.id}-cron`,children:`Cron`}),(0,q.jsx)(gD,{className:ND,id:`${e.id}-cron`,onChange:e=>n(`cron`,e.target.value),value:String(e.data.cron??``)})]}):(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,htmlFor:`${e.id}-interval`,children:`Interval Seconds`}),(0,q.jsx)(gD,{className:ND,id:`${e.id}-interval`,min:1,onChange:e=>n(`interval_seconds`,e.target.value),type:`number`,value:String(e.data.interval_seconds??`5`)})]}),(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,htmlFor:`${e.id}-payload`,children:`Payload`}),(0,q.jsx)(kO,{className:`min-h-24 rounded-md border-white/10 bg-input/30 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-payload`,onChange:e=>n(`payload`,e.target.value),value:String(e.data.payload??``)})]})]}):null,e.type===`output`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,htmlFor:`${e.id}-output-key`,children:`Output Key`}),(0,q.jsx)(gD,{className:ND,id:`${e.id}-output-key`,onChange:e=>n(`output_key`,e.target.value),value:String(e.data.output_key??``)})]}),(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,htmlFor:`${e.id}-transform`,children:`Transform`}),(0,q.jsx)(kO,{className:`min-h-24 rounded-md border-white/10 bg-input/30 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-transform`,onChange:e=>n(`transform`,e.target.value),value:String(e.data.transform??``)})]})]}):null]})}function PV({edge:e,onEdgeChange:t}){return(0,q.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,q.jsx)(`div`,{className:`text-sm font-medium text-white`,children:`Edge Properties`}),(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,htmlFor:`${e.id}-label`,children:`Label`}),(0,q.jsx)(gD,{className:ND,id:`${e.id}-label`,onChange:e=>t({label:e.target.value}),value:e.label})]})]})}var FV={failed:{border:`border-[#ff7474]/45`,dot:`bg-[#ff7474]`,ring:`flowent-workflow-node-ring-failed`},pending:{border:`border-white/10`,dot:`bg-[#777]`,ring:`flowent-workflow-node-ring-pending`},running:{border:`border-[#7ddf89]/35`,dot:`bg-[#7ddf89]`,ring:`flowent-workflow-node-ring-running`},success:{border:`border-[#7ddf89]/30`,dot:`bg-[#7ddf89]`,ring:`flowent-workflow-node-ring-success`}};function IV({data:e,selected:t}){let n=wV[e.workflowType],r=e.result?.status??`pending`,i=r===`running`,a=(0,b.useRef)(null),o=FV[r],s=(e,t)=>{if(!a.current)return;let n=a.current.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2,o=e-r,s=t-i,c=Math.sqrt(o*o+s*s),l=Math.max(0,1-c/220),u=Math.atan2(s,o)*180/Math.PI+90;a.current.style.setProperty(`--mouse-angle`,`${u}deg`),a.current.style.setProperty(`--mouse-intensity`,l.toString())};return(0,q.jsxs)(`div`,{ref:a,className:W(`group relative isolate flex h-14 w-max min-w-[120px] max-w-[260px] items-center gap-2 overflow-visible rounded-[10px] border bg-[#111]/95 px-2.5 py-2.5 text-white shadow-[0_10px_24px_rgba(0,0,0,0.24)] transition-[border-color] duration-300`,t?`border-white/80 ring-1 ring-white/20`:W(o.border,`hover:border-white/25`)),onMouseEnter:e=>s(e.clientX,e.clientY),onMouseLeave:()=>{a.current&&(a.current.style.setProperty(`--mouse-angle`,`135deg`),a.current.style.setProperty(`--mouse-intensity`,`0`))},onMouseMove:e=>s(e.clientX,e.clientY),style:{"--mouse-angle":`135deg`,"--mouse-intensity":`0`},children:[(0,q.jsx)(`div`,{"aria-hidden":`true`,className:W(`flowent-workflow-node-ring`,o.ring)}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:W(`flowent-workflow-node-loading-border`,i&&`flowent-workflow-node-loading-border-active`)}),e.workflowType!==`input`&&e.workflowType!==`timer`?(0,q.jsx)(lz,{className:`!z-10 !size-3.5 !border !border-black/80 !bg-white/20 !opacity-0 transition-[opacity,transform,box-shadow] duration-150 group-hover:!opacity-100`,id:`in`,position:Z.Left,type:`target`}):null,(0,q.jsx)(`div`,{className:`relative z-10 grid size-8 shrink-0 place-items-center rounded-sm border border-white/10 bg-input/30 text-white`,children:(0,q.jsx)(n,{className:`size-4.5`,"aria-hidden":`true`})}),(0,q.jsxs)(`div`,{className:`relative z-10 flex min-w-0 flex-1 items-center justify-between gap-2`,children:[(0,q.jsx)(`span`,{className:`-translate-y-px truncate text-[13px] leading-5 font-semibold text-white`,title:e.description||e.label,children:e.label}),(0,q.jsx)(`div`,{className:`relative flex items-center pr-0.5`,title:r,"aria-label":r,children:(0,q.jsxs)(`span`,{className:`relative flex size-2.5`,children:[i?(0,q.jsx)(`span`,{className:W(`absolute inline-flex size-full animate-ping rounded-full opacity-40`,o.dot)}):null,(0,q.jsx)(`span`,{className:W(`relative inline-flex size-2.5 rounded-full border border-black/80 shadow-sm`,o.dot)})]})})]}),e.workflowType===`output`?null:(0,q.jsx)(lz,{className:`!z-10 !size-3.5 !border !border-black/80 !bg-white/20 !opacity-0 transition-[opacity,transform,box-shadow] duration-150 group-hover:!opacity-100`,id:`out`,position:Z.Right,type:`source`})]})}var LV={workflowNode:IV};function RV(){let{fitView:e,zoomIn:t,zoomOut:n}=BR();return(0,q.jsxs)(`div`,{className:`absolute top-3 right-3 z-10 flex gap-1 rounded-md border border-white/10 bg-black/80 p-1`,children:[(0,q.jsx)(X,{"aria-label":`Zoom in`,className:`size-7 p-0`,onClick:()=>{t()},size:`icon`,type:`button`,variant:`ghost`,children:(0,q.jsx)(ih,{className:`size-4`,"aria-hidden":`true`})}),(0,q.jsx)(X,{"aria-label":`Zoom out`,className:`size-7 p-0`,onClick:()=>{n()},size:`icon`,type:`button`,variant:`ghost`,children:(0,q.jsx)(rh,{className:`size-4`,"aria-hidden":`true`})}),(0,q.jsx)(X,{"aria-label":`Fit view`,className:`size-7 p-0`,onClick:()=>{e({padding:.18})},size:`icon`,type:`button`,variant:`ghost`,children:(0,q.jsx)(Am,{className:`size-4`,"aria-hidden":`true`})})]})}function zV({draftWorkflow:e,isRunning:t,onChange:n,onDirty:r,runResult:i}){let a=(0,b.useRef)(null),{screenToFlowPosition:o}=BR(),s=(0,b.useRef)(e.id),[c,l]=(0,b.useState)(null),[u,d]=UB(AV(e,i)),[f,p]=WB(jV(e)),[m,h]=(0,b.useState)(``),g=(0,b.useRef)(u),_=(0,b.useRef)(f);(0,b.useEffect)(()=>{g.current=u},[u]),(0,b.useEffect)(()=>{_.current=f},[f]),(0,b.useEffect)(()=>{d(AV(e,i)),p(jV(e)),s.current!==e.id&&(s.current=e.id,l(null))},[e,i,p,d]);let v=(0,b.useMemo)(()=>c?.kind===`node`?e.definition.nodes.find(e=>e.id===c.id):null,[e.definition.nodes,c]),y=(0,b.useMemo)(()=>c?.kind===`edge`?e.definition.edges.find(e=>e.id===c.id):null,[e.definition.edges,c]),x=(0,b.useCallback)((t,i)=>{let a=new Map(e.definition.nodes.map(e=>[e.id,e]));n({...e,definition:{...e.definition,edges:i.map(MV),nodes:t.map(e=>{let t=a.get(e.id);return{data:t?.data??{},description:t?.description??``,id:e.id,name:t?.name??e.data.label,position:e.position,type:t?.type??e.data.workflowType}})}}),r()},[e,n,r]),S=(0,b.useCallback)(e=>{p(t=>{let n=kR({...e,data:{label:``},id:ft(`edge`),label:``,markerEnd:{type:QP.ArrowClosed}},t);return _.current=n,window.requestAnimationFrame(()=>{x(g.current,n)}),n})},[x,p]),C=(0,b.useCallback)(e=>{p(t=>{let n=CR(e,t);return _.current=n,e.some(e=>e.type!==`select`)&&window.requestAnimationFrame(()=>{x(g.current,n)}),n})},[x,p]),w=(0,b.useCallback)(e=>{d(t=>{let n=SR(e,t);return g.current=n,e.some(e=>e.type===`remove`||e.type===`add`||e.type===`replace`||e.type===`position`&&e.dragging!==!0)&&window.requestAnimationFrame(()=>{x(n,_.current)}),n})},[x,d]),T=(0,b.useCallback)((t,a={x:120,y:120})=>{let o=CV.find(e=>e.type===t);if(!o)return;let s=ft(t),c={data:TV(t),description:``,id:s,name:o.label,position:a,type:t};n({...e,definition:{...e.definition,nodes:[...e.definition.nodes,c]}}),r(),d(t=>[...t,...AV({...e,definition:{...e.definition,nodes:[c]}},i)]),l({id:s,kind:`node`})},[e,n,r,i,d]),E=(t,i)=>{n({...e,definition:{...e.definition,nodes:e.definition.nodes.map(e=>e.id===t?{...e,...i}:e)}}),r(),d(e=>e.map(e=>e.id===t?{...e,data:{...e.data,description:i.description??e.data.description,label:i.name??e.data.label}}:e))},D=(t,n,r)=>{E(t,{data:{...e.definition.nodes.find(e=>e.id===t)?.data??{},[n]:r}})},O=(t,i)=>{n({...e,definition:{...e.definition,edges:e.definition.edges.map(e=>e.id===t?{...e,...i}:e)}}),r(),p(e=>e.map(e=>e.id===t?{...e,data:{label:i.label??e.data?.label??``},label:i.label??e.label}:e))},k=()=>{if(c){if(c.kind===`node`){let e=u.filter(e=>e.id!==c.id),t=f.filter(e=>e.source!==c.id&&e.target!==c.id);d(e),p(t),x(e,t)}if(c.kind===`edge`){let e=f.filter(e=>e.id!==c.id);p(e),x(u,e)}l(null)}},A=CV.filter(e=>e.label.toLowerCase().includes(m.trim().toLowerCase()));return(0,q.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[200px_minmax(0,1fr)_300px] max-[1100px]:grid-cols-[180px_minmax(0,1fr)_280px] max-[860px]:grid-cols-1 max-[860px]:grid-rows-[auto_minmax(420px,1fr)_auto]`,children:[(0,q.jsxs)(`aside`,{className:`min-h-0 border-r border-white/10 bg-black p-3 max-[860px]:border-r-0 max-[860px]:border-b`,children:[(0,q.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,q.jsx)(`h3`,{className:wD,children:`Nodes`})}),(0,q.jsxs)(`div`,{className:`relative mt-3`,children:[(0,q.jsx)(Wm,{className:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-[#777]`,"aria-hidden":`true`}),(0,q.jsx)(gD,{className:W(ND,`pl-8`),onChange:e=>h(e.target.value),placeholder:`Search nodes...`,value:m})]}),(0,q.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,q.jsx)(`div`,{className:`text-[11px] leading-4 font-medium text-white/45`,children:`Core`}),A.map(e=>{let t=e.icon;return(0,q.jsxs)(X,{"aria-label":`${e.label} ${e.description}`,className:`h-auto w-full justify-start gap-2 rounded-md border border-white/10 bg-input/30 px-2.5 py-2 text-left text-white shadow-none hover:bg-input/50`,draggable:!0,onClick:()=>T(e.type),onDragStart:t=>{t.dataTransfer.setData(`application/flowent-node`,e.type),t.dataTransfer.effectAllowed=`move`},type:`button`,variant:`ghost`,children:[(0,q.jsx)(t,{className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`min-w-0`,children:[(0,q.jsx)(`span`,{className:`block text-sm leading-5`,children:e.label}),(0,q.jsx)(`span`,{className:`block truncate text-xs leading-4 text-[#9b9b9b]`,children:e.description})]})]},e.type)})]})]}),(0,q.jsxs)(`section`,{className:`relative min-h-0 min-w-0 bg-black`,onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`},onDrop:e=>{e.preventDefault();let t=e.dataTransfer.getData(`application/flowent-node`);CV.some(e=>e.type===t)&&T(t,o({x:e.clientX,y:e.clientY}))},ref:a,children:[u.length===0?(0,q.jsx)(`div`,{className:`pointer-events-none absolute inset-0 z-10 grid place-items-center px-6 text-center text-sm text-[#9b9b9b]`,children:`Drag nodes from the palette to start building your workflow.`}):null,t?(0,q.jsxs)(`div`,{className:`absolute top-3 left-3 z-10 flex items-center gap-2 rounded-md border border-white/10 bg-black/80 px-2.5 py-1.5 text-xs text-[#dedede]`,children:[(0,q.jsx)(km,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),`Workflow running...`]}):null,(0,q.jsx)(RV,{}),(0,q.jsx)(HB,{className:`flowent-workflow-canvas`,deleteKeyCode:[`Backspace`,`Delete`],edges:f,fitView:!0,nodes:u,nodeTypes:LV,onConnect:S,onEdgesChange:C,onEdgeClick:(e,t)=>{l({id:t.id,kind:`edge`})},onNodeClick:(e,t)=>{l({id:t.id,kind:`node`})},onNodesChange:w,onPaneClick:()=>l(null),proOptions:{hideAttribution:!0},children:(0,q.jsx)(ZB,{color:`rgba(255,255,255,0.08)`,gap:18})})]}),(0,q.jsxs)(`aside`,{className:`min-h-0 overflow-y-auto border-l border-white/10 bg-black p-3 max-[860px]:border-l-0 max-[860px]:border-t`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(`h3`,{className:wD,children:`Properties`}),c?(0,q.jsx)(X,{"aria-label":`Remove selection`,className:`size-7 p-0 text-[#ff8a8a]`,onClick:k,size:`icon`,type:`button`,variant:`ghost`,children:(0,q.jsx)(Qm,{className:`size-4`,"aria-hidden":`true`})}):null]}),!v&&!y?(0,q.jsx)(`p`,{className:W(AD,`mt-3`),children:`Select a node or edge to view its properties.`}):null,v?(0,q.jsx)(NV,{node:v,onNodeChange:e=>E(v.id,e),onNodeDataChange:(e,t)=>D(v.id,e,t)}):null,y?(0,q.jsx)(PV,{edge:y,onEdgeChange:e=>O(y.id,e)}):null]})]})}var BV=e=>e.definition.nodes.filter(e=>e.type===`input`),VV=e=>e.definition.nodes.filter(e=>e.type===`timer`),HV=(e,t)=>{let n=new Set(e.map(e=>e.id));return Object.fromEntries(Object.entries(t).filter(([e,t])=>n.has(e)&&t!==``))},UV=e=>{let t=Number(e.data.interval_seconds??5);return!Number.isFinite(t)||t<1?1e3:t*1e3},WV=(e,t=new Date)=>String(e.data.mode??`interval`)===`cron`?GV(String(e.data.cron??`* * * * *`),t):UV(e),GV=(e,t=new Date)=>{let n=e.trim().split(/\s+/);if(n.length!==5)return 6e4;let[r,i,a,o,s]=n,c=YV(r,0,59),l=YV(i,0,23),u=YV(a,1,31),d=YV(o,1,12),f=YV(s,0,7,e=>e===7?0:e);if(!c||!l||!u||!d||!f)return 6e4;let p=new Date(t);p.setSeconds(0,0),p.setMinutes(p.getMinutes()+1);for(let e=0;e<527040;e+=1){if(ZV(p,{day:u,hour:l,minute:c,month:d,weekday:f}))return Math.max(1e3,p.getTime()-t.getTime());p.setMinutes(p.getMinutes()+1)}return 6e4},KV=(e,t)=>new Promise((n,r)=>{if(t.aborted){r(new DOMException(`Run stopped.`,`AbortError`));return}let i=()=>{window.clearTimeout(a),r(new DOMException(`Run stopped.`,`AbortError`))},a=window.setTimeout(()=>{t.removeEventListener(`abort`,i),n()},e);t.addEventListener(`abort`,i,{once:!0})}),qV=e=>e instanceof DOMException&&e.name===`AbortError`,JV=e=>e.nodeResults.find(e=>e.status===`failed`)?.error||`Run could not be completed.`,YV=(e,t,n,r=e=>e)=>{let i=new Set;for(let a of e.split(`,`)){let[e,o]=a.split(`/`),s=o?Number(o):1;if(!Number.isInteger(s)||s<1)return null;let c=XV(e,t,n);if(!c)return null;for(let e=c.start;e<=c.end;e+=s){let a=r(e);if(a<t||a>n)return null;i.add(a)}}return i.size>0?{values:i,wildcard:e===`*`}:null},XV=(e,t,n)=>{if(e===`*`)return{end:n,start:t};let[r,i]=e.split(`-`),a=Number(r),o=i===void 0?a:Number(i);return!Number.isInteger(a)||!Number.isInteger(o)||a<t||o>n||a>o?null:{end:o,start:a}},ZV=(e,t)=>{let n=t.day.values.has(e.getDate()),r=t.weekday.values.has(e.getDay()),i=t.day.wildcard||t.weekday.wildcard?n&&r:n||r;return t.minute.values.has(e.getMinutes())&&t.hour.values.has(e.getHours())&&t.month.values.has(e.getMonth()+1)&&i};function QV({draftWorkflow:e,inputValues:t,isInputFormOpen:n,isDirty:r,isRunning:i,onCancelInputForm:a,onClose:o,onConfirmInputForm:s,onDelete:c,onDraftChange:l,onInputValueChange:u,onMarkDirty:d,onRun:f,onSave:p,onStop:m,runResult:h}){let g=Object.entries(h?.outputs??{}),_=BV(e),v=VV(e).length>0,y=i&&v;return(0,q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-black`,children:[(0,q.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-2 border-b border-white/10 bg-black px-3`,children:[(0,q.jsx)(gD,{"aria-label":`Workflow name`,className:W(ND,`max-w-[360px]`),onChange:t=>{l({...e,name:t.target.value}),d()},value:e.name}),r?(0,q.jsx)(`span`,{className:`text-xs text-[#9b9b9b]`,children:`Unsaved`}):null,(0,q.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,q.jsxs)(X,{className:W(ID,`gap-1.5 px-2.5`),disabled:!0,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(eh,{className:`size-4`,"aria-hidden":`true`}),`Undo`]}),(0,q.jsxs)(X,{className:W(ID,`gap-1.5 px-2.5`),disabled:!0,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(Bm,{className:`size-4`,"aria-hidden":`true`}),`Redo`]}),(0,q.jsxs)(X,{className:W(ID,`gap-1.5 px-2.5`),onClick:p,size:`sm`,type:`button`,variant:`outline`,children:[(0,q.jsx)(Um,{className:`size-4`,"aria-hidden":`true`}),`Save`]}),(0,q.jsxs)(X,{className:`h-8 gap-1.5 px-2.5`,disabled:i&&!y,onClick:y?m:f,size:`sm`,type:`button`,variant:i?`outline`:`default`,children:[y?(0,q.jsx)(Ym,{className:`size-4`,"aria-hidden":`true`}):i?(0,q.jsx)(km,{className:`size-4 animate-spin`,"aria-hidden":`true`}):(0,q.jsx)(Im,{className:`size-4`,"aria-hidden":`true`}),y?`Stop`:`Run`]}),(0,q.jsx)(X,{"aria-label":`Delete workflow`,className:`size-8 p-0 text-[#ff8a8a]`,onClick:c,size:`icon`,type:`button`,variant:`ghost`,children:(0,q.jsx)(Qm,{className:`size-4`,"aria-hidden":`true`})}),(0,q.jsx)(X,{"aria-label":`Close editor`,className:`size-8 p-0`,onClick:o,size:`icon`,type:`button`,variant:`ghost`,children:(0,q.jsx)(nh,{className:`size-4`,"aria-hidden":`true`})})]})]}),n?(0,q.jsx)($V,{inputNodes:_,inputValues:t,onCancel:a,onChange:u,onStart:s}):null,h?(0,q.jsxs)(`div`,{className:`grid shrink-0 gap-2 border-b border-white/10 px-3 py-2 text-xs text-[#dedede]`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(cm,{className:`size-4 text-[#7ddf89]`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:h.status===`success`?`Run completed.`:`Run failed.`})]}),g.length>0?(0,q.jsx)(`div`,{className:`grid gap-1`,children:g.map(([e,t])=>(0,q.jsxs)(`div`,{className:`grid grid-cols-[minmax(72px,140px)_minmax(0,1fr)] gap-2`,children:[(0,q.jsx)(`span`,{className:`truncate text-[#9b9b9b]`,children:e}),(0,q.jsx)(`span`,{className:`min-w-0 whitespace-pre-wrap break-words text-white`,children:t})]},e))}):null]}):null,(0,q.jsx)(RB,{children:(0,q.jsx)(zV,{draftWorkflow:e,isRunning:i,onChange:l,onDirty:d,runResult:h})})]})}function $V({inputNodes:e,inputValues:t,onCancel:n,onChange:r,onStart:i}){return(0,q.jsxs)(`div`,{className:`grid shrink-0 gap-3 border-b border-white/10 bg-black px-3 py-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`div`,{className:`text-sm font-medium text-white`,children:`Workflow Input`}),(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(X,{className:W(ID,`px-2.5`),onClick:n,size:`sm`,type:`button`,variant:`outline`,children:`Cancel`}),(0,q.jsx)(X,{className:`h-8 px-2.5`,onClick:i,size:`sm`,type:`button`,children:`Start`})]})]}),(0,q.jsx)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:e.map(e=>{let n=String(e.data.default_value??``);return(0,q.jsxs)(`div`,{className:jD,children:[(0,q.jsx)(ZD,{className:MD,htmlFor:`${e.id}-run-input`,children:e.name}),(0,q.jsx)(kO,{className:`min-h-20 rounded-md border-white/10 bg-input/30 text-base text-white shadow-none placeholder:text-[#777] focus-visible:border-[#7a7a7a] focus-visible:ring-2 focus-visible:ring-ring/25`,id:`${e.id}-run-input`,onChange:t=>r(e.id,t.target.value),placeholder:n?`Default: ${n}`:`Use default value`,value:t[e.id]??``})]},e.id)})})]})}function eH({activeWorkflow:e,isRunningWorkflow:t,newWorkflowKey:n,onCloseEditor:r,onDeleteWorkflow:i,onFinishWorkflowRun:a,onRunWorkflow:o,onSaveWorkflow:s,runningWorkflowId:c,workflowRunResult:l}){let[u,d]=(0,b.useState)(()=>e?OV(e):DV()),[f,p]=(0,b.useState)({}),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(!e),v=xO(),y=(0,b.useRef)(null),x=(0,b.useRef)({newWorkflowKey:n,workflowId:e?.id??``});(0,b.useEffect)(()=>{let t=e?.id??``;x.current.workflowId===t&&x.current.newWorkflowKey===n||(x.current={newWorkflowKey:n,workflowId:t},d(e?OV(e):DV()),p({}),h(!1),_(!e))},[e,n]),(0,b.useEffect)(()=>()=>{y.current?.abort()},[]);let S=l?.workflowId===u.id?l:null,C=c===u.id&&t,w=()=>{g&&!window.confirm(`Unsaved changes will be lost. Continue?`)||r()},T=async()=>{let e=await s(u);return e.data?(d(e.data),_(!1),e.data):(v.error(e.error),null)},E=()=>{y.current?.abort(),y.current=null,a(u.id)},D=async(e,t)=>{let n=HV(BV(e),t),r=VV(e);if(r.length===0){let t=await o(e.id,{inputs:n});if(!t.data){v.error(t.error);return}t.data.status===`failed`&&v.error(JV(t.data));return}let i=new AbortController;y.current?.abort(),y.current=i;try{await O(e,r,n,i)}catch(e){qV(e)||v.error(e instanceof Error?e.message:`Run could not be completed.`)}finally{y.current===i&&(y.current=null),a(e.id)}},O=async(e,t,n,r)=>{let i=r.signal;for(let r of t){if(i.aborted)throw new DOMException(`Run stopped.`,`AbortError`);let t=await o(e.id,{inputs:n,signal:i,timerId:r.id});if(!t.data)throw Error(t.error);if(t.data.status===`failed`)throw Error(JV(t.data))}let a=t.map(e=>({nextAt:Date.now()+WV(e),timerNode:e}));for(;!i.aborted;){let t=a.sort((e,t)=>e.nextAt-t.nextAt)[0];if(!t)return;await KV(Math.max(0,t.nextAt-Date.now()),i);let r=await o(e.id,{inputs:n,signal:i,timerId:t.timerNode.id});if(!r.data)throw Error(r.error);if(r.data.status===`failed`)throw Error(JV(r.data));t.nextAt=Date.now()+WV(t.timerNode)}},k=async e=>{let t=await T();t&&(h(!1),await D(t,e))},A=async()=>{let e=BV(u);if(e.length>1){p(Object.fromEntries(e.map(e=>[e.id,f[e.id]??``]))),h(!0);return}await k(f)},j=async()=>{await i(u.id)&&r()};return(0,q.jsx)(QV,{draftWorkflow:u,inputValues:f,isInputFormOpen:m,isDirty:g,isRunning:C,onCancelInputForm:()=>h(!1),onClose:w,onConfirmInputForm:()=>{k(f)},onDelete:()=>{j()},onDraftChange:d,onInputValueChange:(e,t)=>p(n=>({...n,[e]:t})),onMarkDirty:()=>_(!0),onRun:()=>{A()},onSave:()=>{T()},onStop:E,runResult:S})}function tH({delayDuration:e=0,...t}){return(0,q.jsx)($E,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function nH({...e}){return(0,q.jsx)(eD,{"data-slot":`tooltip`,...e})}function rH({...e}){return(0,q.jsx)(tD,{"data-slot":`tooltip-trigger`,...e})}function iH({className:e,sideOffset:t=0,children:n,...r}){return(0,q.jsx)(nD,{children:(0,q.jsxs)(rD,{"data-slot":`tooltip-content`,sideOffset:t,className:W(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,q.jsx)(iD,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function aH(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var oH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cH={};function lH(e,t){return((t||cH).jsx?sH:oH).test(e)}var uH=/[ \t\n\f\r]/g;function dH(e){return typeof e==`object`?e.type===`text`?fH(e.value):!1:fH(e)}function fH(e){return e.replace(uH,``)===``}var pH=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};pH.prototype.normal={},pH.prototype.property={},pH.prototype.space=void 0;function mH(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new pH(n,r,t)}function hH(e){return e.toLowerCase()}var gH=class{constructor(e,t){this.attribute=t,this.property=e}};gH.prototype.attribute=``,gH.prototype.booleanish=!1,gH.prototype.boolean=!1,gH.prototype.commaOrSpaceSeparated=!1,gH.prototype.commaSeparated=!1,gH.prototype.defined=!1,gH.prototype.mustUseProperty=!1,gH.prototype.number=!1,gH.prototype.overloadedBoolean=!1,gH.prototype.property=``,gH.prototype.spaceSeparated=!1,gH.prototype.space=void 0;var _H=c({boolean:()=>yH,booleanish:()=>bH,commaOrSpaceSeparated:()=>wH,commaSeparated:()=>CH,number:()=>Q,overloadedBoolean:()=>xH,spaceSeparated:()=>SH}),vH=0,yH=TH(),bH=TH(),xH=TH(),Q=TH(),SH=TH(),CH=TH(),wH=TH();function TH(){return 2**++vH}var EH=Object.keys(_H),DH=class extends gH{constructor(e,t,n,r){let i=-1;if(super(e,t),OH(this,`space`,r),typeof n==`number`)for(;++i<EH.length;){let e=EH[i];OH(this,EH[i],(n&_H[e])===_H[e])}}};DH.prototype.defined=!0;function OH(e,t,n){n&&(e[t]=n)}function kH(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new DH(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[hH(r)]=r,n[hH(a.attribute)]=r}return new pH(t,n,e.space)}var AH=kH({properties:{ariaActiveDescendant:null,ariaAtomic:bH,ariaAutoComplete:null,ariaBusy:bH,ariaChecked:bH,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:SH,ariaCurrent:null,ariaDescribedBy:SH,ariaDetails:null,ariaDisabled:bH,ariaDropEffect:SH,ariaErrorMessage:null,ariaExpanded:bH,ariaFlowTo:SH,ariaGrabbed:bH,ariaHasPopup:null,ariaHidden:bH,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:SH,ariaLevel:Q,ariaLive:null,ariaModal:bH,ariaMultiLine:bH,ariaMultiSelectable:bH,ariaOrientation:null,ariaOwns:SH,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:bH,ariaReadOnly:bH,ariaRelevant:null,ariaRequired:bH,ariaRoleDescription:SH,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:bH,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function jH(e,t){return t in e?e[t]:t}function MH(e,t){return jH(e,t.toLowerCase())}var NH=kH({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:CH,acceptCharset:SH,accessKey:SH,action:null,allow:null,allowFullScreen:yH,allowPaymentRequest:yH,allowUserMedia:yH,alt:null,as:null,async:yH,autoCapitalize:null,autoComplete:SH,autoFocus:yH,autoPlay:yH,blocking:SH,capture:null,charSet:null,checked:yH,cite:null,className:SH,cols:Q,colSpan:null,content:null,contentEditable:bH,controls:yH,controlsList:SH,coords:Q|CH,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yH,defer:yH,dir:null,dirName:null,disabled:yH,download:xH,draggable:bH,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yH,formTarget:null,headers:SH,height:Q,hidden:xH,high:Q,href:null,hrefLang:null,htmlFor:SH,httpEquiv:SH,id:null,imageSizes:null,imageSrcSet:null,inert:yH,inputMode:null,integrity:null,is:null,isMap:yH,itemId:null,itemProp:SH,itemRef:SH,itemScope:yH,itemType:SH,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yH,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:yH,muted:yH,name:null,nonce:null,noModule:yH,noValidate:yH,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:yH,optimum:Q,pattern:null,ping:SH,placeholder:null,playsInline:yH,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yH,referrerPolicy:null,rel:SH,required:yH,reversed:yH,rows:Q,rowSpan:Q,sandbox:SH,scope:null,scoped:yH,seamless:yH,selected:yH,shadowRootClonable:yH,shadowRootDelegatesFocus:yH,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:bH,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:yH,useMap:null,value:bH,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:SH,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yH,declare:yH,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:yH,noHref:yH,noShade:yH,noWrap:yH,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:bH,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yH,disableRemotePlayback:yH,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:MH}),PH=kH({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,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`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,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`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,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`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:wH,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:SH,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:yH,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:CH,g2:CH,glyphName:CH,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:wH,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:SH,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:wH,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wH,rev:wH,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wH,requiredFeatures:wH,requiredFonts:wH,requiredFormats:wH,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:wH,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:wH,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:wH,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:jH}),FH=kH({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),IH=kH({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:MH}),LH=kH({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),RH={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},zH=/[A-Z]/g,BH=/-[a-z]/g,VH=/^data[-\w.:]+$/i;function HH(e,t){let n=hH(t),r=t,i=gH;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&VH.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(BH,WH);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!BH.test(e)){let n=e.replace(zH,UH);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=DH}return new i(r,t)}function UH(e){return`-`+e.toLowerCase()}function WH(e){return e.charAt(1).toUpperCase()}var GH=mH([AH,NH,FH,IH,LH],`html`),KH=mH([AH,PH,FH,IH,LH],`svg`);function qH(e){return e.join(` `).trim()}var JH=s(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
67
|
+
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),YH=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(JH());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),XH=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),ZH=s(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(YH()),r=XH();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),QH=eU(`end`),$H=eU(`start`);function eU(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function tU(e){let t=$H(e),n=QH(e);if(t&&n)return{start:t,end:n}}function nU(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?iU(e.position):`start`in e||`end`in e?iU(e):`line`in e||`column`in e?rU(e):``}function rU(e){return aU(e&&e.line)+`:`+aU(e&&e.column)}function iU(e){return rU(e&&e.start)+`-`+rU(e&&e.end)}function aU(e){return e&&typeof e==`number`?e:1}var oU=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=nU(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};oU.prototype.file=``,oU.prototype.name=``,oU.prototype.reason=``,oU.prototype.message=``,oU.prototype.stack=``,oU.prototype.column=void 0,oU.prototype.line=void 0,oU.prototype.ancestors=void 0,oU.prototype.cause=void 0,oU.prototype.fatal=void 0,oU.prototype.place=void 0,oU.prototype.ruleId=void 0,oU.prototype.source=void 0;var sU=u(ZH(),1),cU={}.hasOwnProperty,lU=new Map,uU=/[A-Z]/g,dU=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),fU=new Set([`td`,`th`]),pU=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function mU(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=TU(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=wU(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?KH:GH,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=hU(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function hU(e,t,n){if(t.type===`element`)return gU(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return _U(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return yU(e,t,n);if(t.type===`mdxjsEsm`)return vU(e,t);if(t.type===`root`)return bU(e,t,n);if(t.type===`text`)return xU(e,t)}function gU(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=KH,e.schema=i),e.ancestors.push(t);let a=jU(e,t.tagName,!1),o=EU(e,t),s=OU(e,t);return dU.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!dH(e):!0})),SU(e,o,a,t),CU(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function _U(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}MU(e,t.position)}function vU(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);MU(e,t.position)}function yU(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=KH,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:jU(e,t.name,!0),o=DU(e,t),s=OU(e,t);return SU(e,o,a,t),CU(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function bU(e,t,n){let r={};return CU(r,OU(e,t)),e.create(t,e.Fragment,r,n)}function xU(e,t){return t.value}function SU(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function CU(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function wU(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function TU(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=$H(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function EU(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&cU.call(t.properties,i)){let a=kU(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&fU.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function DU(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else MU(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else MU(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function OU(e,t){let n=[],r=-1,i=e.passKeys?new Map:lU;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=hU(e,a,o);s!==void 0&&n.push(s)}return n}function kU(e,t,n){let r=HH(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?aH(n):qH(n)),r.property===`style`){let t=typeof n==`object`?n:AU(e,String(n));return e.stylePropertyNameCase===`css`&&(t=NU(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?RH[r.property]||r.property:r.attribute,n]}}function AU(e,t){try{return(0,sU.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new oU("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=pU+`#cannot-parse-style-attribute`,r}}function jU(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=lH(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=lH(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return cU.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);MU(e)}function MU(e,t){let n=new oU("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=pU+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function NU(e){let t={},n;for(n in e)cU.call(e,n)&&(t[PU(n)]=e[n]);return t}function PU(e){let t=e.replace(uU,FU);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function FU(e){return`-`+e.toLowerCase()}var IU={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},LU={};function RU(e,t){let n=t||LU;return zU(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function zU(e,t,n){if(VU(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return BU(e.children,t,n)}return Array.isArray(e)?BU(e,t,n):``}function BU(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=zU(e[i],t,n);return r.join(``)}function VU(e){return!!(e&&typeof e==`object`)}var HU=document.createElement(`i`);function UU(e){let t=`&`+e+`;`;HU.innerHTML=t;let n=HU.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function WU(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function GU(e,t){return e.length>0?(WU(e,e.length,0,t),e):t}var KU={}.hasOwnProperty;function qU(e){let t={},n=-1;for(;++n<e.length;)JU(t,e[n]);return t}function JU(e,t){let n;for(n in t){let r=(KU.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){KU.call(r,a)||(r[a]=[]);let e=i[a];YU(r[a],Array.isArray(e)?e:e?[e]:[])}}}function YU(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);WU(e,0,0,r)}function XU(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function ZU(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var QU=lW(/[A-Za-z]/),$U=lW(/[\dA-Za-z]/),eW=lW(/[#-'*+\--9=?A-Z^-~]/);function tW(e){return e!==null&&(e<32||e===127)}var nW=lW(/\d/),rW=lW(/[\dA-Fa-f]/),iW=lW(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function aW(e){return e!==null&&(e<0||e===32)}function oW(e){return e===-2||e===-1||e===32}var sW=lW(/\p{P}|\p{S}/u),cW=lW(/\s/);function lW(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function uW(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&$U(e.charCodeAt(n+1))&&$U(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function dW(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return oW(r)?(e.enter(n),s(r)):t(r)}function s(r){return oW(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var fW={tokenize:pW};function pW(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),dW(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return $(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var mW={tokenize:gW},hW={tokenize:_W};function gW(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return WU(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(hW,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(hW,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return $(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;WU(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function _W(e,t,n){return dW(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function vW(e){if(e===null||aW(e)||cW(e))return 1;if(sW(e))return 2}function yW(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var bW={name:`attention`,resolveAll:xW,tokenize:SW};function xW(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};CW(d,-c),CW(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=GU(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=GU(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=GU(l,yW(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=GU(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=GU(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,WU(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function SW(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=vW(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=vW(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function CW(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var wW={name:`autolink`,tokenize:TW};function TW(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return QU(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||$U(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||$U(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||tW(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):eW(t)?(e.consume(t),l):n(t)}function u(e){return $U(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||$U(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var EW={partial:!0,tokenize:DW};function DW(e,t,n){return r;function r(t){return oW(t)?dW(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||$(e)?t(e):n(e)}}var OW={continuation:{tokenize:AW},exit:jW,name:`blockQuote`,tokenize:kW};function kW(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return oW(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function AW(e,t,n){let r=this;return i;function i(t){return oW(t)?dW(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(OW,t,n)(r)}}function jW(e){e.exit(`blockQuote`)}var MW={name:`characterEscape`,tokenize:NW};function NW(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return iW(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var PW={name:`characterReference`,tokenize:FW};function FW(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=$U,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=rW,u):(e.enter(`characterReferenceValue`),a=7,o=nW,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===$U&&!UU(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var IW={partial:!0,tokenize:zW},LW={concrete:!0,name:`codeFenced`,tokenize:RW};function RW(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),oW(t)?dW(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||$(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(IW,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):oW(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),dW(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||$(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&oW(t)?dW(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||$(t)?e.check(IW,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||$(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),oW(t)?dW(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),oW(t)?dW(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function zW(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var BW={name:`codeIndented`,tokenize:HW},VW={partial:!0,tokenize:UW};function HW(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),dW(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):$(t)?e.attempt(VW,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||$(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function UW(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):dW(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):$(e)?i(e):n(e)}}var WW={name:`codeText`,previous:KW,resolve:GW,tokenize:qW};function GW(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function KW(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function qW(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||$(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var JW=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&YW(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),YW(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),YW(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);YW(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);YW(this.left,t.reverse())}}};function YW(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function XW(e){let t={},n=-1,r,i,a,o,s,c,l,u=new JW(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,ZW(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return WU(e,0,1/0,u.slice(0)),!l}function ZW(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var QW={resolve:eG,tokenize:tG},$W={partial:!0,tokenize:nG};function eG(e){return XW(e),e}function tG(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):$(t)?e.check($W,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function nG(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),dW(e,a,`linePrefix`)}function a(i){if(i===null||$(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function rG(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||tW(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||$(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||aW(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||tW(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function iG(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):$(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!oW(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function aG(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),dW(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||$(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function oG(e,t){let n;return r;function r(i){return $(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):oW(i)?dW(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var sG={name:`definition`,tokenize:lG},cG={partial:!0,tokenize:uG};function lG(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return iG.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=ZU(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return aW(t)?oG(e,l)(t):l(t)}function l(t){return rG(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(cG,d,d)(t)}function d(t){return oW(t)?dW(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function uG(e,t,n){return r;function r(t){return aW(t)?oG(e,i)(t):n(t)}function i(t){return aG(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return oW(t)?dW(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||$(e)?t(e):n(e)}}var dG={name:`hardBreakEscape`,tokenize:fG};function fG(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return $(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var pG={name:`headingAtx`,resolve:mG,tokenize:hG};function mG(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},WU(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function hG(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||aW(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||$(n)?(e.exit(`atxHeading`),t(n)):oW(n)?dW(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||aW(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var gG=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),_G=[`pre`,`script`,`style`,`textarea`],vG={concrete:!0,name:`htmlFlow`,resolveTo:xG,tokenize:SG},yG={partial:!0,tokenize:wG},bG={partial:!0,tokenize:CG};function xG(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function SG(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):QU(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):QU(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return QU(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||aW(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&_G.includes(l)?(i=1,r.interrupt?t(s):O(s)):gG.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||$U(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return oW(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||QU(t)?(e.consume(t),b):oW(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||$U(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):oW(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):oW(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||$(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||aW(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||oW(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||$(t)?O(t):oW(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(yG,ee,k)(t)):t===null||$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(bG,A,ee)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||$(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return _G.includes(n)?(e.consume(t),L):O(t)}return QU(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||$(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),L)}function ee(n){return e.exit(`htmlFlow`),t(n)}}function CG(e,t,n){let r=this;return i;function i(t){return $(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function wG(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(EW,t,n)}}var TG={name:`htmlText`,tokenize:EG};function EG(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):QU(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):QU(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):$(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):$(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):$(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):$(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return QU(t)?(e.consume(t),S):n(t)}function S(t){return t===45||$U(t)?(e.consume(t),S):C(t)}function C(t){return $(t)?(o=C,N(t)):oW(t)?(e.consume(t),C):M(t)}function w(t){return t===45||$U(t)?(e.consume(t),w):t===47||t===62||aW(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||QU(t)?(e.consume(t),E):$(t)?(o=T,N(t)):oW(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||$U(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):$(t)?(o=D,N(t)):oW(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):$(t)?(o=O,N(t)):oW(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):$(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||aW(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||aW(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return oW(t)?dW(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var DG={name:`labelEnd`,resolveAll:jG,resolveTo:MG,tokenize:NG},OG={tokenize:PG},kG={tokenize:FG},AG={tokenize:IG};function jG(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&WU(e,0,e.length,n),e}function MG(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=GU(s,e.slice(a+1,a+r+3)),s=GU(s,[[`enter`,u,t]]),s=GU(s,yW(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=GU(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=GU(s,e.slice(o+1)),s=GU(s,[[`exit`,c,t]]),WU(e,a,e.length,s),e}function NG(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(ZU(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(OG,u,o?u:d)(t):t===91?e.attempt(kG,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(AG,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function PG(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return aW(t)?oG(e,a)(t):a(t)}function a(t){return t===41?u(t):rG(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return aW(t)?oG(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?aG(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return aW(t)?oG(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function FG(e,t,n){let r=this;return i;function i(t){return iG.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(ZU(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function IG(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var LG={name:`labelStartImage`,resolveAll:DG.resolveAll,tokenize:RG};function RG(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var zG={name:`labelStartLink`,resolveAll:DG.resolveAll,tokenize:BG};function BG(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var VG={name:`lineEnding`,tokenize:HG};function HG(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),dW(e,t,`linePrefix`)}}var UG={name:`thematicBreak`,tokenize:WG};function WG(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),oW(t)?dW(e,s,`whitespace`)(t):s(t))}}var GG={continuation:{tokenize:YG},exit:ZG,name:`list`,tokenize:JG},KG={partial:!0,tokenize:QG},qG={partial:!0,tokenize:XG};function JG(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:nW(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(UG,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return nW(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(EW,r.interrupt?n:u,e.attempt(KG,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return oW(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function YG(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(EW,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,dW(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!oW(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(qG,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,dW(e,e.attempt(GG,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function XG(e,t,n){let r=this;return dW(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function ZG(e){e.exit(this.containerState.type)}function QG(e,t,n){let r=this;return dW(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!oW(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var $G={name:`setextUnderline`,resolveTo:eK,tokenize:tK};function eK(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function tK(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),oW(t)?dW(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var nK={tokenize:rK};function rK(e){let t=this,n=e.attempt(EW,r,e.attempt(this.parser.constructs.flowInitial,i,dW(e,e.attempt(this.parser.constructs.flow,i,e.attempt(QW,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var iK={resolveAll:cK()},aK=sK(`string`),oK=sK(`text`);function sK(e){return{resolveAll:cK(e===`text`?lK:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function cK(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function lK(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var uK=c({attentionMarkers:()=>vK,contentInitial:()=>fK,disable:()=>yK,document:()=>dK,flow:()=>mK,flowInitial:()=>pK,insideSpan:()=>_K,string:()=>hK,text:()=>gK}),dK={42:GG,43:GG,45:GG,48:GG,49:GG,50:GG,51:GG,52:GG,53:GG,54:GG,55:GG,56:GG,57:GG,62:OW},fK={91:sG},pK={[-2]:BW,[-1]:BW,32:BW},mK={35:pG,42:UG,45:[$G,UG],60:vG,61:$G,95:UG,96:LW,126:LW},hK={38:PW,92:MW},gK={[-5]:VG,[-4]:VG,[-3]:VG,33:LG,38:PW,42:bW,60:[wW,TG],91:zG,92:[dG,MW],93:DG,95:bW,96:WW},_K={null:[bW,iK]},vK={null:[42,95]},yK={null:[]};function bK(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=GU(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=yW(a,l.events,l),l.events):[]}function f(e,t){return SK(p(e),t)}function p(e){return xK(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){$(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&WU(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function xK(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function SK(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
68
68
|
`;break;case-3:o=`\r
|
|
69
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function HU(e){let t={constructs:fV([kU,...(e||{}).extensions||[]]),content:n(jV),defined:[],document:n(NV),flow:n(xU),lazy:{},string:n(wU),text:n(TU)};return t;function n(e){return n;function n(n){return zU(t,e,n)}}}function UU(e){for(;!hH(e););return e}var WU=/[\0\t\n\r]/g;function GU(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(WU.lastIndex=u,c=WU.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var KU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function qU(e){return e.replace(KU,JU)}function JU(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return hV(n.slice(t?2:1),t?16:10)}return cV(n)||e}var YU={}.hasOwnProperty;function XU(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),ZU(n)(UU(HU(n).document().write(GU()(e,t,!0))))}function ZU(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(me),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ue),blockQuote:a(ae),characterEscape:T,characterReference:T,codeFenced:a(oe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(oe,o),codeText:a(se,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(le),hardBreakEscape:a(de),hardBreakTrailing:a(de),htmlFlow:a(fe,o),htmlFlowData:T,htmlText:a(fe,o),htmlTextData:T,image:a(pe),label:o,link:a(me),listItem:a(ge),listItemValue:f,listOrdered:a(he,d),listUnordered:a(he),paragraph:a(_e),reference:te,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ue),strong:a(ve),thematicBreak:a(be)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ie,autolinkProtocol:re,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:R,characterReferenceMarkerNumeric:R,characterReferenceValue:z,characterReference:B,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ne,resourceDestinationString:I,resourceTitleString:L,resource:ee,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};$U(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];YU.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||tW).call(a,void 0,e[0])}for(r.position={start:QU(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:QU(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:QU(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||tW).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+xB({start:e.start,end:e.end})+`): it’s not open`);n.position.end=QU(e.end)}function u(){return rV(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=gV(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ye(),n.position={start:QU(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=QU(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=QU(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=qU(t),n.identifier=gV(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ee(){this.data.inReference=void 0}function te(){this.data.referenceType=`collapsed`}function ne(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=gV(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function R(e){this.data.characterReferenceType=e.type}function z(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=hV(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=cV(t);let i=this.stack[this.stack.length-1];i.value+=r}function B(e){let t=this.stack.pop();t.position.end=QU(e.end)}function re(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ie(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ae(){return{type:`blockquote`,children:[]}}function oe(){return{type:`code`,lang:null,meta:null,value:``}}function se(){return{type:`inlineCode`,value:``}}function ce(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function le(){return{type:`emphasis`,children:[]}}function ue(){return{type:`heading`,depth:0,children:[]}}function de(){return{type:`break`}}function fe(){return{type:`html`,value:``}}function pe(){return{type:`image`,title:null,url:``,alt:null}}function me(){return{type:`link`,title:null,url:``,children:[]}}function he(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ge(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function _e(){return{type:`paragraph`,children:[]}}function ve(){return{type:`strong`,children:[]}}function ye(){return{type:`text`,value:``}}function be(){return{type:`thematicBreak`}}}function QU(e){return{line:e.line,column:e.column,offset:e.offset}}function $U(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?$U(e,r):eW(e,r)}}function eW(e,t){let n;for(n in t)if(YU.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function tW(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+xB({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+xB({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+xB({start:t.start,end:t.end})+`) is still open`)}function nW(e){let t=this;t.parser=n;function n(n){return XU(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function rW(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function iW(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
70
|
-
`}]}function
|
|
71
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function
|
|
69
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function CK(e){let t={constructs:qU([uK,...(e||{}).extensions||[]]),content:n(fW),defined:[],document:n(mW),flow:n(nK),lazy:{},string:n(aK),text:n(oK)};return t;function n(e){return n;function n(n){return bK(t,e,n)}}}function wK(e){for(;!XW(e););return e}var TK=/[\0\t\n\r]/g;function EK(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(TK.lastIndex=u,c=TK.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var DK=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function OK(e){return e.replace(DK,kK)}function kK(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return XU(n.slice(t?2:1),t?16:10)}return UU(n)||e}var AK={}.hasOwnProperty;function jK(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),MK(n)(wK(CK(n).document().write(EK()(e,t,!0))))}function MK(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(me),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ue),blockQuote:a(ae),characterEscape:T,characterReference:T,codeFenced:a(oe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(oe,o),codeText:a(se,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(le),hardBreakEscape:a(de),hardBreakTrailing:a(de),htmlFlow:a(fe,o),htmlFlowData:T,htmlText:a(fe,o),htmlTextData:T,image:a(pe),label:o,link:a(me),listItem:a(ge),listItemValue:f,listOrdered:a(he,d),listUnordered:a(he),paragraph:a(_e),reference:te,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ue),strong:a(ve),thematicBreak:a(be)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ie,autolinkProtocol:re,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:R,characterReferenceMarkerNumeric:R,characterReferenceValue:z,characterReference:B,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ne,resourceDestinationString:I,resourceTitleString:L,resource:ee,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};PK(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];AK.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||IK).call(a,void 0,e[0])}for(r.position={start:NK(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:NK(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:NK(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||IK).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+nU({start:e.start,end:e.end})+`): it’s not open`);n.position.end=NK(e.end)}function u(){return RU(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ZU(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ye(),n.position={start:NK(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=NK(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=NK(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=OK(t),n.identifier=ZU(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ee(){this.data.inReference=void 0}function te(){this.data.referenceType=`collapsed`}function ne(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ZU(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function R(e){this.data.characterReferenceType=e.type}function z(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=XU(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=UU(t);let i=this.stack[this.stack.length-1];i.value+=r}function B(e){let t=this.stack.pop();t.position.end=NK(e.end)}function re(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ie(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ae(){return{type:`blockquote`,children:[]}}function oe(){return{type:`code`,lang:null,meta:null,value:``}}function se(){return{type:`inlineCode`,value:``}}function ce(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function le(){return{type:`emphasis`,children:[]}}function ue(){return{type:`heading`,depth:0,children:[]}}function de(){return{type:`break`}}function fe(){return{type:`html`,value:``}}function pe(){return{type:`image`,title:null,url:``,alt:null}}function me(){return{type:`link`,title:null,url:``,children:[]}}function he(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ge(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function _e(){return{type:`paragraph`,children:[]}}function ve(){return{type:`strong`,children:[]}}function ye(){return{type:`text`,value:``}}function be(){return{type:`thematicBreak`}}}function NK(e){return{line:e.line,column:e.column,offset:e.offset}}function PK(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?PK(e,r):FK(e,r)}}function FK(e,t){let n;for(n in t)if(AK.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function IK(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+nU({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+nU({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+nU({start:t.start,end:t.end})+`) is still open`)}function LK(e){let t=this;t.parser=n;function n(n){return jK(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function RK(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function zK(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
70
|
+
`}]}function BK(e,t){let n=t.value?t.value+`
|
|
71
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function VK(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function HK(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UK(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=uW(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function WK(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GK(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function KK(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function qK(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return KK(e,t);let i={src:uW(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function JK(e,t){let n={src:uW(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function YK(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function XK(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return KK(e,t);let i={href:uW(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function ZK(e,t){let n={href:uW(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function QK(e,t,n){let r=e.all(t),i=n?$K(n):eq(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
72
72
|
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
73
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function
|
|
73
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function $K(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=eq(n[r])}return t}function eq(e){return e.spread??e.children.length>1}function tq(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function nq(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rq(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function iq(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aq(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=$H(t.children[1]),o=QH(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function oq(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function sq(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var cq=9,lq=32;function uq(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(dq(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(dq(t.slice(i),i>0,!1)),a.join(``)}function dq(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===cq||t===lq;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===cq||t===lq;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function fq(e,t){let n={type:`text`,value:uq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function pq(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var mq={blockquote:RK,break:zK,code:BK,delete:VK,emphasis:HK,footnoteReference:UK,heading:WK,html:GK,imageReference:qK,image:JK,inlineCode:YK,linkReference:XK,link:ZK,listItem:QK,list:tq,paragraph:nq,root:rq,strong:iq,table:aq,tableCell:sq,tableRow:oq,text:fq,thematicBreak:pq,toml:hq,yaml:hq,definition:hq,footnoteDefinition:hq};function hq(){}var gq=typeof self==`object`?self:globalThis,_q=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new gq[e](t)},vq=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(_q(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(_q(a,o),i)};return r},yq=e=>vq(new Map,e)(0),bq=``,{toString:xq}={},{keys:Sq}=Object,Cq=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=xq.call(e).slice(8,-1);switch(n){case`Array`:return[1,bq];case`Object`:return[2,bq];case`Date`:return[3,bq];case`RegExp`:return[4,bq];case`Map`:return[5,bq];case`Set`:return[6,bq];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},wq=([e,t])=>e===0&&(t===`function`||t===`symbol`),Tq=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Cq(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Sq(r))(e||!wq(Cq(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(wq(Cq(n))||wq(Cq(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!wq(Cq(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Eq=(e,{json:t,lossy:n}={})=>{let r=[];return Tq(!(t||n),!!t,new Map,r)(e),r},Dq=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?yq(Eq(e,t)):structuredClone(e):(e,t)=>yq(Eq(e,t));function Oq(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function kq(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Aq(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Oq,r=e.options.footnoteBackLabel||kq,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=uW(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Dq(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
74
74
|
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
75
|
-
`}]}}var
|
|
75
|
+
`}]}}var jq=(function(e){if(e==null)return Iq;if(typeof e==`function`)return Fq(e);if(typeof e==`object`)return Array.isArray(e)?Mq(e):Nq(e);if(typeof e==`string`)return Pq(e);throw Error(`Expected function, string, or object as test`)});function Mq(e){let t=[],n=-1;for(;++n<e.length;)t[n]=jq(e[n]);return Fq(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Nq(e){let t=e;return Fq(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Pq(e){return Fq(t);function t(t){return t&&t.type===e}}function Fq(e){return t;function t(t,n,r){return!!(Lq(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Iq(){return!0}function Lq(e){return typeof e==`object`&&!!e&&`type`in e}function Rq(e){return e}var zq=[];function Bq(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=jq(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+Rq(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=zq,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Vq(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Vq(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?zq:[e]}function Hq(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Bq(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Uq={}.hasOwnProperty,Wq={};function Gq(e,t){let n=t||Wq,r=new Map,i=new Map,a={all:s,applyData:qq,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...mq,...n.handlers},one:o,options:n,patch:Kq,wrap:Yq};return Hq(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Uq.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Dq(n);return r.children=a.all(e),r}return Dq(e)}return(a.options.unknownHandler||Jq)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Xq(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Xq(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Kq(e,t){e.position&&(t.position=tU(e))}function qq(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Dq(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Jq(e,t){let n=t.data||{},r=`value`in t&&!(Uq.call(n,`hProperties`)||Uq.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Yq(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
76
76
|
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
77
77
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
78
|
-
`}),n}function
|
|
79
|
-
`},i)),a}function _G(e,t){return e&&`run`in e?async function(n,r){let i=gG(n,{file:r,...t});await e.run(i,r)}:function(n,r){return gG(n,{file:r,...e||t})}}function vG(e){if(e)throw e}var yG=s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function bG(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function xG(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?SG(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function SG(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var CG={basename:wG,dirname:TG,extname:EG,join:DG,sep:`/`};function wG(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);AG(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function TG(e){if(AG(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function EG(e){AG(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function DG(...e){let t=-1,n;for(;++t<e.length;)AG(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:OG(n)}function OG(e){AG(e);let t=e.codePointAt(0)===47,n=kG(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function kG(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function AG(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var jG={cwd:MG};function MG(){return`/`}function NG(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function PG(e){if(typeof e==`string`)e=new URL(e);else if(!NG(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return FG(e)}function FG(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var IG=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],LG=class{constructor(e){let t;t=e?NG(e)?{path:e}:typeof e==`string`||VG(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:jG.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<IG.length;){let e=IG[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)IG.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?CG.basename(this.path):void 0}set basename(e){zG(e,`basename`),RG(e,`basename`),this.path=CG.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?CG.dirname(this.path):void 0}set dirname(e){BG(this.basename,`dirname`),this.path=CG.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?CG.extname(this.path):void 0}set extname(e){if(RG(e,`extname`),BG(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=CG.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){NG(e)&&(e=PG(e)),zG(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?CG.basename(this.path,this.extname):void 0}set stem(e){zG(e,`stem`),RG(e,`stem`),this.path=CG.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new TB(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function RG(e,t){if(e&&e.includes(CG.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+CG.sep+"`")}function zG(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function BG(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function VG(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var HG=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),UG=u(yG(),1),WG={}.hasOwnProperty,GG=new class e extends HG{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=xG()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,UG.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(JG(`data`,this.frozen),this.namespace[e]=t,this):WG.call(this.namespace,e)&&this.namespace[e]||void 0:e?(JG(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=ZG(e),n=this.parser||this.Parser;return KG(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),KG(`process`,this.parser||this.Parser),qG(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=ZG(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);$G(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),KG(`processSync`,this.parser||this.Parser),qG(`processSync`,this.compiler||this.Compiler),this.process(e,r),XG(`processSync`,`process`,t),n;function r(e,r){t=!0,vG(e),n=r}}run(e,t,n){YG(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=ZG(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),XG(`runSync`,`run`,n),r;function i(e,t){vG(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=ZG(t),r=this.compiler||this.Compiler;return qG(`stringify`,r),YG(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(JG(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,UG.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];bG(o)&&bG(r)&&(r=(0,UG.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function KG(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function qG(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function JG(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function YG(e){if(!bG(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function XG(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function ZG(e){return QG(e)?e:new LG(e)}function QG(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function $G(e){return typeof e==`string`||eK(e)}function eK(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var tK=[],nK={allowDangerousHtml:!0},rK=/^(https?|ircs?|mailto|xmpp)$/i,iK=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function aK(e){let t=oK(e),n=sK(e);return cK(t.runSync(t.parse(n),n),e)}function oK(e){let t=e.rehypePlugins||tK,n=e.remarkPlugins||tK,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...nK}:nK;return GG().use(nW).use(n).use(_G,r).use(t)}function sK(e){let t=e.children||``,n=new LG;return typeof t==`string`?n.value=t:``+t,n}function cK(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||lK;for(let e of iK)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return sG(e,l),NB(e,{Fragment:q.Fragment,components:i,ignoreInvalidStyle:!0,jsx:q.jsx,jsxs:q.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in tV)if(Object.hasOwn(tV,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=tV[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function lK(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||rK.test(e.slice(0,t))?e:``}function uK(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function dK(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function fK(e,t,n){let r=XW((n||{}).ignore||[]),i=pK(t),a=-1;for(;++a<i.length;)aG(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function pK(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([mK(e[0]),hK(e[1])])}return t}function mK(e){return typeof e==`string`?new RegExp(dK(e),`g`):e}function hK(e){return typeof e==`function`?e:function(){return e}}var gK=`phrasing`,_K=[`autolink`,`link`,`image`,`label`];function vK(){return{transforms:[EK],enter:{literalAutolink:bK,literalAutolinkEmail:xK,literalAutolinkHttp:xK,literalAutolinkWww:xK},exit:{literalAutolink:TK,literalAutolinkEmail:wK,literalAutolinkHttp:SK,literalAutolinkWww:CK}}}function yK(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:gK,notInConstruct:_K},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:gK,notInConstruct:_K},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:gK,notInConstruct:_K}]}}function bK(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function xK(e){this.config.enter.autolinkProtocol.call(this,e)}function SK(e){this.config.exit.autolinkProtocol.call(this,e)}function CK(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function wK(e){this.config.exit.autolinkEmail.call(this,e)}function TK(e){this.exit(e)}function EK(e){fK(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,DK],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,OK]],{ignore:[`link`,`linkReference`]})}function DK(e,t,n,r,i){let a=``;if(!jK(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!kK(n)))return!1;let o=AK(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function OK(e,t,n,r){return!jK(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function kK(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function AK(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=uK(e,`(`),a=uK(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function jK(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||DV(n)||EV(n))&&(!t||n!==47)}VK.peek=BK;function MK(){this.buffer()}function NK(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function PK(){this.buffer()}function FK(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function IK(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gV(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LK(e){this.exit(e)}function RK(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gV(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zK(e){this.exit(e)}function BK(){return`[`}function VK(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function HK(){return{enter:{gfmFootnoteCallString:MK,gfmFootnoteCall:NK,gfmFootnoteDefinitionLabelString:PK,gfmFootnoteDefinition:FK},exit:{gfmFootnoteCallString:IK,gfmFootnoteCall:LK,gfmFootnoteDefinitionLabelString:RK,gfmFootnoteDefinition:zK}}}function UK(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:VK},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
80
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?
|
|
81
|
-
`)}function
|
|
82
|
-
`&&
|
|
83
|
-
`}function
|
|
78
|
+
`}),n}function Xq(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Zq(e,t){let n=Gq(e,t),r=n.one(e,void 0),i=Aq(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
79
|
+
`},i)),a}function Qq(e,t){return e&&`run`in e?async function(n,r){let i=Zq(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Zq(n,{file:r,...e||t})}}function $q(e){if(e)throw e}var eJ=s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function tJ(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function nJ(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?rJ(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function rJ(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var iJ={basename:aJ,dirname:oJ,extname:sJ,join:cJ,sep:`/`};function aJ(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);dJ(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function oJ(e){if(dJ(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function sJ(e){dJ(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function cJ(...e){let t=-1,n;for(;++t<e.length;)dJ(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:lJ(n)}function lJ(e){dJ(e);let t=e.codePointAt(0)===47,n=uJ(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function uJ(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function dJ(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var fJ={cwd:pJ};function pJ(){return`/`}function mJ(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function hJ(e){if(typeof e==`string`)e=new URL(e);else if(!mJ(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return gJ(e)}function gJ(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var _J=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],vJ=class{constructor(e){let t;t=e?mJ(e)?{path:e}:typeof e==`string`||SJ(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:fJ.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<_J.length;){let e=_J[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)_J.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?iJ.basename(this.path):void 0}set basename(e){bJ(e,`basename`),yJ(e,`basename`),this.path=iJ.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?iJ.dirname(this.path):void 0}set dirname(e){xJ(this.basename,`dirname`),this.path=iJ.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?iJ.extname(this.path):void 0}set extname(e){if(yJ(e,`extname`),xJ(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=iJ.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){mJ(e)&&(e=hJ(e)),bJ(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?iJ.basename(this.path,this.extname):void 0}set stem(e){bJ(e,`stem`),yJ(e,`stem`),this.path=iJ.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new oU(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function yJ(e,t){if(e&&e.includes(iJ.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+iJ.sep+"`")}function bJ(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function xJ(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function SJ(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var CJ=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),wJ=u(eJ(),1),TJ={}.hasOwnProperty,EJ=new class e extends CJ{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=nJ()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,wJ.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(kJ(`data`,this.frozen),this.namespace[e]=t,this):TJ.call(this.namespace,e)&&this.namespace[e]||void 0:e?(kJ(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=MJ(e),n=this.parser||this.Parser;return DJ(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),DJ(`process`,this.parser||this.Parser),OJ(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=MJ(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);PJ(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),DJ(`processSync`,this.parser||this.Parser),OJ(`processSync`,this.compiler||this.Compiler),this.process(e,r),jJ(`processSync`,`process`,t),n;function r(e,r){t=!0,$q(e),n=r}}run(e,t,n){AJ(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=MJ(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),jJ(`runSync`,`run`,n),r;function i(e,t){$q(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=MJ(t),r=this.compiler||this.Compiler;return OJ(`stringify`,r),AJ(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(kJ(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,wJ.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];tJ(o)&&tJ(r)&&(r=(0,wJ.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function DJ(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function OJ(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function kJ(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function AJ(e){if(!tJ(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function jJ(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function MJ(e){return NJ(e)?e:new vJ(e)}function NJ(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function PJ(e){return typeof e==`string`||FJ(e)}function FJ(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var IJ=[],LJ={allowDangerousHtml:!0},RJ=/^(https?|ircs?|mailto|xmpp)$/i,zJ=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function BJ(e){let t=VJ(e),n=HJ(e);return UJ(t.runSync(t.parse(n),n),e)}function VJ(e){let t=e.rehypePlugins||IJ,n=e.remarkPlugins||IJ,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...LJ}:LJ;return EJ().use(LK).use(n).use(Qq,r).use(t)}function HJ(e){let t=e.children||``,n=new vJ;return typeof t==`string`?n.value=t:``+t,n}function UJ(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||WJ;for(let e of zJ)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Hq(e,l),mU(e,{Fragment:q.Fragment,components:i,ignoreInvalidStyle:!0,jsx:q.jsx,jsxs:q.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in IU)if(Object.hasOwn(IU,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=IU[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function WJ(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||RJ.test(e.slice(0,t))?e:``}function GJ(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function KJ(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function qJ(e,t,n){let r=jq((n||{}).ignore||[]),i=JJ(t),a=-1;for(;++a<i.length;)Bq(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function JJ(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([YJ(e[0]),XJ(e[1])])}return t}function YJ(e){return typeof e==`string`?new RegExp(KJ(e),`g`):e}function XJ(e){return typeof e==`function`?e:function(){return e}}var ZJ=`phrasing`,QJ=[`autolink`,`link`,`image`,`label`];function $J(){return{transforms:[sY],enter:{literalAutolink:tY,literalAutolinkEmail:nY,literalAutolinkHttp:nY,literalAutolinkWww:nY},exit:{literalAutolink:oY,literalAutolinkEmail:aY,literalAutolinkHttp:rY,literalAutolinkWww:iY}}}function eY(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:ZJ,notInConstruct:QJ},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:ZJ,notInConstruct:QJ},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:ZJ,notInConstruct:QJ}]}}function tY(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function nY(e){this.config.enter.autolinkProtocol.call(this,e)}function rY(e){this.config.exit.autolinkProtocol.call(this,e)}function iY(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function aY(e){this.config.exit.autolinkEmail.call(this,e)}function oY(e){this.exit(e)}function sY(e){qJ(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,cY],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,lY]],{ignore:[`link`,`linkReference`]})}function cY(e,t,n,r,i){let a=``;if(!fY(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!uY(n)))return!1;let o=dY(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function lY(e,t,n,r){return!fY(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function uY(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function dY(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=GJ(e,`(`),a=GJ(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function fY(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||cW(n)||sW(n))&&(!t||n!==47)}SY.peek=xY;function pY(){this.buffer()}function mY(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function hY(){this.buffer()}function gY(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function _Y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ZU(this.sliceSerialize(e)).toLowerCase(),n.label=t}function vY(e){this.exit(e)}function yY(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ZU(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bY(e){this.exit(e)}function xY(){return`[`}function SY(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function CY(){return{enter:{gfmFootnoteCallString:pY,gfmFootnoteCall:mY,gfmFootnoteDefinitionLabelString:hY,gfmFootnoteDefinition:gY},exit:{gfmFootnoteCallString:_Y,gfmFootnoteCall:vY,gfmFootnoteDefinitionLabelString:yY,gfmFootnoteDefinition:bY}}}function wY(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:SY},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
80
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?EY:TY))),s(),o}}function TY(e,t,n){return t===0?e:EY(e,t,n)}function EY(e,t,n){return(n?``:` `)+e}var DY=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];MY.peek=NY;function OY(){return{canContainEols:[`delete`],enter:{strikethrough:AY},exit:{strikethrough:jY}}}function kY(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:DY}],handlers:{delete:MY}}}function AY(e){this.enter({type:`delete`,children:[]},e)}function jY(e){this.exit(e)}function MY(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function NY(){return`~`}function PY(e){return e.length}function FY(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||PY,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=IY(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=LY(r[d]);else{let e=LY(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
81
|
+
`)}function IY(e){return e==null?``:String(e)}function LY(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function RY(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),zY);return i(),o}function zY(e,t,n){return`>`+(n?``:` `)+e}function BY(e,t){return VY(e,t.inConstruct,!0)&&!VY(e,t.notInConstruct,!1)}function VY(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function HY(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
82
|
+
`&&BY(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
83
|
+
`}function UY(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function WY(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function GY(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function KY(e,t,n,r){let i=GY(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(WY(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,qY);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(UY(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
84
84
|
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
85
85
|
`),a&&(u+=s.move(a+`
|
|
86
|
-
`)),u+=s.move(c),l(),u}function
|
|
87
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function
|
|
86
|
+
`)),u+=s.move(c),l(),u}function qY(e,t,n){return(n?``:` `)+e}function JY(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function YY(e,t,n,r){let i=JY(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
87
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function XY(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ZY(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function QY(e,t,n){let r=vW(e),i=vW(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}$Y.peek=eX;function $Y(e,t,n,r){let i=XY(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=QY(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=ZY(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=QY(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+ZY(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function eX(e,t,n){return n.options.emphasis||`*`}function tX(e,t){let n=!1;return Hq(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&RU(e)&&(t.options.setext||n))}function nX(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(tX(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
88
88
|
`,after:`
|
|
89
89
|
`});return r(),t(),o+`
|
|
90
90
|
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
91
91
|
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
92
|
-
`,...a.current()});return/^[\t ]/.test(l)&&(l=
|
|
92
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=ZY(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}rX.peek=iX;function rX(e){return e.value||``}function iX(){return`<`}aX.peek=oX;function aX(e,t,n,r){let i=JY(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function oX(){return`!`}sX.peek=cX;function sX(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function cX(){return`!`}lX.peek=uX;function lX(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function uX(){return"`"}function dX(e,t){let n=RU(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}fX.peek=pX;function fX(e,t,n,r){let i=JY(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(dX(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function pX(e,t,n){return dX(e,n)?`<`:`[`}mX.peek=hX;function mX(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function hX(){return`[`}function gX(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function _X(e){let t=gX(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function vX(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function yX(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function bX(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?vX(n):gX(n),s=e.ordered?o===`.`?`)`:`.`:_X(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),yX(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function xX(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function SX(e,t,n,r){let i=xX(n),a=n.bulletCurrent||gX(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function CX(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var wX=jq([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function TX(e,t,n,r){return(e.children.some(function(e){return wX(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function EX(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}DX.peek=OX;function DX(e,t,n,r){let i=EX(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=QY(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=ZY(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=QY(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+ZY(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function OX(e,t,n){return n.options.strong||`*`}function kX(e,t,n,r){return n.safe(e.value,r)}function AX(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function jX(e,t,n){let r=(yX(n)+(n.options.ruleSpaces?` `:``)).repeat(AX(n));return n.options.ruleSpaces?r.slice(0,-1):r}var MX={blockquote:RY,break:HY,code:KY,definition:YY,emphasis:$Y,hardBreak:HY,heading:nX,html:rX,image:aX,imageReference:sX,inlineCode:lX,link:fX,linkReference:mX,list:bX,listItem:SX,paragraph:CX,root:TX,strong:DX,text:kX,thematicBreak:jX};function NX(){return{enter:{table:PX,tableData:RX,tableHeader:RX,tableRow:IX},exit:{codeText:zX,table:FX,tableData:LX,tableHeader:LX,tableRow:LX}}}function PX(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function FX(e){this.exit(e),this.data.inTable=void 0}function IX(e){this.enter({type:`tableRow`,children:[]},e)}function LX(e){this.exit(e)}function RX(e){this.enter({type:`tableCell`,children:[]},e)}function zX(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,BX));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function BX(e,t){return t===`|`?t:e}function VX(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
93
93
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
94
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return eq(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Zq.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function sJ(){return{exit:{taskListCheckValueChecked:lJ,taskListCheckValueUnchecked:lJ,paragraph:uJ}}}function cJ(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:dJ}}}function lJ(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function uJ(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function dJ(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Zq.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function fJ(){return[vK(),HK(),qK(),Qq(),sJ()]}function pJ(e){return{extensions:[yK(),UK(e),JK(),oJ(e),cJ()]}}var mJ={tokenize:OJ,partial:!0},hJ={tokenize:kJ,partial:!0},gJ={tokenize:AJ,partial:!0},_J={tokenize:jJ,partial:!0},vJ={tokenize:MJ,partial:!0},yJ={name:`wwwAutolink`,tokenize:EJ,previous:NJ},bJ={name:`protocolAutolink`,tokenize:DJ,previous:PJ},xJ={name:`emailAutolink`,tokenize:TJ,previous:FJ},SJ={};function CJ(){return{text:SJ}}for(var wJ=48;wJ<123;)SJ[wJ]=xJ,wJ++,wJ===58?wJ=65:wJ===91&&(wJ=97);SJ[43]=xJ,SJ[45]=xJ,SJ[46]=xJ,SJ[95]=xJ,SJ[72]=[xJ,bJ],SJ[104]=[xJ,bJ],SJ[87]=[xJ,yJ],SJ[119]=[xJ,yJ];function TJ(e,t,n){let r=this,i,a;return o;function o(t){return!IJ(t)||!FJ.call(r,r.previous)||LJ(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return IJ(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(vJ,u,l)(t):t===45||t===95||vV(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&_V(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function EJ(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!NJ.call(r,r.previous)||LJ(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(mJ,e.attempt(hJ,e.attempt(gJ,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function DJ(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&PJ.call(r,r.previous)&&!LJ(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(_V(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||bV(t)||wV(t)||DV(t)||EV(t)?n(t):e.attempt(hJ,e.attempt(gJ,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function OJ(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function kJ(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(_J,c,s)(t):t===null||wV(t)||DV(t)||t!==45&&EV(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function AJ(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(_J,t,a)(o):o===null||wV(o)||DV(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function jJ(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||wV(o)||DV(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||wV(e)||DV(e)?t(e):r(e)}function a(e){return _V(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):_V(t)?(e.consume(t),o):n(t)}}function MJ(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return vV(e)?n(e):t(e)}}function NJ(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||wV(e)}function PJ(e){return!_V(e)}function FJ(e){return!(e===47||IJ(e))}function IJ(e){return e===43||e===45||e===46||e===95||vV(e)}function LJ(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var RJ={tokenize:KJ,partial:!0};function zJ(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:UJ,continuation:{tokenize:WJ},exit:GJ}},text:{91:{name:`gfmFootnoteCall`,tokenize:HJ},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:BJ,resolveTo:VJ}}}}function BJ(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=gV(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function VJ(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function HJ(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||wV(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(gV(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return wV(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function UJ(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||wV(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=gV(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return wV(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),AV(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function WJ(e,t,n){return e.check(GV,t,e.attempt(RJ,t,n))}function GJ(e){e.exit(`gfmFootnoteDefinition`)}function KJ(e,t,n){let r=this;return AV(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function qJ(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&lV(o,o.length,0,RV(s,e.slice(r+1,n),t)),lV(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),lV(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=LV(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=LV(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var JJ=class{constructor(){this.map=[]}add(e,t,n){YJ(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function YJ(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function XJ(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function ZJ(){return{flow:{null:{name:`table`,tokenize:QJ,resolveAll:$J}}}}function QJ(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):TV(t)?AV(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||wV(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,TV(t)?AV(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return TV(t)?AV(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||$(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return TV(t)?AV(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||$(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||$(n)?(e.exit(`tableRow`),t(n)):TV(n)?AV(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||wV(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function $J(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new JJ;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(tY(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=eY(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=eY(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=eY(f,t,o,i,n,d)):(o[0]=o[1],d=eY(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&tY(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=XJ(t.events,n))}return e}function eY(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},nY(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=nY(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=nY(t.events,n[2]),a=nY(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},nY(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function tY(e,t,n,r,i){let a=[],o=nY(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function nY(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var rY={name:`tasklistCheck`,tokenize:aY};function iY(){return{text:{91:rY}}}function aY(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return wV(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return $(r)?t(r):TV(r)?e.check({tokenize:oY},t,n)(r):n(r)}}function oY(e,t,n){return AV(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function sY(e){return fV([CJ(),zJ(),qJ(e),ZJ(),iY()])}var cY={};function lY(e){let t=this,n=e||cY,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(sY(n)),a.push(fJ()),o.push(pJ(n))}var uY=e=>{let t={...e};return delete t.node,t},dY=()=>(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`flowent-response-cursor`,"data-testid":`response-cursor`}),fY=e=>e?.position?.end?.offset??-1,pY=e=>{if(!e)return-1;let t=fY(e),n=(e.children??[]).map(pY);return Math.max(t,...n)},mY=new Set([`blockquote`,`h1`,`h2`,`h3`,`ol`,`p`,`pre`,`table`,`ul`]),hY=e=>(e?.children??[]).some(e=>e.type===`element`&&e.tagName!==void 0&&mY.has(e.tagName)),gY=e=>typeof e?.position?.start?.line==`number`&&typeof e.position.end?.line==`number`&&e.position.start.line!==e.position.end.line,_Y=(e,t)=>t>=0&&pY(e)===t,vY=(e,t)=>(0,q.jsxs)(q.Fragment,{children:[e,t?(0,q.jsx)(dY,{}):null]});function yY({content:e,isStreaming:t=!1}){let n=t?e.trimEnd().length:-1;return(0,q.jsx)(aK,{components:{a:({className:e,...t})=>(0,q.jsx)(`a`,{className:W(`text-white underline underline-offset-4`,e),rel:`noreferrer`,target:`_blank`,...uY(t)}),blockquote:({className:e,...t})=>(0,q.jsx)(`blockquote`,{className:W(`my-3 border-l border-white/20 pl-4 text-white/80`,e),...uY(t)}),code:({className:e,children:t,node:r,...i})=>{let a=gY(r);return(0,q.jsx)(`code`,{className:W(`font-mono text-[0.92em] text-white`,!a&&`rounded bg-white/10 px-1.5 py-0.5`,e),...uY(i),children:vY(t,_Y(r,n)&&a)})},h1:({className:e,children:t,node:r,...i})=>(0,q.jsx)(`h1`,{className:W(`mb-3 mt-5 text-2xl font-semibold text-white`,e),...uY(i),children:vY(t,_Y(r,n))}),h2:({className:e,children:t,node:r,...i})=>(0,q.jsx)(`h2`,{className:W(`mb-2.5 mt-5 text-xl font-semibold text-white`,e),...uY(i),children:vY(t,_Y(r,n))}),h3:({className:e,children:t,node:r,...i})=>(0,q.jsx)(`h3`,{className:W(`mb-2 mt-4 text-lg font-semibold text-white`,e),...uY(i),children:vY(t,_Y(r,n))}),hr:({className:e,...t})=>(0,q.jsx)(`hr`,{className:W(`my-4 border-white/10`,e),...uY(t)}),li:({className:e,children:t,node:r,...i})=>(0,q.jsx)(`li`,{className:W(`pl-1`,e),...uY(i),children:vY(t,_Y(r,n)&&!hY(r))}),ol:({className:e,...t})=>(0,q.jsx)(`ol`,{className:W(`my-3 list-decimal space-y-1 pl-6`,e),...uY(t)}),p:({className:e,children:t,node:r,...i})=>(0,q.jsx)(`p`,{className:W(`my-3 first:mt-0 last:mb-0`,e),...uY(i),children:vY(t,_Y(r,n))}),pre:({className:e,...t})=>(0,q.jsx)(`pre`,{className:W(`my-3 overflow-x-auto rounded-lg border border-white/10 bg-white/[0.045] p-3 text-sm leading-6 text-white`,e),...uY(t)}),table:({className:e,...t})=>(0,q.jsx)(`div`,{className:`my-3 overflow-x-auto`,children:(0,q.jsx)(`table`,{className:W(`w-full border-collapse text-left text-sm`,e),...uY(t)})}),tbody:({className:e,...t})=>(0,q.jsx)(`tbody`,{className:W(`divide-y divide-white/10`,e),...uY(t)}),td:({className:e,...t})=>(0,q.jsx)(`td`,{className:W(`border border-white/10 px-3 py-2 align-top`,e),...uY(t)}),th:({className:e,...t})=>(0,q.jsx)(`th`,{className:W(`border border-white/10 bg-white/[0.04] px-3 py-2 font-medium`,e),...uY(t)}),thead:({className:e,...t})=>(0,q.jsx)(`thead`,{className:W(`text-white`,e),...uY(t)}),ul:({className:e,...t})=>(0,q.jsx)(`ul`,{className:W(`my-3 list-disc space-y-1 pl-6`,e),...uY(t)})},remarkPlugins:[lY],children:e})}function bY({children:e,className:t,disabled:n,label:r,onClick:i}){return(0,q.jsxs)(xz,{children:[(0,q.jsx)(Sz,{asChild:!0,children:(0,q.jsx)(X,{"aria-label":r,className:W(`size-7 rounded-lg border-0 bg-transparent text-white/45 shadow-none transition-colors hover:bg-white/10 hover:text-white focus-visible:ring-2 focus-visible:ring-white/20 disabled:pointer-events-auto disabled:cursor-not-allowed disabled:text-white/20 disabled:opacity-100 disabled:hover:bg-transparent`,t),disabled:n,onClick:i,size:`icon-sm`,type:`button`,variant:`ghost`,children:e})}),(0,q.jsx)(Cz,{side:`top`,sideOffset:6,children:r})]})}function xY({tool:e}){let[t,n]=(0,b.useState)(!1),r=e.status===`waiting`?`Waiting`:e.status===`running`?`Running`:e.status===`success`?`Done`:`Failed`;return(0,q.jsxs)(`div`,{className:`max-w-full text-base leading-5 text-white`,children:[(0,q.jsxs)(X,{"aria-expanded":t,className:`h-8 w-full justify-start gap-2 rounded-lg border-0 bg-transparent px-2 text-base text-white shadow-none hover:bg-transparent hover:text-white aria-expanded:bg-transparent aria-expanded:text-white active:not-aria-[haspopup]:translate-y-0`,onClick:()=>n(e=>!e),type:`button`,variant:`ghost`,children:[(0,q.jsx)(pm,{"aria-hidden":`true`,className:W(`size-3.5 shrink-0 text-white/55 transition-transform`,t?`rotate-90`:``)}),(0,q.jsx)(PY,{tool:e}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:e.title}),(0,q.jsx)(`span`,{className:`shrink-0 text-xs text-white/55`,children:r})]}),t?(0,q.jsx)(SY,{tool:e}):null]})}function SY({tool:e}){let t=NY(e.result),n=MY(e.arguments),r=DY(e),i=r.payloads.length>0||r.exitCode!==void 0;return!n&&!i?null:(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 py-1`,children:[n?(0,q.jsx)(wY,{label:`ARGS`,value:EY(e.arguments)}):null,r.payloads.map(e=>(0,q.jsx)(wY,{label:e.label,value:e.value},e.label)),r.exitCode===void 0?null:(0,q.jsx)(TY,{exitCode:r.exitCode}),t?(0,q.jsx)(CY,{approval:t}):null]})}function CY({approval:e}){let t=e.decision===`denied`?`Denied`:`Approved`,n=e.toolResult?.trim()?e.toolResult:null;return(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`div`,{className:`mb-1 text-[11px] font-medium leading-4 text-white/45`,children:`REVIEW`}),(0,q.jsxs)(`div`,{className:`grid gap-1 rounded-md border border-white/10 bg-black px-2.5 py-2 text-xs leading-5 text-white/70`,children:[(0,q.jsx)(`div`,{className:`font-medium text-white`,children:t}),e.reason?(0,q.jsx)(`div`,{className:`break-words text-white/60`,children:e.reason}):null,n?(0,q.jsxs)(`div`,{className:`mt-1.5 border-t border-white/5 pt-1.5`,children:[(0,q.jsx)(`div`,{className:`mb-0.5 text-[10px] font-medium leading-4 text-white/40`,children:`FAILURE`}),(0,q.jsx)(`div`,{className:`whitespace-pre-wrap break-words font-mono text-[11px] leading-4 text-white/50`,children:n})]}):null,e.writePaths?.length?(0,q.jsx)(`div`,{className:`grid gap-0.5 font-mono text-[11px] leading-4 text-white/50`,children:e.writePaths.map(e=>(0,q.jsx)(`span`,{className:`break-words`,children:e},e))}):null]})]})}function wY({label:e,value:t}){return(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`div`,{className:`mb-1 text-[11px] font-medium leading-4 text-white/45`,children:e}),(0,q.jsx)(`pre`,{className:`max-h-64 overflow-auto rounded-md bg-input/20 px-2.5 py-2 font-mono text-xs leading-5 text-white/70`,children:(0,q.jsx)(`code`,{className:`whitespace-pre-wrap break-words`,children:t})})]})}function TY({exitCode:e}){return(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] font-medium leading-4 text-white/45`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:W(`size-1.5 rounded-full`,e===`0`?`bg-[#7ddf89]`:`bg-[#ff7474]`)}),(0,q.jsxs)(`span`,{children:[`Exit `,e]})]})}function EY(e){return typeof e==`string`?e:JSON.stringify(e,null,2)}function DY(e){let t=e.result;if(!MY(t))return{payloads:[]};let n=Object.fromEntries(Object.entries(t).filter(([e])=>e!==`approval`));return typeof n.text==`string`?{payloads:[{label:`RESULT`,value:n.text}]}:n.type===`command`?OY(n):typeof n.output==`string`?{payloads:[{label:`RESULT`,value:n.output}]}:{payloads:[{label:`RESULT`,value:EY(n)}]}}function OY(e){let t=AY(e.output_chunks);if(t.length>0)return kY({exitCode:e.exit_code,stderr:jY(t,`stderr`),stdout:jY(t,`stdout`)});let n=typeof e.stdout==`string`?e.stdout.trim():``,r=typeof e.stderr==`string`?e.stderr.trim():``,i=typeof e.output==`string`?e.output.trim():``;return n||r||e.exit_code!==void 0?kY({exitCode:e.exit_code,stderr:r,stdout:n}):i?{payloads:[{label:`RESULT`,value:i}]}:{payloads:[{label:`RESULT`,value:EY(e)}]}}function kY({exitCode:e,stderr:t,stdout:n}){return{exitCode:e===void 0?void 0:String(e),payloads:[...n.trim()?[{label:`STDOUT`,value:n}]:[],...t.trim()?[{label:`STDERR`,value:t}]:[]]}}function AY(e){return Array.isArray(e)?e.flatMap(e=>!e||typeof e!=`object`||!(`content`in e)||!(`stream`in e)||typeof e.content!=`string`||e.stream!==`stdout`&&e.stream!==`stderr`?[]:[{content:e.content,stream:e.stream}]):[]}function jY(e,t){return e.filter(e=>e.stream===t).map(e=>e.content).join(``).trimEnd()}function MY(e){return e!=null&&Object.keys(e).length>0}function NY(e){let t=e?.approval;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;return{action:typeof n.action==`string`?n.action:void 0,decision:typeof n.decision==`string`?n.decision:void 0,reason:typeof n.reason==`string`?n.reason:void 0,toolResult:typeof n.tool_result==`string`?n.tool_result:void 0,toolName:typeof n.tool_name==`string`?n.tool_name:void 0,writePaths:Array.isArray(n.write_paths)?n.write_paths.filter(e=>typeof e==`string`):void 0}}function PY({tool:e}){let t=W(`size-3.5 shrink-0`,e.status===`failed`?`text-red-300`:`text-white/80`,e.status===`running`?`animate-pulse`:``,e.status===`waiting`?`text-amber-300`:``);return e.status===`success`?(0,q.jsx)(dm,{"aria-hidden":`true`,className:t}):e.status===`failed`?(0,q.jsx)(Qm,{"aria-hidden":`true`,className:t}):e.status===`waiting`?(0,q.jsx)(Ym,{"aria-hidden":`true`,className:t}):e.name===`web_search`||e.name===`grep_files`?(0,q.jsx)(Bm,{"aria-hidden":`true`,className:t}):e.name===`shell_command`?(0,q.jsx)(Km,{"aria-hidden":`true`,className:t}):(0,q.jsx)(vm,{"aria-hidden":`true`,className:t})}function FY({disableErrorRetry:e,groups:t,isStreaming:n,onRetryError:r,showWaitingAfterOutput:i}){let a=t.flatMap(e=>e.items).reverse().find(e=>e.type===`text`)?.id;return(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col`,"aria-label":`Assistant response`,children:[t.map((t,i)=>(0,q.jsxs)(b.Fragment,{children:[i>0?(0,q.jsx)(RY,{}):null,(0,q.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:t.items.map(t=>t.type===`tool`?(0,q.jsx)(xY,{tool:t.tool},t.id):t.type===`thinking`?(0,q.jsx)(zY,{content:t.content,isStreaming:t.isStreaming===!0},t.id):t.type===`error`?(0,q.jsx)(LY,{disabled:e,item:t,onRetry:()=>r(t.id)},t.id):(0,q.jsx)(yY,{content:t.content,isStreaming:n&&t.id===a},t.id))})]},t.id)),i?(0,q.jsx)(`div`,{className:`mt-3`,children:(0,q.jsx)(IY,{})}):null]})}function IY(){return(0,q.jsxs)(`div`,{"aria-label":`Thinking`,className:`flex h-6 items-center gap-1.5`,role:`status`,children:[(0,q.jsx)(`span`,{className:`flowent-thinking-dot`}),(0,q.jsx)(`span`,{className:`flowent-thinking-dot`}),(0,q.jsx)(`span`,{className:`flowent-thinking-dot`})]})}function LY({disabled:e,item:t,onRetry:n}){return(0,q.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-red-500/15 bg-red-500/[0.06] p-3 text-base leading-5 text-red-100/90`,role:`alert`,children:[(0,q.jsx)(Ym,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-red-400`}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`div`,{className:`font-semibold text-red-100/95`,children:t.title}),(0,q.jsx)(`div`,{className:`mt-1 text-red-100/75`,children:t.message}),t.detail?(0,q.jsx)(`div`,{className:`mt-2 break-words text-xs leading-5 text-red-100/55`,children:t.detail}):null]}),(0,q.jsx)(bY,{className:`shrink-0 text-red-100/55 hover:bg-red-400/10 hover:text-red-50 disabled:text-red-100/25`,disabled:e,label:`Retry`,onClick:n,children:(0,q.jsx)(Rm,{"aria-hidden":`true`,className:`size-4`})})]})}function RY(){return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`my-3 h-px w-full bg-white/10`,"data-testid":`assistant-output-separator`})}function zY({content:e,isStreaming:t}){let[n,r]=(0,b.useState)(!1),i=t||n;return(0,q.jsxs)(`div`,{className:`max-w-full text-base leading-5 text-white`,children:[(0,q.jsxs)(X,{"aria-expanded":i,className:`h-8 w-full justify-start gap-2 rounded-lg border-0 bg-transparent px-2 text-base text-white/75 shadow-none hover:bg-input/30 hover:text-white`,onClick:()=>r(e=>!e),type:`button`,variant:`ghost`,children:[(0,q.jsx)(pm,{"aria-hidden":`true`,className:W(`size-3.5 shrink-0 transition-transform`,i?`rotate-90`:``)}),(0,q.jsx)(vm,{"aria-hidden":`true`,className:W(`size-3.5 shrink-0 text-white/70`,t?`animate-pulse`:``)}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t?`Thinking...`:`Thought Process`})]}),i?(0,q.jsx)(`div`,{className:`py-1`,children:(0,q.jsx)(`div`,{className:`whitespace-pre-wrap break-words text-base leading-5 text-white/60`,children:e})}):null]})}function BY(e){if(e.groups?.length)return e.groups.filter(e=>e.items.length>0);if(e.items?.length)return[{id:`${e.id}-items`,items:e.items}];let t=(e.tools??[]).map(e=>({id:`tool-${e.id}`,tool:e,type:`tool`})),n=e.thinking?{content:e.thinking,id:`${e.id}-thinking`,isStreaming:e.isStreamingThinking,type:`thinking`}:null,r=[],i=[...n?[n]:[],...t];if(t.length&&r.push({id:`${e.id}-process`,items:i}),e.content){let n={content:e.content,id:`${e.id}-content`,type:`text`};t.length?r.push({id:`${e.id}-content`,items:[n]}):r.push({id:`${e.id}-content`,items:[...i,n]})}else i.length&&!t.length&&r.push({id:`${e.id}-process`,items:i});return r}var VY=12e4,HY=12e3;function UY(e,t,n,r){let i=GY(e),a=n??(i>=0?e[i].usage_info:null),o=a?.last_token_usage.total_tokens,s=[...(a&&i>=0?e.slice(i+1):a?[]:e).map(e=>e.content),t].reduce((e,t)=>e+qY(t),Math.max(0,o??0)),c=Math.max(1,r??a?.model_context_window??VY),l=KY(s,c);return{percent:l,tone:l>90?`critical`:l>=75?`warning`:`neutral`,total:c,used:s}}function WY(e){return e>=1e3?`${Math.floor(e/1e3)}k`:e.toString()}function GY(e){for(let t=e.length-1;t>=0;--t)if(e[t].usage_info)return t;return-1}function KY(e,t){if(t<=HY)return e>0?100:0;let n=Math.max(0,e-HY),r=t-HY;return Math.min(100,Math.floor(n/r*100))}function qY(e){return e?Math.max(1,Math.ceil(new TextEncoder().encode(e).length/4)):0}function JY({capacity:e,isRefining:t}){let n=e.tone===`critical`?`bg-red-500`:e.tone===`warning`?`bg-amber-500`:`bg-zinc-400`,r=e.tone===`critical`?`text-red-400`:e.tone===`warning`?`text-amber-400`:`text-zinc-300`,i=`${WY(e.used)} / ${WY(e.total)}`;return(0,q.jsxs)(`div`,{"aria-busy":t,"aria-live":`polite`,className:`flex min-h-9 items-center justify-between gap-3 border-t border-zinc-800/50 bg-zinc-900/40 px-4 py-1.5 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)] transition-colors`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-[10px] font-semibold tracking-wider text-zinc-500 uppercase`,children:[(0,q.jsx)(sm,{"aria-hidden":`true`,className:W(`size-3 shrink-0`,t&&`animate-pulse`)}),(0,q.jsx)(`span`,{className:`hidden sm:inline`,children:`Context`})]}),(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(`span`,{className:W(`text-[10px] font-semibold whitespace-nowrap`,t?`animate-pulse text-zinc-300`:`text-zinc-500 uppercase`),children:t?`Refining...`:i}),(0,q.jsx)(`div`,{"aria-label":`Context capacity status`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":e.percent,className:`h-1 w-16 overflow-hidden rounded-full bg-zinc-800 sm:w-24`,role:`progressbar`,children:(0,q.jsx)(`div`,{className:W(`h-full rounded-full transition-all duration-500 ease-in-out`,t&&`flowent-context-refining-indicator w-1/3 opacity-80`,n),style:{width:t?void 0:`${e.percent}%`}})}),!t&&(0,q.jsxs)(`span`,{className:W(`text-[10px] font-semibold`,r),children:[e.percent,`%`]})]})]})}function YY(e){let t=[];for(let n of e)n.author!==`user`||n.content.trim().length===0||t.at(-1)!==n.content&&t.push(n.content);return t}function XY(e){return!e.value.slice(0,e.selectionStart).includes(`
|
|
95
|
-
`)}function
|
|
96
|
-
`)}function
|
|
97
|
-
`)[0]??``,L=I.startsWith(`/`)?I.slice(1):``,ee=I.startsWith(`/`)&&!L.includes(`/`)&&!I.includes(` `),te=(0,b.useMemo)(()=>{if(!ee)return[];let t=L.toLowerCase();return e.filter(e=>e.name.toLowerCase().startsWith(t))},[L,e,ee]),ne=ee&&!D&&te.length>0,R=n.match(/(?:^|\s)\$([a-z0-9-]*)$/i),z=R?.[1]??``,B=!!R,re=(0,b.useMemo)(()=>{if(!B)return[];let e=z.toLowerCase();return h.filter(t=>t.enabled&&!t.error&&t.slug.toLowerCase().startsWith(e))},[B,z,h]),ie=!ne&&B&&!k&&re.length>0,ae=e.find(e=>e.name===L),oe=!!(ee&&ae)&&(!a||ae?.id===`clear`),se=()=>_.current?.value??n,ce=
|
|
98
|
-
`).map(e=>e.trim()).find(e=>e.length>0)?.replace(/\s+/g,` `);return t?t.length<=64?t:`${t.slice(0,61)}…`:`Message`}function sX(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.author!==`assistant`)continue;let r=n.tools??[];for(let e=r.length-1;e>=0;--e){let t=r[e];if(t.name!==`update_plan`)continue;let n=cX(t.result)??cX(t.arguments);if(n?.length)return{items:n}}}return null}function cX(e){let t=e?.items;return Array.isArray(t)?t.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e,n=typeof t.step==`string`?t.step.trim():``;return n?[{status:lX(t.status),step:n}]:[]}):null}function lX(e){return e===`completed`||e===`in_progress`||e===`pending`?e:`pending`}function uX({commands:e,contextWindowLimit:t,draft:n,errorMessage:r,isRefiningContext:i,isResponding:a,messages:o,usageInfo:s,onCommand:c,onCommandError:l,onDraftChange:u,onEditMessage:d,onRetryError:f,onRetryMessage:p,onSendMessage:m,onStopResponse:h,skills:g}){let[_,v]=(0,b.useState)(112);return(0,q.jsx)(`section`,{className:`h-full min-h-0 bg-black`,"aria-label":`Workspace`,children:(0,q.jsx)(bz,{delayDuration:500,children:(0,q.jsxs)(`div`,{className:`relative h-full min-h-0 min-w-0 overflow-hidden`,children:[(0,q.jsx)(iX,{commands:e,contextWindowLimit:t,draft:n,errorMessage:r,isRefiningContext:i,isSending:a,messages:o,plan:(0,b.useMemo)(()=>sX(o),[o]),usageInfo:s,onCommand:c,onCommandError:l,onDraftChange:u,onSendMessage:m,onStopResponse:h,onOffsetChange:v,skills:g}),(0,q.jsx)(dX,{composerOffset:_,isResponding:a,messages:o,onEditMessage:d,onRetryError:f,onRetryMessage:p})]})})})}function dX({composerOffset:e,isResponding:t,messages:n,onEditMessage:r,onRetryError:i,onRetryMessage:a}){let o=(0,b.useRef)(null),s=(0,b.useRef)(!0),c=(0,b.useRef)(null),l=n.at(-1),u=l?.author??``,d=l?.id??``,f=(0,b.useRef)(d),p=(0,b.useMemo)(()=>!t||u===`assistant`?n:[...n,{author:`assistant`,content:``,id:`assistant-pending`}],[t,u,n]),m=t&&u===`assistant`?d:``;(0,b.useEffect)(()=>{d!==f.current&&(f.current=d,u===`user`&&(s.current=!0)),s.current&&c.current?.scrollIntoView({block:`end`,behavior:`smooth`})},[p,u,d]);let h=()=>{let e=o.current;e&&(s.current=e.scrollHeight-e.scrollTop-e.clientHeight<96)},g=(0,b.useMemo)(()=>fX(p),[p]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{"aria-label":`Conversation messages`,"aria-live":`polite`,className:W(`absolute inset-0 flex min-h-0 flex-col overflow-auto bg-black px-6 pt-12 max-[900px]:px-4`,Xw),onScroll:h,ref:o,style:{paddingBottom:e,scrollPaddingBottom:e},children:[p.length===0?(0,q.jsx)(`div`,{className:`mx-auto grid min-h-full w-full max-w-4xl place-items-center pb-24`,children:(0,q.jsx)(`h1`,{className:`m-0 text-center text-[28px] font-medium leading-[1.2] text-white max-[560px]:text-2xl`,children:`Where should we begin?`})}):null,p.map(e=>(0,q.jsx)(b.Fragment,{children:e.author===`system`?(0,q.jsx)(pX,{message:e}):(0,q.jsx)(mX,{isStreaming:t&&e.id===m&&e.author===`assistant`&&e.isStreamingText===!0,isPending:e.id===`assistant-pending`||t&&e.author===`assistant`&&e.id===m&&e.isStreamingText!==!0,isResponding:t,message:e,onEditMessage:r,onRetryError:i,onRetryMessage:a})},e.id)),(0,q.jsx)(`div`,{"aria-hidden":`true`,ref:c})]}),(0,q.jsx)(aX,{messageListRef:o,messages:g})]})}function fX(e){return e.filter(e=>e.id!==`assistant-pending`&&(e.author===`user`||e.author===`assistant`)&&e.content.trim().length>0)}function pX({message:e}){let[t,n]=(0,b.useState)(!1),r=Zp(),i=e.content===`Context compacted`||e.content===`Context optimized`,a=e.content===`Context optimized`?Wm:e.content===`Context compacted`?dm:null;if(i){let i=`${e.id}-summary`;return(0,q.jsx)(`div`,{className:`mx-auto flex w-full max-w-4xl py-3`,children:(0,q.jsxs)(`div`,{className:`w-full overflow-hidden rounded-xl border border-white/10 bg-input/20 text-white shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]`,children:[(0,q.jsxs)(X,{"aria-controls":i,"aria-expanded":t,className:`h-auto w-full justify-between rounded-xl border-0 bg-transparent px-4 py-3 text-left text-base leading-5 text-white/80 shadow-none hover:bg-input/30 hover:text-white focus-visible:ring-2 focus-visible:ring-white/20`,onClick:()=>n(e=>!e),type:`button`,variant:`ghost`,children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[a?(0,q.jsx)(a,{"aria-hidden":`true`,className:`size-4 shrink-0 text-white/55`}):null,(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.content})]}),(0,q.jsx)(pm,{"aria-hidden":`true`,className:W(`size-4 shrink-0 text-white/45 transition-transform duration-200`,t&&`rotate-90`)})]}),(0,q.jsx)($d,{initial:!1,children:t?(0,q.jsx)(Xp.div,{animate:{height:`auto`,opacity:1},className:`overflow-hidden`,exit:r?{opacity:0}:{height:0,opacity:0},initial:r?{opacity:0}:{height:0,opacity:0},transition:{duration:.18,ease:[.32,.72,0,1]},children:(0,q.jsx)(`div`,{"aria-label":`${e.content} summary`,className:`border-t border-white/10 px-4 py-3 text-sm leading-6 text-white/80`,id:i,role:`region`,children:(0,q.jsx)(yY,{content:e.summary??``})})}):null})]})})}return(0,q.jsx)(`div`,{className:`mx-auto flex w-full max-w-4xl justify-center py-3`,children:(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-full border border-white/10 bg-input/30 px-3 py-1.5 text-base leading-5 text-white/70`,children:[a?(0,q.jsx)(a,{"aria-hidden":`true`,className:`size-3.5 text-white/50`}):null,e.content]})})}function mX({isPending:e,isResponding:t,isStreaming:n,message:r,onEditMessage:i,onRetryError:a,onRetryMessage:o}){let[s,c]=(0,b.useState)(!1),l=r.author===`assistant`?BY(r):[],u=l.at(-1)?.items.at(-1),d=e&&l.length===0,f=e&&l.length>0&&!n&&(u?.type!==`tool`||u.tool.status!==`waiting`),p=r.author===`user`,m=t||r.id===`assistant-pending`,h=t||!p;return(0,q.jsx)(`article`,{id:r.id,className:W(`flowent-message-row group/message mx-auto flex w-full max-w-4xl scroll-mt-12 scroll-mb-40 py-3`,r.author===`user`?`justify-end`:`justify-start`),children:(0,q.jsx)(`div`,{className:W(`flex min-w-0 flex-col text-base leading-6 text-white`,r.author===`user`?`max-w-[70%] items-end`:`w-full max-w-full`),children:s?(0,q.jsx)(hX,{initialContent:r.content,isResponding:t,onCancel:()=>c(!1),onSave:e=>{i({action:`save`,content:e,messageId:r.id}),c(!1)},onSaveAndRetry:e=>{i({action:`resend`,content:e,messageId:r.id}),c(!1)}}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:W(`min-w-0`,r.author===`user`?`flowent-user-message-bubble rounded-[22px] px-4 py-2.5`:`w-full max-w-full`),children:d?(0,q.jsx)(IY,{}):(0,q.jsx)(yX,{assistantGroups:l,disableErrorRetry:m,isStreaming:n,message:r,onRetryError:e=>a({errorId:e,messageId:r.id}),showWaitingAfterOutput:f})}),(0,q.jsx)(gX,{canEdit:p,disableEdit:h,disableRetry:m,message:r,onEdit:()=>c(!0),onRetry:()=>o(r.id)})]})})})}function hX({initialContent:e,isResponding:t,onCancel:n,onSave:r,onSaveAndRetry:i}){let[a,o]=(0,b.useState)(e),s=a.length===0,c=s||t;return(0,q.jsxs)(`div`,{className:`w-full min-w-[min(420px,70vw)] max-w-[min(720px,70vw)] rounded-[22px] border border-white/10 bg-input/30 p-2.5 shadow-[inset_0_0_1px_rgba(255,255,255,0.12)]`,children:[(0,q.jsx)(JT,{"aria-label":`Edit message`,autoFocus:!0,className:`max-h-[240px] min-h-28 resize-none border-white/10 bg-black/30 px-3 py-2 text-base leading-6 text-white shadow-none focus-visible:border-white/20 focus-visible:ring-1 focus-visible:ring-white/20 dark:bg-black/30`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),n();return}e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&!c&&(e.preventDefault(),i(a))}}),(0,q.jsxs)(`div`,{className:`mt-2 flex items-center justify-end gap-1`,children:[(0,q.jsx)(bY,{label:`Cancel`,onClick:n,children:(0,q.jsx)(Qm,{"aria-hidden":`true`,className:`size-4`})}),(0,q.jsx)(bY,{disabled:s,label:`Save`,onClick:()=>r(a),children:(0,q.jsx)(zm,{"aria-hidden":`true`,className:`size-4`})}),(0,q.jsx)(bY,{disabled:c,label:`Save and retry`,onClick:()=>i(a),children:(0,q.jsx)(Vm,{"aria-hidden":`true`,className:`size-4`})})]})]})}function gX({canEdit:e,disableEdit:t,disableRetry:n,message:r,onEdit:i,onRetry:a}){let[o,s]=(0,b.useState)(`idle`),c=(0,b.useRef)(null);(0,b.useEffect)(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);let l=e=>{s(e),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{s(`idle`),c.current=null},e===`copied`?2e3:1200)},u=async()=>{l(await _X(r.content)?`copied`:`failed`)},d=o===`copied`?`Copied`:o===`failed`?`Copy failed`:`Copy`;return(0,q.jsxs)(`div`,{className:W(`mt-1 flex items-center gap-0.5 opacity-100 transition-opacity duration-150 hover-only:opacity-0 hover-only:group-hover/message:opacity-100 focus-within:opacity-100`,r.author===`user`?`justify-end pr-1`:`justify-start pl-1`),children:[(0,q.jsx)(bY,{label:d,onClick:()=>void u(),children:o===`copied`?(0,q.jsx)(dm,{"aria-hidden":`true`,className:`size-4 text-white`}):o===`failed`?(0,q.jsx)(Ym,{"aria-hidden":`true`,className:`size-4 text-amber-300`}):(0,q.jsx)(xm,{"aria-hidden":`true`,className:`size-4`})}),e?(0,q.jsx)(bY,{disabled:t,label:`Edit`,onClick:i,children:(0,q.jsx)(jm,{"aria-hidden":`true`,className:`size-4`})}):null,(0,q.jsx)(bY,{disabled:n,label:`Retry`,onClick:a,children:(0,q.jsx)(Rm,{"aria-hidden":`true`,className:`size-4`})})]})}async function _X(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{return vX(e)}return vX(e)}function vX(e){if(typeof document.execCommand!=`function`)return!1;let t=document.activeElement,n=document.createElement(`textarea`);n.value=e,n.setAttribute(`readonly`,``),n.style.position=`fixed`,n.style.top=`-9999px`,n.style.left=`-9999px`,n.style.width=`1px`,n.style.height=`1px`,n.style.opacity=`0`,document.body.appendChild(n),n.focus(),n.select();let r=!1;try{r=document.execCommand(`copy`)}finally{n.remove(),t instanceof HTMLElement&&t.focus({preventScroll:!0})}return r}function yX({assistantGroups:e,disableErrorRetry:t,isStreaming:n,message:r,onRetryError:i,showWaitingAfterOutput:a}){return r.author===`assistant`?(0,q.jsx)(`div`,{className:`flowent-markdown-message min-w-0 break-words`,children:(0,q.jsx)(FY,{disableErrorRetry:t,groups:e,isStreaming:n,onRetryError:i,showWaitingAfterOutput:a})}):(0,q.jsx)(`div`,{className:`flowent-markdown-message min-w-0 break-words`,children:(0,q.jsx)(`p`,{className:`m-0 whitespace-pre-wrap break-words`,children:r.content})})}function bX(){let e=BT(),t=(0,b.useMemo)(()=>er(),[]),[n,r]=(0,b.useState)(t.view),i=(0,b.useRef)(null),a=(0,b.useCallback)(async()=>{await i.current?.()},[]),{commands:o,draft:s,editMessage:c,handleCommandError:l,isRefiningContext:u,isResponding:d,loadState:f,messages:p,responseError:m,retryError:h,retryMessage:g,runCommand:_,sendMessage:v,setContextWindowLimit:y,setDraft:x,stopResponse:S,usageInfo:C}=Kn({refreshAppState:(0,b.useCallback)(async()=>i.current?.()??null,[]),showError:e.error}),{activeProvider:w,agentPrompt:T,contextWindowLimit:E,fetchProviderModels:D,handleActiveModelChange:O,handleActiveProviderChange:k,handleReasoningEffortChange:A,isCreatingProvider:j,isFetchingModels:M,loadProviderEditor:N,openNewProviderEditor:P,providerDraft:F,providers:I,reasoningEffort:L,removeProvider:ee,replaceProviders:te,replaceRuntimeSettings:ne,saveProvider:R,saveRuntimeSettings:z,selectedModel:B,selectedProviderId:re,updateProviderDraft:ie}=_n({onContextWindowLimitChange:(0,b.useCallback)(e=>{y(e)},[y]),refreshAppState:a,showError:e.error}),{activeSkill:ae,addWritablePath:oe,approveTelegramSession:se,reloadSkills:ce,removeWritablePath:le,replaceSkills:ue,replaceTelegramBot:de,replaceWritablePaths:fe,saveTelegramBot:pe,selectSkill:me,skills:he,telegramBot:ge,toggleSkill:_e,updateTelegramBot:ve,writablePaths:ye}=sn(),{importMcpServer:be,importingMcpServerId:xe,isCreatingMcpServer:Se,isMcpImportOpen:Ce,isPreviewingMcpImport:we,loadMcpEditor:Te,mcpDraft:V,mcpImportPreview:Ee,mcpImportSource:De,mcpServers:Oe,openMcpImport:ke,openNewMcpEditor:Ae,reconnectMcpServer:je,removeMcpServer:Me,replaceMcpServers:Ne,saveMcpServer:Pe,updateMcpDraft:Fe,updateMcpImportSource:Ie}=$t({showError:e.error}),{activeWorkflow:H,activeWorkflowId:Le,closeWorkflowEditor:Re,deleteWorkflow:ze,finishWorkflowRun:Be,newWorkflowKey:Ve,openNewWorkflow:He,openWorkflow:Ue,replaceWorkflows:U,runWorkflow:We,runningWorkflowId:Ge,saveWorkflow:Ke,workflowRunResult:qe,workflows:Je}=Wt(t.workflowId),{appVersion:Ye,refreshAppState:Xe}=qn({loadWorkspaceState:f,mcpServers:Oe,replaceMcpServers:Ne,replaceProviders:te,replaceRuntimeSettings:ne,replaceSkills:ue,replaceTelegramBot:de,replaceWorkflows:U,replaceWritablePaths:fe,showError:e.error,skills:he,telegramBot:ge});i.current=Xe;let Ze=(0,b.useCallback)((e,t=``,n)=>{r(e),e===`workflows`&&(t?Ue(t):He()),nr({view:e,workflowId:t},n)},[He,Ue]);return(0,b.useEffect)(()=>{nr({view:n,workflowId:n===`workflows`?Le:``},{replace:!0})},[n,Le]),(0,b.useEffect)(()=>{let e=()=>{let e=er();if(r(e.view),e.view===`workflows`){e.workflowId?Ue(e.workflowId):He();return}Re()};return window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`popstate`,e)}},[Re,He,Ue]),(0,q.jsxs)(fT,{activeProviderName:w?.name,activeView:n,activeWorkflowId:Le,onNewWorkflow:()=>Ze(`workflows`),onViewChange:e=>Ze(e),onWorkflowSelect:e=>Ze(`workflows`,e),workflows:Je,children:[(0,q.jsx)(Gw,{value:`workspace`,className:Kw,tabIndex:-1,children:(0,q.jsx)(uX,{contextWindowLimit:E,draft:s,errorMessage:m,isRefiningContext:u,isResponding:d,messages:p,usageInfo:C,commands:o,skills:he,onCommand:_,onCommandError:l,onDraftChange:x,onEditMessage:e=>{c(e)},onRetryMessage:e=>{g(e)},onRetryError:e=>{h(e)},onSendMessage:e=>{v(e)},onStopResponse:S})}),(0,q.jsx)(Gw,{value:`workflows`,className:Kw,children:(0,q.jsx)(yz,{activeWorkflow:H,isRunningWorkflow:!!Ge,newWorkflowKey:Ve,onCloseEditor:()=>Ze(`workspace`),onDeleteWorkflow:ze,onFinishWorkflowRun:Be,onRunWorkflow:We,onSaveWorkflow:Ke,runningWorkflowId:Ge,workflowRunResult:qe})}),(0,q.jsx)(Gw,{value:`providers`,className:Kw,children:(0,q.jsx)(UT,{activeProvider:F,isFetchingModels:M,isCreatingProvider:j,onFetchModels:D,onNewProvider:P,onProviderSelect:N,onRemoveProvider:ee,onSaveProvider:R,onUpdateProvider:ie,providers:I})}),(0,q.jsx)(Gw,{value:`channels`,className:Kw,children:(0,q.jsx)(wT,{onApproveSession:se,onSaveTelegramBot:pe,onUpdateTelegramBot:ve,telegramBot:ge})}),(0,q.jsx)(Gw,{value:`permissions`,className:Kw,children:(0,q.jsx)(VT,{onAddWritablePath:oe,onRemoveWritablePath:e=>{le(e)},writablePaths:ye})}),(0,q.jsx)(Gw,{value:`mcp`,className:Kw,children:(0,q.jsx)(kT,{activeServer:V,isCreatingServer:Se,isImportOpen:Ce,importPreview:Ee,importSource:De,importingServerId:xe,isPreviewing:we,onNewServer:Ae,onImport:ke,onImportSourceChange:Ie,onImportServer:e=>{be(e)},onReconnectServer:je,onRemoveServer:Me,onSaveServer:()=>{Pe()},onServerSelect:Te,onUpdateServer:Fe,servers:Oe})}),(0,q.jsx)(Gw,{value:`skills`,className:Kw,children:(0,q.jsx)(tE,{activeSkill:ae,onReloadSkills:()=>{ce()},onSkillSelect:me,onSkillToggle:(e,t)=>{_e(e,t)},skills:he})}),(0,q.jsx)(Gw,{value:`settings`,className:Kw,children:(0,q.jsx)(XT,{agentPrompt:T,appVersion:Ye,contextWindowLimit:E,modelOptions:w?.models??[],onModelChange:O,onProviderChange:k,onReasoningEffortChange:A,onRuntimeSettingsSave:z,providers:I,reasoningEffort:L,selectedModel:B,selectedProviderId:re})})]})}function xX(){return(0,q.jsx)(yE,{children:(0,q.jsx)(bX,{})})}function SX(){return null}function CX(){return(0,b.useEffect)(()=>{},[]),null}var wX=`--flowent-viewport-height`,TX=`--flowent-keyboard-offset`,EX=120;function DX(){if(typeof window>`u`)return;let e=typeof CSS<`u`&&CSS.supports(`height`,`100dvh`),t=OX(),n=0,r=0,i=e=>{document.documentElement.style.setProperty(wX,`${e}px`)},a=e=>{document.documentElement.style.setProperty(TX,`${e}px`)},o=(o=!1)=>{r=0;let s=OX(),c=kX(s),l=AX()&&t-s>EX;e||(o||!l)&&(t=s,i(s)),c!==n&&(n=c,a(c))},s=(e=!1)=>{r!==0&&window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>o(e))};o(!0),window.addEventListener(`resize`,()=>s(),{passive:!0}),window.addEventListener(`orientationchange`,()=>s(!0),{passive:!0}),window.addEventListener(`focusin`,()=>s(),{passive:!0}),window.addEventListener(`focusout`,()=>s(),{passive:!0}),window.visualViewport?.addEventListener(`resize`,()=>s(),{passive:!0}),window.visualViewport?.addEventListener(`scroll`,()=>s(),{passive:!0})}function OX(){return Math.round(document.documentElement.clientHeight||window.innerHeight||0)}function kX(e){if(!AX())return 0;let t=window.visualViewport;if(!t)return 0;let n=Math.max(0,e-t.height-t.offsetTop);return n>EX?Math.round(n):0}function AX(){let e=document.activeElement;if(e instanceof HTMLTextAreaElement)return!e.disabled&&!e.readOnly;if(e instanceof HTMLInputElement){let t=new Set([``,`email`,`number`,`password`,`search`,`tel`,`text`,`url`]);return!e.disabled&&!e.readOnly&&t.has(e.type)}return e instanceof HTMLElement&&e.isContentEditable}DX(),(0,x.createRoot)(document.getElementById(`root`)).render((0,q.jsxs)(b.StrictMode,{children:[(0,q.jsx)(xX,{}),(0,q.jsx)(SX,{}),(0,q.jsx)(CX,{})]}));
|
|
94
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return FY(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=MX.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function HX(){return{exit:{taskListCheckValueChecked:WX,taskListCheckValueUnchecked:WX,paragraph:GX}}}function UX(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:KX}}}function WX(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function GX(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function KX(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=MX.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function qX(){return[$J(),CY(),OY(),NX(),HX()]}function JX(e){return{extensions:[eY(),wY(e),kY(),VX(e),UX()]}}var YX={tokenize:lZ,partial:!0},XX={tokenize:uZ,partial:!0},ZX={tokenize:dZ,partial:!0},QX={tokenize:fZ,partial:!0},$X={tokenize:pZ,partial:!0},eZ={name:`wwwAutolink`,tokenize:sZ,previous:mZ},tZ={name:`protocolAutolink`,tokenize:cZ,previous:hZ},nZ={name:`emailAutolink`,tokenize:oZ,previous:gZ},rZ={};function iZ(){return{text:rZ}}for(var aZ=48;aZ<123;)rZ[aZ]=nZ,aZ++,aZ===58?aZ=65:aZ===91&&(aZ=97);rZ[43]=nZ,rZ[45]=nZ,rZ[46]=nZ,rZ[95]=nZ,rZ[72]=[nZ,tZ],rZ[104]=[nZ,tZ],rZ[87]=[nZ,eZ],rZ[119]=[nZ,eZ];function oZ(e,t,n){let r=this,i,a;return o;function o(t){return!_Z(t)||!gZ.call(r,r.previous)||vZ(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return _Z(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check($X,u,l)(t):t===45||t===95||$U(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&QU(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function sZ(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!mZ.call(r,r.previous)||vZ(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(YX,e.attempt(XX,e.attempt(ZX,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function cZ(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&hZ.call(r,r.previous)&&!vZ(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(QU(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||tW(t)||aW(t)||cW(t)||sW(t)?n(t):e.attempt(XX,e.attempt(ZX,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function lZ(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function uZ(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(QX,c,s)(t):t===null||aW(t)||cW(t)||t!==45&&sW(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function dZ(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(QX,t,a)(o):o===null||aW(o)||cW(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function fZ(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||aW(o)||cW(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||aW(e)||cW(e)?t(e):r(e)}function a(e){return QU(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):QU(t)?(e.consume(t),o):n(t)}}function pZ(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return $U(e)?n(e):t(e)}}function mZ(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||aW(e)}function hZ(e){return!QU(e)}function gZ(e){return!(e===47||_Z(e))}function _Z(e){return e===43||e===45||e===46||e===95||$U(e)}function vZ(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var yZ={tokenize:DZ,partial:!0};function bZ(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:wZ,continuation:{tokenize:TZ},exit:EZ}},text:{91:{name:`gfmFootnoteCall`,tokenize:CZ},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:xZ,resolveTo:SZ}}}}function xZ(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=ZU(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function SZ(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function CZ(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||aW(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(ZU(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return aW(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function wZ(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||aW(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=ZU(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return aW(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),dW(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function TZ(e,t,n){return e.check(EW,t,e.attempt(yZ,t,n))}function EZ(e){e.exit(`gfmFootnoteDefinition`)}function DZ(e,t,n){let r=this;return dW(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function OZ(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&WU(o,o.length,0,yW(s,e.slice(r+1,n),t)),WU(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),WU(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=vW(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=vW(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var kZ=class{constructor(){this.map=[]}add(e,t,n){AZ(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function AZ(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function jZ(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function MZ(){return{flow:{null:{name:`table`,tokenize:NZ,resolveAll:PZ}}}}function NZ(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):oW(t)?dW(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||aW(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,oW(t)?dW(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return oW(t)?dW(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||$(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return oW(t)?dW(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||$(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||$(n)?(e.exit(`tableRow`),t(n)):oW(n)?dW(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||aW(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function PZ(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new kZ;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(IZ(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=FZ(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=FZ(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=FZ(f,t,o,i,n,d)):(o[0]=o[1],d=FZ(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&IZ(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=jZ(t.events,n))}return e}function FZ(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},LZ(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=LZ(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=LZ(t.events,n[2]),a=LZ(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},LZ(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function IZ(e,t,n,r,i){let a=[],o=LZ(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function LZ(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var RZ={name:`tasklistCheck`,tokenize:BZ};function zZ(){return{text:{91:RZ}}}function BZ(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return aW(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return $(r)?t(r):oW(r)?e.check({tokenize:VZ},t,n)(r):n(r)}}function VZ(e,t,n){return dW(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function HZ(e){return qU([iZ(),bZ(),OZ(e),MZ(),zZ()])}var UZ={};function WZ(e){let t=this,n=e||UZ,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(HZ(n)),a.push(qX()),o.push(JX(n))}var GZ=e=>{let t={...e};return delete t.node,t},KZ=()=>(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`flowent-response-cursor`,"data-testid":`response-cursor`}),qZ=e=>e?.position?.end?.offset??-1,JZ=e=>{if(!e)return-1;let t=qZ(e),n=(e.children??[]).map(JZ);return Math.max(t,...n)},YZ=new Set([`blockquote`,`h1`,`h2`,`h3`,`ol`,`p`,`pre`,`table`,`ul`]),XZ=e=>(e?.children??[]).some(e=>e.type===`element`&&e.tagName!==void 0&&YZ.has(e.tagName)),ZZ=e=>typeof e?.position?.start?.line==`number`&&typeof e.position.end?.line==`number`&&e.position.start.line!==e.position.end.line,QZ=(e,t)=>t>=0&&JZ(e)===t,$Z=(e,t)=>(0,q.jsxs)(q.Fragment,{children:[e,t?(0,q.jsx)(KZ,{}):null]});function eQ({content:e,isStreaming:t=!1}){let n=t?e.trimEnd().length:-1;return(0,q.jsx)(BJ,{components:{a:({className:e,...t})=>(0,q.jsx)(`a`,{className:W(`text-white underline underline-offset-4`,e),rel:`noreferrer`,target:`_blank`,...GZ(t)}),blockquote:({className:e,...t})=>(0,q.jsx)(`blockquote`,{className:W(`my-3 border-l border-white/20 pl-4 text-white/80`,e),...GZ(t)}),code:({className:e,children:t,node:r,...i})=>{let a=ZZ(r);return(0,q.jsx)(`code`,{className:W(`font-mono text-[0.92em] text-white`,!a&&`rounded bg-white/10 px-1.5 py-0.5`,e),...GZ(i),children:$Z(t,QZ(r,n)&&a)})},h1:({className:e,children:t,node:r,...i})=>(0,q.jsx)(`h1`,{className:W(`mb-3 mt-5 text-2xl font-semibold text-white`,e),...GZ(i),children:$Z(t,QZ(r,n))}),h2:({className:e,children:t,node:r,...i})=>(0,q.jsx)(`h2`,{className:W(`mb-2.5 mt-5 text-xl font-semibold text-white`,e),...GZ(i),children:$Z(t,QZ(r,n))}),h3:({className:e,children:t,node:r,...i})=>(0,q.jsx)(`h3`,{className:W(`mb-2 mt-4 text-lg font-semibold text-white`,e),...GZ(i),children:$Z(t,QZ(r,n))}),hr:({className:e,...t})=>(0,q.jsx)(`hr`,{className:W(`my-4 border-white/10`,e),...GZ(t)}),li:({className:e,children:t,node:r,...i})=>(0,q.jsx)(`li`,{className:W(`pl-1`,e),...GZ(i),children:$Z(t,QZ(r,n)&&!XZ(r))}),ol:({className:e,...t})=>(0,q.jsx)(`ol`,{className:W(`my-3 list-decimal space-y-1 pl-6`,e),...GZ(t)}),p:({className:e,children:t,node:r,...i})=>(0,q.jsx)(`p`,{className:W(`my-3 first:mt-0 last:mb-0`,e),...GZ(i),children:$Z(t,QZ(r,n))}),pre:({className:e,...t})=>(0,q.jsx)(`pre`,{className:W(`my-3 overflow-x-auto rounded-lg border border-white/10 bg-white/[0.045] p-3 text-sm leading-6 text-white`,e),...GZ(t)}),table:({className:e,...t})=>(0,q.jsx)(`div`,{className:`my-3 overflow-x-auto`,children:(0,q.jsx)(`table`,{className:W(`w-full border-collapse text-left text-sm`,e),...GZ(t)})}),tbody:({className:e,...t})=>(0,q.jsx)(`tbody`,{className:W(`divide-y divide-white/10`,e),...GZ(t)}),td:({className:e,...t})=>(0,q.jsx)(`td`,{className:W(`border border-white/10 px-3 py-2 align-top`,e),...GZ(t)}),th:({className:e,...t})=>(0,q.jsx)(`th`,{className:W(`border border-white/10 bg-white/[0.04] px-3 py-2 font-medium`,e),...GZ(t)}),thead:({className:e,...t})=>(0,q.jsx)(`thead`,{className:W(`text-white`,e),...GZ(t)}),ul:({className:e,...t})=>(0,q.jsx)(`ul`,{className:W(`my-3 list-disc space-y-1 pl-6`,e),...GZ(t)})},remarkPlugins:[WZ],children:e})}function tQ({children:e,className:t,disabled:n,label:r,onClick:i}){return(0,q.jsxs)(nH,{children:[(0,q.jsx)(rH,{asChild:!0,children:(0,q.jsx)(X,{"aria-label":r,className:W(`size-7 rounded-lg border-0 bg-transparent text-white/45 shadow-none transition-colors hover:bg-white/10 hover:text-white focus-visible:ring-2 focus-visible:ring-white/20 disabled:pointer-events-auto disabled:cursor-not-allowed disabled:text-white/20 disabled:opacity-100 disabled:hover:bg-transparent`,t),disabled:n,onClick:i,size:`icon-sm`,type:`button`,variant:`ghost`,children:e})}),(0,q.jsx)(iH,{side:`top`,sideOffset:6,children:r})]})}function nQ({tool:e}){let[t,n]=(0,b.useState)(!1),r=e.status===`waiting`?`Waiting`:e.status===`running`?`Running`:e.status===`success`?`Done`:`Failed`;return(0,q.jsxs)(`div`,{className:`max-w-full text-base leading-5 text-white`,children:[(0,q.jsxs)(X,{"aria-expanded":t,className:`h-8 w-full justify-start gap-2 rounded-lg border-0 bg-transparent px-2 text-base text-white shadow-none hover:bg-transparent hover:text-white aria-expanded:bg-transparent aria-expanded:text-white active:not-aria-[haspopup]:translate-y-0`,onClick:()=>n(e=>!e),type:`button`,variant:`ghost`,children:[(0,q.jsx)(pm,{"aria-hidden":`true`,className:W(`size-3.5 shrink-0 text-white/55 transition-transform`,t?`rotate-90`:``)}),(0,q.jsx)(hQ,{tool:e}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:e.title}),(0,q.jsx)(`span`,{className:`shrink-0 text-xs text-white/55`,children:r})]}),t?(0,q.jsx)(rQ,{tool:e}):null]})}function rQ({tool:e}){let t=mQ(e.result),n=pQ(e.arguments),r=cQ(e),i=r.payloads.length>0||r.exitCode!==void 0;return!n&&!i?null:(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 py-1`,children:[n?(0,q.jsx)(aQ,{label:`ARGS`,value:sQ(e.arguments)}):null,r.payloads.map(e=>(0,q.jsx)(aQ,{label:e.label,value:e.value},e.label)),r.exitCode===void 0?null:(0,q.jsx)(oQ,{exitCode:r.exitCode}),t?(0,q.jsx)(iQ,{approval:t}):null]})}function iQ({approval:e}){let t=e.decision===`denied`?`Denied`:`Approved`,n=e.toolResult?.trim()?e.toolResult:null;return(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`div`,{className:`mb-1 text-[11px] font-medium leading-4 text-white/45`,children:`REVIEW`}),(0,q.jsxs)(`div`,{className:`grid gap-1 rounded-md border border-white/10 bg-black px-2.5 py-2 text-xs leading-5 text-white/70`,children:[(0,q.jsx)(`div`,{className:`font-medium text-white`,children:t}),e.reason?(0,q.jsx)(`div`,{className:`break-words text-white/60`,children:e.reason}):null,n?(0,q.jsxs)(`div`,{className:`mt-1.5 border-t border-white/5 pt-1.5`,children:[(0,q.jsx)(`div`,{className:`mb-0.5 text-[10px] font-medium leading-4 text-white/40`,children:`FAILURE`}),(0,q.jsx)(`div`,{className:`whitespace-pre-wrap break-words font-mono text-[11px] leading-4 text-white/50`,children:n})]}):null,e.writePaths?.length?(0,q.jsx)(`div`,{className:`grid gap-0.5 font-mono text-[11px] leading-4 text-white/50`,children:e.writePaths.map(e=>(0,q.jsx)(`span`,{className:`break-words`,children:e},e))}):null]})]})}function aQ({label:e,value:t}){return(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`div`,{className:`mb-1 text-[11px] font-medium leading-4 text-white/45`,children:e}),(0,q.jsx)(`pre`,{className:`max-h-64 overflow-auto rounded-md bg-input/20 px-2.5 py-2 font-mono text-xs leading-5 text-white/70`,children:(0,q.jsx)(`code`,{className:`whitespace-pre-wrap break-words`,children:t})})]})}function oQ({exitCode:e}){return(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] font-medium leading-4 text-white/45`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:W(`size-1.5 rounded-full`,e===`0`?`bg-[#7ddf89]`:`bg-[#ff7474]`)}),(0,q.jsxs)(`span`,{children:[`Exit `,e]})]})}function sQ(e){return typeof e==`string`?e:JSON.stringify(e,null,2)}function cQ(e){let t=e.result;if(!pQ(t))return{payloads:[]};let n=Object.fromEntries(Object.entries(t).filter(([e])=>e!==`approval`));return typeof n.text==`string`?{payloads:[{label:`RESULT`,value:n.text}]}:n.type===`command`?lQ(n):typeof n.output==`string`?{payloads:[{label:`RESULT`,value:n.output}]}:{payloads:[{label:`RESULT`,value:sQ(n)}]}}function lQ(e){let t=dQ(e.output_chunks);if(t.length>0)return uQ({exitCode:e.exit_code,stderr:fQ(t,`stderr`),stdout:fQ(t,`stdout`)});let n=typeof e.stdout==`string`?e.stdout.trim():``,r=typeof e.stderr==`string`?e.stderr.trim():``,i=typeof e.output==`string`?e.output.trim():``;return n||r||e.exit_code!==void 0?uQ({exitCode:e.exit_code,stderr:r,stdout:n}):i?{payloads:[{label:`RESULT`,value:i}]}:{payloads:[{label:`RESULT`,value:sQ(e)}]}}function uQ({exitCode:e,stderr:t,stdout:n}){return{exitCode:e===void 0?void 0:String(e),payloads:[...n.trim()?[{label:`STDOUT`,value:n}]:[],...t.trim()?[{label:`STDERR`,value:t}]:[]]}}function dQ(e){return Array.isArray(e)?e.flatMap(e=>!e||typeof e!=`object`||!(`content`in e)||!(`stream`in e)||typeof e.content!=`string`||e.stream!==`stdout`&&e.stream!==`stderr`?[]:[{content:e.content,stream:e.stream}]):[]}function fQ(e,t){return e.filter(e=>e.stream===t).map(e=>e.content).join(``).trimEnd()}function pQ(e){return e!=null&&Object.keys(e).length>0}function mQ(e){let t=e?.approval;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;return{action:typeof n.action==`string`?n.action:void 0,decision:typeof n.decision==`string`?n.decision:void 0,reason:typeof n.reason==`string`?n.reason:void 0,toolResult:typeof n.tool_result==`string`?n.tool_result:void 0,toolName:typeof n.tool_name==`string`?n.tool_name:void 0,writePaths:Array.isArray(n.write_paths)?n.write_paths.filter(e=>typeof e==`string`):void 0}}function hQ({tool:e}){let t=W(`size-3.5 shrink-0`,e.status===`failed`?`text-red-300`:`text-white/80`,e.status===`running`?`animate-pulse`:``,e.status===`waiting`?`text-amber-300`:``);return e.status===`success`?(0,q.jsx)(dm,{"aria-hidden":`true`,className:t}):e.status===`failed`?(0,q.jsx)(nh,{"aria-hidden":`true`,className:t}):e.status===`waiting`?(0,q.jsx)($m,{"aria-hidden":`true`,className:t}):e.name===`web_search`||e.name===`grep_files`?(0,q.jsx)(Wm,{"aria-hidden":`true`,className:t}):e.name===`shell_command`?(0,q.jsx)(Xm,{"aria-hidden":`true`,className:t}):(0,q.jsx)(bm,{"aria-hidden":`true`,className:t})}function gQ({disableErrorRetry:e,groups:t,isStreaming:n,onRetryError:r,showWaitingAfterOutput:i}){let a=t.flatMap(e=>e.items).reverse().find(e=>e.type===`text`)?.id;return(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col`,"aria-label":`Assistant response`,children:[t.map((t,i)=>(0,q.jsxs)(b.Fragment,{children:[i>0?(0,q.jsx)(yQ,{}):null,(0,q.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:t.items.map(t=>t.type===`tool`?(0,q.jsx)(nQ,{tool:t.tool},t.id):t.type===`thinking`?(0,q.jsx)(bQ,{content:t.content,isStreaming:t.isStreaming===!0},t.id):t.type===`error`?(0,q.jsx)(vQ,{disabled:e,item:t,onRetry:()=>r(t.id)},t.id):(0,q.jsx)(eQ,{content:t.content,isStreaming:n&&t.id===a},t.id))})]},t.id)),i?(0,q.jsx)(`div`,{className:`mt-3`,children:(0,q.jsx)(_Q,{})}):null]})}function _Q(){return(0,q.jsxs)(`div`,{"aria-label":`Thinking`,className:`flex h-6 items-center gap-1.5`,role:`status`,children:[(0,q.jsx)(`span`,{className:`flowent-thinking-dot`}),(0,q.jsx)(`span`,{className:`flowent-thinking-dot`}),(0,q.jsx)(`span`,{className:`flowent-thinking-dot`})]})}function vQ({disabled:e,item:t,onRetry:n}){return(0,q.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-red-500/15 bg-red-500/[0.06] p-3 text-base leading-5 text-red-100/90`,role:`alert`,children:[(0,q.jsx)($m,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-red-400`}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`div`,{className:`font-semibold text-red-100/95`,children:t.title}),(0,q.jsx)(`div`,{className:`mt-1 text-red-100/75`,children:t.message}),t.detail?(0,q.jsx)(`div`,{className:`mt-2 break-words text-xs leading-5 text-red-100/55`,children:t.detail}):null]}),(0,q.jsx)(tQ,{className:`shrink-0 text-red-100/55 hover:bg-red-400/10 hover:text-red-50 disabled:text-red-100/25`,disabled:e,label:`Retry`,onClick:n,children:(0,q.jsx)(Hm,{"aria-hidden":`true`,className:`size-4`})})]})}function yQ(){return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`my-3 h-px w-full bg-white/10`,"data-testid":`assistant-output-separator`})}function bQ({content:e,isStreaming:t}){let[n,r]=(0,b.useState)(!1),i=t||n;return(0,q.jsxs)(`div`,{className:`max-w-full text-base leading-5 text-white`,children:[(0,q.jsxs)(X,{"aria-expanded":i,className:`h-8 w-full justify-start gap-2 rounded-lg border-0 bg-transparent px-2 text-base text-white/75 shadow-none hover:bg-input/30 hover:text-white`,onClick:()=>r(e=>!e),type:`button`,variant:`ghost`,children:[(0,q.jsx)(pm,{"aria-hidden":`true`,className:W(`size-3.5 shrink-0 transition-transform`,i?`rotate-90`:``)}),(0,q.jsx)(bm,{"aria-hidden":`true`,className:W(`size-3.5 shrink-0 text-white/70`,t?`animate-pulse`:``)}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t?`Thinking...`:`Thought Process`})]}),i?(0,q.jsx)(`div`,{className:`py-1`,children:(0,q.jsx)(`div`,{className:`whitespace-pre-wrap break-words text-base leading-5 text-white/60`,children:e})}):null]})}function xQ(e){if(e.groups?.length)return e.groups.filter(e=>e.items.length>0);if(e.items?.length)return[{id:`${e.id}-items`,items:e.items}];let t=(e.tools??[]).map(e=>({id:`tool-${e.id}`,tool:e,type:`tool`})),n=e.thinking?{content:e.thinking,id:`${e.id}-thinking`,isStreaming:e.isStreamingThinking,type:`thinking`}:null,r=[],i=[...n?[n]:[],...t];if(t.length&&r.push({id:`${e.id}-process`,items:i}),e.content){let n={content:e.content,id:`${e.id}-content`,type:`text`};t.length?r.push({id:`${e.id}-content`,items:[n]}):r.push({id:`${e.id}-content`,items:[...i,n]})}else i.length&&!t.length&&r.push({id:`${e.id}-process`,items:i});return r}var SQ=12e4,CQ=12e3;function wQ(e,t,n,r){let i=EQ(e),a=n??(i>=0?e[i].usage_info:null),o=a?.last_token_usage.total_tokens,s=[...(a&&i>=0?e.slice(i+1):a?[]:e).map(e=>e.content),t].reduce((e,t)=>e+OQ(t),Math.max(0,o??0)),c=Math.max(1,r??a?.model_context_window??SQ),l=DQ(s,c);return{percent:l,tone:l>90?`critical`:l>=75?`warning`:`neutral`,total:c,used:s}}function TQ(e){return e>=1e3?`${Math.floor(e/1e3)}k`:e.toString()}function EQ(e){for(let t=e.length-1;t>=0;--t)if(e[t].usage_info)return t;return-1}function DQ(e,t){if(t<=CQ)return e>0?100:0;let n=Math.max(0,e-CQ),r=t-CQ;return Math.min(100,Math.floor(n/r*100))}function OQ(e){return e?Math.max(1,Math.ceil(new TextEncoder().encode(e).length/4)):0}function kQ({capacity:e,isRefining:t}){let n=e.tone===`critical`?`bg-red-500`:e.tone===`warning`?`bg-amber-500`:`bg-zinc-400`,r=e.tone===`critical`?`text-red-400`:e.tone===`warning`?`text-amber-400`:`text-zinc-300`,i=`${TQ(e.used)} / ${TQ(e.total)}`;return(0,q.jsxs)(`div`,{"aria-busy":t,"aria-live":`polite`,className:`flex min-h-9 items-center justify-between gap-3 border-t border-zinc-800/50 bg-zinc-900/40 px-4 py-1.5 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)] transition-colors`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-[10px] font-semibold tracking-wider text-zinc-500 uppercase`,children:[(0,q.jsx)(sm,{"aria-hidden":`true`,className:W(`size-3 shrink-0`,t&&`animate-pulse`)}),(0,q.jsx)(`span`,{className:`hidden sm:inline`,children:`Context`})]}),(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(`span`,{className:W(`text-[10px] font-semibold whitespace-nowrap`,t?`animate-pulse text-zinc-300`:`text-zinc-500 uppercase`),children:t?`Refining...`:i}),(0,q.jsx)(`div`,{"aria-label":`Context capacity status`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":e.percent,className:`h-1 w-16 overflow-hidden rounded-full bg-zinc-800 sm:w-24`,role:`progressbar`,children:(0,q.jsx)(`div`,{className:W(`h-full rounded-full transition-all duration-500 ease-in-out`,t&&`flowent-context-refining-indicator w-1/3 opacity-80`,n),style:{width:t?void 0:`${e.percent}%`}})}),!t&&(0,q.jsxs)(`span`,{className:W(`text-[10px] font-semibold`,r),children:[e.percent,`%`]})]})]})}function AQ(e){let t=[];for(let n of e)n.author!==`user`||n.content.trim().length===0||t.at(-1)!==n.content&&t.push(n.content);return t}function jQ(e){return!e.value.slice(0,e.selectionStart).includes(`
|
|
95
|
+
`)}function MQ(e){return!e.value.slice(e.selectionEnd).includes(`
|
|
96
|
+
`)}function NQ(){return typeof navigator>`u`?!1:/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1}function PQ({commands:e,selectedIndex:t,onCommand:n,onSelectIndex:r}){return(0,q.jsx)(`div`,{"aria-label":`Commands`,className:`mb-2 overflow-hidden rounded-xl border border-white/10 bg-[#171717] p-1 shadow-[0_16px_44px_rgba(0,0,0,0.42)]`,role:`listbox`,children:e.map((e,i)=>(0,q.jsxs)(X,{"aria-selected":i===t,className:W(`flex h-auto w-full items-center justify-start gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left text-base text-white shadow-none transition-colors hover:bg-input/50 hover:text-white`,i===t&&`bg-input/40`),onClick:()=>n(e),onMouseEnter:()=>r(i),size:`sm`,role:`option`,type:`button`,variant:`ghost`,children:[(0,q.jsx)(Xm,{"aria-hidden":`true`,className:`size-4 text-white/75`}),(0,q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`span`,{className:`block font-medium leading-5`,children:e.label}),(0,q.jsx)(`span`,{className:`block truncate text-xs leading-4 text-white/55`,children:e.description})]})]},e.id))})}function FQ({selectedIndex:e,skills:t,onSelectIndex:n,onSkill:r}){return(0,q.jsx)(`div`,{"aria-label":`Skills`,className:`mb-2 overflow-hidden rounded-xl border border-white/10 bg-[#171717] p-1 shadow-[0_16px_44px_rgba(0,0,0,0.42)]`,role:`listbox`,children:t.map((t,i)=>(0,q.jsxs)(X,{"aria-selected":i===e,className:W(`flex h-auto w-full items-center justify-start gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left text-base text-white shadow-none transition-colors hover:bg-input/50 hover:text-white`,i===e&&`bg-input/40`),onClick:()=>r(t),onMouseEnter:()=>n(i),size:`sm`,role:`option`,type:`button`,variant:`ghost`,children:[(0,q.jsx)(Jm,{"aria-hidden":`true`,className:`size-4 text-white/75`}),(0,q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`span`,{className:`block font-medium leading-5`,children:[`$`,t.slug]}),(0,q.jsx)(`span`,{className:`block truncate text-xs leading-4 text-white/55`,children:t.description||t.name})]})]},t.id))})}function IQ({isHidden:e,plan:t}){let[n,r]=(0,b.useState)(!1),i=(0,b.useRef)(null),a=Zp();if((0,b.useEffect)(()=>{e&&r(!1)},[e]),(0,b.useEffect)(()=>{if(!n)return;let e=e=>{if(e.pointerType===`mouse`)return;let t=e.target;t instanceof Node&&(i.current?.contains(t)||r(!1))},t=e=>{e.key===`Escape`&&r(!1)};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,t)}},[n]),!t||e)return null;let o=`Plan · ${t.items.filter(e=>e.status===`completed`).length}/${t.items.length} done`;return(0,q.jsxs)(`div`,{className:`border-b border-zinc-800/50 bg-zinc-900/40 shadow-[inset_0_-1px_0_rgba(255,255,255,0.03)]`,onPointerLeave:e=>{e.pointerType===`mouse`&&r(!1)},ref:i,children:[(0,q.jsxs)(X,{"aria-expanded":n,className:`h-9 w-full justify-start gap-2 rounded-none border-0 bg-transparent px-3 text-xs font-medium text-zinc-300 shadow-none hover:bg-input/40 hover:text-white sm:text-sm`,onClick:()=>r(e=>!e),type:`button`,variant:`ghost`,children:[(0,q.jsx)(pm,{"aria-hidden":`true`,className:W(`size-3.5 shrink-0 text-white/55 transition-transform`,n&&`rotate-90`)}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:o})]}),(0,q.jsx)($d,{initial:!1,children:n?(0,q.jsx)(Xp.div,{animate:a?{opacity:1}:{height:`auto`,opacity:1},className:`overflow-hidden border-t border-zinc-800/50 bg-zinc-950/50`,"data-slot":`plan-tasks-panel`,exit:a?{opacity:1}:{height:0,opacity:0},initial:a?!1:{height:0,opacity:0},transition:a?{duration:0}:{duration:.18,ease:[.32,.72,0,1]},children:(0,q.jsx)(`ol`,{"aria-label":`Plan tasks`,className:`grid max-h-[150px] gap-1 overflow-auto p-1.5 sm:max-h-[25vh]`,children:t.items.map((e,t)=>(0,q.jsxs)(`li`,{className:W(`grid min-w-0 grid-cols-[1.25rem_auto_minmax(0,1fr)_auto] items-start gap-2 rounded-lg px-2 py-1.5 text-sm leading-5`,e.status===`in_progress`?`bg-input/30 text-white`:e.status===`completed`?`text-white/55`:`text-white/75`),children:[(0,q.jsx)(`span`,{className:`text-right text-xs leading-5 text-white/35`,children:t+1}),(0,q.jsx)(LQ,{status:e.status}),(0,q.jsx)(`span`,{className:`min-w-0 break-words`,children:e.step}),(0,q.jsx)(`span`,{className:`shrink-0 text-xs leading-5 text-white/45`,children:RQ(e.status)})]},`${t}-${e.step}`))})},`plan-tasks-panel`):null})]})}function LQ({status:e}){let t=`mt-0.5 size-3.5 shrink-0`;return e===`completed`?(0,q.jsx)(dm,{"aria-hidden":`true`,className:W(t,`text-white/65`)}):e===`in_progress`?(0,q.jsx)(sm,{"aria-hidden":`true`,className:W(t,`animate-pulse text-white`)}):(0,q.jsx)(bm,{"aria-hidden":`true`,className:W(t,`text-white/40`)})}function RQ(e){return e===`completed`?`Done`:e===`in_progress`?`Doing`:`Pending`}function zQ({commands:e,contextWindowLimit:t,draft:n,errorMessage:r,isRefiningContext:i,isSending:a,messages:o,plan:s,usageInfo:c,onCommand:l,onCommandError:u,onDraftChange:d,onOffsetChange:f,onSendMessage:p,onStopResponse:m,skills:h}){let g=(0,b.useRef)(null),_=(0,b.useRef)(null),v=(0,b.useRef)(!1),y=(0,b.useRef)(()=>{}),x=(0,b.useRef)(!1),S=(0,b.useRef)(!1),C=(0,b.useRef)(!1),w=(0,b.useRef)(!1),T=(0,b.useRef)(null),E=(0,b.useRef)(``),[D,O]=(0,b.useState)(!1),[k,A]=(0,b.useState)(!1),[j,M]=(0,b.useState)(0),[N,P]=(0,b.useState)(0),F=(0,b.useMemo)(()=>AQ(o),[o]),I=n.split(`
|
|
97
|
+
`)[0]??``,L=I.startsWith(`/`)?I.slice(1):``,ee=I.startsWith(`/`)&&!L.includes(`/`)&&!I.includes(` `),te=(0,b.useMemo)(()=>{if(!ee)return[];let t=L.toLowerCase();return e.filter(e=>e.name.toLowerCase().startsWith(t))},[L,e,ee]),ne=ee&&!D&&te.length>0,R=n.match(/(?:^|\s)\$([a-z0-9-]*)$/i),z=R?.[1]??``,B=!!R,re=(0,b.useMemo)(()=>{if(!B)return[];let e=z.toLowerCase();return h.filter(t=>t.enabled&&!t.error&&t.slug.toLowerCase().startsWith(e))},[B,z,h]),ie=!ne&&B&&!k&&re.length>0,ae=e.find(e=>e.name===L),oe=!!(ee&&ae)&&(!a||ae?.id===`clear`),se=()=>_.current?.value??n,ce=NQ();x.current=ce;let le=se().length>0&&(!a||oe)&&!i,ue=a&&!oe,de=!ue&&!le,fe=de&&!ce,pe=(0,b.useMemo)(()=>wQ(o,n,c,t),[t,n,o,c]);(0,b.useEffect)(()=>{if(S.current){S.current=!1;return}O(!1),M(0)},[n]),(0,b.useEffect)(()=>{if(w.current){w.current=!1;return}A(!1),P(0)},[n]),(0,b.useEffect)(()=>{if(C.current){C.current=!1;return}T.current=null,E.current=``},[n]),(0,b.useEffect)(()=>{M(e=>Math.min(e,Math.max(te.length-1,0)))},[te.length]),(0,b.useEffect)(()=>{P(e=>Math.min(e,Math.max(re.length-1,0)))},[re.length]),(0,b.useEffect)(()=>{let e=g.current;if(!e)return;let t=0,n=()=>{t=0;let n=Number.parseFloat(getComputedStyle(e).bottom),r=Number.isFinite(n)?n:0;f(e.offsetHeight+r+24)},r=()=>{t!==0&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(n)};if(n(),window.addEventListener(`resize`,r,{passive:!0}),window.addEventListener(`focusin`,r,{passive:!0}),window.addEventListener(`focusout`,r,{passive:!0}),window.visualViewport?.addEventListener(`resize`,r,{passive:!0}),window.visualViewport?.addEventListener(`scroll`,r,{passive:!0}),typeof ResizeObserver>`u`)return()=>{t!==0&&window.cancelAnimationFrame(t),window.removeEventListener(`resize`,r),window.removeEventListener(`focusin`,r),window.removeEventListener(`focusout`,r),window.visualViewport?.removeEventListener(`resize`,r),window.visualViewport?.removeEventListener(`scroll`,r)};let i=new ResizeObserver(r);return i.observe(e),()=>{t!==0&&window.cancelAnimationFrame(t),window.removeEventListener(`resize`,r),window.removeEventListener(`focusin`,r),window.removeEventListener(`focusout`,r),window.visualViewport?.removeEventListener(`resize`,r),window.visualViewport?.removeEventListener(`scroll`,r),i.disconnect()}},[f]);let me=e=>{if(!l(e.id)){O(!0);return}d(``),O(!1)},he=()=>{if(!ee||L.length===0)return!1;let t=e.find(e=>e.name===L);return t?(me(t),!0):!1},ge=e=>{let t=n.replace(/(?:^|\s)\$([a-z0-9-]*)$/i,t=>`${t.startsWith(` `)?` `:``}$${e.slug} `);w.current=!0,d(t),A(!0)},_e=e=>{C.current=!0,d(e),window.requestAnimationFrame(()=>{let t=_.current;t&&(t.focus(),t.setSelectionRange(e.length,e.length))})},ve=e=>{if(F.length===0||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.nativeEvent.isComposing)return!1;let t=e.currentTarget;if(e.key===`ArrowUp`){if(!jQ(t))return!1;e.preventDefault();let n=T.current,r=n===null?F.length-1:Math.max(n-1,0);return n===null&&(E.current=t.value),T.current=r,_e(F[r]),!0}if(e.key!==`ArrowDown`||!MQ(t))return!1;let n=T.current;if(n===null)return!1;e.preventDefault();let r=n+1;return r>=F.length?(T.current=null,_e(E.current),E.current=``,!0):(T.current=r,_e(F[r]),!0)},ye=()=>{let e=se();if(ie){let e=re[N];if(e){ge(e);return}}if(ne){let e=te[j];if(e){me(e);return}}if(!he()){if(ee&&L.length>0){O(!1),u(`Command not found.`);return}p(e)}};return y.current=()=>{ye()},(0,b.useEffect)(()=>{let e=_.current;if(!e)return;let t=e=>{if(x.current){if(v.current){v.current=!1;return}e.inputType!==`insertLineBreak`&&e.inputType!==`insertParagraph`||(e.preventDefault(),y.current())}};return e.addEventListener(`beforeinput`,t),()=>e.removeEventListener(`beforeinput`,t)},[]),(0,q.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-[calc(1.5rem+var(--flowent-keyboard-offset))] z-10 px-6 max-[900px]:px-4`,ref:g,children:(0,q.jsxs)(`div`,{className:`pointer-events-auto mx-auto w-full max-w-[640px]`,children:[ne?(0,q.jsx)(PQ,{commands:te,selectedIndex:j,onCommand:me,onSelectIndex:M}):null,ie?(0,q.jsx)(FQ,{selectedIndex:N,skills:re,onSelectIndex:P,onSkill:ge}):null,r?(0,q.jsx)(`p`,{className:`mb-2 rounded-md bg-black/80 px-3 py-2 text-base leading-5 text-red-300 shadow-[0_12px_32px_rgba(0,0,0,0.45)]`,children:r}):null,(0,q.jsxs)(`form`,{"aria-label":`Workspace composer`,className:`flex flex-col-reverse overflow-clip rounded-[14px] border border-zinc-800 bg-zinc-950 shadow-[0_16px_44px_rgba(0,0,0,0.42),inset_0_0_1px_rgba(255,255,255,0.2)] transition-colors focus-within:border-zinc-700`,onSubmit:e=>{e.preventDefault(),ye()},children:[(0,q.jsx)(kQ,{capacity:pe,isRefining:i}),(0,q.jsxs)(`div`,{className:`grid min-h-14 w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-2 bg-[#212121] p-2.5`,children:[(0,q.jsx)(kO,{"aria-label":`Message Flowent`,className:`flowent-composer-textarea max-h-[216px] min-h-9 resize-none overflow-y-auto border-0 bg-transparent px-2 py-1.5 text-white shadow-none placeholder:text-[#9b9b9b] focus-visible:border-transparent focus-visible:ring-0 dark:bg-transparent`,enterKeyHint:`send`,ref:_,value:n,onChange:e=>d(e.target.value),onInput:e=>d(e.currentTarget.value),onKeyDown:e=>{if(v.current=e.key===`Enter`&&e.shiftKey,ie){if(e.key===`ArrowDown`){e.preventDefault(),P((N+1)%re.length);return}if(e.key===`ArrowUp`){e.preventDefault(),P((N-1+re.length)%re.length);return}if(e.key===`Tab`){let t=re[N];t&&(e.preventDefault(),ge(t));return}if(e.key===`Escape`){e.preventDefault(),A(!0);return}}if(ne){if(e.key===`ArrowDown`){e.preventDefault(),M((j+1)%te.length);return}if(e.key===`ArrowUp`){e.preventDefault(),M((j-1+te.length)%te.length);return}if(e.key===`Tab`){let t=te[j];t&&(e.preventDefault(),S.current=!0,d(t.label),O(!0));return}if(e.key===`Escape`){e.preventDefault(),O(!0);return}}ve(e)||e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),ye())},placeholder:`Message Flowent`}),(0,q.jsx)(X,{"aria-label":ue?`Stop`:`Send message`,className:W(`size-9 rounded-full shadow-none disabled:bg-transparent disabled:text-white/35 disabled:opacity-100 [&_svg]:size-5`,ue?`bg-white text-black hover:bg-[#e5e5e5] [&_svg]:size-3.5`:`bg-white text-black hover:bg-[#e5e5e5]`,de&&`bg-transparent text-white/35 hover:bg-transparent`),"aria-disabled":de,disabled:fe,onClick:ue?m:void 0,size:`icon-lg`,type:ue?`button`:`submit`,children:ue?(0,q.jsx)(Ym,{"aria-hidden":`true`,fill:`currentColor`}):(0,q.jsx)(lm,{"aria-hidden":`true`})})]}),(0,q.jsx)(IQ,{isHidden:ne||ie,plan:s})]})]})})}function BQ({messageListRef:e,messages:t}){let[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(!1),c=(0,b.useRef)(null),l=(0,b.useRef)(!1),u=(0,b.useRef)(null),d=(0,b.useRef)(null),f=(0,b.useCallback)(()=>{let t=e.current,n=c.current;if(!t||!n)return;let r=t.scrollHeight-t.clientHeight,i=n.scrollHeight-n.clientHeight;if(r<=0||i<=0){n.scrollTop=0;return}n.scrollTop=Math.min(1,Math.max(0,t.scrollTop/r))*i},[e]);if((0,b.useEffect)(()=>{let t=e.current;if(!t)return;let n=()=>{l.current||f()};return t.addEventListener(`scroll`,n,{passive:!0}),f(),()=>{t.removeEventListener(`scroll`,n)}},[t.length,e,f]),(0,b.useLayoutEffect)(()=>{if(f(),!(i||o))return u.current=window.requestAnimationFrame(f),d.current=window.setTimeout(f,220),()=>{u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null)}},[i,o,f]),t.length===0)return null;let p=e=>{document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`})};return(0,q.jsx)(`nav`,{"aria-label":`Conversation shortcuts`,className:`group/shortcut-rail pointer-events-none fixed right-5 top-1/2 z-20 hidden -translate-y-1/2 items-center justify-end max-[1180px]:hidden min-[1181px]:flex`,onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||(i||(l.current=!1),s(!1))},onFocusCapture:()=>{l.current=!0,s(!0)},onMouseEnter:()=>{l.current=!0,a(!0)},onMouseLeave:()=>{r(``),a(!1),o||(l.current=!1)},children:(0,q.jsx)(`div`,{className:`pointer-events-auto flowent-hidden-scrollbar flex max-h-[min(78vh,620px)] flex-col items-end gap-1.5 overflow-x-hidden overflow-y-auto overscroll-contain rounded-2xl border border-white/5 bg-black/20 p-2 shadow-[0_16px_44px_rgba(0,0,0,0.2)] backdrop-blur-sm transition-colors duration-200 group-hover/shortcut-rail:bg-black/70`,ref:c,children:t.map(e=>{let t=n===e.id,a=VQ(e.content),s=e.author===`user`?`You`:`Flowent`,c=i||o||t;return(0,q.jsxs)(X,{"aria-label":`Jump to ${s}: ${a}`,className:`group/shortcut h-auto max-w-[260px] cursor-pointer justify-end gap-2 rounded-full border-0 bg-transparent px-0 py-0 text-right text-xs text-white shadow-none transition-all duration-200 hover:bg-transparent hover:text-white focus-visible:ring-2 focus-visible:ring-white/20`,onClick:()=>p(e.id),onMouseEnter:()=>r(e.id),size:`sm`,type:`button`,variant:`ghost`,children:[c?(0,q.jsxs)(`span`,{className:W(`grid max-w-[220px] gap-0.5 overflow-hidden whitespace-nowrap opacity-70 transition-all duration-300 ease-out group-focus-visible/shortcut:opacity-100`,t&&`opacity-100`),children:[(0,q.jsx)(`span`,{className:`text-[10px] font-semibold tracking-wider text-white/45 uppercase`,children:s}),(0,q.jsx)(`span`,{className:`truncate text-[11px] font-medium leading-4 text-white/85`,children:a})]}):null,(0,q.jsx)(`span`,{"aria-hidden":`true`,className:W(`size-1.5 rounded-full bg-white/25 shadow-[0_0_0_1px_rgba(255,255,255,0.08)] transition-all duration-200 group-hover/shortcut-rail:size-2 group-hover/shortcut-rail:bg-white/35 group-hover/shortcut:scale-125`,e.author===`user`&&`bg-white/45`,t&&`size-2.5 scale-150 bg-white`)})]},e.id)})})})}function VQ(e){let t=e.split(`
|
|
98
|
+
`).map(e=>e.trim()).find(e=>e.length>0)?.replace(/\s+/g,` `);return t?t.length<=64?t:`${t.slice(0,61)}…`:`Message`}function HQ(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.author!==`assistant`)continue;let r=n.tools??[];for(let e=r.length-1;e>=0;--e){let t=r[e];if(t.name!==`update_plan`)continue;let n=UQ(t.result)??UQ(t.arguments);if(n?.length)return{items:n}}}return null}function UQ(e){let t=e?.items;return Array.isArray(t)?t.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e,n=typeof t.step==`string`?t.step.trim():``;return n?[{status:WQ(t.status),step:n}]:[]}):null}function WQ(e){return e===`completed`||e===`in_progress`||e===`pending`?e:`pending`}function GQ({commands:e,contextWindowLimit:t,draft:n,errorMessage:r,isRefiningContext:i,isResponding:a,messages:o,usageInfo:s,onCommand:c,onCommandError:l,onDraftChange:u,onEditMessage:d,onRetryError:f,onRetryMessage:p,onSendMessage:m,onStopResponse:h,skills:g}){let[_,v]=(0,b.useState)(112);return(0,q.jsx)(`section`,{className:`h-full min-h-0 bg-black`,"aria-label":`Workspace`,children:(0,q.jsx)(tH,{delayDuration:500,children:(0,q.jsxs)(`div`,{className:`relative h-full min-h-0 min-w-0 overflow-hidden`,children:[(0,q.jsx)(zQ,{commands:e,contextWindowLimit:t,draft:n,errorMessage:r,isRefiningContext:i,isSending:a,messages:o,plan:(0,b.useMemo)(()=>HQ(o),[o]),usageInfo:s,onCommand:c,onCommandError:l,onDraftChange:u,onSendMessage:m,onStopResponse:h,onOffsetChange:v,skills:g}),(0,q.jsx)(KQ,{composerOffset:_,isResponding:a,messages:o,onEditMessage:d,onRetryError:f,onRetryMessage:p})]})})})}function KQ({composerOffset:e,isResponding:t,messages:n,onEditMessage:r,onRetryError:i,onRetryMessage:a}){let o=(0,b.useRef)(null),s=(0,b.useRef)(!0),c=(0,b.useRef)(null),l=n.at(-1),u=l?.author??``,d=l?.id??``,f=(0,b.useRef)(d),p=(0,b.useMemo)(()=>!t||u===`assistant`?n:[...n,{author:`assistant`,content:``,id:`assistant-pending`}],[t,u,n]),m=t&&u===`assistant`?d:``;(0,b.useEffect)(()=>{d!==f.current&&(f.current=d,u===`user`&&(s.current=!0)),s.current&&c.current?.scrollIntoView({block:`end`,behavior:`smooth`})},[p,u,d]);let h=()=>{let e=o.current;e&&(s.current=e.scrollHeight-e.scrollTop-e.clientHeight<96)},g=(0,b.useMemo)(()=>qQ(p),[p]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{"aria-label":`Conversation messages`,"aria-live":`polite`,className:W(`absolute inset-0 flex min-h-0 flex-col overflow-auto bg-black px-6 pt-12 max-[900px]:px-4`,ED),onScroll:h,ref:o,style:{paddingBottom:e,scrollPaddingBottom:e},children:[p.length===0?(0,q.jsx)(`div`,{className:`mx-auto grid min-h-full w-full max-w-4xl place-items-center pb-24`,children:(0,q.jsx)(`h1`,{className:`m-0 text-center text-[28px] font-medium leading-[1.2] text-white max-[560px]:text-2xl`,children:`Where should we begin?`})}):null,p.map(e=>(0,q.jsx)(b.Fragment,{children:e.author===`system`?(0,q.jsx)(JQ,{message:e}):(0,q.jsx)(YQ,{isStreaming:t&&e.id===m&&e.author===`assistant`&&e.isStreamingText===!0,isPending:e.id===`assistant-pending`||t&&e.author===`assistant`&&e.id===m&&e.isStreamingText!==!0,isResponding:t,message:e,onEditMessage:r,onRetryError:i,onRetryMessage:a})},e.id)),(0,q.jsx)(`div`,{"aria-hidden":`true`,ref:c})]}),(0,q.jsx)(BQ,{messageListRef:o,messages:g})]})}function qQ(e){return e.filter(e=>e.id!==`assistant-pending`&&(e.author===`user`||e.author===`assistant`)&&e.content.trim().length>0)}function JQ({message:e}){let[t,n]=(0,b.useState)(!1),r=Zp(),i=e.content===`Context compacted`||e.content===`Context optimized`,a=e.content===`Context optimized`?Jm:e.content===`Context compacted`?dm:null;if(i){let i=`${e.id}-summary`;return(0,q.jsx)(`div`,{className:`mx-auto flex w-full max-w-4xl py-3`,children:(0,q.jsxs)(`div`,{className:`w-full overflow-hidden rounded-xl border border-white/10 bg-input/20 text-white shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]`,children:[(0,q.jsxs)(X,{"aria-controls":i,"aria-expanded":t,className:`h-auto w-full justify-between rounded-xl border-0 bg-transparent px-4 py-3 text-left text-base leading-5 text-white/80 shadow-none hover:bg-input/30 hover:text-white focus-visible:ring-2 focus-visible:ring-white/20`,onClick:()=>n(e=>!e),type:`button`,variant:`ghost`,children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[a?(0,q.jsx)(a,{"aria-hidden":`true`,className:`size-4 shrink-0 text-white/55`}):null,(0,q.jsx)(`span`,{className:`truncate font-medium`,children:e.content})]}),(0,q.jsx)(pm,{"aria-hidden":`true`,className:W(`size-4 shrink-0 text-white/45 transition-transform duration-200`,t&&`rotate-90`)})]}),(0,q.jsx)($d,{initial:!1,children:t?(0,q.jsx)(Xp.div,{animate:{height:`auto`,opacity:1},className:`overflow-hidden`,exit:r?{opacity:0}:{height:0,opacity:0},initial:r?{opacity:0}:{height:0,opacity:0},transition:{duration:.18,ease:[.32,.72,0,1]},children:(0,q.jsx)(`div`,{"aria-label":`${e.content} summary`,className:`border-t border-white/10 px-4 py-3 text-sm leading-6 text-white/80`,id:i,role:`region`,children:(0,q.jsx)(eQ,{content:e.summary??``})})}):null})]})})}return(0,q.jsx)(`div`,{className:`mx-auto flex w-full max-w-4xl justify-center py-3`,children:(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-full border border-white/10 bg-input/30 px-3 py-1.5 text-base leading-5 text-white/70`,children:[a?(0,q.jsx)(a,{"aria-hidden":`true`,className:`size-3.5 text-white/50`}):null,e.content]})})}function YQ({isPending:e,isResponding:t,isStreaming:n,message:r,onEditMessage:i,onRetryError:a,onRetryMessage:o}){let[s,c]=(0,b.useState)(!1),l=r.author===`assistant`?xQ(r):[],u=l.at(-1)?.items.at(-1),d=e&&l.length===0,f=e&&l.length>0&&!n&&(u?.type!==`tool`||u.tool.status!==`waiting`),p=r.author===`user`,m=t||r.id===`assistant-pending`,h=t||!p;return(0,q.jsx)(`article`,{id:r.id,className:W(`flowent-message-row group/message mx-auto flex w-full max-w-4xl scroll-mt-12 scroll-mb-40 py-3`,r.author===`user`?`justify-end`:`justify-start`),children:(0,q.jsx)(`div`,{className:W(`flex min-w-0 flex-col text-base leading-6 text-white`,r.author===`user`?`max-w-[70%] items-end`:`w-full max-w-full`),children:s?(0,q.jsx)(XQ,{initialContent:r.content,isResponding:t,onCancel:()=>c(!1),onSave:e=>{i({action:`save`,content:e,messageId:r.id}),c(!1)},onSaveAndRetry:e=>{i({action:`resend`,content:e,messageId:r.id}),c(!1)}}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:W(`min-w-0`,r.author===`user`?`flowent-user-message-bubble rounded-[22px] px-4 py-2.5`:`w-full max-w-full`),children:d?(0,q.jsx)(_Q,{}):(0,q.jsx)(e$,{assistantGroups:l,disableErrorRetry:m,isStreaming:n,message:r,onRetryError:e=>a({errorId:e,messageId:r.id}),showWaitingAfterOutput:f})}),(0,q.jsx)(ZQ,{canEdit:p,disableEdit:h,disableRetry:m,message:r,onEdit:()=>c(!0),onRetry:()=>o(r.id)})]})})})}function XQ({initialContent:e,isResponding:t,onCancel:n,onSave:r,onSaveAndRetry:i}){let[a,o]=(0,b.useState)(e),s=a.length===0,c=s||t;return(0,q.jsxs)(`div`,{className:`w-full min-w-[min(420px,70vw)] max-w-[min(720px,70vw)] rounded-[22px] border border-white/10 bg-input/30 p-2.5 shadow-[inset_0_0_1px_rgba(255,255,255,0.12)]`,children:[(0,q.jsx)(kO,{"aria-label":`Edit message`,autoFocus:!0,className:`max-h-[240px] min-h-28 resize-none border-white/10 bg-black/30 px-3 py-2 text-base leading-6 text-white shadow-none focus-visible:border-white/20 focus-visible:ring-1 focus-visible:ring-white/20 dark:bg-black/30`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),n();return}e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&!c&&(e.preventDefault(),i(a))}}),(0,q.jsxs)(`div`,{className:`mt-2 flex items-center justify-end gap-1`,children:[(0,q.jsx)(tQ,{label:`Cancel`,onClick:n,children:(0,q.jsx)(nh,{"aria-hidden":`true`,className:`size-4`})}),(0,q.jsx)(tQ,{disabled:s,label:`Save`,onClick:()=>r(a),children:(0,q.jsx)(Um,{"aria-hidden":`true`,className:`size-4`})}),(0,q.jsx)(tQ,{disabled:c,label:`Save and retry`,onClick:()=>i(a),children:(0,q.jsx)(Gm,{"aria-hidden":`true`,className:`size-4`})})]})]})}function ZQ({canEdit:e,disableEdit:t,disableRetry:n,message:r,onEdit:i,onRetry:a}){let[o,s]=(0,b.useState)(`idle`),c=(0,b.useRef)(null);(0,b.useEffect)(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);let l=e=>{s(e),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{s(`idle`),c.current=null},e===`copied`?2e3:1200)},u=async()=>{l(await QQ(r.content)?`copied`:`failed`)},d=o===`copied`?`Copied`:o===`failed`?`Copy failed`:`Copy`;return(0,q.jsxs)(`div`,{className:W(`mt-1 flex items-center gap-0.5 opacity-100 transition-opacity duration-150 hover-only:opacity-0 hover-only:group-hover/message:opacity-100 focus-within:opacity-100`,r.author===`user`?`justify-end pr-1`:`justify-start pl-1`),children:[(0,q.jsx)(tQ,{label:d,onClick:()=>void u(),children:o===`copied`?(0,q.jsx)(dm,{"aria-hidden":`true`,className:`size-4 text-white`}):o===`failed`?(0,q.jsx)($m,{"aria-hidden":`true`,className:`size-4 text-amber-300`}):(0,q.jsx)(Cm,{"aria-hidden":`true`,className:`size-4`})}),e?(0,q.jsx)(tQ,{disabled:t,label:`Edit`,onClick:i,children:(0,q.jsx)(Nm,{"aria-hidden":`true`,className:`size-4`})}):null,(0,q.jsx)(tQ,{disabled:n,label:`Retry`,onClick:a,children:(0,q.jsx)(Hm,{"aria-hidden":`true`,className:`size-4`})})]})}async function QQ(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{return $Q(e)}return $Q(e)}function $Q(e){if(typeof document.execCommand!=`function`)return!1;let t=document.activeElement,n=document.createElement(`textarea`);n.value=e,n.setAttribute(`readonly`,``),n.style.position=`fixed`,n.style.top=`-9999px`,n.style.left=`-9999px`,n.style.width=`1px`,n.style.height=`1px`,n.style.opacity=`0`,document.body.appendChild(n),n.focus(),n.select();let r=!1;try{r=document.execCommand(`copy`)}finally{n.remove(),t instanceof HTMLElement&&t.focus({preventScroll:!0})}return r}function e$({assistantGroups:e,disableErrorRetry:t,isStreaming:n,message:r,onRetryError:i,showWaitingAfterOutput:a}){return r.author===`assistant`?(0,q.jsx)(`div`,{className:`flowent-markdown-message min-w-0 break-words`,children:(0,q.jsx)(gQ,{disableErrorRetry:t,groups:e,isStreaming:n,onRetryError:i,showWaitingAfterOutput:a})}):(0,q.jsx)(`div`,{className:`flowent-markdown-message min-w-0 break-words`,children:(0,q.jsx)(`p`,{className:`m-0 whitespace-pre-wrap break-words`,children:r.content})})}function t$(){let e=xO(),t=(0,b.useMemo)(()=>er(),[]),[n,r]=(0,b.useState)(t.view),i=(0,b.useRef)(null),a=(0,b.useCallback)(async()=>{await i.current?.()},[]),{commands:o,draft:s,editMessage:c,handleCommandError:l,isRefiningContext:u,isResponding:d,loadState:f,messages:p,responseError:m,retryError:h,retryMessage:g,runCommand:_,sendMessage:v,setContextWindowLimit:y,setDraft:x,stopResponse:S,usageInfo:C}=Kn({refreshAppState:(0,b.useCallback)(async()=>i.current?.()??null,[]),showError:e.error}),{activeProvider:w,agentPrompt:T,contextWindowLimit:E,fetchProviderModels:D,handleActiveModelChange:O,handleActiveProviderChange:k,handleReasoningEffortChange:A,isCreatingProvider:j,isFetchingModels:M,loadProviderEditor:N,openNewProviderEditor:P,providerDraft:F,providers:I,reasoningEffort:L,removeProvider:ee,replaceProviders:te,replaceRuntimeSettings:ne,saveProvider:R,saveRuntimeSettings:z,selectedModel:B,selectedProviderId:re,updateProviderDraft:ie}=_n({onContextWindowLimitChange:(0,b.useCallback)(e=>{y(e)},[y]),refreshAppState:a,showError:e.error}),{activeSkill:ae,addWritablePath:oe,approveTelegramSession:se,reloadSkills:ce,removeWritablePath:le,replaceSkills:ue,replaceTelegramBot:de,replaceWritablePaths:fe,saveTelegramBot:pe,selectSkill:me,skills:he,telegramBot:ge,toggleSkill:_e,updateTelegramBot:ve,writablePaths:ye}=sn(),{importMcpServer:be,importingMcpServerId:xe,isCreatingMcpServer:Se,isMcpImportOpen:Ce,isPreviewingMcpImport:we,loadMcpEditor:Te,mcpDraft:V,mcpImportPreview:Ee,mcpImportSource:De,mcpServers:Oe,openMcpImport:ke,openNewMcpEditor:Ae,reconnectMcpServer:je,removeMcpServer:Me,replaceMcpServers:Ne,saveMcpServer:Pe,updateMcpDraft:Fe,updateMcpImportSource:Ie}=$t({showError:e.error}),{activeWorkflow:H,activeWorkflowId:Le,closeWorkflowEditor:Re,deleteWorkflow:ze,finishWorkflowRun:Be,newWorkflowKey:Ve,openNewWorkflow:He,openWorkflow:Ue,replaceWorkflows:U,renameWorkflow:We,runWorkflow:Ge,runningWorkflowId:Ke,saveWorkflow:qe,workflowRunResult:Je,workflows:Ye}=Wt(t.workflowId),{appVersion:Xe,refreshAppState:Ze}=qn({loadWorkspaceState:f,mcpServers:Oe,replaceMcpServers:Ne,replaceProviders:te,replaceRuntimeSettings:ne,replaceSkills:ue,replaceTelegramBot:de,replaceWorkflows:U,replaceWritablePaths:fe,showError:e.error,skills:he,telegramBot:ge});i.current=Ze;let Qe=(0,b.useCallback)((e,t=``,n)=>{r(e),e===`workflows`&&(t?Ue(t):He()),nr({view:e,workflowId:t},n)},[He,Ue]);return(0,b.useEffect)(()=>{nr({view:n,workflowId:n===`workflows`?Le:``},{replace:!0})},[n,Le]),(0,b.useEffect)(()=>{let e=()=>{let e=er();if(r(e.view),e.view===`workflows`){e.workflowId?Ue(e.workflowId):He();return}Re()};return window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`popstate`,e)}},[Re,He,Ue]),(0,q.jsxs)(GD,{activeProviderName:w?.name,activeView:n,activeWorkflowId:Le,onNewWorkflow:()=>Qe(`workflows`),onViewChange:e=>Qe(e),onWorkflowDelete:e=>{ze(e)},onWorkflowRename:(t,n)=>{We(t,n).then(t=>{t.data||e.error(t.error)})},onWorkflowSelect:e=>Qe(`workflows`,e),workflows:Ye,children:[(0,q.jsx)(xD,{value:`workspace`,className:SD,tabIndex:-1,children:(0,q.jsx)(GQ,{contextWindowLimit:E,draft:s,errorMessage:m,isRefiningContext:u,isResponding:d,messages:p,usageInfo:C,commands:o,skills:he,onCommand:_,onCommandError:l,onDraftChange:x,onEditMessage:e=>{c(e)},onRetryMessage:e=>{g(e)},onRetryError:e=>{h(e)},onSendMessage:e=>{v(e)},onStopResponse:S})}),(0,q.jsx)(xD,{value:`workflows`,className:SD,children:(0,q.jsx)(eH,{activeWorkflow:H,isRunningWorkflow:!!Ke,newWorkflowKey:Ve,onCloseEditor:()=>Qe(`workspace`),onDeleteWorkflow:ze,onFinishWorkflowRun:Be,onRunWorkflow:Ge,onSaveWorkflow:qe,runningWorkflowId:Ke,workflowRunResult:Je})}),(0,q.jsx)(xD,{value:`providers`,className:SD,children:(0,q.jsx)(wO,{activeProvider:F,isFetchingModels:M,isCreatingProvider:j,onFetchModels:D,onNewProvider:P,onProviderSelect:N,onRemoveProvider:ee,onSaveProvider:R,onUpdateProvider:ie,providers:I})}),(0,q.jsx)(xD,{value:`channels`,className:SD,children:(0,q.jsx)(aO,{onApproveSession:se,onSaveTelegramBot:pe,onUpdateTelegramBot:ve,telegramBot:ge})}),(0,q.jsx)(xD,{value:`permissions`,className:SD,children:(0,q.jsx)(SO,{onAddWritablePath:oe,onRemoveWritablePath:e=>{le(e)},writablePaths:ye})}),(0,q.jsx)(xD,{value:`mcp`,className:SD,children:(0,q.jsx)(uO,{activeServer:V,isCreatingServer:Se,isImportOpen:Ce,importPreview:Ee,importSource:De,importingServerId:xe,isPreviewing:we,onNewServer:Ae,onImport:ke,onImportSourceChange:Ie,onImportServer:e=>{be(e)},onReconnectServer:je,onRemoveServer:Me,onSaveServer:()=>{Pe()},onServerSelect:Te,onUpdateServer:Fe,servers:Oe})}),(0,q.jsx)(xD,{value:`skills`,className:SD,children:(0,q.jsx)(IO,{activeSkill:ae,onReloadSkills:()=>{ce()},onSkillSelect:me,onSkillToggle:(e,t)=>{_e(e,t)},skills:he})}),(0,q.jsx)(xD,{value:`settings`,className:SD,children:(0,q.jsx)(jO,{agentPrompt:T,appVersion:Xe,contextWindowLimit:E,modelOptions:w?.models??[],onModelChange:O,onProviderChange:k,onReasoningEffortChange:A,onRuntimeSettingsSave:z,providers:I,reasoningEffort:L,selectedModel:B,selectedProviderId:re})})]})}function n$(){return(0,q.jsx)(ek,{children:(0,q.jsx)(t$,{})})}function r$(){return null}function i$(){return(0,b.useEffect)(()=>{},[]),null}var a$=`--flowent-viewport-height`,o$=`--flowent-keyboard-offset`,s$=120;function c$(){if(typeof window>`u`)return;let e=typeof CSS<`u`&&CSS.supports(`height`,`100dvh`),t=l$(),n=0,r=0,i=e=>{document.documentElement.style.setProperty(a$,`${e}px`)},a=e=>{document.documentElement.style.setProperty(o$,`${e}px`)},o=(o=!1)=>{r=0;let s=l$(),c=u$(s),l=d$()&&t-s>s$;e||(o||!l)&&(t=s,i(s)),c!==n&&(n=c,a(c))},s=(e=!1)=>{r!==0&&window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>o(e))};o(!0),window.addEventListener(`resize`,()=>s(),{passive:!0}),window.addEventListener(`orientationchange`,()=>s(!0),{passive:!0}),window.addEventListener(`focusin`,()=>s(),{passive:!0}),window.addEventListener(`focusout`,()=>s(),{passive:!0}),window.visualViewport?.addEventListener(`resize`,()=>s(),{passive:!0}),window.visualViewport?.addEventListener(`scroll`,()=>s(),{passive:!0})}function l$(){return Math.round(document.documentElement.clientHeight||window.innerHeight||0)}function u$(e){if(!d$())return 0;let t=window.visualViewport;if(!t)return 0;let n=Math.max(0,e-t.height-t.offsetTop);return n>s$?Math.round(n):0}function d$(){let e=document.activeElement;if(e instanceof HTMLTextAreaElement)return!e.disabled&&!e.readOnly;if(e instanceof HTMLInputElement){let t=new Set([``,`email`,`number`,`password`,`search`,`tel`,`text`,`url`]);return!e.disabled&&!e.readOnly&&t.has(e.type)}return e instanceof HTMLElement&&e.isContentEditable}c$(),(0,x.createRoot)(document.getElementById(`root`)).render((0,q.jsxs)(b.StrictMode,{children:[(0,q.jsx)(n$,{}),(0,q.jsx)(r$,{}),(0,q.jsx)(i$,{})]}));
|