foss-design 0.9.3 → 0.9.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.
@@ -5,8 +5,8 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
5
5
  `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
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:``)?L(n):``}function Pe(e,t){switch(e.tag){case 26:case 27:case 5:return L(e.type);case 16:return L(`Lazy`);case 13:return e.child!==t&&t!==null?L(`Suspense Fallback`):L(`Suspense`);case 19:return L(`SuspenseList`);case 0:case 15:return Ne(e.type,!1);case 11:return Ne(e.type.render,!1);case 1:return Ne(e.type,!0);case 31:return L(`Activity`);case 30:return L(`ViewTransition`);default:return``}}function Fe(e){try{var t=``,n=null;do t+=Pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
7
  Error generating stack: `+e.message+`
8
- `+e.stack}}var Ie=Object.prototype.hasOwnProperty,Le=t.unstable_scheduleCallback,Re=t.unstable_cancelCallback,ze=t.unstable_shouldYield,Be=t.unstable_requestPaint,Ve=t.unstable_now,He=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,We=t.unstable_UserBlockingPriority,Ge=t.unstable_NormalPriority,Ke=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Je=t.log,Ye=t.unstable_setDisableYieldValue,Xe=null,Ze=null;function Qe(e){if(typeof Je==`function`&&Ye(e),Ze&&typeof Ze.setStrictMode==`function`)try{Ze.setStrictMode(Xe,e)}catch{}}var $e=Math.clz32?Math.clz32:nt,et=Math.log,tt=Math.LN2;function nt(e){return e>>>=0,e===0?32:31-(et(e)/tt|0)|0}var rt=256,it=262144,at=4194304;function ot(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&-e;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 st(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=ot(n))):i=ot(o):i=ot(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ot(n))):i=ot(o)):i=ot(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 ct(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-$e(n),i=1<<r;t|=e[r],n&=~i}return t}function ut(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 dt(){var e=at;return at<<=1,!(at&62914560)&&(at=4194304),e}function ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mt(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-$e(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&&ht(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ht(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-$e(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-$e(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function _t(e,t){var n=t&-t;return n=n&42?1:vt(n),(n&(e.suspendedLanes|t))===0?n:0}function vt(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 yt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function bt(){var e=F.p;return e===0?(e=window.event,e===void 0?32:Dh(e.type)):e}function xt(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var St=Math.random().toString(36).slice(2),Ct=`__reactFiber$`+St,wt=`__reactProps$`+St,Tt=`__reactContainer$`+St,Et=`__reactEvents$`+St,Dt=`__reactListeners$`+St,Ot=`__reactHandles$`+St,kt=`__reactResources$`+St,At=`__reactMarker$`+St,jt=`__reactLoad$`+St;function Mt(e){delete e[Ct],delete e[wt],delete e[Dt],delete e[Ot]}function Nt(e){var t;if(t=e[Ct])return t;for(var n=e.parentNode;n;){if(t=n[Tt]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gm(e);e!==null;){if(n=e[Ct])return n;e=gm(e)}return t}e=n,n=e.parentNode}return null}function Pt(e){if(e=e[Ct]||e[Tt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function It(e){var t=e[kt];return t||=e[kt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Lt(e){e[At]=!0}function Rt(e){e[jt]=void 0}var zt=new Set,Bt={};function Vt(e,t){Ht(e,t),Ht(e+`Capture`,t)}function Ht(e,t){for(Bt[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var Ut=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]*$`),Wt={},Gt={};function Kt(e){return Ie.call(Gt,e)?!0:Ie.call(Wt,e)?!1:Ut.test(e)?Gt[e]=!0:(Wt[e]=!0,!1)}var R=!1;function qt(){var e=R;return R=!1,e}function Jt(e,t,n){if(Kt(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 Yt(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 Xt(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 Zt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function $t(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 en(e){if(!e._valueTracker){var t=Qt(e)?`checked`:`value`;e._valueTracker=$t(e,t,``+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var nn=/[\n"\\]/g;function rn(e){return e.replace(nn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function an(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=``+Zt(t)):e.value!==``+Zt(t)&&(e.value=``+Zt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):sn(e,Zt(n)):o===`number`&&e.value==t?sn(e,Zt(e.value)):sn(e,Zt(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=``+Zt(s):e.removeAttribute(`name`)}function on(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)){en(e);return}n=n==null?``:``+Zt(n),t=t==null?n:``+Zt(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),en(e)}function sn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function cn(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=``+Zt(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 ln(e,t,n){if(t!=null&&(t=``+Zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Zt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ge(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Zt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),en(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=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 pn(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||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(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]=``,R=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(pn(e,a,r),R=!0)}else for(var o in t)t.hasOwnProperty(o)&&pn(e,o,t[o])}function hn(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 gn=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`],[`maskType`,`mask-type`],[`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`]]),_n=/^[\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 vn(e){return _n.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function yn(){}var bn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,Cn=null;function wn(e){var t=Pt(e);if(t&&(e=t.stateNode)){var n=e[wt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(an(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="`+rn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[wt]||null;if(!a)throw Error(i(90));an(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&&tn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Sn!==null||Cn!==null)&&(Hd(),Sn&&(t=Sn,e=Cn,Cn=Sn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[wt]||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 On=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.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 Nn=i.slice(e,1<r?1-r:void 0)}function Fn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function In(){return!0}function Ln(){return!1}function Rn(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)?In:Ln,this.isPropagationStopped=Ln,this}return D(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=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=D({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,z,Gn=D({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nr,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!==z&&(z&&e.type===`mousemove`?(Un=e.screenX-z.screenX,Wn=e.screenY-z.screenY):Wn=Un=0,z=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),Kn=Rn(Gn),qn=Rn(D({},Gn,{dataTransfer:0})),Jn=Rn(D({},Vn,{relatedTarget:0})),Yn=Rn(D({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Xn=Rn(D({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Zn=Rn(D({},zn,{data:0})),Qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},$n={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`},er={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function tr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=er[e])?!!t[e]:!1}function nr(){return tr}var rr=Rn(D({},Vn,{key:function(e){if(e.key){var t=Qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?$n[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ir=Rn(D({},Gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),ar=Rn(D({},zn,{submitter:0})),or=Rn(D({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nr})),sr=Rn(D({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),cr=Rn(D({},Gn,{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})),lr=Rn(D({},zn,{newState:0,oldState:0,source:0})),ur=[9,13,27,32],dr=On&&`CompositionEvent`in window,fr=null;On&&`documentMode`in document&&(fr=document.documentMode);var pr=On&&`TextEvent`in window&&!fr,mr=On&&(!dr||fr&&8<fr&&11>=fr),hr=` `,gr=!1;function _r(e,t){switch(e){case`keyup`:return ur.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function vr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var yr=!1;function B(e,t){switch(e){case`compositionend`:return vr(t);case`keypress`:return t.which===32?(gr=!0,hr):null;case`textInput`:return e=t.data,e===hr&&gr?null:e;default:return null}}function br(e,t){if(yr)return e===`compositionend`||!dr&&_r(e,t)?(e=Pn(),Nn=Mn=jn=null,yr=!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 mr&&t.locale!==`ko`?null:t.data;default:return null}}var xr={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 Sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!xr[e.type]:t===`textarea`}function Cr(e,t,n,r){Sn?Cn?Cn.push(r):Cn=[r]:Sn=r,t=Zf(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var wr=null,Tr=null;function Er(e){Gf(e,0)}function Dr(e){if(tn(Ft(e)))return e}function Or(e,t){if(e===`change`)return t}var kr=!1;if(On){var Ar;if(On){var jr=`oninput`in document;if(!jr){var Mr=document.createElement(`div`);Mr.setAttribute(`oninput`,`return;`),jr=typeof Mr.oninput==`function`}Ar=jr}else Ar=!1;kr=Ar&&(!document.documentMode||9<document.documentMode)}function Nr(){wr&&(wr.detachEvent(`onpropertychange`,Pr),Tr=wr=null)}function Pr(e){if(e.propertyName===`value`&&Dr(Tr)){var t=[];Cr(t,Tr,e,xn(e)),En(Er,t)}}function Fr(e,t,n){e===`focusin`?(Nr(),wr=t,Tr=n,wr.attachEvent(`onpropertychange`,Pr)):e===`focusout`&&Nr()}function Ir(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Dr(Tr)}function Lr(e,t){if(e===`click`)return Dr(t)}function Rr(e,t){if(e===`input`||e===`change`)return Dr(t)}function zr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Br=typeof Object.is==`function`?Object.is:zr;function Vr(e,t){if(Br(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(!Ie.call(t,i)||!Br(e[i],t[i]))return!1}return!0}function Hr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wr(e,t){var n=Ur(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=Ur(n)}}function Gr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Hr(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=Hr(e.document)}return t}function V(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 qr=On&&`documentMode`in document&&11>=document.documentMode,Jr=null,Yr=null,Xr=null,Zr=!1;function Qr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Zr||Jr==null||Jr!==Hr(r)||(r=Jr,`selectionStart`in r&&V(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}),Xr&&Vr(Xr,r)||(Xr=r,r=Zf(Yr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Jr)))}function $r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ei={animationend:$r(`Animation`,`AnimationEnd`),animationiteration:$r(`Animation`,`AnimationIteration`),animationstart:$r(`Animation`,`AnimationStart`),transitionrun:$r(`Transition`,`TransitionRun`),transitionstart:$r(`Transition`,`TransitionStart`),transitioncancel:$r(`Transition`,`TransitionCancel`),transitionend:$r(`Transition`,`TransitionEnd`)},ti={},ni={};On&&(ni=document.createElement(`div`).style,`AnimationEvent`in window||(delete ei.animationend.animation,delete ei.animationiteration.animation,delete ei.animationstart.animation),`TransitionEvent`in window||delete ei.transitionend.transition);function ri(e){if(ti[e])return ti[e];if(!ei[e])return e;var t=ei[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ni)return ti[e]=t[n];return e}var ii=ri(`animationend`),ai=ri(`animationiteration`),oi=ri(`animationstart`),si=ri(`transitionrun`),ci=ri(`transitionstart`),li=ri(`transitioncancel`),ui=ri(`transitionend`),di=new Map,fi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);fi.push(`scrollEnd`);function pi(e,t){di.set(e,t),Vt(t,[e])}var mi=0;function hi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Cd.identifierPrefix;var n=mi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function gi(e){if(e==null||typeof e==`string`)return e;var t=null,n=jd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function _i(e,t){return e=gi(e),t=gi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var vi=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)},yi=[],bi=0,xi=0;function Si(){for(var e=bi,t=xi=bi=0;t<e;){var n=yi[t];yi[t++]=null;var r=yi[t];yi[t++]=null;var i=yi[t];yi[t++]=null;var a=yi[t];if(yi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ei(n,i,a)}}function Ci(e,t,n,r){yi[bi++]=e,yi[bi++]=t,yi[bi++]=n,yi[bi++]=r,xi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function wi(e,t,n,r){return Ci(e,t,n,r),Di(e)}function Ti(e,t){return Ci(e,null,null,t),Di(e)}function Ei(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-$e(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Di(e){if(50<Md)throw Md=0,Nd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Oi={};function ki(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 Ai(e,t,n,r){return new ki(e,t,n,r)}function ji(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mi(e,t){var n=e.alternate;return n===null?(n=Ai(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&1206910976,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 Ni(e,t){e.flags&=1206910978;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 Pi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)ji(r)&&(s=1);else if(typeof r==`string`)s=Zm(e,n,Se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Ai(31,n,t,a),e.elementType=se,e.lanes=o,e;case j:return Fi(n.children,a,o,t);case ee:s=8,a|=24;break;case te:return e=Ai(12,n,t,a|2),e.elementType=te,e.lanes=o,e;case ie:return e=Ai(13,n,t,a),e.elementType=ie,e.lanes=o,e;case N:return e=Ai(19,n,t,a),e.elementType=N,e.lanes=o,e;case ce:case ue:return e=a|32,e=Ai(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case M:s=10;break a;case ne:s=9;break a;case re:s=11;break a;case ae:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ai(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Fi(e,t,n,r){return e=Ai(7,e,r,t),e.lanes=n,e}function Ii(e,t,n){return e=Ai(6,e,null,t),e.lanes=n,e}function Li(e){var t=Ai(18,null,null,0);return t.stateNode=e,t}function Ri(e,t,n){return t=Ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var zi=new WeakMap;function Bi(e,t){if(typeof e==`object`&&e){var n=zi.get(e);return n===void 0?(t={value:e,source:t,stack:Fe(t)},zi.set(e,t),t):n}return{value:e,source:t,stack:Fe(t)}}var Vi=[],Hi=0,Ui=null,Wi=0,Gi=[],Ki=0,qi=null,Ji=1,Yi=``;function Xi(e,t){Vi[Hi++]=Wi,Vi[Hi++]=Ui,Ui=e,Wi=t}function Zi(e,t,n){Gi[Ki++]=Ji,Gi[Ki++]=Yi,Gi[Ki++]=qi,qi=e;var r=Ji;e=Yi;var i=32-$e(r)-1;r&=~(1<<i),n+=1;var a=32-$e(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ji=1<<32-$e(t)+i|n<<i|r,Yi=a+e}else Ji=1<<a|n<<i|r,Yi=e}function Qi(e){e.return!==null&&(Xi(e,1),Zi(e,1,0))}function $i(e){for(;e===Ui;)Ui=Vi[--Hi],Vi[Hi]=null,Wi=Vi[--Hi],Vi[Hi]=null;for(;e===qi;)qi=Gi[--Ki],Gi[Ki]=null,Yi=Gi[--Ki],Gi[Ki]=null,Ji=Gi[--Ki],Gi[Ki]=null}function ea(e,t){Gi[Ki++]=Ji,Gi[Ki++]=Yi,Gi[Ki++]=qi,Ji=t.id,Yi=t.overflow,qi=e}var ta=null,na=null,H=!1,ra=null,ia=!1,aa=Error(i(519));function oa(e){throw fa(Bi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),aa}function sa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[wt]=r,n){case`dialog`:J(`cancel`,t),J(`close`,t);break;case`iframe`:case`object`:case`embed`:J(`load`,t);break;case`video`:case`audio`:for(n=0;n<Uf.length;n++)J(Uf[n],t);break;case`source`:J(`error`,t);break;case`img`:case`image`:case`link`:J(`error`,t),J(`load`,t);break;case`details`:J(`toggle`,t);break;case`input`:J(`invalid`,t),on(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:J(`invalid`,t);break;case`textarea`:J(`invalid`,t),un(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||rp(t.textContent,n)?(r.popover!=null&&(J(`beforetoggle`,t),J(`toggle`,t)),r.onScroll!=null&&J(`scroll`,t),r.onScrollEnd!=null&&J(`scrollend`,t),r.onClick!=null&&(t.onclick=yn),t=!0):t=!1,t||oa(e,!0)}function ca(e){for(ta=e.return;ta;)switch(ta.tag){case 5:case 31:case 13:ia=!1;return;case 27:case 3:ia=!0;return;default:ta=ta.return}}function la(e){if(e!==ta)return!1;if(!H)return ca(e),H=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||_p(e.type,e.memoizedProps)),n=!n),n&&na&&oa(e),ca(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));na=hm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));na=hm(e)}else t===27?(t=na,Ep(e.type)?(e=mm,mm=null,na=e):na=t):na=ta?pm(e.stateNode.nextSibling):null;return!0}function ua(){na=ta=null,H=!1}function da(){var e=ra;return e!==null&&(hd===null?hd=e:hd.push.apply(hd,e),ra=null),e}function fa(e){ra===null?ra=[e]:ra.push(e)}var pa=I(null),ma=null,ha=null;function ga(e,t,n){xe(pa,t._currentValue),t._currentValue=n}function _a(e){e._currentValue=pa.current,be(pa)}function va(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 ya(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),va(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),va(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),va(a.return,n,e),s=a.child,s=s===null?null:s.sibling):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 ba(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;Br(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Te.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[dh]:e.push(dh))}a=a.return}return e!==null&&ya(t,e,n,r),t.flags|=262144,e!==null}function xa(e){for(e=e.firstContext;e!==null;){if(!Br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Sa(e){ma=e,ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ca(e){return Ta(ma,e)}function wa(e,t){return ma===null&&Sa(e),Ta(e,t)}function Ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ha===null){if(e===null)throw Error(i(308));ha=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ha=ha.next=t;return n}var Ea=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()})}},Da=t.unstable_scheduleCallback,Oa=t.unstable_NormalPriority,ka={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Aa(){return{controller:new Ea,data:new Map,refCount:0}}function ja(e){e.refCount--,e.refCount===0&&Da(Oa,function(){e.controller.abort()})}function Ma(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Na=null;function Pa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Fa=null,Ia=0,La=0,Ra=null;function za(e,t){if(Fa===null){var n=Fa=[];Ia=0,La=Rf(),Ra={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ia++,t.then(Ba,Ba),t}function Ba(){if(--Ia===0&&(Na=null,Fa!==null)){Ra!==null&&(Ra.status=`fulfilled`);var e=Fa;Fa=null,La=0,Ra=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Va(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ha=P.S;P.S=function(e,t){if(vd=Ve(),typeof t==`object`&&t&&typeof t.then==`function`&&za(e,t),Na!==null)for(var n=wf;n!==null;)Ma(n,Na),n=n.next;if(n=e.types,n!==null){for(var r=wf;r!==null;)Ma(r,n),r=r.next;if(La!==0){r=Na,r===null&&(r=Na=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ha!==null&&Ha(e,t)};var Ua=I(null);function Wa(){var e=Ua.current;return e===null?td.pooledCache:e}function Ga(e,t){t===null?xe(Ua,Ua.current):xe(Ua,t.pool)}function Ka(){var e=Wa();return e===null?null:{parent:ka._currentValue,pool:e}}var qa=Error(i(460)),Ja=Error(i(474)),Ya=Error(i(542)),Xa={then:function(){}};function Za(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Qa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yn,yn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,no(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(yn,yn);else{if(e=td,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,no(e),e}throw eo=t,qa}}function $a(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(eo=e,qa):e}}var eo=null;function to(){if(eo===null)throw Error(i(459));var e=eo;return eo=null,e}function no(e){if(e===qa||e===Ya)throw Error(i(483))}var ro=null,io=0;function ao(e){var t=io;return io+=1,ro===null&&(ro=[]),Qa(ro,e,t)}function oo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function so(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function co(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=Mi(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ii(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===j?(e=d(e,t,n.props.children,r,n.key),oo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===oe&&$a(i)===t.type)?(t=a(t,n.props),oo(t,n),t.return=e,t):(t=Pi(n.type,n.key,n.props,null,e.mode,r),oo(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=Ri(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=Fi(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=Ii(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Pi(t.type,t.key,t.props,null,e.mode,n),oo(n,t),n.return=e,n;case A:return t=Ri(t,e.mode,n),t.return=e,t;case oe:return t=$a(t),f(e,t,n)}if(ge(t)||pe(t))return t=Fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ao(t),n);if(t.$$typeof===M)return f(e,wa(e,t),n);so(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 k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case oe:return n=$a(n),p(e,t,n,r)}if(ge(n)||pe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ao(n),r);if(n.$$typeof===M)return p(e,t,wa(e,n),r);so(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=$a(r),m(e,t,n,r,i)}if(ge(r)||pe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ao(r),i);if(r.$$typeof===M)return m(e,t,n,wa(t,r),i);so(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),H&&Xi(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 H&&Xi(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(_.key===null?h:_.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)}),H&&Xi(i,h),l}function g(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),H&&Xi(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 H&&Xi(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(_.key===null?g:_.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)}),H&&Xi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),oo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&$a(l)===r.type){n(e,r.sibling),c=a(r,o.props),oo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Fi(o.props.children,e.mode,c,o.key),oo(c,o),c.return=e,e=c):(c=Pi(o.type,o.key,o.props,null,e.mode,c),oo(c,o),c.return=e,e=c)}return s(e);case A: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}n(e,r);break}t(e,r),r=r.sibling}c=Ri(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=$a(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(pe(o)){if(l=pe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,ao(o),c);if(o.$$typeof===M)return _(e,r,wa(e,o),c);so(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=Ii(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{io=0;var i=_(e,t,n,r);return ro=null,i}catch(t){if(t===qa||t===Ya)throw t;var a=Ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var lo=co(!0),uo=co(!1),fo=!1;function po(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mo(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 ho(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function go(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Di(e),Ei(e,null,n),t}return Ci(e,r,t,n),Di(e)}function _o(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,gt(e,n)}}function vo(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 yo=!1;function bo(){if(yo){var e=Ra;if(e!==null)throw e}}function xo(e,t,n,r){yo=!1;var i=e.updateQueue;fo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(q&f)===f:(r&f)===f){f!==0&&f===La&&(yo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:fo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ld|=o,e.lanes=o,e.memoizedState=d}}function So(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Co(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)So(n[e],t)}var wo=I(null),To=I(0);function Eo(e,t){e=sd,xe(To,e),xe(wo,t),sd=e|t.baseLanes}function Do(){xe(To,sd),xe(wo,wo.current)}function Oo(){sd=To.current,be(wo),be(To)}var ko=I(null),Ao=null;function jo(e){var t=e.alternate;xe(Io,Io.current&1),xe(ko,e),Ao===null&&(t===null||wo.current!==null||t.memoizedState!==null)&&(Ao=e)}function Mo(e){xe(Io,Io.current),xe(ko,e),Ao===null&&(Ao=e)}function No(e){e.tag===22?(xe(Io,Io.current),xe(ko,e),Ao===null&&(Ao=e)):Po()}function Po(){xe(Io,Io.current),xe(ko,ko.current)}function Fo(e){be(ko),Ao===e&&(Ao=null),be(Io)}var Io=I(0);function Lo(e,t){xe(ko,ko.current),xe(Io,t)}function Ro(e){be(Io),be(ko),Ao===e&&(Ao=null)}function zo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||um(n)||dm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Bo=0,U=null,Vo=null,Ho=null,Uo=!1,Wo=!1,Go=!1,Ko=0,qo=0,Jo=null,Yo=0;function Xo(){throw Error(i(321))}function Zo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Br(e[n],t[n]))return!1;return!0}function Qo(e,t,n,r,i,a){return Bo=a,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?hc:gc,Go=!1,a=n(r,i),Go=!1,Wo&&(a=es(t,n,r,i)),$o(e),a}function $o(e){P.H=mc;var t=Vo!==null&&Vo.next!==null;if(Bo=0,Ho=Vo=U=null,Uo=!1,qo=0,Jo=null,t)throw Error(i(300));e===null||Nc||(e=e.dependencies,e!==null&&xa(e)&&(Nc=!0))}function es(e,t,n,r){U=e;var a=0;do{if(Wo&&(Jo=null),qo=0,Wo=!1,25<=a)throw Error(i(301));if(a+=1,Ho=Vo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=_c,o=t(n,r)}while(Wo);return o}function ts(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?cs(t):t,e=e.useState()[0],(Vo===null?null:Vo.memoizedState)!==e&&(U.flags|=1024),t}function ns(){var e=Ko!==0;return Ko=0,e}function rs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function is(e){if(Uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Uo=!1}Bo=0,Ho=Vo=U=null,Wo=!1,qo=Ko=0,Jo=null}function as(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ho===null?U.memoizedState=Ho=e:Ho=Ho.next=e,Ho}function os(){if(Vo===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=Vo.next;var t=Ho===null?U.memoizedState:Ho.next;if(t!==null)Ho=t,Vo=e;else{if(e===null)throw U.alternate===null?Error(i(467)):Error(i(310));Vo=e,e={memoizedState:Vo.memoizedState,baseState:Vo.baseState,baseQueue:Vo.baseQueue,queue:Vo.queue,next:null},Ho===null?U.memoizedState=Ho=e:Ho=Ho.next=e}return Ho}function ss(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cs(e){var t=qo;return qo+=1,Jo===null&&(Jo=[]),e=Qa(Jo,e,t),t=U,(Ho===null?t.memoizedState:Ho.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?hc:gc),e}function ls(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return cs(e);if(e.$$typeof===de)return;if(e.$$typeof===M)return Ca(e)}throw Error(i(438,String(e)))}function us(e){var t=null,n=U.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=U.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=ss(),U.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]=le;return t.index++,n}function ds(e,t){return typeof t==`function`?t(e):t}function fs(e){return ps(os(),Vo,e)}function ps(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?(Bo&f)===f:(q&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===La&&(d=!0);else if((Bo&p)===p){u=u.next,p===La&&(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,U.lanes|=p,ld|=p;f=u.action,Go&&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,U.lanes|=f,ld|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Br(o,e.memoizedState)&&(Nc=!0,d&&(n=Ra,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 ms(e){var t=os(),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);Br(o,t.memoizedState)||(Nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function hs(e,t,n){var r=U,a=os(),o=H;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Br((Vo||a).memoizedState,n);if(s&&(a.memoizedState=n,Nc=!0),a=a.queue,Bs(vs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ho!==null&&!!(Ho.memoizedState.tag&1),Fs(e?9:8,{destroy:void 0},_s.bind(null,r,a,n,t),null),e){if(r.flags|=2048,td===null)throw Error(i(349));o||Bo&127||gs(r,t,n)}return n}function gs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t=ss(),U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function _s(e,t,n,r){t.value=n,t.getSnapshot=r,ys(t)&&bs(e)}function vs(e,t,n){return n(function(){ys(t)&&bs(e)})}function ys(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Br(e,n)}catch{return!0}}function bs(e){var t=Ti(e,2);t!==null&&Ld(t,e,2)}function xs(e){var t=as();if(typeof e==`function`){var n=e;if(e=n(),Go){Qe(!0);try{n()}finally{Qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:e},t}function Ss(e,t,n,r){return e.baseState=n,ps(e,Vo,typeof r==`function`?r:ds)}function Cs(e,t,n,r,a){if(dc(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)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ws(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ws(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};o.types=a===null?null:a.types,P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Ts(e,t,s)}catch(n){Ds(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Ts(e,t,a)}catch(n){Ds(e,t,n)}}function Ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Es(e,t,n)},function(n){return Ds(e,t,n)}):Es(e,t,n)}function Es(e,t,n){t.status=`fulfilled`,t.value=n,Os(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ws(e,n)))}function Ds(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Os(t),t=t.next;while(t!==r)}e.action=null}function Os(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ks(e,t){return t}function As(e,t){if(H){var n=td.formState;if(n!==null){a:{var r=U;if(H){if(na){b:{for(var i=na,a=ia;i.nodeType!==8;){if(!a){i=null;break b}if(i=pm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){na=pm(i.nextSibling),r=i.data===`F!`;break a}}oa(r)}r=!1}r&&(t=n[0])}}return n=as(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:t},n.queue=r,n=cc.bind(null,U,r),r.dispatch=n,r=xs(!1),a=uc.bind(null,U,!1,r.queue),r=as(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Cs.bind(null,U,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function js(e){return Ms(os(),Vo,e)}function Ms(e,t,n){if(t=ps(e,t,ks)[0],e=fs(ds)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=cs(t)}catch(e){throw e===qa?Ya:e}else r=t;t=os();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(U.flags|=2048,Fs(9,{destroy:void 0},Ns.bind(null,i,n),null)),[r,a,e]}function Ns(e,t){e.action=t}function Ps(e){var t=os(),n=Vo;if(n!==null)return Ms(t,n,e);os(),t=t.memoizedState,n=os();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Fs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=U.updateQueue,t===null&&(t=ss(),U.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 Is(){return os().memoizedState}function Ls(e,t,n,r){var i=as();U.flags|=e,i.memoizedState=Fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Rs(e,t,n,r){var i=os();r=r===void 0?null:r;var a=i.memoizedState.inst;Vo!==null&&r!==null&&Zo(r,Vo.memoizedState.deps)?i.memoizedState=Fs(t,a,n,r):(U.flags|=e,i.memoizedState=Fs(1|t,a,n,r))}function zs(e,t){Ls(8390656,8,e,t)}function Bs(e,t){Rs(2048,8,e,t)}function Vs(e){U.flags|=4;var t=U.updateQueue;if(t===null)t=ss(),U.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hs(e){var t=os().memoizedState;return Vs({ref:t,nextImpl:e}),function(){if(G&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Us(e,t){return Rs(4,2,e,t)}function Ws(e,t){return Rs(4,4,e,t)}function Gs(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 Ks(e,t,n){n=n==null?null:n.concat([e]),Rs(4,4,Gs.bind(null,t,e),n)}function qs(){}function Js(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Zo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ys(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Zo(t,r[1]))return r[0];if(r=e(),Go){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r}function Xs(e,t,n){return n===void 0||Bo&1073741824&&!(q&261930)?e.memoizedState=t:(e.memoizedState=n,e=Fd(),U.lanes|=e,ld|=e,n)}function Zs(e,t,n,r){return Br(n,t)?n:wo.current===null?!(Bo&106)||Bo&1073741824&&!(q&261930)?(Nc=!0,e.memoizedState=n):(e=Fd(),U.lanes|=e,ld|=e,t):(e=Xs(e,n,r),Br(e,t)||(Nc=!0),e)}function Qs(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};s.types=o===null?null:o.types,P.T=s,uc(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?lc(e,t,Va(c,r),Pd(e)):lc(e,t,r,Pd(e))}catch(n){lc(e,t,{then:function(){},status:`rejected`,reason:n},Pd())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function $s(){}function ec(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=tc(e).queue;Qs(e,a,t,_e,n===null?$s:function(){return nc(e),n(r)})}function tc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function nc(e){var t=tc(e);t.next===null&&(t=e.alternate.memoizedState),lc(e,t.next.queue,{},Pd())}function rc(){return Ca(dh)}function ic(){return os().memoizedState}function ac(){return os().memoizedState}function oc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Pd();e=ho(n);var r=go(t,e,n);r!==null&&(Ld(r,t,n),_o(r,t,n)),t={cache:Aa()},e.payload=t;return}t=t.return}}function sc(e,t,n){var r=Pd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dc(e)?fc(t,n):(n=wi(e,t,n,r),n!==null&&(Ld(n,e,r),pc(n,t,r)))}function cc(e,t,n){lc(e,t,n,Pd())}function lc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dc(e))fc(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,Br(s,o))return Ci(e,t,i,0),td===null&&Si(),!1}catch{}if(n=wi(e,t,i,r),n!==null)return Ld(n,e,r),pc(n,t,r),!0}return!1}function uc(e,t,n,r){if(r={lane:2,revertLane:Rf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},dc(e)){if(t)throw Error(i(479))}else t=wi(e,n,r,2),t!==null&&Ld(t,e,2)}function dc(e){var t=e.alternate;return e===U||t!==null&&t===U}function fc(e,t){Wo=Uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}var mc={readContext:Ca,use:ls,useCallback:Xo,useContext:Xo,useEffect:Xo,useImperativeHandle:Xo,useLayoutEffect:Xo,useInsertionEffect:Xo,useMemo:Xo,useReducer:Xo,useRef:Xo,useState:Xo,useDebugValue:Xo,useDeferredValue:Xo,useTransition:Xo,useSyncExternalStore:Xo,useId:Xo,useHostTransitionStatus:Xo,useFormState:Xo,useActionState:Xo,useOptimistic:Xo,useMemoCache:Xo,useCacheRefresh:Xo,useEffectEvent:Xo},hc={readContext:Ca,use:ls,useCallback:function(e,t){return as().memoizedState=[e,t===void 0?null:t],e},useContext:Ca,useEffect:zs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ls(4194308,4,Gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ls(4194308,4,e,t)},useInsertionEffect:function(e,t){Ls(4,2,e,t)},useMemo:function(e,t){var n=as();t=t===void 0?null:t;var r=e();if(Go){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=as();if(n!==void 0){var i=n(t);if(Go){Qe(!0);try{n(t)}finally{Qe(!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=sc.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=as();return e={current:e},t.memoizedState=e},useState:function(e){e=xs(e);var t=e.queue,n=cc.bind(null,U,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qs,useDeferredValue:function(e,t){return Xs(as(),e,t)},useTransition:function(){var e=xs(!1);return e=Qs.bind(null,U,e.queue,!0,!1),as().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=U,a=as();if(H){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),td===null)throw Error(i(349));q&127||gs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,zs(vs.bind(null,r,o,e),[e]),r.flags|=2048,Fs(9,{destroy:void 0},_s.bind(null,r,o,n,t),null),n},useId:function(){var e=as(),t=td.identifierPrefix;if(H){var n=Yi,r=Ji;n=(r&~(1<<32-$e(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ko++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:rc,useFormState:As,useActionState:As,useOptimistic:function(e){var t=as();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=uc.bind(null,U,!0,n),n.dispatch=t,[e,t]},useMemoCache:us,useCacheRefresh:function(){return as().memoizedState=oc.bind(null,U)},useEffectEvent:function(e){var t=as(),n={impl:e};return t.memoizedState=n,function(){if(G&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},gc={readContext:Ca,use:ls,useCallback:Js,useContext:Ca,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:fs,useRef:Is,useState:function(){return fs(ds)},useDebugValue:qs,useDeferredValue:function(e,t){return Zs(os(),Vo.memoizedState,e,t)},useTransition:function(){var e=fs(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:js,useActionState:js,useOptimistic:function(e,t){return Ss(os(),Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs},_c={readContext:Ca,use:ls,useCallback:Js,useContext:Ca,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:ms,useRef:Is,useState:function(){return ms(ds)},useDebugValue:qs,useDeferredValue:function(e,t){var n=os();return Vo===null?Xs(n,e,t):Zs(n,Vo.memoizedState,e,t)},useTransition:function(){var e=ms(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){var n=os();return Vo===null?(n.baseState=e,[e,n.queue.dispatch]):Ss(n,Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs};function vc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var yc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Pd(),i=ho(r);i.payload=t,n!=null&&(i.callback=n),t=go(e,i,r),t!==null&&(Ld(t,e,r),_o(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Pd(),i=ho(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=go(e,i,r),t!==null&&(Ld(t,e,r),_o(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pd(),r=ho(n);r.tag=2,t!=null&&(r.callback=t),t=go(e,r,n),t!==null&&(Ld(t,e,n),_o(t,e,n))}};function bc(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?!Vr(n,r)||!Vr(i,a):!0}function xc(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&&yc.enqueueReplaceState(t,t.state,null)}function Sc(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=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Cc(e){vi(e)}function wc(e){console.error(e)}function Tc(e){vi(e)}function Ec(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Dc(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 Oc(e,t,n){return n=ho(n),n.tag=3,n.payload={element:null},n.callback=function(){Ec(e,t)},n}function kc(e){return e=ho(e),e.tag=3,e}function Ac(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(){Dc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Dc(t,n,r),typeof i!=`function`&&(xd===null?xd=new Set([this]):xd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function jc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ba(t,n,a,!0),n=ko.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Ao===null?Yd():n.alternate===null&&cd===0&&(cd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),vf(e,r,a)),!1;case 22:return n.flags|=65536,r===Xa?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)),vf(e,r,a)),!1}throw Error(i(435,n.tag))}return vf(e,r,a),Yd(),!1}if(H)return t=ko.current,t===null?(r!==aa&&(t=Error(i(423),{cause:r}),fa(Bi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Bi(r,n),a=Oc(e.stateNode,r,a),vo(e,a),cd!==4&&(cd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==aa&&(e=Error(i(422),{cause:r}),fa(Bi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Bi(o,n),md===null?md=[o]:md.push(o),cd!==4&&(cd=2),t===null)return!0;r=Bi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Oc(n.stateNode,r,e),vo(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`&&(xd===null||!xd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=kc(a),Ac(a,e,n,r),vo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Mc=Error(i(461)),Nc=!1;function Pc(e,t,n,r){t.child=e===null?uo(t,null,n,r):lo(t,e.child,n,r)}function Fc(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 Sa(t),r=Qo(e,t,n,o,a,i),s=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(H&&s&&Qi(t),t.flags|=1,Pc(e,t,r,i),t.child)}function Ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ji(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Lc(e,t,a,r,i)):(e=Pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ul(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Vr:n,n(o,r)&&e.ref===t.ref)return ll(e,t,i)}return t.flags|=1,e=Mi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Vr(a,r)&&e.ref===t.ref){if(Nc=!1,t.pendingProps=r=a,ul(e,i))e.flags&131072&&(Nc=!0);else return t.lanes=e.lanes,ll(e,t,i)}}return Gc(e,t,n,r,i)}function Rc(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 Bc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ga(t,a===null?null:a.cachePool),a===null?Do():Eo(t,a),No(t);else return r=t.lanes=536870912,Bc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ga(t,null),Do(),Po()):(Ga(t,a.cachePool),Eo(t,a),Po(),t.memoizedState=null);return Pc(e,t,i,n),t.child}function zc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bc(e,t,n,r,i){var a=Wa();return a=a===null?null:{parent:ka._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ga(t,null),Do(),No(t),e!==null&&ba(e,t,r,!0),t.childLanes=i,null}function Vc(e,t){return t=el({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hc(e,t,n){return lo(t,e.child,null,n),e=Vc(t,t.pendingProps),e.flags|=2,Fo(t),t.memoizedState=null,e}function Uc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(H){if(r.mode===`hidden`)return e=Vc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},zc(null,e);if(Mo(t),(e=na)?(e=lm(e,ia),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi===null?null:{id:Ji,overflow:Yi},retryLane:536870912,hydrationErrors:null},n=Li(e),n.return=t,t.child=n,ta=t,na=null)):e=null,e===null)throw oa(t);return t.lanes=536870912,null}return Vc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Mo(t),a){if(t.flags&256)t.flags&=-257,t=Hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Nc||ba(e,t,n,!1),a=(n&e.childLanes)!==0,Nc||a){if(wo.current===null){if(r=td,r!==null&&(s=_t(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ti(e,s),Ld(r,e,s),Mc;Yd()}t=Hc(e,t,n)}else e=o.treeContext,na=pm(s.nextSibling),ta=t,H=!0,ra=null,ia=!1,e!==null&&ea(t,e),t=Vc(t,r),t.flags|=134221824;return t}return e=Mi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wc(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 Gc(e,t,n,r,i){return Sa(t),n=Qo(e,t,n,r,void 0,i),r=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(H&&r&&Qi(t),t.flags|=1,Pc(e,t,n,i),t.child)}function Kc(e,t,n,r,i,a){return Sa(t),t.updateQueue=null,n=es(t,r,n,i),$o(e),r=ns(),e!==null&&!Nc?(rs(e,t,a),ll(e,t,a)):(H&&r&&Qi(t),t.flags|=1,Pc(e,t,n,a),t.child)}function qc(e,t,n,r,i){if(Sa(t),t.stateNode===null){var a=Oi,o=n.contextType;typeof o==`object`&&o&&(a=Ca(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=yc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},po(t),o=n.contextType,a.context=typeof o==`object`&&o?Ca(o):Oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(vc(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&&yc.enqueueReplaceState(a,a.state,null),xo(t,r,a,i),bo(),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=Sc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Oi,typeof u==`object`&&u&&(o=Ca(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)&&xc(t,a,r,o),fo=!1;var f=t.memoizedState;a.state=f,xo(t,r,a,i),bo(),l=t.memoizedState,s||f!==l||fo?(typeof d==`function`&&(vc(t,n,d,r),l=t.memoizedState),(c=fo||bc(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,mo(e,t),o=t.memoizedProps,u=Sc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Oi,typeof l==`object`&&l&&(c=Ca(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)&&xc(t,a,r,c),fo=!1,f=t.memoizedState,a.state=f,xo(t,r,a,i),bo();var p=t.memoizedState;o!==d||f!==p||fo||e!==null&&e.dependencies!==null&&xa(e.dependencies)?(typeof s==`function`&&(vc(t,n,s,r),p=t.memoizedState),(u=fo||bc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&xa(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,Wc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=lo(t,e.child,null,i),t.child=lo(t,null,n,i)):Pc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ll(e,t,i),e}function Jc(e,t,n,r){return ua(),t.flags|=256,Pc(e,t,n,r),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(e){return{baseLanes:e,cachePool:Ka()}}function Zc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=fd),e}function Qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Io.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(H){if(i?jo(t):Po(),(e=na)?(e=lm(e,ia),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi===null?null:{id:Ji,overflow:Yi},retryLane:536870912,hydrationErrors:null},n=Li(e),n.return=t,t.child=n,ta=t,na=null)):e=null,e===null)throw oa(t);return t.lanes=dm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Po(),i=t.mode,a=el({mode:`hidden`,children:a},i),r=Fi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Xc(n),r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(null,r)):(jo(t),$c(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return nl(e,t,a,o,r,c,s,n)}return i?(Po(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Mi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Fi(i,a,n,null),i.flags|=2):i=Mi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,zc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Xc(n):(a=i.cachePool,a===null?a=Ka():(s=ka._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(e.child,r)):(jo(t),n=e.child,e=n.sibling,n=Mi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function $c(e,t){return t=el({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function el(e,t){return e=Ai(22,e,null,t),e.lanes=0,e}function tl(e,t,n){return lo(t,e.child,null,n),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(jo(t),t.flags&=-257,tl(e,t,c)):t.memoizedState===null?(Po(),o=a.fallback,s=t.mode,a=el({mode:`visible`,children:a.children},s),o=Fi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,lo(t,e.child,null,c),a=t.child,a.memoizedState=Xc(c),a.childLanes=Zc(e,r,c),t.memoizedState=Yc,zc(null,a)):(Po(),t.child=e.child,t.flags|=128,null);if(jo(t),dm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,fa({value:a,source:null,stack:null})),tl(e,t,c)}if(Nc||ba(e,t,c,!1),r=(c&e.childLanes)!==0,Nc||r){if(wo.current!==null)return tl(e,t,c);if(r=td,r!==null&&(a=_t(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ti(e,a),Ld(r,e,a),Mc;return um(o)||Yd(),tl(e,t,c)}return um(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,na=pm(o.nextSibling),ta=t,H=!0,ra=null,ia=!1,e!==null&&ea(t,e),t=$c(t,a.children),t.flags|=134221824,t)}function rl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),va(e.return,t,n)}function il(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&zo(n)===null&&(t=e),e=e.sibling}return t}function al(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 ol(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function sl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Io.current;if(t.flags&128)return Lo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Lo(t,o),i===`backwards`&&e!==null?(ol(e),Pc(e,t,r,n),ol(e)):Pc(e,t,r,n),r=H?Wi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rl(e,n,t);else if(e.tag===19)rl(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`backwards`:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ol(t)),al(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&zo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case`together`:al(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r)}return t.child}function cl(e,t,n){var r=t.pendingProps;return ga(t,t.type,r.value),Pc(e,t,r.children,n),t.child}function ll(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ld|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ba(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=Mi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Mi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ul(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&xa(e)))}function dl(e,t,n){switch(t.tag){case 3:Ee(t,t.stateNode.containerInfo),ga(t,ka,e.memoizedState.cache),ua();break;case 27:case 5:Oe(t);break;case 4:Ee(t,t.stateNode.containerInfo);break;case 10:ga(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Mo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return jo(t),t.flags|=128,null;r=ba(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Qc(e,t,n):(jo(t),e=ll(e,t,n),e===null?null:e.sibling)}jo(t);break;case 19:if(t.flags&128)return sl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ba(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return sl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Lo(t,Io.current),r)break;return null;case 22:return t.lanes=0,Rc(e,t,n,t.pendingProps);case 24:ga(t,ka,e.memoizedState.cache)}return ll(e,t,n)}function fl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Nc=!0;else{if(!ul(e,n)&&!(t.flags&128))return Nc=!1,dl(e,t,n);Nc=!!(e.flags&131072)}}else Nc=!1,H&&t.flags&1048576&&Zi(t,Wi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=$a(t.elementType),t.type=e,typeof e==`function`)ji(e)?(r=Sc(e,r),t.tag=1,t=qc(null,t,e,r,n)):(t.tag=0,t=Gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===re){t.tag=11,t=Fc(null,t,e,r,n);break a}if(a===ae){t.tag=14,t=Ic(null,t,e,r,n);break a}if(a===M){t.tag=10,t.type=e,t=cl(null,t,n);break a}}throw t=he(e)||e,Error(i(306,t,``))}}return t;case 0:return Gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Sc(r,t.pendingProps),qc(e,t,r,a,n);case 3:a:{if(Ee(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,mo(e,t),xo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ga(t,ka,r),r!==o.cache&&ya(t,[ka],n,!0),bo(),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=Jc(e,t,r,n);break a}if(r!==a){a=Bi(Error(i(424)),t),fa(a),t=Jc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(na=pm(e.firstChild),ta=t,H=!0,ra=null,ia=!0,n=uo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ua(),r===a){t=ll(e,t,n);break a}Pc(e,t,r,n)}t=t.child}return t;case 26:return Wc(e,t),e===null?(n=Lm(t.type,null,t.pendingProps,null))?t.memoizedState=n:H||(t.stateNode=gp(t.type,t.pendingProps,we.current,t)):t.memoizedState=Lm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Oe(t),e===null&&H&&(r=t.stateNode=ym(t.type,t.pendingProps,we.current),ta=t,ia=!0,a=na,Ep(t.type)?(mm=a,na=pm(r.firstChild)):na=a),Pc(e,t,t.pendingProps.children,n),Wc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&H&&((a=r=na)&&(r=sm(r,t.type,t.pendingProps,ia),r===null?a=!1:(t.stateNode=r,ta=t,na=pm(r.firstChild),ia=!1,a=!0)),a||oa(t)),Oe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,_p(a,o)?r=null:s!==null&&_p(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Qo(e,t,ts,null,null,n),dh._currentValue=a),Wc(e,t),Pc(e,t,r,n),t.child;case 6:return e===null&&H&&((e=n=na)&&(n=cm(n,t.pendingProps,ia),n===null?e=!1:(t.stateNode=n,ta=t,na=null,e=!0)),e||oa(t)),null;case 13:return Qc(e,t,n);case 4:return Ee(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=lo(t,null,r,n):Pc(e,t,r,n),t.child;case 11:return Fc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Wc(e,t),Pc(e,t,r,n),t.child;case 8:return Pc(e,t,t.pendingProps.children,n),t.child;case 12:return Pc(e,t,t.pendingProps.children,n),t.child;case 10:return cl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Sa(t),a=Ca(a),r=r(a),t.flags|=1,Pc(e,t,r,n),t.child;case 14:return Ic(e,t,t.type,t.pendingProps,n);case 15:return Lc(e,t,t.type,t.pendingProps,n);case 19:return sl(e,t,n);case 31:return Uc(e,t,n);case 22:return Rc(e,t,n,t.pendingProps);case 24:return Sa(t),r=Ca(ka),e===null?(a=Wa(),a===null&&(a=td,o=Aa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},po(t),ga(t,ka,a)):((e.lanes&n)!==0&&(mo(e,t),xo(t,null,null,n),bo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ga(t,ka,r),r!==a.cache&&ya(t,[ka],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ga(t,ka,r))),Pc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:H&&Qi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Wc(e,t),Pc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function pl(e){e.flags|=4}function ml(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Qm(t,r):Qm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Kd())e.flags|=8192;else throw eo=Xa,Ja}}else e.flags&=-16777217}function hl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!$m(t)){if(Kd())e.flags|=8192;else throw eo=Xa,Ja}}function gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:dt(),e.lanes|=t,pd|=t)}function _l(e,t){if(!H)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function vl(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&1206910976,r|=i.flags&1206910976,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 yl(e,t,n){var r=t.pendingProps;switch($i(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vl(t),null;case 1:return vl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),_a(ka),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(la(t)?pl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,da())),vl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(pl(t),o===null?(vl(t),ml(t,a,null,r,n)):(vl(t),hl(t,o))):o?o===e.memoizedState?(vl(t),t.flags&=-16777217):(pl(t),vl(t),hl(t,o)):(e=e.memoizedProps,e!==r&&pl(t),vl(t),ml(t,a,e,r,n)),null;case 27:if(ke(t),n=we.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}e=Se.current,la(t)?sa(t,e):(e=ym(a,r,n),t.stateNode=e,pl(t))}return vl(t),t.subtreeFlags&=-33554433,null;case 5:if(ke(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}if(o=Se.current,la(t))sa(t,o);else{var s=pp(we.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[Ct]=t,o[wt]=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(op(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&&pl(t)}}return vl(t),t.subtreeFlags&=-33554433,ml(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=we.current,la(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ta,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||rp(e.nodeValue,n)),e||oa(t,!0)}else e=pp(e).createTextNode(r),e[Ct]=t,t.stateNode=e}return vl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=la(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[Ct]=t}else ua(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),e=!1}else n=da(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Fo(t),t):(Fo(t),null);if(t.flags&128)throw Error(i(558))}return vl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=la(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[Ct]=t}else ua(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),a=!1}else a=da(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Fo(t),t):(Fo(t),null)}return Fo(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),gl(t,t.updateQueue),vl(t),null);case 4:return De(),e===null&&qf(t.stateNode.containerInfo),t.flags|=67108864,vl(t),null;case 10:return _a(t.type),vl(t),null;case 19:if(Ro(t),r=t.memoizedState,r===null)return vl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)_l(r,!1);else{if(cd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=zo(e),o!==null){for(t.flags|=128,_l(r,!1),e=o.updateQueue,t.updateQueue=e,gl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ni(n,e),n=n.sibling;return Lo(t,Io.current&1|2),H&&Xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ve()>yd&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}}else{if(!a){if(e=zo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,gl(t,e),_l(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!H)return vl(t),null}else 2*Ve()-r.renderingStartTime>yd&&n!==536870912&&(t.flags|=128,a=!0,_l(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ve(),e.sibling=null,o=Io.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||H?Lo(t,o):(n=o,xe(ko,t),xe(Io,n),Ao===null&&(Ao=t)),H&&Xi(t,r.treeForkCount),e}return vl(t),null;case 22:case 23:return Fo(t),Oo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(vl(t),t.subtreeFlags&6&&(t.flags|=8192)):vl(t),n=t.updateQueue,n!==null&&gl(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&&be(Ua),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),_a(ka),vl(t),null;case 25:return null;case 30:return t.flags|=33554432,vl(t),null}throw Error(i(156,t.tag))}function bl(e,t){switch($i(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _a(ka),De(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(Fo(t),t.alternate===null)throw Error(i(340));ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Fo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ro(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return De(),null;case 10:return _a(t.type),null;case 22:case 23:return Fo(t),Oo(),e!==null&&be(Ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _a(ka),null;case 25:return null;default:return null}}function xl(e,t){switch($i(t),t.tag){case 3:_a(ka),De();break;case 26:case 27:case 5:ke(t);break;case 4:De();break;case 31:t.memoizedState!==null&&Fo(t);break;case 13:Fo(t);break;case 19:Ro(t);break;case 10:_a(t.type);break;case 22:case 23:Fo(t),Oo(),e!==null&&be(Ua);break;case 24:_a(ka)}}function Sl(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){_f(t,t.return,e)}}function Cl(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){_f(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){_f(t,t.return,e)}}function wl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Co(t,n)}catch(t){_f(e,e.return,t)}}}function Tl(e,t,n){n.props=Sc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){_f(e,t,n)}}function El(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:var i=e.stateNode,a=hi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Rp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new zp(e);m(e.child,!1,nm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){_f(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){_f(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){_f(e,t,n)}else n.current=null}}function Ol(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)im(e.stateNode,t[n])}function kl(e){for(var t=e.return;t!==null&&(Ml(t)&&im(e.stateNode,t.stateNode),!jl(t));)t=t.return}function Al(e){for(var t=e.return;t!==null&&(Ml(t)&&am(e.stateNode,t.stateNode),!jl(t));)t=t.return}function jl(e){return e.tag===5||e.tag===3||e.tag===27}function Ml(e){return e&&e.tag===7&&e.stateNode!==null}function Nl(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){_f(e,e.return,t)}}function Pl(e,t,n){try{var r=e.stateNode;cp(r,e.type,n,t),r[wt]=t}catch(t){_f(e,e.return,t)}}function Fl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ep(e.type)||e.tag===4}function Il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Fl(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&&Ep(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 Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yn)),Ol(e,r),R=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Ep(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ol(e,r),R=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Ep(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);op(t,r,n),t[Ct]=e,t[wt]=n}catch(t){_f(e,e.return,t)}}var Bl=!1,Vl=null;function Hl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Bl=!0)}var Ul=null;function Wl(){var e=Ul;return Ul=null,e}var Gl=0;function Kl(e,t,n,r,i){return Gl=0,ql(e.child,t,n,r,i)}function ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Mp(o);r.push(s),s.view&&(a=!0)}else a||Mp(o).view&&(a=!0);Bl=!0,kp(o,Gl===0?t:t+`_`+Gl,n),Gl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||ql(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Jl(e,t){for(;e!==null;)e.tag===5?Ap(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Jl(e.child,t)),e=e.sibling}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Yl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=_i(t.default,t.share),t!==`none`&&(Kl(e,n,t,null,!1)||Jl(e.child,!1))}e=e.sibling}}function Xl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=hi(r,n),a=_i(r.default,n.paired?r.share:r.enter);a===`none`?Yl(e):Kl(e,i,a,null,!1)?(Yl(e),n.paired||t||Id(e,r.onEnter)):Jl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e,t),e=e.sibling;else Yl(e)}function Zl(e){if(Vl!==null&&Vl.size!==0){var t=Vl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=_i(n.default,n.share);if(a!==`none`&&(Kl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Id(e,n.onShare)):Jl(e.child,!1)),t.delete(r),t.size===0)break}}}Zl(e)}e=e.sibling}}}function Ql(e){if(e.tag===30){var t=e.memoizedProps,n=hi(t,e.stateNode),r=Vl===null?void 0:Vl.get(n),i=_i(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Kl(e,n,i,null,!1)?r===void 0?Id(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Vl.delete(n),Id(e,t.onShare)):Jl(e.child,!1)),Vl!==null&&Zl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Vl!==null&&Zl(e)}function $l(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=hi(t,e.stateNode);t=_i(t.default,t.update),e.flags&=-5,t!==`none`&&Kl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&$l(e);e=e.sibling}}function eu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Jl(e.child,!1))}eu(e)}e=e.sibling}}function tu(e){if(e.tag===30)e.stateNode.paired=null,Jl(e.child,!1),eu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e),e=e.sibling;else eu(e)}function nu(e){for(e=e.child;e!==null;)e.tag===30?Jl(e.child,!1):e.subtreeFlags&33554432&&nu(e),e=e.sibling}function ru(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Gl<a.length){var l=a[Gl],u=Mp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&kp(c,Gl===0?n:n+`_`+Gl,i),s&&e.flags&4||(Ul===null&&(Ul=[]),Ul.push(c,Gl===0?r:r+`_`+Gl,t.memoizedProps)),Gl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:ru(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function iu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=hi(n,r),a=_i(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Np)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Gl=0,i=ru(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Id(e,n.onUpdate))}else e.subtreeFlags&33554432&&iu(e,t);e=e.sibling}}var au=!1,W=!1,ou=!1,su=!1,cu=typeof WeakSet==`function`?WeakSet:Set,lu=null,uu=!1,du=!1,fu=!1,pu=!1;function mu(e,t,n){if(e=e.containerInfo,dp=bh,e=Kr(e),V(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(fp={focusedElem:e,selectionRange:r},bh=!1,n=(n&335544064)===n,lu=t,t=n?9270:1024;lu!==null;){if(e=lu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Hl(e),hu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ql(r),hu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Hl(e),hu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,lu=r):(n&&$l(e),hu(n))}}Vl=null}function hu(e){for(;lu!==null;){var t=lu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Sc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){_f(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)om(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:om(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=hi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=_i(a.default,a.update),a!==`none`&&Kl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,lu=r;break}lu=t.return}}function gu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Iu(e,n),r&4&&Sl(5,n);break;case 1:if(Iu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){_f(n,n.return,e)}else{var i=Sc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){_f(n,n.return,e)}}}r&64&&wl(n),r&512&&El(n,n.return);break;case 3:if(Iu(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{Co(e,t)}catch(e){_f(n,n.return,e)}}break;case 27:t===null&&r&4&&zl(n);case 26:case 5:Iu(e,n),t===null&&r&4&&Nl(n),r&512&&El(n,n.return);break;case 12:Iu(e,n);break;case 31:Iu(e,n),r&4&&Tu(e,n);break;case 13:Iu(e,n),r&4&&Eu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=xf.bind(null,n),fm(e,n))));break;case 22:if(r=n.memoizedState!==null||au,!r){var a=t!==null&&t.memoizedState!==null||W;t=au,i=W,au=r,(W=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Ru(e,n,r)):Iu(e,n),au=t,W=i}break;case 30:Iu(e,n),r&512&&El(n,n.return);break;case 7:r&512&&El(n,n.return);default:Iu(e,n)}}function _u(e,t){for(e=e.child;e!==null;)vu(e,t),e=e.sibling}function vu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){_f(e,e.return,t)}yu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,R=!0}catch(t){_f(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Op(s,!0):Op(e.stateNode,!1)}catch(t){_f(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&_u(e,t);break;default:_u(e,t)}}function yu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:vu(n,r);break a;case 22:n.memoizedState===null&&yu(n,r);break a;default:yu(n,r)}}e=e.sibling}}function bu(e){var t=e.alternate;t!==null&&(e.alternate=null,bu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var xu=null,Su=!1;function Cu(e,t,n){for(n=n.child;n!==null;)wu(e,t,n),n=n.sibling}function wu(e,t,n){if(Ze&&typeof Ze.onCommitFiberUnmount==`function`)try{Ze.onCommitFiberUnmount(Xe,n)}catch{}switch(n.tag){case 26:W||Dl(n,t),Cu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!W&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:W||Dl(n,t),Al(n);var r=xu,i=Su;Ep(n.type)&&(xu=n.stateNode,Su=!1),Cu(e,t,n),bm(n.stateNode,n.type,n.memoizedProps),xu=r,Su=i;break;case 5:W||Dl(n,t),Al(n);case 6:if(n.tag===6&&Al(n),r=xu,i=Su,xu=null,Cu(e,t,n),xu=r,Su=i,xu!==null){if(Su)try{(xu.nodeType===9?xu.body:xu.nodeName===`HTML`?xu.ownerDocument.body:xu).removeChild(n.stateNode),R=!0}catch(e){_f(n,t,e)}else try{xu.removeChild(n.stateNode),R=!0}catch(e){_f(n,t,e)}}break;case 18:xu!==null&&(Su?(e=xu,Dp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Kh(e)):Dp(xu,n.stateNode));break;case 4:r=xu,i=Su,xu=n.stateNode.containerInfo,Su=!0,Cu(e,t,n),xu=r,Su=i;break;case 0:case 11:case 14:case 15:Cl(2,n,t),W||Cl(4,n,t),Cu(e,t,n);break;case 1:W||(Dl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Tl(n,t,r)),Cu(e,t,n);break;case 21:Cu(e,t,n);break;case 22:W=(r=W)||n.memoizedState!==null,Cu(e,t,n),W=r;break;case 30:Dl(n,t),Cu(e,t,n);break;case 7:W||Dl(n,t),Cu(e,t,n);break;default:Cu(e,t,n)}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Kh(e)}catch(e){_f(t,t.return,e)}}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Kh(e)}catch(e){_f(t,t.return,e)}}function Du(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cu),t;default:throw Error(i(435,e.tag))}}function Ou(e,t){var n=Du(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Sf.bind(null,e,t);t.then(r,r)}})}function ku(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Ep(l.type)){xu=l.stateNode,Su=!1;break a}break;case 5:xu=l.stateNode,Su=!1;break a;case 3:case 4:xu=l.stateNode.containerInfo,Su=!0;break a}l=l.return}if(xu===null)throw Error(i(160));wu(s,c,o),xu=null,Su=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ju(t,e,n),t=t.sibling}var Au=null;function ju(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}ku(t,e,n),Mu(e),a&4&&(Cl(3,e,e.return),Sl(3,e),Cl(5,e,e.return));break;case 1:ku(t,e,n),Mu(e),a&512&&(W||r===null||Dl(r,r.return)),a&64&&au&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Au,ku(t,e,n),Mu(e),a&512&&(W||r===null||Dl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(au)e.stateNode=gp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[At]||r[Ct]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),op(r,t,n),r[Ct]=e,Lt(r),t=r;break a;case`link`:if(o=Ym(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),op(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Ym(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),op(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Ct]=e,Lt(r),t=r}e.stateNode=t}}else au||Xm(o,e.type,e.stateNode)}else e.stateNode=Wm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||W||t.parentNode.removeChild(t)):a.count--,n===null?au||Xm(o,e.type,e.stateNode):Wm(o,n,e.memoizedProps))}break;case 27:ku(t,e,n),Mu(e),a&512&&(W||r===null||Dl(r,r.return)),r!==null&&a&4&&Pl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=ou,ou=!1,ku(t,e,n),ou=o,Mu(e),a&512&&(W||r===null||Dl(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),R=!0}catch(t){_f(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Pl(e,t,r===null?t:r.memoizedProps)),a&1024&&(su=!0);break;case 6:if(ku(t,e,n),Mu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,R=!0}catch(t){_f(e,e.return,t)}}break;case 3:if(R=!1,Jm=null,o=Au,Au=wm(t.containerInfo),ku(t,e,n),Au=o,Mu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Kh(t.containerInfo)}catch(t){_f(e,e.return,t)}su&&(su=!1,Nu(e)),R=!1;break;case 4:a=ou,ou=au,r=qt(),o=Au,Au=wm(e.stateNode.containerInfo),ku(t,e,n),Mu(e),Au=o,R&&du&&(fu=!0),R=r,ou=a;break;case 12:ku(t,e,n),Mu(e);break;case 31:ku(t,e,n),Mu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 13:ku(t,e,n),Mu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(_d=Ve()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=au,l=W,u=ou;au=c||o,ou=u||o,W=l||s,ku(t,e,n),W=l,ou=u,au=c,Mu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||au||W||(t=s||W,n=au,r=W,au=o||au,W=t,Lu(e,2),au=n,W=r),!o&&ou||_u(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Ou(e,n))));break;case 19:ku(t,e,n),Mu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 30:a&512&&(W||r===null||Dl(r,r.return)),a=qt(),o=du,s=(n&335544064)===n,c=e.memoizedProps,du=s&&_i(c.default,c.update)!==`none`,ku(t,e,n),Mu(e),s&&r!==null&&R&&(e.flags|=4),du=o,R=a;break;case 21:break;case 7:a&512&&(W||r===null||Dl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ku(t,e,n),Mu(e)}}function Mu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Fl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ml(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(jl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Rl(e,Il(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),Rl(e,Il(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ll(e,Il(e),u,s);break;default:throw Error(i(161))}}catch(t){_f(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Nu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Nu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,bh=!0,t.reset(),bh=!1),e=e.sibling}}function Pu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Fu(t,e),t=t.sibling;else iu(t,!1)}function Fu(e,t){var n=e.alternate;if(n===null)Xl(e,!1);else switch(e.tag){case 3:if(pu=uu=!1,Wl(),Pu(t,e),!uu&&!fu){if(e=Ul,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ap(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),pu=!0}Ul=null;break;case 5:Pu(t,e);break;case 4:r=uu,uu=!1,Pu(t,e),uu&&(fu=!0),uu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Pu(t,e):Xl(e,!1));break;case 30:r=uu,i=Wl(),uu=!1,Pu(t,e),uu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=hi(a,o),o=hi(n.memoizedProps,o);var s=_i(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Gl=0,t=ru(e,n,t,o,s,a,!0),Gl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Id(e,e.memoizedProps.onUpdate),Ul=i):i!==null&&(i.push.apply(i,Ul),Ul=i),uu=e.flags&32?!0:r;break;default:Pu(t,e)}}function Iu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gu(e,t.alternate,t),t=t.sibling}function Lu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Cl(4,n,n.return),Lu(n,r);break;case 1:Dl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Tl(n,n.return,i),Lu(n,r);break;case 27:r&2&&bm(n.stateNode,n.type,n.memoizedProps);case 5:Dl(n,n.return),n.tag!==5&&n.tag!==27||Al(n),Lu(n,r);break;case 6:Al(n);break;case 26:Dl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||W||i.parentNode.removeChild(i),Lu(n,r);break;case 22:n.memoizedState===null&&Lu(n,r);break;case 30:Dl(n,n.return),Lu(n,r);break;case 7:Dl(n,n.return);default:Lu(n,r)}e=e.sibling}}function Ru(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Ru(i,a,n),Sl(4,a);break;case 1:if(Ru(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){_f(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)So(l[i],c)}catch(e){_f(r,r.return,e)}}s&&o&64&&wl(a),El(a,a.return);break;case 27:n&2&&zl(a);case 5:a.tag!==5&&a.tag!==27||kl(a),Ru(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 6:kl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||au||Xm(wm(c.ownerDocument),a.type,c),Ru(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 12:Ru(i,a,n);break;case 31:Ru(i,a,n),s&&o&4&&Tu(i,a);break;case 13:Ru(i,a,n),s&&o&4&&Eu(i,a);break;case 22:a.memoizedState===null&&Ru(i,a,n),El(a,a.return);break;case 30:Ru(i,a,n),El(a,a.return);break;case 7:El(a,a.return);default:Ru(i,a,n)}t=t.sibling}}function zu(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&&ja(n))}function Bu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ja(e))}function Vu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Hu(e,t,n,r),t=t.sibling;else i&&nu(t)}function Hu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&tu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Vu(e,t,n,r),a&2048&&Sl(9,t);break;case 1:Vu(e,t,n,r);break;case 3:Vu(e,t,n,r),i&&pu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&ja(a)));break;case 12:if(a&2048){Vu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){_f(t,t.return,e)}}else Vu(e,t,n,r);break;case 31:Vu(e,t,n,r);break;case 13:Vu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&tu(t),o._visibility&2?Vu(e,t,n,r):(o._visibility|=2,Uu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&tu(s),o._visibility&2?Vu(e,t,n,r):Wu(e,t)),a&2048&&zu(s,t);break;case 24:Vu(e,t,n,r),a&2048&&Bu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Jl(a.child,!0),Jl(t.child,!0))),Vu(e,t,n,r);break;default:Vu(e,t,n,r)}}function Uu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!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:Uu(a,o,s,c,i),Sl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Uu(a,o,s,c,i)):u._visibility&2?Uu(a,o,s,c,i):Wu(a,o),i&&l&2048&&zu(o.alternate,o);break;case 24:Uu(a,o,s,c,i),i&&l&2048&&Bu(o.alternate,o);break;default:Uu(a,o,s,c,i)}t=t.sibling}}function Wu(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:Wu(n,r),i&2048&&zu(r.alternate,r);break;case 24:Wu(n,r),i&2048&&Bu(r.alternate,r);break;default:Wu(n,r)}t=t.sibling}}var Gu=8192;function Ku(e,t,n){if(e.subtreeFlags&Gu)for(e=e.child;e!==null;)qu(e,t,n),e=e.sibling}function qu(e,t,n){switch(e.tag){case 26:Ku(e,t,n),e.flags&Gu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&th(n,e)):nh(n,Au,e.memoizedState,e.memoizedProps));break;case 5:Ku(e,t,n),e.flags&Gu&&(e=e.stateNode,(t&335544128)===t&&th(n,e));break;case 3:case 4:var r=Au;Au=wm(e.stateNode.containerInfo),Ku(e,t,n),Au=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Gu,Gu=16777216,Ku(e,t,n),Gu=r):Ku(e,t,n));break;case 30:if((e.flags&Gu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Vl===null&&(Vl=new Map),Vl.set(r,i)}Ku(e,t,n);break;default:Ku(e,t,n)}}function Ju(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 Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Qu(r,e)}Ju(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xu(e),e=e.sibling}function Xu(e){switch(e.tag){case 0:case 11:case 15:Yu(e),e.flags&2048&&Cl(9,e,e.return);break;case 3:Yu(e);break;case 12:Yu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zu(e)):Yu(e);break;default:Yu(e)}}function Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Qu(r,e)}Ju(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Cl(8,t,t.return),Zu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Zu(t));break;default:Zu(t)}e=e.sibling}}function Qu(e,t){for(;lu!==null;){var n=lu;switch(n.tag){case 0:case 11:case 15:Cl(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:ja(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,lu=r;else a:for(n=e;lu!==null;){r=lu;var i=r.sibling,a=r.return;if(bu(r),r===n){lu=null;break a}if(i!==null){i.return=a,lu=i;break a}lu=a}}}var $u={getCacheForType:function(e){var t=Ca(ka),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ca(ka).controller.signal}},ed=typeof WeakMap==`function`?WeakMap:Map,G=0,td=null,K=null,q=0,nd=0,rd=null,id=!1,ad=!1,od=!1,sd=0,cd=0,ld=0,ud=0,dd=0,fd=0,pd=0,md=null,hd=null,gd=!1,_d=0,vd=0,yd=1/0,bd=null,xd=null,Sd=0,Cd=null,wd=null,Td=0,Ed=0,Dd=null,Od=null,kd=null,Ad=null,jd=null,Md=0,Nd=null;function Pd(){return G&2&&q!==0?q&-q:P.T===null?bt():Rf()}function Fd(){if(fd===0){if(!(q&536870912)||H){var e=it;it<<=1,!(it&3932160)&&(it=262144),fd=e}else fd=536870912}return e=ko.current,e!==null&&(e.flags|=32),fd}function Id(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Rp(hi(e.memoizedProps,n))),Ad===null&&(Ad=[]),Ad.push(t.bind(null,r))}}function Ld(e,t,n){(e===td&&(nd===2||nd===9)||e.cancelPendingCommit!==null)&&(Wd(e,0),Vd(e,q,fd,!1)),pt(e,n),(!(G&2)||e!==td)&&(e===td&&(!(G&2)&&(ud|=n),cd===4&&Vd(e,q,fd,!1)),Af(e))}function Rd(e,t,n){if(G&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ct(e,t),a=r?Qd(e,t):Xd(e,t,!0),o=r;do{if(a===0){ad&&!r&&Vd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Bd(n)){a=Xd(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=md;var l=c.current.memoizedState.isDehydrated;if(l&&(Wd(c,s).flags|=256),s=Xd(c,s,!1),s!==2&&s!==6){if(od&&!l){c.errorRecoveryDisabledLanes|=o,ud|=o,a=4;break a}o=hd,hd=a,o!==null&&(hd===null?hd=o:hd.push.apply(hd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Wd(e,0),Vd(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&&(t&62914560)!==t)break;case 6:Vd(r,t,fd,!id);break a;case 2:hd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=_d+300-Ve(),10<a)){if(Vd(r,t,fd,!id),st(r,0,!0)!==0)break a;Td=t,r.timeoutHandle=bp(zd.bind(null,r,n,hd,bd,gd,t,fd,ud,pd,id,o,`Throttled`,-0,0),a);break a}zd(r,n,hd,bd,gd,t,fd,ud,pd,id,o,null,-0,0)}break}while(1);Af(e)}function zd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},Vl=null,qu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=oh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?_d-Ve():(a&4194048)===a?vd-Ve():0,m=ih(d,m),m!==null)){Td=a,e.cancelPendingCommit=m(of.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Vd(e,a,o,!l);return}of(e,t,a,n,r,i,o,s,c,l,u,d)}function Bd(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(!Br(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 Vd(e,t,n,r){t=lt(e,t),t&=~dd,t&=~ud,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-$e(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ht(e,n,t)}function Hd(){return G&6?!0:(jf(0,!1),!1)}function Ud(){if(K!==null){if(nd===0)var e=K.return;else e=K,ha=ma=null,is(e),ro=null,io=0,e=K;for(;e!==null;)xl(e.alternate,e),e=e.return;K=null}}function Wd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,xp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Td=0,Ud(),td=e,K=n=Mi(e.current,null),q=t,nd=0,rd=null,id=!1,ad=ct(e,t),od=!1,pd=fd=dd=ud=ld=cd=0,hd=md=null,gd=!1,sd=lt(e,t),Si(),n}function Gd(e,t){U=null,P.H=mc,t===qa||t===Ya?(t=to(),nd=3):t===Ja?(t=to(),nd=4):nd=t===Mc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,rd=t,K===null&&(cd=1,Ec(e,Bi(t,e.current)))}function Kd(){var e=ko.current;return e===null?!0:(q&4194048)===q?Ao===null:(q&62914560)===q||q&536870912?e===Ao:!1}function qd(){var e=P.H;return P.H=mc,e===null?mc:e}function Jd(){var e=P.A;return P.A=$u,e}function Yd(){cd=4,id||(q&4194048)!==q&&ko.current!==null||(ad=!0),!(ld&134217727)&&!(ud&134217727)||td===null||Vd(td,q,fd,!1)}function Xd(e,t,n){var r=G;G|=2;var i=qd(),a=Jd();(td!==e||q!==t)&&(bd=null,Wd(e,t)),t=!1;var o=cd;a:do try{if(nd!==0&&K!==null){var s=K,c=rd;switch(nd){case 8:Ud(),o=6;break a;case 3:case 2:case 9:case 6:ko.current===null&&(t=!0);var l=nd;if(nd=0,rd=null,nf(e,s,c,l),n&&ad){o=0;break a}break;default:l=nd,nd=0,rd=null,nf(e,s,c,l)}}Zd(),o=cd;break}catch(t){Gd(e,t)}while(1);return t&&e.shellSuspendCounter++,ha=ma=null,G=r,P.H=i,P.A=a,K===null&&(td=null,q=0,Si()),o}function Zd(){for(;K!==null;)ef(K)}function Qd(e,t){var n=G;G|=2;var r=qd(),a=Jd();td!==e||q!==t?(bd=null,yd=Ve()+500,Wd(e,t)):ad=ct(e,t);a:do try{if(nd!==0&&K!==null){t=K;var o=rd;b:switch(nd){case 1:nd=0,rd=null,nf(e,t,o,1);break;case 2:case 9:if(Za(o)){nd=0,rd=null,tf(t);break}t=function(){nd!==2&&nd!==9||td!==e||(nd=7),Af(e)},o.then(t,t);break a;case 3:nd=7;break a;case 4:nd=5;break a;case 7:Za(o)?(nd=0,rd=null,tf(t)):(nd=0,rd=null,nf(e,t,o,7));break;case 5:var s=null;switch(K.tag){case 26:s=K.memoizedState;case 5:case 27:var c=K;if(s?$m(s):c.stateNode.complete){nd=0,rd=null;var l=c.sibling;if(l!==null)K=l;else{var u=c.return;u===null?K=null:(K=u,rf(u))}break b}}nd=0,rd=null,nf(e,t,o,5);break;case 6:nd=0,rd=null,nf(e,t,o,6);break;case 8:Ud(),cd=6;break a;default:throw Error(i(462))}}$d();break}catch(t){Gd(e,t)}while(1);return ha=ma=null,P.H=r,P.A=a,G=n,K===null?(td=null,q=0,Si(),cd):0}function $d(){for(;K!==null&&!ze();)ef(K)}function ef(e){var t=fl(e.alternate,e,sd);e.memoizedProps=e.pendingProps,t===null?rf(e):K=t}function tf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Kc(n,t,t.pendingProps,t.type,void 0,q);break;case 11:t=Kc(n,t,t.pendingProps,t.type.render,t.ref,q);break;case 5:is(t);var r=t;r===ta&&(H?(ca(r),r.tag===5&&r.stateNode!=null&&(na=r.stateNode)):(ca(r),H=!0));default:xl(n,t),t=K=Ni(t,sd),t=fl(n,t,sd)}e.memoizedProps=e.pendingProps,t===null?rf(e):K=t}function nf(e,t,n,r){ha=ma=null,is(t),ro=null,io=0;var i=t.return;try{if(jc(e,i,t,n,q)){cd=1,Ec(e,Bi(n,e.current)),K=null;return}}catch(t){if(i!==null)throw K=i,t;cd=1,Ec(e,Bi(n,e.current)),K=null;return}t.flags&32768?(H||r===1?e=!0:ad||q&536870912?e=!1:(id=e=!0,(r===2||r===9||r===3||r===6)&&(r=ko.current,r!==null&&r.tag===13&&(r.flags|=16384))),af(t,e)):rf(t)}function rf(e){var t=e;do{if(t.flags&32768){af(t,id);return}e=t.return;var n=yl(t.alternate,t,sd);if(n!==null){K=n;return}if(t=t.sibling,t!==null){K=t;return}K=t=e}while(t!==null);cd===0&&(cd=5)}function af(e,t){do{var n=bl(e.alternate,e);if(n!==null){n.flags&=32767,K=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){K=e;return}K=e=n}while(e!==null);cd=6,K=null}function of(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do mf();while(Sd!==0);if(G&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===td&&(K=td=null,q=0),wd=t,Cd=e,Td=n,Dd=a,Od=r,sf(e,t,n,s,c,l,f)}}function sf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Ed=s,s|=xi,mt(e,n,s,r,i,a),Ad=null,(n&335544064)===n?(jd=Pa(e),r=10262):(jd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Cf(Ge,function(){return hf(),null})):(e.callbackNode=null,e.callbackPriority=0),Bl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=P.T,P.T=null,i=F.p,F.p=2,a=G,G|=4;try{mu(e,t,n)}finally{G=a,F.p=i,P.T=r}}Sd=1,Bl?kd=Ip(o,e.containerInfo,jd,uf,df,lf,ff,hf,cf,null,null):(uf(),df(),ff())}function cf(e){if(Sd!==0){var t=Cd.onRecoverableError;t(e,{componentStack:null})}}function lf(){Sd===3&&(Sd=0,Fu(wd,Cd),Sd=4)}function uf(){if(Sd===1){Sd=0;var e=Cd,t=wd,n=Td,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=P.T,P.T=null;var i=F.p;F.p=2;var a=G;G|=4;try{du=fu=!1,ju(t,e,n),n=fp;var o=Kr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Gr(s.ownerDocument.documentElement,s)){if(c!==null&&V(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 _=Wr(s,h),v=Wr(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}}bh=!!dp,fp=dp=null}finally{G=a,F.p=i,P.T=r}}e.current=t,Sd=2}}function df(){if(Sd===2){Sd=0;var e=Cd,t=wd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=G;G|=4;try{gu(e,t.alternate,t)}finally{G=i,F.p=r,P.T=n}}Sd=3}}function ff(){if(Sd===4||Sd===3){Sd=0;var e=kd;kd=null,Be();var t=Cd,n=wd,r=Td,i=Od,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Sd=5:(Sd=0,wd=Cd=null,pf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(xd=null),yt(r),n=n.stateNode,Ze&&typeof Ze.onCommitFiberRoot==`function`)try{Ze.onCommitFiberRoot(Xe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=P.T,a=F.p,F.p=2,P.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{P.T=n,F.p=a}}if(i=Ad,o=jd,jd=null,i!==null&&(Ad=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Td&3&&mf(),Af(t),a=t.pendingLanes,r&261930&&a&42?t===Nd?Md++:(Md=0,Nd=t):(Md=0,Nd=null),jf(0,!1)}}function pf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ja(t)))}function mf(){return kd!==null&&(kd.skipTransition(),kd=null),uf(),df(),ff(),hf()}function hf(){if(Sd!==5)return!1;var e=Cd,t=Ed;Ed=0;var n=yt(Td),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=Dd,Dd=null;var o=Cd,s=Td;if(Sd=0,wd=Cd=null,Td=0,G&6)throw Error(i(331));var c=G;if(G|=4,Xu(o.current),Hu(o,o.current,s,n),G=c,jf(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot==`function`)try{Ze.onPostCommitFiberRoot(Xe,o)}catch{}return!0}finally{F.p=a,P.T=r,pf(e,t)}}function gf(e,t,n){t=Bi(n,t),t=Oc(e.stateNode,t,2),e=go(e,t,2),e!==null&&(pt(e,2),Af(e))}function _f(e,t,n){if(e.tag===3)gf(e,e,n);else for(;t!==null;){if(t.tag===3){gf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(xd===null||!xd.has(r))){e=Bi(n,e),n=kc(2),r=go(t,n,2),r!==null&&(Ac(n,r,t,e),pt(r,2),Af(r));break}}t=t.return}}function vf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ed;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)||(od=!0,i.add(n),e=yf.bind(null,e,t,n),t.then(e,e))}function yf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,td===e&&(q&n)===n&&(cd===4||cd===3&&(q&62914560)===q&&300>Ve()-_d?G&2?dd|=n:Wd(e,0):dd|=n,pd===q&&(pd=0)),Af(e)}function bf(e,t){t===0&&(t=dt()),e=Ti(e,t),e!==null&&(pt(e,t),Af(e))}function xf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bf(e,n)}function Sf(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),bf(e,n)}function Cf(e,t){return Le(e,t)}var wf=null,Tf=null,Ef=!1,Df=!1,Of=!1,kf=0;function Af(e){e!==Tf&&e.next===null&&(Tf===null?wf=Tf=e:Tf=Tf.next=e),Df=!0,Ef||(Ef=!0,Lf())}function jf(e,t){if(!Of&&Df){Of=!0;do for(var n=!1,r=wf;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-$e(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,If(r,a))}else a=q,a=st(r,r===td?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ct(r,a)||(n=!0,If(r,a))}r=r.next}while(n);Of=!1}}function Mf(){Nf()}function Nf(){Df=Ef=!1;var e=0;kf!==0&&yp()&&(e=kf);for(var t=Ve(),n=null,r=wf;r!==null;){var i=r.next,a=Pf(r,t);a===0?(r.next=null,n===null?wf=i:n.next=i,i===null&&(Tf=n)):(n=r,(e!==0||a&3)&&(Df=!0)),r=i}Sd!==0&&Sd!==5||jf(e,!1),kf!==0&&(kf=0)}function Pf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-$e(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ut(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=td,n=q,n=st(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(nd===2||nd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Re(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ct(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Re(r),yt(n)){case 2:case 8:n=We;break;case 32:n=Ge;break;case 268435456:n=qe;break;default:n=Ge}return r=Ff.bind(null,e),n=Le(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Re(r),e.callbackPriority=2,e.callbackNode=null,2}function Ff(e,t){if(Sd!==0&&Sd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(mf()&&e.callbackNode!==n)return null;var r=q;return r=st(e,e===td?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Rd(e,r,t),Pf(e,Ve()),e.callbackNode!=null&&e.callbackNode===n?Ff.bind(null,e):null)}function If(e,t){if(mf())return null;Rd(e,t,!0)}function Lf(){wp(function(){G&6?Le(Ue,Mf):Nf()})}function Rf(){if(kf===0){var e=La;e===0&&(e=rt,rt<<=1,!(rt&261888)&&(rt=256)),kf=e}return kf}function zf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:vn(e)}function Bf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=zf((i[wt]||null).action),o=r.submitter;o&&(t=(t=o[wt]||null)?zf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(kf!==0){var e=new FormData(i,o);ec(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ec(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Vf=0;Vf<fi.length;Vf++){var Hf=fi[Vf];pi(Hf.toLowerCase(),`on`+(Hf[0].toUpperCase()+Hf.slice(1)))}pi(ii,`onAnimationEnd`),pi(ai,`onAnimationIteration`),pi(oi,`onAnimationStart`),pi(`dblclick`,`onDoubleClick`),pi(`focusin`,`onFocus`),pi(`focusout`,`onBlur`),pi(si,`onTransitionRun`),pi(ci,`onTransitionStart`),pi(li,`onTransitionCancel`),pi(ui,`onTransitionEnd`),Ht(`onMouseEnter`,[`mouseout`,`mouseover`]),Ht(`onMouseLeave`,[`mouseout`,`mouseover`]),Ht(`onPointerEnter`,[`pointerout`,`pointerover`]),Ht(`onPointerLeave`,[`pointerout`,`pointerover`]),Vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Uf=`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(` `),Wf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Uf));function Gf(e,t){t=!!(t&4);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){vi(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){vi(e)}i.currentTarget=null,a=c}}}}function J(e,t){var n=t[Et];n===void 0&&(n=t[Et]=new Set);var r=e+`__bubble`;n.has(r)||(Jf(t,e,2,!1),n.add(r))}function Kf(e,t,n){var r=0;t&&(r|=4),Jf(n,e,r,t)}var Y=`_reactListening`+Math.random().toString(36).slice(2);function qf(e){if(!e[Y]){e[Y]=!0,zt.forEach(function(t){t!==`selectionchange`&&(Wf.has(t)||Kf(t,!1,e),Kf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Y]||(t[Y]=!0,Kf(`selectionchange`,!1,t))}}function Jf(e,t,n,r){switch(Dh(t)){case 2:var i=xh;break;case 8:i=Sh;break;default:i=Ch}n=i.bind(null,t,n,e),i=void 0,!kn||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 Yf(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=Nt(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=xn(n),s=[];a:{var c=di.get(e);if(c!==void 0){var l=Bn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:l=rr;break;case`focusin`:u=`focus`,l=Jn;break;case`focusout`:u=`blur`,l=Jn;break;case`beforeblur`:case`afterblur`:l=Jn;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=Kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=qn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=or;break;case ii:case ai:case oi:l=Yn;break;case ui:l=sr;break;case`scroll`:case`scrollend`:l=Hn;break;case`wheel`:l=cr;break;case`copy`:case`cut`:case`paste`:l=Xn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ir;break;case`submit`:l=ar;break;case`toggle`:case`beforetoggle`:l=lr}var d=!!(t&4),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=Dn(m,p),g!=null&&d.push(Xf(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(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==bn&&(u=n.relatedTarget||n.fromElement)&&(Nt(u)||u[Tt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Nt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ir,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ft(c),h=l==null?u:Ft(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Nt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Qf):null,c!==null&&$f(s,u,c,d,!1),l!==null&&f!==null&&$f(s,f,l,d,!0)))}a:{if(c=r?Ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Or;else if(Sr(c)){if(kr)_=Rr;else{_=Ir;var v=Fr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&hn(r.elementType)&&(_=Or):_=Lr;if(_&&=_(e,r)){Cr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ft(r):window,e){case`focusin`:(Sr(v)||v.contentEditable===`true`)&&(Jr=v,Yr=r,Xr=null);break;case`focusout`:Xr=Yr=Jr=null;break;case`mousedown`:Zr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Zr=!1,Qr(s,n,i);break;case`selectionchange`:if(qr)break;case`keydown`:case`keyup`:Qr(s,n,i)}var y;if(dr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else yr?_r(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(mr&&n.locale!==`ko`&&(yr||b!==`onCompositionStart`?b===`onCompositionEnd`&&yr&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,yr=!0)),v=Zf(r,b),0<v.length&&(b=new Zn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=vr(n),y!==null&&(b.data=y)))),(y=pr?B(e,n):br(e,n))&&(b=Zf(r,`onBeforeInput`),0<b.length&&(v=new Zn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Bf(s,e,r,n,i)}Gf(s,t)})}function Xf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zf(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=Dn(e,n),i!=null&&r.unshift(Xf(e,i,a)),i=Dn(e,t),i!=null&&r.push(Xf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Qf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $f(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=Dn(n,a),l!=null&&o.unshift(Xf(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push(Xf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ep=/\r\n?/g,tp=/\u0000|\uFFFD/g;function np(e){return(typeof e==`string`?e:``+e).replace(ep,`
9
- `).replace(tp,``)}function rp(e,t){return t=np(t),np(e)===t}function ip(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(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=vn(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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ip(e,t,`name`,a.name,a,null),ip(e,t,`formEncType`,a.formEncType,a,null),ip(e,t,`formMethod`,a.formMethod,a,null),ip(e,t,`formTarget`,a.formTarget,a,null)):(ip(e,t,`encType`,a.encType,a,null),ip(e,t,`method`,a.method,a,null),ip(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&J(`scroll`,e);return;case`onScrollEnd`:r!=null&&J(`scrollend`,e);return;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));o?.__html!==n&&(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=vn(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`credentialless`: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`:J(`beforetoggle`,e),J(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Jt(e,n,r);else return}R=!0}function ap(e,t,n,r,a,o){switch(n){case`style`:mn(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&J(`scroll`,e);return;case`onScrollEnd`:r!=null&&J(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[wt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}R=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}R=!0}function op(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:J(`error`,e),J(`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:ip(e,t,o,s,n,null)}}a&&ip(e,t,`srcSet`,n.srcSet,n,null),r&&ip(e,t,`src`,n.src,n,null);return;case`input`:J(`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:ip(e,t,r,d,n,null)}}on(e,o,c,l,u,s,a,!1);return;case`select`:for(a in J(`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:ip(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in J(`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:ip(e,t,s,c,n,null)}un(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:ip(e,t,l,r,n,null)}return;case`dialog`:J(`beforetoggle`,e),J(`toggle`,e),J(`cancel`,e),J(`close`,e);break;case`iframe`:case`object`:J(`load`,e);break;case`video`:case`audio`:for(r=0;r<Uf.length;r++)J(Uf[r],e);break;case`image`:J(`error`,e),J(`load`,e);break;case`details`:J(`toggle`,e);break;case`embed`:case`source`:case`link`:J(`error`,e),J(`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:ip(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&ap(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ip(e,t,c,r,n,null))}var sp={};function cp(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)||ip(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`:m!==f&&(R=!0),o=m;break;case`name`:m!==f&&(R=!0),a=m;break;case`checked`:m!==f&&(R=!0),u=m;break;case`defaultChecked`:m!==f&&(R=!0),d=m;break;case`value`:m!==f&&(R=!0),s=m;break;case`defaultValue`:m!==f&&(R=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ip(e,t,p,m,r,f)}}an(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)||ip(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`:o!==l&&(R=!0),p=o;break;case`defaultValue`:o!==l&&(R=!0),c=o;break;case`multiple`:o!==l&&(R=!0),s=o;default:o!==l&&ip(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(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:ip(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`:a!==o&&(R=!0),p=a;break;case`defaultValue`:a!==o&&(R=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ip(e,t,s,a,r,o)}ln(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:ip(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`:p!==m&&(R=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ip(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)&&ip(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:ip(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&ap(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||ap(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ip(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||ip(e,t,f,p,r,m)}function lp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function up(){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&&lp(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&&lp(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 dp=null,fp=null;function pp(e){return e.nodeType===9?e:e.ownerDocument}function mp(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 hp(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 gp(e,t,n,r){return n=pp(n).createElement(e),n[Ct]=r,n[wt]=t,op(n,e,t),Lt(n),n}function _p(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 vp=null;function yp(){var e=window.event;return e&&e.type===`popstate`?e!==vp&&(vp=e,!0):(vp=null,!1)}var bp=typeof setTimeout==`function`?setTimeout:void 0,xp=typeof clearTimeout==`function`?clearTimeout:void 0,Sp=typeof Promise==`function`?Promise:void 0,Cp=typeof requestAnimationFrame==`function`?requestAnimationFrame:bp,wp=typeof queueMicrotask==`function`?queueMicrotask:Sp===void 0?bp:function(e){return Sp.resolve(null).then(e).catch(Tp)};function Tp(e){setTimeout(function(){throw e})}function Ep(e){return e===`head`}function Dp(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),Kh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)xm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,xm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[At]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&xm(e.ownerDocument.body)}n=i}while(n);Kh(t)}function Op(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 kp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ap(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function jp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Mp(e){return jp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Np(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return jp(t,n,e)}function Pp(e){return e.documentElement.clientHeight}function Fp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Ip(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Pp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=eh(f),u>rh){s.length=o;break}f=new Promise(Fp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Lp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Lp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Lp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Lp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Rp(e){return{name:e,group:new Lp(`group`,e),imagePair:new Lp(`image-pair`,e),old:new Lp(`old`,e),new:new Lp(`new`,e)}}function zp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}zp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Wp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Hp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Bp,e,s,r)}this._eventListeners=a}};function Bp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}zp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Wp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Hp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Vp,e,n,i),r.splice(t,1),a!==null&&a()}};function Vp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Hp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Up(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Wp(e,t,n,r){if(e.length===0)return-1;r=Up(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Up(a.optionsOrUseCapture)===r)return i}return-1}zp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Hp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Hp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},zp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag!==6&&(e=b(e),_m(e,t))}zp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Kp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Gp(t[n],e);n--);};function Kp(e,t){return t.push(e),!1}zp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=pp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,qp,e,void 0,void 0))};function qp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}zp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}zp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0);for(var n=t=0;n<Xp.length;n++){var r=Xp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Xp[t++]=r}Xp.length=t}};function Yp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var Xp=[],Zp=!1;function Qp(e,t,n){Xp.push({fragmentInstance:e,observer:t,instance:n}),Zp||(Zp=!0,vm(function(){Zp=!1;var e=Xp;Xp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}zp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,$p,e,void 0,void 0),e};function $p(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}zp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},zp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Kp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||em(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function em(e,t,n,r,i){var a=Nt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function tm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}zp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Kp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),tm(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),tm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function nm(e,t){return e=b(e),rm(e,t),!1}function rm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function im(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Xp.length;i++){var a=Xp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Xp[r++]=a)}Xp.length=r,n.observe(e)}),rm(e,t))}function am(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Qp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function om(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`:om(n),Mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sm(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[At])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=pm(e.nextSibling),e===null)break}return null}function cm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pm(e.nextSibling),e===null))return null;return e}function lm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pm(e.nextSibling),e===null))return null;return e}function um(e){return e.data===`$?`||e.data===`$~`}function dm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function fm(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 pm(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 mm=null;function hm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gm(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 _m(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function vm(e){Cp(function(){Cp(function(t){return e(t)})})}function ym(e,t,n){switch(t=pp(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 bm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ip(e,t,r,null,sp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),Mt(e)}function xm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mt(e)}var Sm=new Map,Cm=new Set;function wm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Tm=F.d;F.d={f:Em,r:Dm,D:Am,C:jm,L:Mm,m:Nm,X:Fm,S:Pm,M:Im};function Em(){var e=Tm.f(),t=Hd();return e||t}function Dm(e){var t=Pt(e);t!==null&&t.tag===5&&t.type===`form`?nc(t):Tm.r(e)}var Om=typeof document>`u`?null:document;function km(e,t,n){var r=Om;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Cm.has(i)||(Cm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),op(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Am(e){Tm.D(e),km(`dns-prefetch`,e,null)}function jm(e,t){Tm.C(e,t),km(`preconnect`,e,t)}function Mm(e,t,n){Tm.L(e,t,n);var r=Om;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Rm(e);break;case`script`:a=Hm(e)}if(!(Sm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Sm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(zm(a))||t===`script`&&r.querySelector(Um(a))))){var o=r.createElement(`link`);op(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function Nm(e,t){Tm.m(e,t);var n=Om;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Hm(e)}if(!Sm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Sm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Um(a)))return}r=n.createElement(`link`),op(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function Pm(e,t,n){Tm.S(e,t,n);var r=Om;if(r&&e){var i=It(r).hoistableStyles,a=Rm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(zm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Sm.get(a))&&Km(e,n);var c=o=r.createElement(`link`);Lt(c),op(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,Gm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Fm(e,t){Tm.X(e,t);var n=Om;if(n&&e){var r=It(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),Lt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Im(e,t){Tm.M(e,t);var n=Om;if(n&&e){var r=It(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),Lt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lm(e,t,n,r){var a=(a=we.current)?wm(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`?(n=Rm(n.href),t=It(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Rm(n.href);var o=It(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(zm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Sm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Sm.set(e,o)),Vm(a,e,o,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`?(n=Hm(n),t=It(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Rm(e){return`href="`+rn(e)+`"`}function zm(e){return`link[rel="stylesheet"][`+e+`]`}function Bm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Vm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),op(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Hm(e){return`[src="`+rn(e)+`"]`}function Um(e){return`script[async]`+e}function Wm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),op(r,`style`,a),Gm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Rm(n.href);var o=e.querySelector(zm(a));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Bm(n),(a=Sm.get(a))&&Km(r,a),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),op(o,`link`,r),t.state.loading|=4,Gm(o,n.precedence,e),t.instance=o;case`script`:return o=Hm(n.src),(a=e.querySelector(Um(o)))?(t.instance=a,Lt(a),a):(r=n,(a=Sm.get(o))&&(r=D({},n),qm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Lt(a),op(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,Gm(r,n.precedence,e));return t.instance}function Gm(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 Km(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Jm=null;function Ym(e,t,n){if(Jm===null){var r=new Map,i=Jm=new Map;i.set(n,r)}else i=Jm,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[At]||a[Ct]||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 Xm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Zm(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 Qm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function $m(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function eh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function th(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=eh(t),e.suspenseyImages.push(t)),e=sh.bind(e),t.decode().then(e,e))}function nh(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=Rm(r.href),a=t.querySelector(zm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=oh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Bm(r),(i=Sm.get(i))&&Km(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),op(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=oh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var rh=0;function ih(e,t){return e.stylesheets&&e.count===0&&lh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&rh===0&&(rh=62500*up());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>rh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ah(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)lh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function oh(){this.count--,ah(this)}function sh(){this.imgCount--,ah(this)}var ch=null;function lh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ch=new Map,t.forEach(uh,e),ch=null,oh.call(e))}function uh(e,t){if(!(t.state.loading&4)){var n=ch.get(e);if(n)var r=n.get(null);else{n=new Map,ch.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=oh.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 dh={$$typeof:M,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function fh(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=ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.hiddenUpdates=ft(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function ph(e,t,n,r,i,a,o,s,c,l,u,d){return e=new fh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ai(3,null,null,t),e.current=a,a.stateNode=e,t=Aa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},po(a),e}function mh(e){return e?(e=Oi,e):Oi}function hh(e,t,n,r,i,a){i=mh(i),r.context===null?r.context=i:r.pendingContext=i,r=ho(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=go(e,r,t),n!==null&&(Ld(n,e,t),_o(n,e,t))}function gh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function _h(e,t){gh(e,t),(e=e.alternate)&&gh(e,t)}function vh(e){if(e.tag===13||e.tag===31){var t=Ti(e,67108864);t!==null&&Ld(t,e,67108864),_h(e,67108864)}}function yh(e){if(e.tag===13||e.tag===31){var t=Pd();t=vt(t);var n=Ti(e,t);n!==null&&Ld(n,e,t),_h(e,t)}}var bh=!0;function xh(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,Ch(e,t,n,r)}finally{F.p=a,P.T=i}}function Sh(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,Ch(e,t,n,r)}finally{F.p=a,P.T=i}}function Ch(e,t,n,r){if(bh){var i=wh(r);if(i===null)Yf(e,t,r,Th,n),Ih(e,r);else if(Rh(i,e,t,n,r))r.stopPropagation();else if(Ih(e,r),t&4&&-1<Fh.indexOf(e)){for(;i!==null;){var a=Pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ot(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-$e(o);s.entanglements[1]|=c,o&=~c}Af(a),!(G&6)&&(yd=Ve()+500,jf(0,!1))}}break;case 31:case 13:s=Ti(a,2),s!==null&&Ld(s,a,2),Hd(),_h(a,2)}if(a=wh(r),a===null&&Yf(e,t,r,Th,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Yf(e,t,r,null,n)}}function wh(e){return e=xn(e),Eh(e)}var Th=null;function Eh(e){if(Th=null,e=Nt(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 Th=e,null}function Dh(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Oh=!1,kh=null,Ah=null,jh=null,Mh=new Map,Nh=new Map,Ph=[],Fh=`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 Ih(e,t){switch(e){case`focusin`:case`focusout`:kh=null;break;case`dragenter`:case`dragleave`:Ah=null;break;case`mouseover`:case`mouseout`:jh=null;break;case`pointerover`:case`pointerout`:Mh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Nh.delete(t.pointerId)}}function Lh(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=Pt(t),t!==null&&vh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Rh(e,t,n,r,i){switch(t){case`focusin`:return kh=Lh(kh,e,t,n,r,i),!0;case`dragenter`:return Ah=Lh(Ah,e,t,n,r,i),!0;case`mouseover`:return jh=Lh(jh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Mh.set(a,Lh(Mh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Nh.set(a,Lh(Nh.get(a)||null,e,t,n,r,i)),!0}return!1}function zh(e){var t=Nt(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,xt(e.priority,function(){yh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,xt(e.priority,function(){yh(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 Bh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Pt(n),t!==null&&vh(t),e.blockedOn=n,!1;t.shift()}return!0}function Vh(e,t,n){Bh(e)&&n.delete(t)}function Hh(){Oh=!1,kh!==null&&Bh(kh)&&(kh=null),Ah!==null&&Bh(Ah)&&(Ah=null),jh!==null&&Bh(jh)&&(jh=null),Mh.forEach(Vh),Nh.forEach(Vh)}function Uh(e,n){e.blockedOn===n&&(e.blockedOn=null,Oh||(Oh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Hh)))}var Wh=null;function Gh(e){Wh!==e&&(Wh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Wh===e&&(Wh=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(Eh(r||n)===null)continue;break}var a=Pt(n);a!==null&&(e.splice(t,3),t-=3,ec(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Kh(e){function t(t){return Uh(t,e)}kh!==null&&Uh(kh,e),Ah!==null&&Uh(Ah,e),jh!==null&&Uh(jh,e),Mh.forEach(t),Nh.forEach(t);for(var n=0;n<Ph.length;n++){var r=Ph[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ph.length&&(n=Ph[0],n.blockedOn===null);)zh(n),n.blockedOn===null&&Ph.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[wt]||null;if(typeof a==`function`)o||Gh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[wt]||null)s=o.formAction;else if(Eh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Gh(n)}}}function qh(){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 Jh(e){this._internalRoot=e}Yh.prototype.render=Jh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;hh(n,Pd(),e,t,null,null)},Yh.prototype.unmount=Jh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hh(e.current,2,null,e,null,null),Hd(),t[Tt]=null}};function Yh(e){this._internalRoot=e}Yh.prototype.unstable_scheduleHydration=function(e){if(e){var t=bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ph.length&&t!==0&&t<Ph[n].priority;n++);Ph.splice(n,0,e),n===0&&zh(e)}};var Xh=n.version;if(Xh!==`19.3.0`)throw Error(i(527,Xh,`19.3.0`));F.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:f(e),e=e===null?null:e.stateNode,e};var Zh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Qh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qh.isDisabled&&Qh.supportsFiber)try{Xe=Qh.inject(Zh),Ze=Qh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Cc,s=wc,c=Tc;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=ph(e,1,!1,null,null,n,r,null,o,s,c,qh),e[Tt]=t.current,qf(e),new Jh(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_();function b(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var x=o((e=>{var t=d();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 f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),S=o(((e,t)=>{t.exports=x()}))(),C=v.useInsertionEffect,w=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?v.useLayoutEffect:v.useEffect,T=C||w,E=e=>{let t=v.useRef([e,(...e)=>t[0](...e)]).current;return T(()=>{t[0]=e}),t[1]},D=[`popstate`,`pushState`,`replaceState`,`hashchange`],O=[],k=()=>O.forEach(e=>e()),A=e=>(O.push(e)===1&&D.forEach(e=>addEventListener(e,k)),()=>{O=O.filter(t=>t!==e),O.length||D.forEach(e=>removeEventListener(e,k))}),j=(e,t)=>(0,S.useSyncExternalStore)(A,e,t),ee=()=>location.search,te=({ssrSearch:e}={})=>j(ee,e==null?ee:()=>e),ne=()=>location.pathname,M=({ssrPath:e}={})=>j(ne,e==null?ne:()=>e),re=(e,{replace:t=!1,state:n=null}={})=>history[t?`replaceState`:`pushState`](n,``,e),ie=e=>[M(e),re],N=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[N]===void 0){for(let e of[`pushState`,`replaceState`]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,N,{value:!0})}var ae=(e=``)=>e===`/`?``:e,oe=(e,t)=>e[0]===`~`?e.slice(1):ae(t)+e,se=(e,t)=>(e=ce(ae(e)),t=ce(t),!e||!t.toLowerCase().indexOf(e.toLowerCase())?t.slice(e.length)||`/`:`~`+t),ce=e=>{try{return e.includes(`%`)?decodeURI(e):e}catch{return e}},le={hook:ie,searchHook:te,parser:b,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},ue=(0,v.createContext)(le),de=()=>(0,v.useContext)(ue),fe={},pe=(0,v.createContext)(fe),me=()=>(0,v.useContext)(pe),he=(e,t=e.base)=>se(t,e.hook(e)[0]),ge=e=>{let[t,n]=e.hook(e);return[se(e.base,t),E((t,r)=>e.aroundNav(n,oe(t,e.base),r))]},P=()=>ge(de()),F=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{pattern:t}:e(t||`*`,r),o=i.exec(n);if(!o)return[!1,null];let s={};for(let e=1;e<o.length;e++)s[e-1]=o[e];if(a)for(let e=0;e<a.length;e++)s[a[e]]=o[e+1];else Object.assign(s,o.groups);return r?[!0,s,o[0]]:[!0,s]},_e=({children:e,...t})=>{let n=de(),r=t.hook?le:n,i=r;if(t.ssrPath){let[e,n=t.ssrSearch??``]=t.ssrPath.split(`?`);e&&(t.ssrSearch=n,t.ssrPath=e)}t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let a=(0,v.useRef)(r),o=a.current,s=o;for(let e in r){let n=e===`base`?r[e]+(t[e]??``):t[e]??r[e];n!==s[e]&&(o===s&&(a.current=s={...s}),s[e]=n),(n!==r[e]||n!==i[e])&&(i=s)}return(0,v.createElement)(ue.Provider,{value:i},e)},ve=({children:e,component:t},n)=>t?(0,v.createElement)(t,{params:n}):typeof e==`function`?e(n):e,ye=e=>{let t=(0,v.useRef)(fe),n=t.current,r=Object.keys(e);return t.current=r.length!==Object.keys(n).length||r.some(t=>e[t]!==n[t])?e:n},I=({path:e,nest:t,match:n,...r})=>{let i=de(),a=he(i),[o,s,c]=n??F(i.parser,e,a,t),l=ye({...me(),...s});if(!o)return null;let u=ve(r,l);return(0,v.createElement)(pe.Provider,{value:l},c?(0,v.createElement)(_e,{base:c},u):u)},be=(0,v.forwardRef)((e,t)=>{let n=de(),[r,i]=ge(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e;return m.onClick=E(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),m.href=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n),u!==void 0&&(m.className=u?.call?u(r===o):u),t&&(m.ref=t),c&&(0,v.isValidElement)(l)?(0,v.cloneElement)(l,m):(0,v.createElement)(`a`,m,l)}),xe=(e,t=[])=>{if(Array.isArray(e))for(let n of e)xe(n&&n.type===v.Fragment?n.props.children:n,t);else t.push(e);return t},Se=({children:e,location:t})=>{let n=de(),r=he(n);for(let i of xe(e)){let e=0;if((0,v.isValidElement)(i)&&(e=F(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,v.cloneElement)(i,{match:e})}return null},Ce=e=>{let{to:t,href:n=t}=e,r=de(),[,i]=ge(r),a=E(()=>i(t||n,e)),{ssrContext:o}=r;return w(()=>{a()},[]),o&&(o.redirectTo=t),null},we=[],Te=()=>we.forEach(e=>e()),Ee=e=>(we.push(e)===1&&addEventListener(`hashchange`,Te),()=>{we=we.filter(t=>t!==e),we.length||removeEventListener(`hashchange`,Te)}),De=/^#?\/?/,Oe=()=>`/`+location.hash.replace(De,``),ke=(e,{state:t=null,replace:n=!1}={})=>{let r=location.href,[i,a]=e.replace(De,``).split(`?`),o=new URL(r);o.hash=`/${i}`,a!==void 0&&(o.search=a);let s=o.href;history[n?`replaceState`:`pushState`](t,``,s);let c=typeof HashChangeEvent<`u`?new HashChangeEvent(`hashchange`,{oldURL:r,newURL:s}):new Event(`hashchange`,{detail:{oldURL:r,newURL:s}});dispatchEvent(c)},Ae=({ssrPath:e=`/`}={})=>[(0,S.useSyncExternalStore)(Ee,Oe,()=>e),ke];Ae.hrefs=e=>`#`+e;var je=o((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})),L=o(((e,t)=>{t.exports=je()}))(),Me=v.createContext(void 0),Ne=e=>{let t=v.useContext(Me);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Pe=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,L.jsx)(Me.Provider,{value:e,children:t})),Fe={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ie=new class{#e=Fe;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Le(e){setTimeout(e,0)}var Re=typeof window>`u`||`Deno`in globalThis;function ze(){}function Be(e,t){return typeof e==`function`?e(t):e}function Ve(e){return typeof e==`number`&&e>=0&&e!==1/0}function He(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ue(e,t){return typeof e==`function`?e(t):e}function We(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Ke(o,t.options))return!1}else if(!Je(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ge(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(qe(t.options.mutationKey)!==qe(a))return!1}else if(!Je(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ke(e,t){return(t?.queryKeyHashFn||qe)(e)}function qe(e){return JSON.stringify(e,(e,t)=>$e(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Je(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!Je(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Je(e[r],t[r]))return!1;return!0}return!1}var Ye=Object.prototype.hasOwnProperty;function Xe(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Qe(e)&&Qe(t);if(!r&&!($e(e)&&$e(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Ye.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Xe(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Ze(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Qe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $e(e){if(!et(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!et(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function et(e){return Object.prototype.toString.call(e)===`[object Object]`}function tt(e){return new Promise(t=>{Ie.setTimeout(t,e)})}function nt(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Xe(e,t)}function rt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function it(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var at=Symbol();function ot(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===at?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function st(e,t){return typeof e==`function`?e(...t):!!e}function ct(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var lt=()=>Re,ut=()=>lt(),dt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ft=new class extends dt{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},pt=Le;function mt(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=pt,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ht=mt(),gt=new class extends dt{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function _t(e){return Math.min(1e3*2**e,3e4)}function vt(e){return(e??`online`)!==`online`||gt.isOnline()}var yt=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function bt(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(ze);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new yt(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>ft.isFocused()&&(e.networkMode===`always`||gt.isOnline())&&e.canRun(),p=()=>vt(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(ut()?0:3),a=e.retryDelay??_t,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),tt(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var xt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ve(this.gcTime)&&(this.#e=Ie.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ut()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Ie.clearTimeout(this.#e),this.#e=void 0)}};function St(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ct(e,()=>t.signal,()=>n=!0)},u=ot(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?it:rt;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?wt:Ct,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ct(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Ct(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function wt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Tt=class extends xt{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Ot(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ot(this.options);e.data!==void 0&&(this.setState(Dt(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=nt(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(ze).catch(ze):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ue(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===at||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Ue(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!He(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ot(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?St(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=bt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof yt&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof yt){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Et(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Dt(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ht.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Et(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vt(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Dt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ot(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var kt=class extends dt{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),jt(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Ue(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Ze(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Nt(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Ue(this.options.enabled,this.#t)!==Ue(t.enabled,this.#t)||Ue(this.options.staleTime,this.#t)!==Ue(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Ue(this.options.enabled,this.#t)!==Ue(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Ze(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ze)),t}#h(e){return!ut()&&Ue(this.options.enabled,this.#t)!==!1&&Ve(e)}#g(){this.#b();let e=Ue(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=He(this.#r.dataUpdatedAt,e)+1;this.#u=Ie.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Ue(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=Ie.setInterval(()=>{(this.options.refetchIntervalInBackground||ft.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Ie.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Ie.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&jt(e,t),o=i&&Nt(e,n,t,r);(a||o)&&(l={...l,...Et(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=nt(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=nt(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Pt(e,t),refetch:this.refetch,isEnabled:Ue(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Ze(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();ht.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function At(e,t){return Ue(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Ue(t.retryOnMount,e)!==!1)}function jt(e,t){return At(e,t)||e.state.data!==void 0&&Mt(e,t,t.refetchOnMount)}function Mt(e,t,n){if(Ue(t.enabled,e)!==!1&&Ue(t.staleTime,e)!==`static`){let r=Ue(n,e);return r===`always`||r!==!1&&Pt(e,t)}return!1}function Nt(e,t,n,r){return(e!==t||Ue(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Pt(e,n)}function Pt(e,t){return Ue(t.enabled,e)!==!1&&e.isStaleByTime(Ue(t.staleTime,e))}var Ft=class extends xt{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||It(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=bt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ht.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function It(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Lt=class extends dt{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Ft({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Rt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Rt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Rt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Rt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ht.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ge(t,e))}findAll(e={}){return this.getAll().filter(t=>Ge(e,t))}notify(e){ht.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ht.batch(()=>Promise.all(e.map(e=>e.continue().catch(ze))))}};function Rt(e){return e.options.scope?.id}var zt=class extends dt{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Ke(r,t),a=this.get(i);return a||(a=new Tt({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ht.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>We(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>We(e,t)):t}notify(e){ht.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ht.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ht.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Bt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new zt,this.#t=e.mutationCache||new Lt,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ft.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=gt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ue(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Be(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ht.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ht.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ht.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=ht.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(ze).catch(ze)}invalidateQueries(e,t={}){return ht.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ht.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(ze)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(ze)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Ue(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ue(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ze).catch(ze)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ze).catch(ze)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return gt.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(qe(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Je(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(qe(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Je(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Ke(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===at&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Vt=v.createContext(!1),Ht=()=>v.useContext(Vt);Vt.Provider;function Ut(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Wt=v.createContext(Ut()),Gt=()=>v.useContext(Wt),Kt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?st(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},R=e=>{v.useEffect(()=>{e.clearReset()},[e])},qt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||st(n,[e.error,r])),Jt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Yt=(e,t)=>e?.suspense&&t.isPending,Xt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Zt(e,t,n){let r=Ht(),i=Gt(),a=Ne(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Jt(o),Kt(o,i,s),R(i);let[l]=v.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(v.useSyncExternalStore(v.useCallback(e=>{let t=d?l.subscribe(ht.batchCalls(e)):ze;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o)},[o,l]),Yt(o,u))throw Xt(o,l,i);if(qt({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Qt(e,t){return Zt(e,kt,t)}var $t=(0,v.createContext)({});function en(e){let t=(0,v.useRef)(null);return t.current===null&&(t.current=e()),t.current}var tn=typeof window<`u`?v.useLayoutEffect:v.useEffect,nn=(0,v.createContext)(null);function rn(e,t){e.indexOf(t)===-1&&e.push(t)}function an(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var on=(e,t,n)=>n>t?t:n<e?e:n,sn={},cn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ln=e=>typeof e==`object`&&!!e,un=e=>/^0[^.\s]+$/u.test(e);function dn(e){let t;return()=>(t===void 0&&(t=e()),t)}var fn=e=>e,pn=(...e)=>e.reduce((e,t)=>n=>t(e(n))),mn=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},hn=class{constructor(){this.subscriptions=[]}add(e){return rn(this.subscriptions,e),()=>this.remove(e)}remove(e){an(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}},gn=e=>e*1e3,_n=e=>e/1e3,vn=(e,t)=>t?1e3/t*e:0,yn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,bn=1e-7,xn=12;function Sn(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=yn(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>bn&&++s<xn);return o}function Cn(e,t,n,r){if(e===t&&n===r)return fn;let i=t=>Sn(t,0,1,e,n);return e=>e===0||e===1?e:yn(i(e),t,r)}var wn=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Tn=e=>t=>1-e(1-t),En=Cn(.33,1.53,.69,.99),Dn=Tn(En),On=wn(Dn),kn=e=>e>=1?1:(e*=2)<1?.5*Dn(e):.5*(2-2**(-10*(e-1))),An=e=>1-Math.sin(Math.acos(e)),jn=Tn(An),Mn=wn(An),Nn=Cn(.42,0,1,1),Pn=Cn(0,0,.58,1),Fn=Cn(.42,0,.58,1),In=e=>Array.isArray(e)&&typeof e[0]!=`number`,Ln=e=>Array.isArray(e)&&typeof e[0]==`number`,Rn={linear:fn,easeIn:Nn,easeInOut:Fn,easeOut:Pn,circIn:An,circInOut:Mn,circOut:jn,backIn:Dn,backInOut:On,backOut:En,anticipate:kn},zn=e=>typeof e==`string`,Bn=e=>{if(Ln(e)){e.length;let[t,n,r,i]=e;return Cn(t,n,r,i)}return zn(e)?(Rn[e],`${e}`,Rn[e]):e},Vn=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Hn(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Un=40;function Wn(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Vn.reduce((e,t)=>(e[t]=Hn(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=sn.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,Un),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:Vn.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<Vn.length;t++)o[Vn[t]].cancel(e)},state:i,steps:o}}var{schedule:z,cancel:Gn,state:Kn,steps:qn}=Wn(typeof requestAnimationFrame<`u`?requestAnimationFrame:fn,!0),Jn;function Yn(){Jn=void 0}var Xn={now:()=>(Jn===void 0&&Xn.set(Kn.isProcessing||sn.useManualTiming?Kn.timestamp:performance.now()),Jn),set:e=>{Jn=e,queueMicrotask(Yn)}},Zn=e=>Math.round(e*1e5)/1e5,Qn=e=>t=>typeof t==`string`&&t.startsWith(e),$n=Qn(`--`),er=Qn(`var(--`),tr=e=>er(e)?nr.test(e.split(`/*`)[0].trim()):!1,nr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function rr(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var ir={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},ar={...ir,transform:e=>on(0,1,e)},or={...ir,default:1},sr=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function cr(e){return e==null}var lr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ur=(e,t)=>n=>!!(typeof n==`string`&&lr.test(n)&&n.startsWith(e)||t&&!cr(n)&&Object.prototype.hasOwnProperty.call(n,t)),dr=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(sr);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},fr=e=>on(0,255,e),pr={...ir,transform:e=>Math.round(fr(e))},mr={test:ur(`rgb`,`red`),parse:dr(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+pr.transform(e)+`, `+pr.transform(t)+`, `+pr.transform(n)+`, `+Zn(ar.transform(r))+`)`};function hr(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 gr={test:ur(`#`),parse:hr,transform:mr.transform},_r=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),vr=_r(`deg`),yr=_r(`%`),B=_r(`px`),br=_r(`vh`),xr=_r(`vw`),Sr={...yr,parse:e=>yr.parse(e)/100,transform:e=>yr.transform(e*100)},Cr={test:ur(`hsl`,`hue`),parse:dr(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+yr.transform(Zn(t))+`, `+yr.transform(Zn(n))+`, `+Zn(ar.transform(r))+`)`},wr={test:e=>mr.test(e)||gr.test(e)||Cr.test(e),parse:e=>mr.test(e)?mr.parse(e):Cr.test(e)?Cr.parse(e):gr.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?mr.transform(e):Cr.transform(e),getAnimatableNone:e=>{let t=wr.parse(e);return t.alpha=0,wr.transform(t)}},Tr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Er=new RegExp(sr.source),Dr=new RegExp(Tr.source,`i`);function Or(e){return isNaN(e)&&typeof e==`string`&&(Er.test(e)||Dr.test(e))}var kr=`number`,Ar=`color`,jr=`var`,Mr=`var(`,Nr="${}",Pr=/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 Fr(e){let t=e.toString();return Er.test(t)||Dr.test(t)}function Ir(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Pr,e=>(wr.test(e)?(r.color.push(a),i.push(Ar),n.push(wr.parse(e))):e.startsWith(Mr)?(r.var.push(a),i.push(jr),n.push(e)):(r.number.push(a),i.push(kr),n.push(parseFloat(e))),++a,Nr)).split(Nr),indexes:r,types:i}}function Lr(e){return Ir(e).values}function Rr({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];i+=e===kr?Zn(r[a]):e===Ar?wr.transform(r[a]):r[a]}return i}}function zr(e){return Rr(Ir(e))}var Br=e=>typeof e==`number`?0:wr.test(e)?wr.getAnimatableNone(e):e,Vr=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Br(e);function Hr(e){let t=Ir(e);return Rr(t)(t.values.map((e,n)=>Vr(e,t.split[n])))}var Ur={test:Or,parse:Lr,createTransformer:zr,getAnimatableNone:Hr};function Wr(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 Gr({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=Wr(s,r,e+1/3),a=Wr(s,r,e),o=Wr(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Kr(e,t){return n=>n>0?t:e}var V=(e,t,n)=>e+(t-e)*n,qr=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Jr=[gr,mr,Cr],Yr=e=>Jr.find(t=>t.test(e));function Xr(e){let t=Yr(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===Cr&&(n=Gr(n)),n}var Zr=(e,t)=>{let n=Xr(e),r=Xr(t);if(!n||!r)return Kr(e,t);let i={...n};return e=>(i.red=qr(n.red,r.red,e),i.green=qr(n.green,r.green,e),i.blue=qr(n.blue,r.blue,e),i.alpha=V(n.alpha,r.alpha,e),mr.transform(i))},Qr=new Set([`none`,`hidden`]);function $r(e,t){return Qr.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ei(e,t){return n=>V(e,t,n)}function ti(e){return typeof e==`number`?ei:typeof e==`string`?tr(e)?Kr:wr.test(e)?Zr:ai:Array.isArray(e)?ni:typeof e==`object`?wr.test(e)?Zr:ri:Kr}function ni(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ti(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function ri(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ti(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function ii(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]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var ai=(e,t)=>{let n=Ur.createTransformer(t),r=Ir(e),i=Ir(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?Qr.has(e)&&!i.values.length||Qr.has(t)&&!r.values.length?$r(e,t):pn(ni(ii(r,i),i.values),n):(`${e}${t}`,Kr(e,t))},oi=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function si(e,t){let n=oi.exec(e);if(!n)return;let r=oi.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Zn(V(a,o,e))+i}function ci(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return V(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=si(e,t);if(n)return n}return ti(e)(e,t)}var li=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>z.update(t,e),stop:()=>Gn(t),now:()=>Kn.isProcessing?Kn.timestamp:Xn.now()}},ui=(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)})`},di=2e4;function fi(e,t=50,n=di,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function pi(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(fi(r),di);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:_n(i)}}var mi={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 hi(e,t){return e*Math.sqrt(1-t*t)}var gi=12;function _i(e,t,n){let r=n;for(let n=1;n<gi;n++)r-=e(r)/t(r);return r}var vi=.001;function yi({duration:e=mi.duration,bounce:t=mi.bounce,velocity:n=mi.velocity,mass:r=mi.mass}){let i,a;mi.maxDuration;let o=1-t;o=on(mi.minDamping,mi.maxDamping,o),e=on(mi.minDuration,mi.maxDuration,_n(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=hi(t,o),c=Math.exp(-i);return vi-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o*o*t*t*e,c=Math.exp(-r),l=hi(t*t,o);return(-i(t)+vi>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=_i(i,a,s);if(e=gn(e),isNaN(c))return{stiffness:mi.stiffness,damping:mi.damping,duration:e};{let t=c*c*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var bi=[`duration`,`bounce`];function xi(e,t){return t.some(t=>e[t]!==void 0)}var Si=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Ci(e,t){if(Si(e,t))return e}function wi(e){let t=Ci(e.stiffness),n=Ci(e.damping,!0),r=Ci(e.mass),i={...e,stiffness:t??mi.stiffness,damping:n??mi.damping,mass:r??mi.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&xi(e,bi)};if(i.isTimeDefined){if(i.velocity=0,e.visualDuration){let t=e.visualDuration,n=2*Math.PI/(t*1.2),r=n*n,a=2*on(.05,1,1-(e.bounce||0))*Math.sqrt(r);i={...i,mass:mi.mass,stiffness:r,damping:a}}else{let e=yi(i);i={...i,...e,mass:mi.mass},i.isResolvedFromDuration=!0}(!Si(i.stiffness)||!Si(i.damping,!0))&&(i.stiffness=mi.stiffness,i.damping=mi.damping)}return i}function Ti(e=mi.visualDuration,t=mi.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,velocity:u,isResolvedFromDuration:d,isTimeDefined:f}=wi({...n,velocity:-_n(n.velocity||0)}),p=s/(2*Math.sqrt(o*c)),m=_n(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:u||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?mi.restSpeed.granular:mi.restSpeed.default),g.restDelta=n.restDelta||(e?mi.restDelta.granular:mi.restDelta.default)};_();let v,y,b;if(p<1){let e=hi(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1);v=t=>{let n=Math.exp(-h*t),r=Math.min(e*t,300);return g.target-n*((g.velocity+h*g.delta)*Math.sinh(r)+e*g.delta*Math.cosh(r))/e};let t={P:0,sinh:0,cosh:0};b=()=>{t.P=(g.velocity+h*g.delta)/e,t.sinh=h*t.P-g.delta*e,t.cosh=h*g.delta-t.P*e},y=n=>{let r=Math.exp(-h*n),i=Math.min(e*n,300);return r*(t.sinh*Math.sinh(i)+t.cosh*Math.cosh(i))}}b();let x=d&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f?0:-_n(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>gn(y(e)),next:e=>{let t=v(e);if(d)a.done=e>=l;else{let n=gn(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(fi(S),di),t=ui(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Ti.applyToOptions=e=>{let t=pi(e,100,Ti);return e.ease=t.ease,e.duration=gn(t.duration),e.type=`keyframes`,e};function Ei({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=>e<s||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=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Ti({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Di(e,t,n){let r=[],i=n||sn.mix||ci,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=pn(Array.isArray(t)?t[n]||fn:t,a)),r.push(a)}return r}function Oi(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=Di(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=mn(e[r],e[r+1],n);return s[r](i)};return n?t=>l(on(e[0],e[a-1],t)):l}function ki(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=mn(0,t,r);e.push(V(n,1,i))}}function Ai(e){let t=[0];return ki(t,e.length-1),t}function ji(e,t){return e.map(e=>e*t)}function Mi(e,t){return e.map(()=>t||Fn).splice(0,e.length-1)}function Ni({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=In(r)?r.map(Bn):Bn(r)||Fn,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(sn.mix||ci)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?on(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Oi(ji(n&&n.length===t.length?n:Ai(t),e),t,{ease:Array.isArray(i)?i:Mi(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Pi=5;function Fi(e,t,n){let r=Math.max(t-Pi,0);return vn(n-e(r),t-r)}function Ii(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Fi(t=>e.next(t).value,t,e.next(t).value)}var Li=e=>e!==null;function Ri(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Li),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var zi={decay:Ei,inertia:Ei,tween:Ni,keyframes:Ni,spring:Ti};function Bi(e){typeof e.type==`string`&&(e.type=zi[e.type])}function Vi(e,t){return{kind:e,animation:t,timestamp:Xn.now(),frameTimestamp:Kn.timestamp,frameIsProcessing:Kn.isProcessing}}function Hi(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Vi(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Ui(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Vi(`layout-animation-start`,e),node:t})}catch{}}var Wi=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Gi=e=>e/100,Ki=class extends Wi{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!==Xn.now()&&this.tick(Xn.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Hi(this,this.options)}initAnimation(){let{options:e}=this;Bi(e);let{type:t=Ni,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Ni;s!==Ni&&typeof o[0]!=`number`&&(this.mixKeyframes=pn(Gi,ci(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=fi(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.currentTime=this.holdTime===null?t: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=on(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!==Ei&&(b.value=Ri(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 _n(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+_n(e)}get time(){return _n(this.currentTime)}set time(e){e=gn(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(){return Ii(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Xn.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=_n(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=li,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(Xn.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}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)}},qi=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Ji(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(sr)||[];if(!r)return e;let i=n.replace(r,``),a=+!!qi.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Yi=/\b([a-z-]*)\(.*?\)/gu,Xi={...Ur,getAnimatableNone:e=>{let t=e.match(Yi);return t?t.map(Ji).join(` `):e}},Zi={...Ur,getAnimatableNone:e=>{let t=Ur.parse(e);return Ur.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Qi={...ir,transform:Math.round},$i={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,inset:B,insetBlock:B,insetBlockStart:B,insetBlockEnd:B,insetInline:B,insetInlineStart:B,insetInlineEnd:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,paddingBlock:B,paddingBlockStart:B,paddingBlockEnd:B,paddingInline:B,paddingInlineStart:B,paddingInlineEnd:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,marginBlock:B,marginBlockStart:B,marginBlockEnd:B,marginInline:B,marginInlineStart:B,marginInlineEnd:B,fontSize:B,backgroundPositionX:B,backgroundPositionY:B,rotate:vr,pathRotation:vr,rotateX:vr,rotateY:vr,rotateZ:vr,scale:or,scaleX:or,scaleY:or,scaleZ:or,skew:vr,skewX:vr,skewY:vr,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:ar,originX:Sr,originY:Sr,originZ:B,zIndex:Qi,fillOpacity:ar,strokeOpacity:ar,numOctaves:Qi},ea={...$i,color:wr,backgroundColor:wr,outlineColor:wr,fill:wr,stroke:wr,borderColor:wr,borderTopColor:wr,borderRightColor:wr,borderBottomColor:wr,borderLeftColor:wr,filter:Xi,WebkitFilter:Xi,mask:Zi,WebkitMask:Zi},ta=e=>ea[e],na=new Set([Xi,Zi]);function H(e,t){let n=ta(e);return na.has(n)||(n=Ur),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function ra(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var ia=e=>e*180/Math.PI,aa=e=>sa(ia(Math.atan2(e[1],e[0]))),oa={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:aa,rotateZ:aa,skewX:e=>ia(Math.atan(e[1])),skewY:e=>ia(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},sa=e=>(e%=360,e<0&&(e+=360),e),ca=aa,la=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ua=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),da={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:la,scaleY:ua,scale:e=>(la(e)+ua(e))/2,rotateX:e=>sa(ia(Math.atan2(e[6],e[5]))),rotateY:e=>sa(ia(Math.atan2(-e[2],e[0]))),rotateZ:ca,rotate:ca,skewX:e=>ia(Math.atan(e[4])),skewY:e=>ia(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function fa(e){return+!!e.includes(`scale`)}function pa(e,t){if(!e||e===`none`)return fa(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=da,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=oa,i=t}if(!i)return fa(t);let a=r[t],o=i[1].split(`,`).map(ha);return typeof a==`function`?a(o):o[a]}var ma=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return pa(n,t)};function ha(e){return parseFloat(e.trim())}var ga=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],_a=new Set([...ga,`pathRotation`]),va=e=>e===ir||e===B,ya=new Set([`x`,`y`,`z`]),ba=ga.filter(e=>!ya.has(e));function xa(e){let t=[];return ba.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Sa=new Set([`bottom`,`right`]);function Ca(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var wa={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Ca(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Ca(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>pa(e,`x`),y:({transform:e})=>pa(e,`y`)};wa.translateX=wa.x,wa.translateY=wa.y;var Ta=new Set,Ea=!1,Da=!1,Oa=!1;function ka(){if(Da){let e=[],t=new Set,n=new Set;Ta.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Sa.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=xa(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.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)})}Da=!1,Ea=!1,Ta.forEach(e=>e.complete(Oa)),Ta.clear()}function Aa(){Ta.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Da=!0)})}function ja(){Oa=!0,Aa(),ka(),Oa=!1}function Ma(e,t,n){if(typeof e==`string`){if(cn(e)||un(e))return parseFloat(e);if(!Ur.test(e)&&Ur.test(n))return H(t,n)}return e??void 0}var Na=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?(Ta.add(this),Ea||(Ea=!0,z.read(Aa),z.resolveKeyframes(ka))):(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=Ma(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}ra(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Ta.delete(this)}cancel(){this.state===`scheduled`&&(Ta.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Pa=e=>e.startsWith(`--`);function Fa(e,t,n){Pa(t)?e.style.setProperty(t,n):e.style[t]=n}var Ia={};function La(e,t){let n=dn(e);return()=>Ia[t]??n()}var Ra=La(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),za=La(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Ba=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Va={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Ba([0,.65,.55,1]),circOut:Ba([.55,0,1,.45]),backIn:Ba([.31,.01,.66,-.59]),backOut:Ba([.33,1.53,.69,.99])};function Ha(e,t){if(e)return typeof e==`function`?za()?ui(e,t):`ease-out`:Ln(e)?Ba(e):Array.isArray(e)?e.map(e=>Ha(e,t)||Va.easeOut):Va[e]}function Ua(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=Ha(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Wa(e){return typeof e==`function`&&`applyToOptions`in e}function Ga({type:e,...t}){return Wa(e)&&za()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Ka=class extends Wi{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=Ga(e);this.animation=Ua(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Ri(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Fa(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Hi(this,e,c)}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 _n(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+_n(e)}get time(){return _n(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=gn(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&&Ra()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),fn):r(this)}},qa={anticipate:kn,backInOut:On,circInOut:Mn};function Ja(e){return e in qa}function Ya(e){typeof e.ease==`string`&&Ja(e.ease)&&(e.ease=qa[e.ease])}var Xa=10,Za=class extends Ka{constructor(e){Ya(e),Bi(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 Ki({...a,autoplay:!1}),s=Math.max(Xa,Xn.now()-this.startTime),c=on(0,Xa,s-Xa),l=o.sample(s).value,{name:u}=this.options;i&&u&&Fa(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Qa=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Ur.test(e)||e===`0`)&&!e.startsWith(`url(`));function $a(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 eo(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=Qa(i,t),s=Qa(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):$a(e)||(n===`spring`||Wa(n))&&r}function to(e){e.duration=0,e.type=`keyframes`}var no=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),ro=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function io(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&ro.test(e[t]))return!0;return!1}var ao=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),oo=dn(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function so(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(no.has(n)||ao.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return oo()&&(no.has(n)||ao.has(n)&&io(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var co=40,lo=class extends Wi{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Xn.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Na;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),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=Xn.now();let u=!0;eo(e,i,a,o)||(u=!1,(sn.instantAnimations||!s)&&l?.(Ri(e,n,t)),e[0]=e[e.length-1],to(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>co?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&so(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new Za(n)}catch{m=new Ki(n)}}else m=new Ki(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ja()),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 uo(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 fo=30,po=e=>!isNaN(parseFloat(e)),mo={current:void 0},ho=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Xn.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),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=Xn.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=po(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new hn)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new hn,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){z.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;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.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return mo.current&&mo.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Xn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>fo)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,fo);return vn(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function go(e,t){return new ho(e,t)}function _o(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function vo(e,t){let n=e?.[t]??e?.default??e;return n===e?n:_o(n,e)}var yo={type:`spring`,stiffness:500,damping:25,restSpeed:10},bo=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xo={type:`keyframes`,duration:.8},So={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Co=(e,{keyframes:t})=>t.length>2?xo:_a.has(e)?e.startsWith(`scale`)?bo(t[1]):yo:So,wo=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function To(e){for(let t in e)if(!wo.has(t))return!0;return!1}var Eo=(e,t,n,r={},i,a)=>o=>{let s=vo(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=gn(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};To(s)||Object.assign(u,Co(e,u)),u.duration&&=gn(u.duration),u.repeatDelay&&=gn(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(to(u),u.delay===0&&(d=!0)),(sn.instantAnimations||sn.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,to(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Ri(u.keyframes,s);if(e!==void 0){z.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Ki(u):new lo(u)},Do=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Oo(e){let t=Do.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function ko(e,t,n=1){`${e}`;let[r,i]=Oo(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return cn(e)?parseFloat(e):e}return tr(i)?ko(i,t,n+1):i}function Ao(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function jo(e,t,n,r){if(typeof t==`function`){let[i,a]=Ao(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]=Ao(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Mo(e,t,n){let r=e.getProps();return jo(r,t,n===void 0?r.custom:n,e)}var No=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...ga]),Po=e=>Array.isArray(e);function Fo(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,go(n))}function Io(e){return Po(e)?e[e.length-1]||0:e}function Lo(e,t){let{transitionEnd:n={},transition:r={},...i}=Mo(e,t)||{};i={...i,...n};for(let t in i)Fo(e,t,Io(i[t]))}var Ro=e=>!!(e&&e.getVelocity);function zo(e){return!!(Ro(e)&&e.add)}function Bo(e,t){let n=e.getValue(`willChange`);if(zo(n))return n.add(t);if(!n&&sn.WillChange){let n=new sn.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function U(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Vo=`data-`+U(`framerAppearId`);function Ho(e){return e.props[Vo]}var Uo=typeof window<`u`;function Wo({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Go(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?_o(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&&Wo(f,t))continue;let o={delay:n,...vo(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){z.update(()=>r.set(i));continue}let p=!1;if(Uo&&window.MotionHandoffAnimation){let n=Ho(e);if(n){let e=window.MotionHandoffAnimation(n,t,z);e!==null&&(o.startTime=e,p=!0)}}Bo(e,t);let m=l??e.shouldReduceMotion;r.start(Eo(t,r,i,m&&No.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>z.update(()=>{o&&Lo(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Ko(e,t,n={}){let r=Mo(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(Go(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return qo(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())}return Promise.all([a(),o(n.delay)])}function qo(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(Ko(c,t,{...o,delay:n+(typeof r==`function`?0:r)+uo(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Jo(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Ko(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Ko(e,t,n);else{let i=typeof t==`function`?Mo(e,t,n.custom):t;r=Promise.all(Go(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Yo={test:e=>e===`auto`,parse:e=>e},Xo=e=>t=>t.test(e),Zo=[ir,B,yr,vr,xr,br,Yo],Qo=e=>Zo.find(Xo(e));function $o(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||un(e)}var es=new Set([`auto`,`none`,`0`]);function ts(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!es.has(t)&&Fr(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=H(n,i))}var ns=class extends Na{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(),tr(r))){let i=ko(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!No.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=Qo(r),o=Qo(i);if(rr(r)!==rr(i)&&wa[n]){this.needsMeasurement=!0;return}if(a!==o){if(va(a)&&va(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else wa[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||$o(e[t]))&&n.push(t);n.length&&ts(e,n,t)}measure(){let{element:e,name:t}=this;return wa[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},rs=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function is(e){return ln(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function as(e){return ln(e)&&`ownerSVGElement`in e}var os=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function ss(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 cs={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},ls=ga.length;function us(e,t,n){let r=``,i=!0;for(let a=0;a<ls;a++){let o=ga[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=os(s,$i[o]);if(!c){i=!1;let t=cs[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${os(a,$i.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function ds(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(_a.has(e)){o=!0;continue}if($n(e)){i[e]=n;continue}{let t=os(n,$i[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=us(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var fs={offset:`stroke-dashoffset`,array:`stroke-dasharray`},ps={offset:`strokeDashoffset`,array:`strokeDasharray`};function ms(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?fs:ps;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var hs=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function gs(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(ds(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;for(let e of hs)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&ms(d,i,a,o,!1)}function _s({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function vs({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ys(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 bs(e){return e===void 0||e===1}function xs({scale:e,scaleX:t,scaleY:n}){return!bs(e)||!bs(t)||!bs(n)}function Ss(e){return xs(e)||Cs(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Cs(e){return ws(e.x)||ws(e.y)}function ws(e){return e&&e!==`0%`}function Ts(e,t,n){return n+t*(e-n)}function Es(e,t,n,r,i){return i!==void 0&&(e=Ts(e,i,r)),Ts(e,n,r)+t}function Ds(e,t=0,n=1,r,i){e.min=Es(e.min,t,n,r,i),e.max=Es(e.max,t,n,r,i)}function Os(e,{x:t,y:n}){Ds(e.x,t.translate,t.scale,t.originPoint),Ds(e.y,n.translate,n.scale,n.originPoint)}var ks=.999999999999,As=1.0000000000001;function js(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&&(Ms(e.x,-a.scroll.offset.x),Ms(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Os(e,o)),r&&Ss(a.latestValues)&&Fs(e,a.latestValues,a.layout?.layoutBox))}t.x<As&&t.x>ks&&(t.x=1),t.y<As&&t.y>ks&&(t.y=1)}function Ms(e,t){e.min+=t,e.max+=t}function Ns(e,t,n,r,i=.5){Ds(e,t,n,V(e.min,e.max,i),r)}function Ps(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Fs(e,t,n){let r=n??e;Ns(e.x,Ps(t.x,r.x),t.scaleX,t.scale,t.originX),Ns(e.y,Ps(t.y,r.y),t.scaleY,t.scale,t.originY)}function Is(e,t){return _s(ys(e.getBoundingClientRect(),t))}function Ls(e,t,n){let r=Is(e,n),{scroll:i}=t;return i&&(Ms(r.x,i.offset.x),Ms(r.y,i.offset.y)),r}var{schedule:Rs,cancel:zs}=Wn(queueMicrotask,!1),Bs={x:!1,y:!1};function Vs(){return Bs.x||Bs.y}function Hs(e){return e===`x`||e===`y`?Bs[e]?null:(Bs[e]=!0,()=>{Bs[e]=!1}):Bs.x||Bs.y?null:(Bs.x=Bs.y=!0,()=>{Bs.x=Bs.y=!1})}function Us(e,t){let n=ss(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Ws(e){return!(e.pointerType===`touch`||Vs())}function Gs(e,t,n={}){let[r,i,a]=Us(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(!Ws(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 Ks=(e,t)=>t?e===t||Ks(e,t.parentElement):!1,qs=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Js=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Ys(e){return Js.has(e.tagName)||e.isContentEditable===!0}var Xs=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Zs(e){return Xs.has(e.tagName)||e.isContentEditable===!0}var Qs=new WeakSet;function $s(e){return t=>{t.key===`Enter`&&e(t)}}function ec(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var tc=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=$s(()=>{if(Qs.has(n))return;ec(n,`down`);let e=$s(()=>{ec(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>ec(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function nc(e){return qs(e)&&!Vs()}var rc=new WeakSet;function ic(e,t,n={}){let[r,i,a]=Us(e,n),o=e=>{let r=e.currentTarget;if(!nc(e)||rc.has(e))return;Qs.add(r),n.stopPropagation&&rc.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Qs.has(r)&&Qs.delete(r),nc(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Ks(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),is(e)&&(e.addEventListener(`focus`,e=>tc(e,i)),!Ys(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var ac=new WeakMap,oc,sc=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:as(r)&&`getBBox`in r?r.getBBox()[t]:r[n],cc=sc(`inline`,`width`,`offsetWidth`),lc=sc(`block`,`height`,`offsetHeight`);function uc({target:e,borderBoxSize:t}){ac.get(e)?.forEach(n=>{n(e,{get width(){return cc(e,t)},get height(){return lc(e,t)}})})}function dc(e){e.forEach(uc)}function fc(){typeof ResizeObserver<`u`&&(oc=new ResizeObserver(dc))}function pc(e,t){oc||fc();let n=ss(e);return n.forEach(e=>{let n=ac.get(e);n||(n=new Set,ac.set(e,n)),n.add(t),oc?.observe(e)}),()=>{n.forEach(e=>{let n=ac.get(e);n?.delete(t),n?.size||oc?.unobserve(e)})}}var mc=new Set,hc;function gc(){hc=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};mc.forEach(t=>t(e))},window.addEventListener(`resize`,hc)}function _c(e){return mc.add(e),hc||gc(),()=>{mc.delete(e),!mc.size&&typeof hc==`function`&&(window.removeEventListener(`resize`,hc),hc=void 0)}}function vc(e,t){return typeof e==`function`?_c(e):pc(e,t)}var yc={value:null,addProjectionMetrics:null};function bc(e){return as(e)&&e.tagName===`svg`}var xc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Sc=()=>({x:xc(),y:xc()}),Cc=()=>({min:0,max:0}),wc=()=>({x:Cc(),y:Cc()}),Tc=new WeakMap;function Ec(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Dc(e){return typeof e==`string`||Array.isArray(e)}var Oc=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],kc=[`initial`,...Oc];function Ac(e){if(Ec(e.animate))return!0;for(let t=0;t<kc.length;t++)if(Dc(e[kc[t]]))return!0;return!1}function jc(e){return!!(Ac(e)||e.variants)}function Mc(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Ro(i))e.addValue(r,i);else if(Ro(a))e.addValue(r,go(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,go(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Nc={current:null},Pc={current:!1},Fc=typeof window<`u`;function Ic(){if(Pc.current=!0,Fc){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Nc.current=e.matches;e.addEventListener(`change`,t),t()}else Nc.current=!1}}var Lc=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Rc={};function zc(e){Rc=e}function Bc(){return Rc}var Vc=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=Na,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=Xn.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,z.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=Ac(t),this.isVariantNode=jc(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&&Ro(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,Tc.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:(Pc.current||Ic(),this.shouldReduceMotion=Nc.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(),Gn(this.notifyUpdate),Gn(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&&no.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Ka({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:gn(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=_a.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&z.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 Rc){let t=Rc[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<Lc.length;t++){let n=Lc[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=Mc(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=go(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`&&(cn(n)||un(n))?n=parseFloat(n):typeof n!=`number`&&!Ur.test(n)&&Ur.test(t)&&(n=H(e,t)),this.setBaseTarget(e,Ro(n)?n.get():n)),Ro(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=jo(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&&!Ro(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 hn),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Rs.render(this.render)}},Hc=class extends Vc{constructor(){super(...arguments),this.KeyframeResolver=ns}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;Ro(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Uc=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Wc(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 Gc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Kc={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(B.test(e))e=parseFloat(e);else return e}return`${Gc(e,t.target.x)}% ${Gc(e,t.target.y)}%`}},qc={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Ur.parse(e);if(i.length>5)return r;let a=Ur.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=V(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Jc={borderRadius:{...Kc,applyTo:[...rs]},borderTopLeftRadius:Kc,borderTopRightRadius:Kc,borderBottomLeftRadius:Kc,borderBottomRightRadius:Kc,boxShadow:qc};function Yc(e,{layout:t,layoutId:n}){return _a.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Jc[e]||e===`opacity`)}function Xc(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Ro(r[t])||i&&Ro(i[t])||Yc(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Zc(e){return window.getComputedStyle(e)}var Qc=class extends Hc{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Wc}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(_a.has(t))return this.projection?.isProjecting?fa(t):ma(e,t);{let n=Zc(e),r=($n(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Is(e,t)}build(e,t,n){ds(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Xc(e,t,n)}},$c=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`]),el=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function tl(e,t,n,r){Wc(e,t,void 0,r);for(let n in t.attrs)e.setAttribute($c.has(n)?n:U(n),t.attrs[n])}function nl(e,t,n){let r=Xc(e,t,n);for(let n in e)if(Ro(e[n])||Ro(t[n])){let t=ga.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var rl=class extends Hc{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=wc}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(_a.has(t)){let e=ta(t);return e&&e.default||0}if(hs.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=$c.has(t)?t:U(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return nl(e,t,n)}build(e,t,n){gs(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){tl(e,t,n,r)}mount(e){this.isSVGTag=el(e.tagName),super.mount(e)}},il=kc.length;function al(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&al(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<il;n++){let r=kc[n],i=e.props[r];(Dc(i)||i===!1)&&(t[r]=i)}return t}function ol(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 sl=[...Oc].reverse(),cl=Oc.length;function ll(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Jo(e,t,n)))}function ul(e){let t=ll(e),n=pl(),r=!0,i=!1,a=t=>(n,r)=>{let i=Mo(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=al(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<cl;t++){let p=sl[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Dc(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||Ec(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=dl(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=Po(t)&&Po(n)?!ol(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=Mo(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=uo(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Mo(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=pl(),i=!0}}}function dl(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!ol(t,e):!1}function fl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function pl(){return{animate:fl(!0),whileInView:fl(),whileHover:fl(),whileTap:fl(),whileDrag:fl(),whileFocus:fl(),exit:fl()}}function ml(e,t){e.min=t.min,e.max=t.max}function hl(e,t){ml(e.x,t.x),ml(e.y,t.y)}function gl(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var _l=.9999,vl=1.0001,yl=-.01,bl=.01;function xl(e){return e.max-e.min}function Sl(e,t,n){return Math.abs(e-t)<=n}function Cl(e,t,n,r=.5){e.origin=r,e.originPoint=V(t.min,t.max,e.origin),e.scale=xl(n)/xl(t),e.translate=V(n.min,n.max,e.origin)-e.originPoint,(e.scale>=_l&&e.scale<=vl||isNaN(e.scale))&&(e.scale=1),(e.translate>=yl&&e.translate<=bl||isNaN(e.translate))&&(e.translate=0)}function wl(e,t,n,r){Cl(e.x,t.x,n.x,r?r.originX:void 0),Cl(e.y,t.y,n.y,r?r.originY:void 0)}function Tl(e,t,n,r=0){e.min=(r?V(n.min,n.max,r):n.min)+t.min,e.max=e.min+xl(t)}function El(e,t,n,r){Tl(e.x,t.x,n.x,r?.x),Tl(e.y,t.y,n.y,r?.y)}function Dl(e,t,n,r=0){let i=r?V(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+xl(t)}function Ol(e,t,n,r){Dl(e.x,t.x,n.x,r?.x),Dl(e.y,t.y,n.y,r?.y)}function kl(e,t,n,r,i){return e-=t,e=Ts(e,1/n,r),i!==void 0&&(e=Ts(e,1/i,r)),e}function Al(e,t=0,n=1,r=.5,i,a=e,o=e){if(yr.test(t)&&(t=parseFloat(t),t=V(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=V(a.min,a.max,r);e===a&&(s-=t),e.min=kl(e.min,t,n,s,i),e.max=kl(e.max,t,n,s,i)}function jl(e,t,[n,r,i],a,o){Al(e,t[n],t[r],t[i],t.scale,a,o)}var Ml=[`x`,`scaleX`,`originX`],Nl=[`y`,`scaleY`,`originY`];function Pl(e,t,n,r){jl(e.x,t,Ml,n?n.x:void 0,r?r.x:void 0),jl(e.y,t,Nl,n?n.y:void 0,r?r.y:void 0)}function Fl(e){return e.translate===0&&e.scale===1}function Il(e){return Fl(e.x)&&Fl(e.y)}function Ll(e,t){return e.min===t.min&&e.max===t.max}function Rl(e,t){return Ll(e.x,t.x)&&Ll(e.y,t.y)}function zl(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Bl(e,t){return zl(e.x,t.x)&&zl(e.y,t.y)}function Vl(e){return xl(e.x)/xl(e.y)}function Hl(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ul(e){return[e(`x`),e(`y`)]}function Wl(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 Gl=rs.length,Kl=e=>typeof e==`string`?parseFloat(e):e,ql=e=>typeof e==`number`||B.test(e);function Jl(e,t,n,r,i,a){i?(e.opacity=V(0,n.opacity??1,Xl(r)),e.opacityExit=V(t.opacity??1,0,Zl(r))):a&&(e.opacity=V(t.opacity??1,n.opacity??1,r));for(let i=0;i<Gl;i++){let a=rs[i],o=Yl(t,a),s=Yl(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||ql(o)===ql(s)?(e[a]=Math.max(V(Kl(o),Kl(s),r),0),(yr.test(s)||yr.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=V(t.rotate||0,n.rotate||0,r))}function Yl(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Xl=Ql(0,.5,jn),Zl=Ql(.5,.95,fn);function Ql(e,t,n){return r=>r<e?0:r>t?1:n(mn(e,t,r))}function $l(e,t,n){let r=Ro(e)?e:go(e);return r.start(Eo(``,r,t,n)),r.animation}function eu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var tu=(e,t)=>e.depth-t.depth,nu=class{constructor(){this.children=[],this.isDirty=!1}add(e){rn(this.children,e),this.isDirty=!0}remove(e){an(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(tu),this.isDirty=!1,this.children.forEach(e)}};function ru(e,t){let n=Xn.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Gn(r),e(a-t))};return z.setup(r,!0),()=>Gn(r)}function iu(e){return Ro(e)?e.get():e}var au=class{constructor(){this.members=[]}add(e){rn(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&&(an(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(an(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)}},W={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ou={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},su=[``,`X`,`Y`,`Z`],cu=1e3,lu=0;function uu(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function du(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Ho(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,z,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&du(r)}function fu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=lu++,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,yc.value&&(ou.nodes=ou.calculatedTargetDeltas=ou.calculatedProjections=0),this.nodes.forEach(hu),this.nodes.forEach(wu),this.nodes.forEach(Tu),this.nodes.forEach(gu),yc.addProjectionMetrics&&yc.addProjectionMetrics(ou)},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 nu)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new hn),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=as(t)&&!bc(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;z.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=ru(i,250),W.hasAnimatedSinceResize&&(W.hasAnimatedSinceResize=!1,this.nodes.forEach(Cu)))})}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()||Mu,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Bl(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={...vo(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||Cu(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(),Gn(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(Eu),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&&du(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(yu),this.nodes.forEach(vu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(bu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(xu),this.nodes.forEach(Su),this.nodes.forEach(pu),this.nodes.forEach(mu)):this.nodes.forEach(bu),this.clearAllSnapshots();let e=Xn.now();Kn.delta=on(0,1e3/60,e-Kn.timestamp),Kn.timestamp=e,Kn.isProcessing=!0,qn.update.process(Kn),qn.preRender.process(Kn),qn.render.process(Kn),Kn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Rs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(_u),this.sharedNodes.forEach(Du)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,z.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){z.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!xl(this.snapshot.measuredBox.x)&&!xl(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&&!Il(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Ss(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)),Iu(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(Ru))){let{scroll:e}=this.root;e&&(Ms(t.x,e.offset.x),Ms(t.y,e.offset.y))}return t}removeElementScroll(e){let t=wc();if(hl(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&&hl(t,e),Ms(t.x,i.offset.x),Ms(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||wc();hl(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&&(Ms(r.x,-n.scroll.offset.x),Ms(r.y,-n.scroll.offset.y)),Ss(n.latestValues)&&Fs(r,n.latestValues,n.layout?.layoutBox)}return Ss(this.latestValues)&&Fs(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=wc();hl(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Ss(n.latestValues))continue;let r;n.instance&&(xs(n.latestValues)&&n.updateSnapshot(),r=wc(),hl(r,n.measurePageBox())),Pl(t,n.latestValues,n.snapshot?.layoutBox,r)}return Ss(this.latestValues)&&Pl(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||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!==Kn.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=Kn.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(),El(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):hl(this.target,this.layout.layoutBox),Os(this.target,this.targetDelta)):hl(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),yc.value&&ou.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||xs(this.parent.latestValues)||Cs(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(),Ol(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),hl(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===Kn.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;hl(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;js(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():(gl(this.prevProjectionDelta.x,this.projectionDelta.x),gl(this.prevProjectionDelta.y,this.projectionDelta.y)),wl(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Hl(this.projectionDelta.x,this.prevProjectionDelta.x)||!Hl(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),yc.value&&ou.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=Sc(),this.projectionDelta=Sc(),this.projectionDeltaWithTransform=Sc()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Sc();(!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(ju));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=V(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=V(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Ou(o.x,e.x,n),Ou(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ol(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Au(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Rl(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=wc(),hl(f,this.relativeTarget)),c&&(this.animationValues=a,Jl(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&&=(Gn(this.pendingAnimation),void 0),this.pendingAnimation=z.update(()=>{W.hasAnimatedSinceResize=!0,this.motionValue||=go(0),this.motionValue.jump(0,!1),this.currentAnimation=$l(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),Ui(this.currentAnimation,this),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(cu),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Lu(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||wc();let t=xl(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=xl(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}hl(t,i),Fs(t,r),wl(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new au),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}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&&uu(`z`,e,r,this.animationValues);for(let t=0;t<su.length;t++)uu(`rotate${su[t]}`,e,r,this.animationValues),uu(`skew${su[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=iu(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=iu(t?.pointerEvents)||``),this.hasProjected&&!Ss(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Wl(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`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Jc){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Jc[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?iu(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(vu),this.root.sharedNodes.clear()}}}function pu(e){e.updateLayout()}function mu(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`)Ul(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=xl(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;ml(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Lu(i,t.layoutBox,n)&&Ul(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=xl(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=Sc();wl(o,n,t.layoutBox);let s=Sc();a?wl(s,e.applyTransform(r,!0),t.measuredBox):wl(s,n,t.layoutBox);let c=!Il(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();Ol(s,t.layoutBox,i.layoutBox,o);let c=wc();Ol(c,n,a.layoutBox,o),Bl(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 hu(e){yc.value&&ou.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 gu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function _u(e){e.clearSnapshot()}function vu(e){e.clearMeasurements()}function yu(e){e.isLayoutDirty=!0,e.updateLayout()}function bu(e){e.isLayoutDirty=!1}function xu(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Su(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Cu(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function wu(e){e.resolveTargetDelta()}function Tu(e){e.calcProjection()}function Eu(e){e.resetSkewAndRotation()}function Du(e){e.removeLeadSnapshot()}function Ou(e,t,n){e.translate=V(t.translate,0,n),e.scale=V(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ku(e,t,n,r){e.min=V(t.min,n.min,r),e.max=V(t.max,n.max,r)}function Au(e,t,n,r){ku(e.x,t.x,n.x,r),ku(e.y,t.y,n.y,r)}function ju(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Mu={duration:.45,ease:[.4,0,.1,1]},Nu=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Pu=Nu(`applewebkit/`)&&!Nu(`chrome/`)?Math.round:fn;function Fu(e){e.min=Pu(e.min),e.max=Pu(e.max)}function Iu(e){Fu(e.x),Fu(e.y)}function Lu(e,t,n){return e===`position`||e===`preserve-aspect`&&!Sl(Vl(t),Vl(n),.2)}function Ru(e){return e!==e.root&&e.scroll?.wasRoot}var zu=fu({attachResizeListener:(e,t)=>eu(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Bu={current:void 0},Vu=fu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Bu.current){let e=new zu({});e.mount(window),e.setOptions({layoutScroll:!0}),Bu.current=e}return Bu.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Hu=(0,v.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Uu(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Wu(...e){return t=>{let n=!1,r=e.map(e=>{let r=Uu(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():Uu(e[t],null)}}}}function Gu(...e){return v.useCallback(Wu(...e),e)}var Ku=class extends v.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(is(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=is(e)&&e.offsetWidth||0,r=is(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 qu({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,v.useId)(),s=(0,v.useRef)(null),c=(0,v.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,v.useContext)(Hu),u=Gu(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,v.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(`
8
+ `+e.stack}}var Ie=Object.prototype.hasOwnProperty,Le=t.unstable_scheduleCallback,Re=t.unstable_cancelCallback,ze=t.unstable_shouldYield,Be=t.unstable_requestPaint,Ve=t.unstable_now,He=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,We=t.unstable_UserBlockingPriority,Ge=t.unstable_NormalPriority,Ke=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Je=t.log,Ye=t.unstable_setDisableYieldValue,Xe=null,Ze=null;function Qe(e){if(typeof Je==`function`&&Ye(e),Ze&&typeof Ze.setStrictMode==`function`)try{Ze.setStrictMode(Xe,e)}catch{}}var $e=Math.clz32?Math.clz32:nt,et=Math.log,tt=Math.LN2;function nt(e){return e>>>=0,e===0?32:31-(et(e)/tt|0)|0}var rt=256,it=262144,at=4194304;function ot(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&-e;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 st(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=ot(n))):i=ot(o):i=ot(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ot(n))):i=ot(o)):i=ot(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 ct(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-$e(n),i=1<<r;t|=e[r],n&=~i}return t}function ut(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 dt(){var e=at;return at<<=1,!(at&62914560)&&(at=4194304),e}function ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mt(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-$e(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&&ht(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ht(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-$e(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-$e(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function _t(e,t){var n=t&-t;return n=n&42?1:vt(n),(n&(e.suspendedLanes|t))===0?n:0}function vt(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 yt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function bt(){var e=F.p;return e===0?(e=window.event,e===void 0?32:Dh(e.type)):e}function xt(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var St=Math.random().toString(36).slice(2),Ct=`__reactFiber$`+St,wt=`__reactProps$`+St,Tt=`__reactContainer$`+St,Et=`__reactEvents$`+St,Dt=`__reactListeners$`+St,Ot=`__reactHandles$`+St,kt=`__reactResources$`+St,At=`__reactMarker$`+St,jt=`__reactLoad$`+St;function Mt(e){delete e[Ct],delete e[wt],delete e[Dt],delete e[Ot]}function Nt(e){var t;if(t=e[Ct])return t;for(var n=e.parentNode;n;){if(t=n[Tt]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gm(e);e!==null;){if(n=e[Ct])return n;e=gm(e)}return t}e=n,n=e.parentNode}return null}function Pt(e){if(e=e[Ct]||e[Tt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function It(e){var t=e[kt];return t||=e[kt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Lt(e){e[At]=!0}function Rt(e){e[jt]=void 0}var zt=new Set,Bt={};function Vt(e,t){Ht(e,t),Ht(e+`Capture`,t)}function Ht(e,t){for(Bt[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var Ut=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]*$`),Wt={},Gt={};function Kt(e){return Ie.call(Gt,e)?!0:Ie.call(Wt,e)?!1:Ut.test(e)?Gt[e]=!0:(Wt[e]=!0,!1)}var R=!1;function qt(){var e=R;return R=!1,e}function Jt(e,t,n){if(Kt(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 Yt(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 Xt(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 Zt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function $t(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 en(e){if(!e._valueTracker){var t=Qt(e)?`checked`:`value`;e._valueTracker=$t(e,t,``+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var nn=/[\n"\\]/g;function rn(e){return e.replace(nn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function an(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=``+Zt(t)):e.value!==``+Zt(t)&&(e.value=``+Zt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):sn(e,Zt(n)):o===`number`&&e.value==t?sn(e,Zt(e.value)):sn(e,Zt(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=``+Zt(s):e.removeAttribute(`name`)}function on(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)){en(e);return}n=n==null?``:``+Zt(n),t=t==null?n:``+Zt(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),en(e)}function sn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function cn(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=``+Zt(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 ln(e,t,n){if(t!=null&&(t=``+Zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Zt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ge(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Zt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),en(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=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 pn(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||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(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]=``,R=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(pn(e,a,r),R=!0)}else for(var o in t)t.hasOwnProperty(o)&&pn(e,o,t[o])}function hn(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 gn=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`],[`maskType`,`mask-type`],[`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`]]),_n=/^[\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 vn(e){return _n.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function yn(){}var bn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,Cn=null;function wn(e){var t=Pt(e);if(t&&(e=t.stateNode)){var n=e[wt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(an(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="`+rn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[wt]||null;if(!a)throw Error(i(90));an(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&&tn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Sn!==null||Cn!==null)&&(Ud(),Sn&&(t=Sn,e=Cn,Cn=Sn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[wt]||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 On=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.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 Nn=i.slice(e,1<r?1-r:void 0)}function Fn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function In(){return!0}function Ln(){return!1}function Rn(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)?In:Ln,this.isPropagationStopped=Ln,this}return D(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=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=D({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,z,Gn=D({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nr,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!==z&&(z&&e.type===`mousemove`?(Un=e.screenX-z.screenX,Wn=e.screenY-z.screenY):Wn=Un=0,z=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),Kn=Rn(Gn),qn=Rn(D({},Gn,{dataTransfer:0})),Jn=Rn(D({},Vn,{relatedTarget:0})),Yn=Rn(D({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Xn=Rn(D({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Zn=Rn(D({},zn,{data:0})),Qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},$n={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`},er={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function tr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=er[e])?!!t[e]:!1}function nr(){return tr}var rr=Rn(D({},Vn,{key:function(e){if(e.key){var t=Qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?$n[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ir=Rn(D({},Gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),ar=Rn(D({},zn,{submitter:0})),or=Rn(D({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nr})),sr=Rn(D({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),cr=Rn(D({},Gn,{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})),lr=Rn(D({},zn,{newState:0,oldState:0,source:0})),ur=[9,13,27,32],dr=On&&`CompositionEvent`in window,fr=null;On&&`documentMode`in document&&(fr=document.documentMode);var pr=On&&`TextEvent`in window&&!fr,mr=On&&(!dr||fr&&8<fr&&11>=fr),hr=` `,gr=!1;function _r(e,t){switch(e){case`keyup`:return ur.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function vr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var yr=!1;function B(e,t){switch(e){case`compositionend`:return vr(t);case`keypress`:return t.which===32?(gr=!0,hr):null;case`textInput`:return e=t.data,e===hr&&gr?null:e;default:return null}}function br(e,t){if(yr)return e===`compositionend`||!dr&&_r(e,t)?(e=Pn(),Nn=Mn=jn=null,yr=!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 mr&&t.locale!==`ko`?null:t.data;default:return null}}var xr={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 Sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!xr[e.type]:t===`textarea`}function Cr(e,t,n,r){Sn?Cn?Cn.push(r):Cn=[r]:Sn=r,t=Zf(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var wr=null,Tr=null;function Er(e){Gf(e,0)}function Dr(e){if(tn(Ft(e)))return e}function Or(e,t){if(e===`change`)return t}var kr=!1;if(On){var Ar;if(On){var jr=`oninput`in document;if(!jr){var Mr=document.createElement(`div`);Mr.setAttribute(`oninput`,`return;`),jr=typeof Mr.oninput==`function`}Ar=jr}else Ar=!1;kr=Ar&&(!document.documentMode||9<document.documentMode)}function Nr(){wr&&(wr.detachEvent(`onpropertychange`,Pr),Tr=wr=null)}function Pr(e){if(e.propertyName===`value`&&Dr(Tr)){var t=[];Cr(t,Tr,e,xn(e)),En(Er,t)}}function Fr(e,t,n){e===`focusin`?(Nr(),wr=t,Tr=n,wr.attachEvent(`onpropertychange`,Pr)):e===`focusout`&&Nr()}function Ir(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Dr(Tr)}function Lr(e,t){if(e===`click`)return Dr(t)}function Rr(e,t){if(e===`input`||e===`change`)return Dr(t)}function zr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Br=typeof Object.is==`function`?Object.is:zr;function Vr(e,t){if(Br(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(!Ie.call(t,i)||!Br(e[i],t[i]))return!1}return!0}function Hr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wr(e,t){var n=Ur(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=Ur(n)}}function Gr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Hr(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=Hr(e.document)}return t}function qr(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 Jr=On&&`documentMode`in document&&11>=document.documentMode,Yr=null,Xr=null,Zr=null,Qr=!1;function $r(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qr||Yr==null||Yr!==Hr(r)||(r=Yr,`selectionStart`in r&&qr(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}),Zr&&Vr(Zr,r)||(Zr=r,r=Zf(Xr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Yr)))}function ei(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ti={animationend:ei(`Animation`,`AnimationEnd`),animationiteration:ei(`Animation`,`AnimationIteration`),animationstart:ei(`Animation`,`AnimationStart`),transitionrun:ei(`Transition`,`TransitionRun`),transitionstart:ei(`Transition`,`TransitionStart`),transitioncancel:ei(`Transition`,`TransitionCancel`),transitionend:ei(`Transition`,`TransitionEnd`)},ni={},ri={};On&&(ri=document.createElement(`div`).style,`AnimationEvent`in window||(delete ti.animationend.animation,delete ti.animationiteration.animation,delete ti.animationstart.animation),`TransitionEvent`in window||delete ti.transitionend.transition);function ii(e){if(ni[e])return ni[e];if(!ti[e])return e;var t=ti[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ri)return ni[e]=t[n];return e}var ai=ii(`animationend`),oi=ii(`animationiteration`),si=ii(`animationstart`),ci=ii(`transitionrun`),li=ii(`transitionstart`),ui=ii(`transitioncancel`),di=ii(`transitionend`),fi=new Map,pi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);pi.push(`scrollEnd`);function mi(e,t){fi.set(e,t),Vt(t,[e])}var hi=0;function gi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=wd.identifierPrefix;var n=hi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function _i(e){if(e==null||typeof e==`string`)return e;var t=null,n=Md;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function vi(e,t){return e=_i(e),t=_i(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var yi=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)},bi=[],xi=0,Si=0;function Ci(){for(var e=xi,t=Si=xi=0;t<e;){var n=bi[t];bi[t++]=null;var r=bi[t];bi[t++]=null;var i=bi[t];bi[t++]=null;var a=bi[t];if(bi[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&&Di(n,i,a)}}function wi(e,t,n,r){bi[xi++]=e,bi[xi++]=t,bi[xi++]=n,bi[xi++]=r,Si|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ti(e,t,n,r){return wi(e,t,n,r),Oi(e)}function Ei(e,t){return wi(e,null,null,t),Oi(e)}function Di(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-$e(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Oi(e){if(50<Nd)throw Nd=0,Pd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ki={};function Ai(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 ji(e,t,n,r){return new Ai(e,t,n,r)}function Mi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ni(e,t){var n=e.alternate;return n===null?(n=ji(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&1206910976,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 Pi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Fi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Mi(r)&&(s=1);else if(typeof r==`string`)s=Zm(e,n,Se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=ji(31,n,t,a),e.elementType=se,e.lanes=o,e;case j:return Ii(n.children,a,o,t);case ee:s=8,a|=24;break;case te:return e=ji(12,n,t,a|2),e.elementType=te,e.lanes=o,e;case ie:return e=ji(13,n,t,a),e.elementType=ie,e.lanes=o,e;case N:return e=ji(19,n,t,a),e.elementType=N,e.lanes=o,e;case ce:case ue:return e=a|32,e=ji(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case M:s=10;break a;case ne:s=9;break a;case re:s=11;break a;case ae:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ji(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ii(e,t,n,r){return e=ji(7,e,r,t),e.lanes=n,e}function Li(e,t,n){return e=ji(6,e,null,t),e.lanes=n,e}function Ri(e){var t=ji(18,null,null,0);return t.stateNode=e,t}function zi(e,t,n){return t=ji(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Bi=new WeakMap;function Vi(e,t){if(typeof e==`object`&&e){var n=Bi.get(e);return n===void 0?(t={value:e,source:t,stack:Fe(t)},Bi.set(e,t),t):n}return{value:e,source:t,stack:Fe(t)}}var Hi=[],Ui=0,Wi=null,Gi=0,Ki=[],qi=0,Ji=null,Yi=1,Xi=``;function Zi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Wi,Wi=e,Gi=t}function Qi(e,t,n){Ki[qi++]=Yi,Ki[qi++]=Xi,Ki[qi++]=Ji,Ji=e;var r=Yi;e=Xi;var i=32-$e(r)-1;r&=~(1<<i),n+=1;var a=32-$e(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Yi=1<<32-$e(t)+i|n<<i|r,Xi=a+e}else Yi=1<<a|n<<i|r,Xi=e}function $i(e){e.return!==null&&(Zi(e,1),Qi(e,1,0))}function ea(e){for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null;for(;e===Ji;)Ji=Ki[--qi],Ki[qi]=null,Xi=Ki[--qi],Ki[qi]=null,Yi=Ki[--qi],Ki[qi]=null}function ta(e,t){Ki[qi++]=Yi,Ki[qi++]=Xi,Ki[qi++]=Ji,Yi=t.id,Xi=t.overflow,Ji=e}var na=null,ra=null,V=!1,ia=null,aa=!1,oa=Error(i(519));function sa(e){throw pa(Vi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),oa}function ca(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[wt]=r,n){case`dialog`:J(`cancel`,t),J(`close`,t);break;case`iframe`:case`object`:case`embed`:J(`load`,t);break;case`video`:case`audio`:for(n=0;n<Uf.length;n++)J(Uf[n],t);break;case`source`:J(`error`,t);break;case`img`:case`image`:case`link`:J(`error`,t),J(`load`,t);break;case`details`:J(`toggle`,t);break;case`input`:J(`invalid`,t),on(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:J(`invalid`,t);break;case`textarea`:J(`invalid`,t),un(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||rp(t.textContent,n)?(r.popover!=null&&(J(`beforetoggle`,t),J(`toggle`,t)),r.onScroll!=null&&J(`scroll`,t),r.onScrollEnd!=null&&J(`scrollend`,t),r.onClick!=null&&(t.onclick=yn),t=!0):t=!1,t||sa(e,!0)}function la(e){for(na=e.return;na;)switch(na.tag){case 5:case 31:case 13:aa=!1;return;case 27:case 3:aa=!0;return;default:na=na.return}}function ua(e){if(e!==na)return!1;if(!V)return la(e),V=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||_p(e.type,e.memoizedProps)),n=!n),n&&ra&&sa(e),la(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ra=hm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ra=hm(e)}else t===27?(t=ra,Ep(e.type)?(e=mm,mm=null,ra=e):ra=t):ra=na?pm(e.stateNode.nextSibling):null;return!0}function da(){ra=na=null,V=!1}function fa(){var e=ia;return e!==null&&(gd===null?gd=e:gd.push.apply(gd,e),ia=null),e}function pa(e){ia===null?ia=[e]:ia.push(e)}var ma=I(null),ha=null,ga=null;function _a(e,t,n){xe(ma,t._currentValue),t._currentValue=n}function va(e){e._currentValue=ma.current,be(ma)}function ya(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 ba(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),ya(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),ya(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ya(a.return,n,e),s=a.child,s=s===null?null:s.sibling):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 xa(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;Br(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Te.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[dh]:e.push(dh))}a=a.return}return e!==null&&ba(t,e,n,r),t.flags|=262144,e!==null}function Sa(e){for(e=e.firstContext;e!==null;){if(!Br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ca(e){ha=e,ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function wa(e){return Ea(ha,e)}function Ta(e,t){return ha===null&&Ca(e),Ea(e,t)}function Ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ga===null){if(e===null)throw Error(i(308));ga=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ga=ga.next=t;return n}var Da=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()})}},Oa=t.unstable_scheduleCallback,ka=t.unstable_NormalPriority,Aa={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ja(){return{controller:new Da,data:new Map,refCount:0}}function Ma(e){e.refCount--,e.refCount===0&&Oa(ka,function(){e.controller.abort()})}function Na(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Pa=null;function Fa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ia=null,La=0,Ra=0,za=null;function Ba(e,t){if(Ia===null){var n=Ia=[];La=0,Ra=Rf(),za={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return La++,t.then(Va,Va),t}function Va(){if(--La===0&&(Pa=null,Ia!==null)){za!==null&&(za.status=`fulfilled`);var e=Ia;Ia=null,Ra=0,za=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ha(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ua=P.S;P.S=function(e,t){if(yd=Ve(),typeof t==`object`&&t&&typeof t.then==`function`&&Ba(e,t),Pa!==null)for(var n=wf;n!==null;)Na(n,Pa),n=n.next;if(n=e.types,n!==null){for(var r=wf;r!==null;)Na(r,n),r=r.next;if(Ra!==0){r=Pa,r===null&&(r=Pa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ua!==null&&Ua(e,t)};var Wa=I(null);function Ga(){var e=Wa.current;return e===null?nd.pooledCache:e}function Ka(e,t){t===null?xe(Wa,Wa.current):xe(Wa,t.pool)}function qa(){var e=Ga();return e===null?null:{parent:Aa._currentValue,pool:e}}var Ja=Error(i(460)),Ya=Error(i(474)),Xa=Error(i(542)),Za={then:function(){}};function Qa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function $a(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yn,yn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ro(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(yn,yn);else{if(e=nd,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,ro(e),e}throw to=t,Ja}}function eo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(to=e,Ja):e}}var to=null;function no(){if(to===null)throw Error(i(459));var e=to;return to=null,e}function ro(e){if(e===Ja||e===Xa)throw Error(i(483))}var io=null,ao=0;function oo(e){var t=ao;return ao+=1,io===null&&(io=[]),$a(io,e,t)}function so(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function co(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function lo(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=Ni(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Li(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===j?(e=d(e,t,n.props.children,r,n.key),so(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===oe&&eo(i)===t.type)?(t=a(t,n.props),so(t,n),t.return=e,t):(t=Fi(n.type,n.key,n.props,null,e.mode,r),so(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=zi(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=Ii(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=Li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Fi(t.type,t.key,t.props,null,e.mode,n),so(n,t),n.return=e,n;case A:return t=zi(t,e.mode,n),t.return=e,t;case oe:return t=eo(t),f(e,t,n)}if(ge(t)||pe(t))return t=Ii(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,oo(t),n);if(t.$$typeof===M)return f(e,Ta(e,t),n);co(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 k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case oe:return n=eo(n),p(e,t,n,r)}if(ge(n)||pe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,oo(n),r);if(n.$$typeof===M)return p(e,t,Ta(e,n),r);co(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=eo(r),m(e,t,n,r,i)}if(ge(r)||pe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,oo(r),i);if(r.$$typeof===M)return m(e,t,n,Ta(t,r),i);co(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),V&&Zi(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 V&&Zi(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(_.key===null?h:_.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)}),V&&Zi(i,h),l}function g(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),V&&Zi(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 V&&Zi(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(_.key===null?g:_.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)}),V&&Zi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),so(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&eo(l)===r.type){n(e,r.sibling),c=a(r,o.props),so(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ii(o.props.children,e.mode,c,o.key),so(c,o),c.return=e,e=c):(c=Fi(o.type,o.key,o.props,null,e.mode,c),so(c,o),c.return=e,e=c)}return s(e);case A: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}n(e,r);break}t(e,r),r=r.sibling}c=zi(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=eo(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(pe(o)){if(l=pe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,oo(o),c);if(o.$$typeof===M)return _(e,r,Ta(e,o),c);co(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=Li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ao=0;var i=_(e,t,n,r);return io=null,i}catch(t){if(t===Ja||t===Xa)throw t;var a=ji(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var uo=lo(!0),fo=lo(!1),po=!1;function mo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ho(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 go(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _o(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,W&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Oi(e),Di(e,null,n),t}return wi(e,r,t,n),Oi(e)}function vo(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,gt(e,n)}}function yo(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 bo=!1;function xo(){if(bo){var e=za;if(e!==null)throw e}}function So(e,t,n,r){bo=!1;var i=e.updateQueue;po=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(K&f)===f:(r&f)===f){f!==0&&f===Ra&&(bo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:po=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ud|=o,e.lanes=o,e.memoizedState=d}}function Co(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function wo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Co(n[e],t)}var To=I(null),Eo=I(0);function Do(e,t){e=cd,xe(Eo,e),xe(To,t),cd=e|t.baseLanes}function Oo(){xe(Eo,cd),xe(To,To.current)}function ko(){cd=Eo.current,be(To),be(Eo)}var Ao=I(null),jo=null;function Mo(e){var t=e.alternate;xe(Lo,Lo.current&1),xe(Ao,e),jo===null&&(t===null||To.current!==null||t.memoizedState!==null)&&(jo=e)}function No(e){xe(Lo,Lo.current),xe(Ao,e),jo===null&&(jo=e)}function Po(e){e.tag===22?(xe(Lo,Lo.current),xe(Ao,e),jo===null&&(jo=e)):Fo()}function Fo(){xe(Lo,Lo.current),xe(Ao,Ao.current)}function Io(e){be(Ao),jo===e&&(jo=null),be(Lo)}var Lo=I(0);function Ro(e,t){xe(Ao,Ao.current),xe(Lo,t)}function zo(e){be(Lo),be(Ao),jo===e&&(jo=null)}function Bo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||um(n)||dm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Vo=0,H=null,Ho=null,Uo=null,Wo=!1,Go=!1,Ko=!1,qo=0,Jo=0,Yo=null,Xo=0;function Zo(){throw Error(i(321))}function Qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Br(e[n],t[n]))return!1;return!0}function $o(e,t,n,r,i,a){return Vo=a,H=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?gc:_c,Ko=!1,a=n(r,i),Ko=!1,Go&&(a=ts(t,n,r,i)),es(e),a}function es(e){P.H=hc;var t=Ho!==null&&Ho.next!==null;if(Vo=0,Uo=Ho=H=null,Wo=!1,Jo=0,Yo=null,t)throw Error(i(300));e===null||Pc||(e=e.dependencies,e!==null&&Sa(e)&&(Pc=!0))}function ts(e,t,n,r){H=e;var a=0;do{if(Go&&(Yo=null),Jo=0,Go=!1,25<=a)throw Error(i(301));if(a+=1,Uo=Ho=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=vc,o=t(n,r)}while(Go);return o}function ns(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?ls(t):t,e=e.useState()[0],(Ho===null?null:Ho.memoizedState)!==e&&(H.flags|=1024),t}function rs(){var e=qo!==0;return qo=0,e}function is(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function as(e){if(Wo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wo=!1}Vo=0,Uo=Ho=H=null,Go=!1,Jo=qo=0,Yo=null}function os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Uo===null?H.memoizedState=Uo=e:Uo=Uo.next=e,Uo}function ss(){if(Ho===null){var e=H.alternate;e=e===null?null:e.memoizedState}else e=Ho.next;var t=Uo===null?H.memoizedState:Uo.next;if(t!==null)Uo=t,Ho=e;else{if(e===null)throw H.alternate===null?Error(i(467)):Error(i(310));Ho=e,e={memoizedState:Ho.memoizedState,baseState:Ho.baseState,baseQueue:Ho.baseQueue,queue:Ho.queue,next:null},Uo===null?H.memoizedState=Uo=e:Uo=Uo.next=e}return Uo}function cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var t=Jo;return Jo+=1,Yo===null&&(Yo=[]),e=$a(Yo,e,t),t=H,(Uo===null?t.memoizedState:Uo.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?gc:_c),e}function us(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ls(e);if(e.$$typeof===de)return;if(e.$$typeof===M)return wa(e)}throw Error(i(438,String(e)))}function ds(e){var t=null,n=H.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=H.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=cs(),H.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]=le;return t.index++,n}function fs(e,t){return typeof t==`function`?t(e):t}function ps(e){return ms(ss(),Ho,e)}function ms(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?(Vo&f)===f:(K&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===Ra&&(d=!0);else if((Vo&p)===p){u=u.next,p===Ra&&(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,H.lanes|=p,ud|=p;f=u.action,Ko&&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,H.lanes|=f,ud|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Br(o,e.memoizedState)&&(Pc=!0,d&&(n=za,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 hs(e){var t=ss(),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);Br(o,t.memoizedState)||(Pc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function gs(e,t,n){var r=H,a=ss(),o=V;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Br((Ho||a).memoizedState,n);if(s&&(a.memoizedState=n,Pc=!0),a=a.queue,Vs(ys.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Uo!==null&&!!(Uo.memoizedState.tag&1),Is(e?9:8,{destroy:void 0},vs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,nd===null)throw Error(i(349));o||Vo&127||_s(r,t,n)}return n}function _s(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=H.updateQueue,t===null?(t=cs(),H.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vs(e,t,n,r){t.value=n,t.getSnapshot=r,bs(t)&&xs(e)}function ys(e,t,n){return n(function(){bs(t)&&xs(e)})}function bs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Br(e,n)}catch{return!0}}function xs(e){var t=Ei(e,2);t!==null&&Rd(t,e,2)}function Ss(e){var t=os();if(typeof e==`function`){var n=e;if(e=n(),Ko){Qe(!0);try{n()}finally{Qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:e},t}function Cs(e,t,n,r){return e.baseState=n,ms(e,Ho,typeof r==`function`?r:fs)}function ws(e,t,n,r,a){if(fc(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)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ts(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ts(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};o.types=a===null?null:a.types,P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Es(e,t,s)}catch(n){Os(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Es(e,t,a)}catch(n){Os(e,t,n)}}function Es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ds(e,t,n)},function(n){return Os(e,t,n)}):Ds(e,t,n)}function Ds(e,t,n){t.status=`fulfilled`,t.value=n,ks(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ts(e,n)))}function Os(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ks(t),t=t.next;while(t!==r)}e.action=null}function ks(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function As(e,t){return t}function js(e,t){if(V){var n=nd.formState;if(n!==null){a:{var r=H;if(V){if(ra){b:{for(var i=ra,a=aa;i.nodeType!==8;){if(!a){i=null;break b}if(i=pm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ra=pm(i.nextSibling),r=i.data===`F!`;break a}}sa(r)}r=!1}r&&(t=n[0])}}return n=os(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:As,lastRenderedState:t},n.queue=r,n=lc.bind(null,H,r),r.dispatch=n,r=Ss(!1),a=dc.bind(null,H,!1,r.queue),r=os(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ws.bind(null,H,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ms(e){return Ns(ss(),Ho,e)}function Ns(e,t,n){if(t=ms(e,t,As)[0],e=ps(fs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ls(t)}catch(e){throw e===Ja?Xa:e}else r=t;t=ss();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(H.flags|=2048,Is(9,{destroy:void 0},Ps.bind(null,i,n),null)),[r,a,e]}function Ps(e,t){e.action=t}function Fs(e){var t=ss(),n=Ho;if(n!==null)return Ns(t,n,e);ss(),t=t.memoizedState,n=ss();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=H.updateQueue,t===null&&(t=cs(),H.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 Ls(){return ss().memoizedState}function Rs(e,t,n,r){var i=os();H.flags|=e,i.memoizedState=Is(1|t,{destroy:void 0},n,r===void 0?null:r)}function zs(e,t,n,r){var i=ss();r=r===void 0?null:r;var a=i.memoizedState.inst;Ho!==null&&r!==null&&Qo(r,Ho.memoizedState.deps)?i.memoizedState=Is(t,a,n,r):(H.flags|=e,i.memoizedState=Is(1|t,a,n,r))}function Bs(e,t){Rs(8390656,8,e,t)}function Vs(e,t){zs(2048,8,e,t)}function Hs(e){H.flags|=4;var t=H.updateQueue;if(t===null)t=cs(),H.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Us(e){var t=ss().memoizedState;return Hs({ref:t,nextImpl:e}),function(){if(W&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ws(e,t){return zs(4,2,e,t)}function Gs(e,t){return zs(4,4,e,t)}function Ks(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 qs(e,t,n){n=n==null?null:n.concat([e]),zs(4,4,Ks.bind(null,t,e),n)}function Js(){}function Ys(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xs(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qo(t,r[1]))return r[0];if(r=e(),Ko){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r}function Zs(e,t,n){return n===void 0||Vo&1073741824&&!(K&261930)?e.memoizedState=t:(e.memoizedState=n,e=Id(),H.lanes|=e,ud|=e,n)}function Qs(e,t,n,r){return Br(n,t)?n:To.current===null?!(Vo&106)||Vo&1073741824&&!(K&261930)?(Pc=!0,e.memoizedState=n):(e=Id(),H.lanes|=e,ud|=e,t):(e=Zs(e,n,r),Br(e,t)||(Pc=!0),e)}function $s(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};s.types=o===null?null:o.types,P.T=s,dc(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?uc(e,t,Ha(c,r),Fd(e)):uc(e,t,r,Fd(e))}catch(n){uc(e,t,{then:function(){},status:`rejected`,reason:n},Fd())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function ec(){}function tc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=nc(e).queue;$s(e,a,t,_e,n===null?ec:function(){return rc(e),n(r)})}function nc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rc(e){var t=nc(e);t.next===null&&(t=e.alternate.memoizedState),uc(e,t.next.queue,{},Fd())}function ic(){return wa(dh)}function ac(){return ss().memoizedState}function oc(){return ss().memoizedState}function sc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Fd();e=go(n);var r=_o(t,e,n);r!==null&&(Rd(r,t,n),vo(r,t,n)),t={cache:ja()},e.payload=t;return}t=t.return}}function cc(e,t,n){var r=Fd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fc(e)?pc(t,n):(n=Ti(e,t,n,r),n!==null&&(Rd(n,e,r),mc(n,t,r)))}function lc(e,t,n){uc(e,t,n,Fd())}function uc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fc(e))pc(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,Br(s,o))return wi(e,t,i,0),nd===null&&Ci(),!1}catch{}if(n=Ti(e,t,i,r),n!==null)return Rd(n,e,r),mc(n,t,r),!0}return!1}function dc(e,t,n,r){if(r={lane:2,revertLane:Rf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(i(479))}else t=Ti(e,n,r,2),t!==null&&Rd(t,e,2)}function fc(e){var t=e.alternate;return e===H||t!==null&&t===H}function pc(e,t){Go=Wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}var hc={readContext:wa,use:us,useCallback:Zo,useContext:Zo,useEffect:Zo,useImperativeHandle:Zo,useLayoutEffect:Zo,useInsertionEffect:Zo,useMemo:Zo,useReducer:Zo,useRef:Zo,useState:Zo,useDebugValue:Zo,useDeferredValue:Zo,useTransition:Zo,useSyncExternalStore:Zo,useId:Zo,useHostTransitionStatus:Zo,useFormState:Zo,useActionState:Zo,useOptimistic:Zo,useMemoCache:Zo,useCacheRefresh:Zo,useEffectEvent:Zo},gc={readContext:wa,use:us,useCallback:function(e,t){return os().memoizedState=[e,t===void 0?null:t],e},useContext:wa,useEffect:Bs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Rs(4194308,4,Ks.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){Rs(4,2,e,t)},useMemo:function(e,t){var n=os();t=t===void 0?null:t;var r=e();if(Ko){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=os();if(n!==void 0){var i=n(t);if(Ko){Qe(!0);try{n(t)}finally{Qe(!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=cc.bind(null,H,e),[r.memoizedState,e]},useRef:function(e){var t=os();return e={current:e},t.memoizedState=e},useState:function(e){e=Ss(e);var t=e.queue,n=lc.bind(null,H,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Js,useDeferredValue:function(e,t){return Zs(os(),e,t)},useTransition:function(){var e=Ss(!1);return e=$s.bind(null,H,e.queue,!0,!1),os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=H,a=os();if(V){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),nd===null)throw Error(i(349));K&127||_s(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Bs(ys.bind(null,r,o,e),[e]),r.flags|=2048,Is(9,{destroy:void 0},vs.bind(null,r,o,n,t),null),n},useId:function(){var e=os(),t=nd.identifierPrefix;if(V){var n=Xi,r=Yi;n=(r&~(1<<32-$e(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ic,useFormState:js,useActionState:js,useOptimistic:function(e){var t=os();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dc.bind(null,H,!0,n),n.dispatch=t,[e,t]},useMemoCache:ds,useCacheRefresh:function(){return os().memoizedState=sc.bind(null,H)},useEffectEvent:function(e){var t=os(),n={impl:e};return t.memoizedState=n,function(){if(W&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},_c={readContext:wa,use:us,useCallback:Ys,useContext:wa,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:ps,useRef:Ls,useState:function(){return ps(fs)},useDebugValue:Js,useDeferredValue:function(e,t){return Qs(ss(),Ho.memoizedState,e,t)},useTransition:function(){var e=ps(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){return Cs(ss(),Ho,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us},vc={readContext:wa,use:us,useCallback:Ys,useContext:wa,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:hs,useRef:Ls,useState:function(){return hs(fs)},useDebugValue:Js,useDeferredValue:function(e,t){var n=ss();return Ho===null?Zs(n,e,t):Qs(n,Ho.memoizedState,e,t)},useTransition:function(){var e=hs(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Fs,useActionState:Fs,useOptimistic:function(e,t){var n=ss();return Ho===null?(n.baseState=e,[e,n.queue.dispatch]):Cs(n,Ho,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us};function yc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=go(r);i.payload=t,n!=null&&(i.callback=n),t=_o(e,i,r),t!==null&&(Rd(t,e,r),vo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=go(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=_o(e,i,r),t!==null&&(Rd(t,e,r),vo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Fd(),r=go(n);r.tag=2,t!=null&&(r.callback=t),t=_o(e,r,n),t!==null&&(Rd(t,e,n),vo(t,e,n))}};function xc(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?!Vr(n,r)||!Vr(i,a):!0}function Sc(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&&bc.enqueueReplaceState(t,t.state,null)}function Cc(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=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function wc(e){yi(e)}function Tc(e){console.error(e)}function Ec(e){yi(e)}function Dc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Oc(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 kc(e,t,n){return n=go(n),n.tag=3,n.payload={element:null},n.callback=function(){Dc(e,t)},n}function Ac(e){return e=go(e),e.tag=3,e}function jc(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(){Oc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Oc(t,n,r),typeof i!=`function`&&(Sd===null?Sd=new Set([this]):Sd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Mc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&xa(t,n,a,!0),n=Ao.current,n!==null){switch(n.tag){case 31:case 13:case 19:return jo===null?Xd():n.alternate===null&&ld===0&&(ld=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Za?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),vf(e,r,a)),!1;case 22:return n.flags|=65536,r===Za?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)),vf(e,r,a)),!1}throw Error(i(435,n.tag))}return vf(e,r,a),Xd(),!1}if(V)return t=Ao.current,t===null?(r!==oa&&(t=Error(i(423),{cause:r}),pa(Vi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Vi(r,n),a=kc(e.stateNode,r,a),yo(e,a),ld!==4&&(ld=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==oa&&(e=Error(i(422),{cause:r}),pa(Vi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Vi(o,n),hd===null?hd=[o]:hd.push(o),ld!==4&&(ld=2),t===null)return!0;r=Vi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=kc(n.stateNode,r,e),yo(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`&&(Sd===null||!Sd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ac(a),jc(a,e,n,r),yo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Nc=Error(i(461)),Pc=!1;function Fc(e,t,n,r){t.child=e===null?fo(t,null,n,r):uo(t,e.child,n,r)}function Ic(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 Ca(t),r=$o(e,t,n,o,a,i),s=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(V&&s&&$i(t),t.flags|=1,Fc(e,t,r,i),t.child)}function Lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Mi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Rc(e,t,a,r,i)):(e=Fi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!dl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Vr:n,n(o,r)&&e.ref===t.ref)return ul(e,t,i)}return t.flags|=1,e=Ni(a,r),e.ref=t.ref,e.return=t,t.child=e}function Rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Vr(a,r)&&e.ref===t.ref){if(Pc=!1,t.pendingProps=r=a,dl(e,i))e.flags&131072&&(Pc=!0);else return t.lanes=e.lanes,ul(e,t,i)}}return Kc(e,t,n,r,i)}function zc(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 Vc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ka(t,a===null?null:a.cachePool),a===null?Oo():Do(t,a),Po(t);else return r=t.lanes=536870912,Vc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ka(t,null),Oo(),Fo()):(Ka(t,a.cachePool),Do(t,a),Fo(),t.memoizedState=null);return Fc(e,t,i,n),t.child}function Bc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vc(e,t,n,r,i){var a=Ga();return a=a===null?null:{parent:Aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ka(t,null),Oo(),Po(t),e!==null&&xa(e,t,r,!0),t.childLanes=i,null}function Hc(e,t){return t=tl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Uc(e,t,n){return uo(t,e.child,null,n),e=Hc(t,t.pendingProps),e.flags|=2,Io(t),t.memoizedState=null,e}function Wc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(V){if(r.mode===`hidden`)return e=Hc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bc(null,e);if(No(t),(e=ra)?(e=lm(e,aa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji===null?null:{id:Yi,overflow:Xi},retryLane:536870912,hydrationErrors:null},n=Ri(e),n.return=t,t.child=n,na=t,ra=null)):e=null,e===null)throw sa(t);return t.lanes=536870912,null}return Hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(No(t),a){if(t.flags&256)t.flags&=-257,t=Uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Pc||xa(e,t,n,!1),a=(n&e.childLanes)!==0,Pc||a){if(To.current===null){if(r=nd,r!==null&&(s=_t(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ei(e,s),Rd(r,e,s),Nc;Xd()}t=Uc(e,t,n)}else e=o.treeContext,ra=pm(s.nextSibling),na=t,V=!0,ia=null,aa=!1,e!==null&&ta(t,e),t=Hc(t,r),t.flags|=134221824;return t}return e=Ni(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gc(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 Kc(e,t,n,r,i){return Ca(t),n=$o(e,t,n,r,void 0,i),r=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(V&&r&&$i(t),t.flags|=1,Fc(e,t,n,i),t.child)}function qc(e,t,n,r,i,a){return Ca(t),t.updateQueue=null,n=ts(t,r,n,i),es(e),r=rs(),e!==null&&!Pc?(is(e,t,a),ul(e,t,a)):(V&&r&&$i(t),t.flags|=1,Fc(e,t,n,a),t.child)}function Jc(e,t,n,r,i){if(Ca(t),t.stateNode===null){var a=ki,o=n.contextType;typeof o==`object`&&o&&(a=wa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=bc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},mo(t),o=n.contextType,a.context=typeof o==`object`&&o?wa(o):ki,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(yc(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&&bc.enqueueReplaceState(a,a.state,null),So(t,r,a,i),xo(),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=Cc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ki,typeof u==`object`&&u&&(o=wa(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)&&Sc(t,a,r,o),po=!1;var f=t.memoizedState;a.state=f,So(t,r,a,i),xo(),l=t.memoizedState,s||f!==l||po?(typeof d==`function`&&(yc(t,n,d,r),l=t.memoizedState),(c=po||xc(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,ho(e,t),o=t.memoizedProps,u=Cc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ki,typeof l==`object`&&l&&(c=wa(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)&&Sc(t,a,r,c),po=!1,f=t.memoizedState,a.state=f,So(t,r,a,i),xo();var p=t.memoizedState;o!==d||f!==p||po||e!==null&&e.dependencies!==null&&Sa(e.dependencies)?(typeof s==`function`&&(yc(t,n,s,r),p=t.memoizedState),(u=po||xc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Sa(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,Gc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=uo(t,e.child,null,i),t.child=uo(t,null,n,i)):Fc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ul(e,t,i),e}function Yc(e,t,n,r){return da(),t.flags|=256,Fc(e,t,n,r),t.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:qa()}}function Qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=pd),e}function $c(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Lo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(V){if(i?Mo(t):Fo(),(e=ra)?(e=lm(e,aa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji===null?null:{id:Yi,overflow:Xi},retryLane:536870912,hydrationErrors:null},n=Ri(e),n.return=t,t.child=n,na=t,ra=null)):e=null,e===null)throw sa(t);return t.lanes=dm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Fo(),i=t.mode,a=tl({mode:`hidden`,children:a},i),r=Ii(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Zc(n),r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(null,r)):(Mo(t),el(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return rl(e,t,a,o,r,c,s,n)}return i?(Fo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ni(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ii(i,a,n,null),i.flags|=2):i=Ni(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Bc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Zc(n):(a=i.cachePool,a===null?a=qa():(s=Aa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(e.child,r)):(Mo(t),n=e.child,e=n.sibling,n=Ni(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function el(e,t){return t=tl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function tl(e,t){return e=ji(22,e,null,t),e.lanes=0,e}function nl(e,t,n){return uo(t,e.child,null,n),e=el(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Mo(t),t.flags&=-257,nl(e,t,c)):t.memoizedState===null?(Fo(),o=a.fallback,s=t.mode,a=tl({mode:`visible`,children:a.children},s),o=Ii(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,uo(t,e.child,null,c),a=t.child,a.memoizedState=Zc(c),a.childLanes=Qc(e,r,c),t.memoizedState=Xc,Bc(null,a)):(Fo(),t.child=e.child,t.flags|=128,null);if(Mo(t),dm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,pa({value:a,source:null,stack:null})),nl(e,t,c)}if(Pc||xa(e,t,c,!1),r=(c&e.childLanes)!==0,Pc||r){if(To.current!==null)return nl(e,t,c);if(r=nd,r!==null&&(a=_t(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ei(e,a),Rd(r,e,a),Nc;return um(o)||Xd(),nl(e,t,c)}return um(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ra=pm(o.nextSibling),na=t,V=!0,ia=null,aa=!1,e!==null&&ta(t,e),t=el(t,a.children),t.flags|=134221824,t)}function il(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ya(e.return,t,n)}function al(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Bo(n)===null&&(t=e),e=e.sibling}return t}function ol(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 sl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function cl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Lo.current;if(t.flags&128)return Ro(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ro(t,o),i===`backwards`&&e!==null?(sl(e),Fc(e,t,r,n),sl(e)):Fc(e,t,r,n),r=V?Gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&il(e,n,t);else if(e.tag===19)il(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`backwards`:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,sl(t)),ol(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Bo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ol(t,!0,n,null,a,r);break;case`together`:ol(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ol(t,!1,i,n,a,r)}return t.child}function ll(e,t,n){var r=t.pendingProps;return _a(t,t.type,r.value),Fc(e,t,r.children,n),t.child}function ul(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ud|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(xa(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=Ni(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ni(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Sa(e)))}function fl(e,t,n){switch(t.tag){case 3:Ee(t,t.stateNode.containerInfo),_a(t,Aa,e.memoizedState.cache),da();break;case 27:case 5:Oe(t);break;case 4:Ee(t,t.stateNode.containerInfo);break;case 10:_a(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,No(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Mo(t),t.flags|=128,null;r=xa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?$c(e,t,n):(Mo(t),e=ul(e,t,n),e===null?null:e.sibling)}Mo(t);break;case 19:if(t.flags&128)return cl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(xa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return cl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ro(t,Lo.current),r)break;return null;case 22:return t.lanes=0,zc(e,t,n,t.pendingProps);case 24:_a(t,Aa,e.memoizedState.cache)}return ul(e,t,n)}function pl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Pc=!0;else{if(!dl(e,n)&&!(t.flags&128))return Pc=!1,fl(e,t,n);Pc=!!(e.flags&131072)}}else Pc=!1,V&&t.flags&1048576&&Qi(t,Gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=eo(t.elementType),t.type=e,typeof e==`function`)Mi(e)?(r=Cc(e,r),t.tag=1,t=Jc(null,t,e,r,n)):(t.tag=0,t=Kc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===re){t.tag=11,t=Ic(null,t,e,r,n);break a}if(a===ae){t.tag=14,t=Lc(null,t,e,r,n);break a}if(a===M){t.tag=10,t.type=e,t=ll(null,t,n);break a}}throw t=he(e)||e,Error(i(306,t,``))}}return t;case 0:return Kc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Cc(r,t.pendingProps),Jc(e,t,r,a,n);case 3:a:{if(Ee(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ho(e,t),So(t,r,null,n);var s=t.memoizedState;if(r=s.cache,_a(t,Aa,r),r!==o.cache&&ba(t,[Aa],n,!0),xo(),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=Yc(e,t,r,n);break a}if(r!==a){a=Vi(Error(i(424)),t),pa(a),t=Yc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ra=pm(e.firstChild),na=t,V=!0,ia=null,aa=!0,n=fo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(da(),r===a){t=ul(e,t,n);break a}Fc(e,t,r,n)}t=t.child}return t;case 26:return Gc(e,t),e===null?(n=Lm(t.type,null,t.pendingProps,null))?t.memoizedState=n:V||(t.stateNode=gp(t.type,t.pendingProps,we.current,t)):t.memoizedState=Lm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Oe(t),e===null&&V&&(r=t.stateNode=ym(t.type,t.pendingProps,we.current),na=t,aa=!0,a=ra,Ep(t.type)?(mm=a,ra=pm(r.firstChild)):ra=a),Fc(e,t,t.pendingProps.children,n),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&V&&((a=r=ra)&&(r=sm(r,t.type,t.pendingProps,aa),r===null?a=!1:(t.stateNode=r,na=t,ra=pm(r.firstChild),aa=!1,a=!0)),a||sa(t)),Oe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,_p(a,o)?r=null:s!==null&&_p(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=$o(e,t,ns,null,null,n),dh._currentValue=a),Gc(e,t),Fc(e,t,r,n),t.child;case 6:return e===null&&V&&((e=n=ra)&&(n=cm(n,t.pendingProps,aa),n===null?e=!1:(t.stateNode=n,na=t,ra=null,e=!0)),e||sa(t)),null;case 13:return $c(e,t,n);case 4:return Ee(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=uo(t,null,r,n):Fc(e,t,r,n),t.child;case 11:return Ic(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Gc(e,t),Fc(e,t,r,n),t.child;case 8:return Fc(e,t,t.pendingProps.children,n),t.child;case 12:return Fc(e,t,t.pendingProps.children,n),t.child;case 10:return ll(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ca(t),a=wa(a),r=r(a),t.flags|=1,Fc(e,t,r,n),t.child;case 14:return Lc(e,t,t.type,t.pendingProps,n);case 15:return Rc(e,t,t.type,t.pendingProps,n);case 19:return cl(e,t,n);case 31:return Wc(e,t,n);case 22:return zc(e,t,n,t.pendingProps);case 24:return Ca(t),r=wa(Aa),e===null?(a=Ga(),a===null&&(a=nd,o=ja(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},mo(t),_a(t,Aa,a)):((e.lanes&n)!==0&&(ho(e,t),So(t,null,null,n),xo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,_a(t,Aa,r),r!==a.cache&&ba(t,[Aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),_a(t,Aa,r))),Fc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:V&&$i(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Gc(e,t),Fc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ml(e){e.flags|=4}function hl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Qm(t,r):Qm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(qd())e.flags|=8192;else throw to=Za,Ya}}else e.flags&=-16777217}function gl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!$m(t)){if(qd())e.flags|=8192;else throw to=Za,Ya}}function _l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:dt(),e.lanes|=t,md|=t)}function vl(e,t){if(!V)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function yl(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&1206910976,r|=i.flags&1206910976,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 bl(e,t,n){var r=t.pendingProps;switch(ea(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yl(t),null;case 1:return yl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),va(Aa),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ua(t)?ml(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,fa())),yl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ml(t),o===null?(yl(t),hl(t,a,null,r,n)):(yl(t),gl(t,o))):o?o===e.memoizedState?(yl(t),t.flags&=-16777217):(ml(t),yl(t),gl(t,o)):(e=e.memoizedProps,e!==r&&ml(t),yl(t),hl(t,a,e,r,n)),null;case 27:if(ke(t),n=we.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}e=Se.current,ua(t)?ca(t,e):(e=ym(a,r,n),t.stateNode=e,ml(t))}return yl(t),t.subtreeFlags&=-33554433,null;case 5:if(ke(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}if(o=Se.current,ua(t))ca(t,o);else{var s=pp(we.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[Ct]=t,o[wt]=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(op(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&&ml(t)}}return yl(t),t.subtreeFlags&=-33554433,hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=we.current,ua(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=na,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||rp(e.nodeValue,n)),e||sa(t,!0)}else e=pp(e).createTextNode(r),e[Ct]=t,t.stateNode=e}return yl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ua(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[Ct]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),e=!1}else n=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Io(t),t):(Io(t),null);if(t.flags&128)throw Error(i(558))}return yl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ua(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[Ct]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),a=!1}else a=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Io(t),t):(Io(t),null)}return Io(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),_l(t,t.updateQueue),yl(t),null);case 4:return De(),e===null&&qf(t.stateNode.containerInfo),t.flags|=67108864,yl(t),null;case 10:return va(t.type),yl(t),null;case 19:if(zo(t),r=t.memoizedState,r===null)return yl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)vl(r,!1);else{if(ld!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Bo(e),o!==null){for(t.flags|=128,vl(r,!1),e=o.updateQueue,t.updateQueue=e,_l(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Pi(n,e),n=n.sibling;return Ro(t,Lo.current&1|2),V&&Zi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ve()>bd&&(t.flags|=128,a=!0,vl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Bo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,_l(t,e),vl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!V)return yl(t),null}else 2*Ve()-r.renderingStartTime>bd&&n!==536870912&&(t.flags|=128,a=!0,vl(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ve(),e.sibling=null,o=Lo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||V?Ro(t,o):(n=o,xe(Ao,t),xe(Lo,n),jo===null&&(jo=t)),V&&Zi(t,r.treeForkCount),e}return yl(t),null;case 22:case 23:return Io(t),ko(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(yl(t),t.subtreeFlags&6&&(t.flags|=8192)):yl(t),n=t.updateQueue,n!==null&&_l(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&&be(Wa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),va(Aa),yl(t),null;case 25:return null;case 30:return t.flags|=33554432,yl(t),null}throw Error(i(156,t.tag))}function xl(e,t){switch(ea(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return va(Aa),De(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(Io(t),t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return De(),null;case 10:return va(t.type),null;case 22:case 23:return Io(t),ko(),e!==null&&be(Wa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return va(Aa),null;case 25:return null;default:return null}}function Sl(e,t){switch(ea(t),t.tag){case 3:va(Aa),De();break;case 26:case 27:case 5:ke(t);break;case 4:De();break;case 31:t.memoizedState!==null&&Io(t);break;case 13:Io(t);break;case 19:zo(t);break;case 10:va(t.type);break;case 22:case 23:Io(t),ko(),e!==null&&be(Wa);break;case 24:va(Aa)}}function Cl(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){q(t,t.return,e)}}function wl(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){q(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){q(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{wo(t,n)}catch(t){q(e,e.return,t)}}}function El(e,t,n){n.props=Cc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){q(e,t,n)}}function Dl(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:var i=e.stateNode,a=gi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Rp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new zp(e);m(e.child,!1,nm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){q(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){q(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){q(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)im(e.stateNode,t[n])}function Al(e){for(var t=e.return;t!==null&&(Nl(t)&&im(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function jl(e){for(var t=e.return;t!==null&&(Nl(t)&&am(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function Ml(e){return e.tag===5||e.tag===3||e.tag===27}function Nl(e){return e&&e.tag===7&&e.stateNode!==null}function Pl(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){q(e,e.return,t)}}function Fl(e,t,n){try{var r=e.stateNode;cp(r,e.type,n,t),r[wt]=t}catch(t){q(e,e.return,t)}}function Il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ep(e.type)||e.tag===4}function Ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Il(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&&Ep(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 Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yn)),kl(e,r),R=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Ep(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),kl(e,r),R=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Ep(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);op(t,r,n),t[Ct]=e,t[wt]=n}catch(t){q(e,e.return,t)}}var Vl=!1,Hl=null;function Ul(e){(e.tag===30||e.subtreeFlags&33554432)&&(Vl=!0)}var Wl=null;function Gl(){var e=Wl;return Wl=null,e}var Kl=0;function ql(e,t,n,r,i){return Kl=0,Jl(e.child,t,n,r,i)}function Jl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Mp(o);r.push(s),s.view&&(a=!0)}else a||Mp(o).view&&(a=!0);Vl=!0,kp(o,Kl===0?t:t+`_`+Kl,n),Kl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Jl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Yl(e,t){for(;e!==null;)e.tag===5?Ap(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Yl(e.child,t)),e=e.sibling}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Xl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=vi(t.default,t.share),t!==`none`&&(ql(e,n,t,null,!1)||Yl(e.child,!1))}e=e.sibling}}function Zl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=gi(r,n),a=vi(r.default,n.paired?r.share:r.enter);a===`none`?Xl(e):ql(e,i,a,null,!1)?(Xl(e),n.paired||t||Ld(e,r.onEnter)):Yl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e,t),e=e.sibling;else Xl(e)}function Ql(e){if(Hl!==null&&Hl.size!==0){var t=Hl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=vi(n.default,n.share);if(a!==`none`&&(ql(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ld(e,n.onShare)):Yl(e.child,!1)),t.delete(r),t.size===0)break}}}Ql(e)}e=e.sibling}}}function $l(e){if(e.tag===30){var t=e.memoizedProps,n=gi(t,e.stateNode),r=Hl===null?void 0:Hl.get(n),i=vi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(ql(e,n,i,null,!1)?r===void 0?Ld(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Hl.delete(n),Ld(e,t.onShare)):Yl(e.child,!1)),Hl!==null&&Ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Hl!==null&&Ql(e)}function eu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=gi(t,e.stateNode);t=vi(t.default,t.update),e.flags&=-5,t!==`none`&&ql(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&eu(e);e=e.sibling}}function tu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Yl(e.child,!1))}tu(e)}e=e.sibling}}function nu(e){if(e.tag===30)e.stateNode.paired=null,Yl(e.child,!1),tu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else tu(e)}function ru(e){for(e=e.child;e!==null;)e.tag===30?Yl(e.child,!1):e.subtreeFlags&33554432&&ru(e),e=e.sibling}function iu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Kl<a.length){var l=a[Kl],u=Mp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&kp(c,Kl===0?n:n+`_`+Kl,i),s&&e.flags&4||(Wl===null&&(Wl=[]),Wl.push(c,Kl===0?r:r+`_`+Kl,t.memoizedProps)),Kl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:iu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function au(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=gi(n,r),a=vi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Np)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Kl=0,i=iu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ld(e,n.onUpdate))}else e.subtreeFlags&33554432&&au(e,t);e=e.sibling}}var ou=!1,U=!1,su=!1,cu=!1,lu=typeof WeakSet==`function`?WeakSet:Set,uu=null,du=!1,fu=!1,pu=!1,mu=!1;function hu(e,t,n){if(e=e.containerInfo,dp=bh,e=Kr(e),qr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(fp={focusedElem:e,selectionRange:r},bh=!1,n=(n&335544064)===n,uu=t,t=n?9270:1024;uu!==null;){if(e=uu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&$l(r[a]);if(e.alternate===null&&e.flags&2)n&&Ul(e),gu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&$l(r),gu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ul(e),gu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,uu=r):(n&&eu(e),gu(n))}}Hl=null}function gu(e){for(;uu!==null;){var t=uu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Cc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){q(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)om(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:om(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=gi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=vi(a.default,a.update),a!==`none`&&ql(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,uu=r;break}uu=t.return}}function _u(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lu(e,n),r&4&&Cl(5,n);break;case 1:if(Lu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){q(n,n.return,e)}else{var i=Cc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){q(n,n.return,e)}}}r&64&&Tl(n),r&512&&Dl(n,n.return);break;case 3:if(Lu(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{wo(e,t)}catch(e){q(n,n.return,e)}}break;case 27:t===null&&r&4&&Bl(n);case 26:case 5:Lu(e,n),t===null&&r&4&&Pl(n),r&512&&Dl(n,n.return);break;case 12:Lu(e,n);break;case 31:Lu(e,n),r&4&&Eu(e,n);break;case 13:Lu(e,n),r&4&&Du(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=xf.bind(null,n),fm(e,n))));break;case 22:if(r=n.memoizedState!==null||ou,!r){var a=t!==null&&t.memoizedState!==null||U;t=ou,i=U,ou=r,(U=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),zu(e,n,r)):Lu(e,n),ou=t,U=i}break;case 30:Lu(e,n),r&512&&Dl(n,n.return);break;case 7:r&512&&Dl(n,n.return);default:Lu(e,n)}}function vu(e,t){for(e=e.child;e!==null;)yu(e,t),e=e.sibling}function yu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){q(e,e.return,t)}bu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,R=!0}catch(t){q(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Op(s,!0):Op(e.stateNode,!1)}catch(t){q(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&vu(e,t);break;default:vu(e,t)}}function bu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:yu(n,r);break a;case 22:n.memoizedState===null&&bu(n,r);break a;default:bu(n,r)}}e=e.sibling}}function xu(e){var t=e.alternate;t!==null&&(e.alternate=null,xu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Su=null,Cu=!1;function wu(e,t,n){for(n=n.child;n!==null;)Tu(e,t,n),n=n.sibling}function Tu(e,t,n){if(Ze&&typeof Ze.onCommitFiberUnmount==`function`)try{Ze.onCommitFiberUnmount(Xe,n)}catch{}switch(n.tag){case 26:U||Ol(n,t),wu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!U&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:U||Ol(n,t),jl(n);var r=Su,i=Cu;Ep(n.type)&&(Su=n.stateNode,Cu=!1),wu(e,t,n),bm(n.stateNode,n.type,n.memoizedProps),Su=r,Cu=i;break;case 5:U||Ol(n,t),jl(n);case 6:if(n.tag===6&&jl(n),r=Su,i=Cu,Su=null,wu(e,t,n),Su=r,Cu=i,Su!==null){if(Cu)try{(Su.nodeType===9?Su.body:Su.nodeName===`HTML`?Su.ownerDocument.body:Su).removeChild(n.stateNode),R=!0}catch(e){q(n,t,e)}else try{Su.removeChild(n.stateNode),R=!0}catch(e){q(n,t,e)}}break;case 18:Su!==null&&(Cu?(e=Su,Dp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Kh(e)):Dp(Su,n.stateNode));break;case 4:r=Su,i=Cu,Su=n.stateNode.containerInfo,Cu=!0,wu(e,t,n),Su=r,Cu=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),U||wl(4,n,t),wu(e,t,n);break;case 1:U||(Ol(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&El(n,t,r)),wu(e,t,n);break;case 21:wu(e,t,n);break;case 22:U=(r=U)||n.memoizedState!==null,wu(e,t,n),U=r;break;case 30:Ol(n,t),wu(e,t,n);break;case 7:U||Ol(n,t),wu(e,t,n);break;default:wu(e,t,n)}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Kh(e)}catch(e){q(t,t.return,e)}}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Kh(e)}catch(e){q(t,t.return,e)}}function Ou(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lu),t;default:throw Error(i(435,e.tag))}}function ku(e,t){var n=Ou(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Sf.bind(null,e,t);t.then(r,r)}})}function Au(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Ep(l.type)){Su=l.stateNode,Cu=!1;break a}break;case 5:Su=l.stateNode,Cu=!1;break a;case 3:case 4:Su=l.stateNode.containerInfo,Cu=!0;break a}l=l.return}if(Su===null)throw Error(i(160));Tu(s,c,o),Su=null,Cu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Mu(t,e,n),t=t.sibling}var ju=null;function Mu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Au(t,e,n),Nu(e),a&4&&(wl(3,e,e.return),Cl(3,e),wl(5,e,e.return));break;case 1:Au(t,e,n),Nu(e),a&512&&(U||r===null||Ol(r,r.return)),a&64&&ou&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ju,Au(t,e,n),Nu(e),a&512&&(U||r===null||Ol(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ou)e.stateNode=gp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[At]||r[Ct]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),op(r,t,n),r[Ct]=e,Lt(r),t=r;break a;case`link`:if(o=Ym(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),op(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Ym(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),op(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Ct]=e,Lt(r),t=r}e.stateNode=t}}else ou||Xm(o,e.type,e.stateNode)}else e.stateNode=Wm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Fl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||U||t.parentNode.removeChild(t)):a.count--,n===null?ou||Xm(o,e.type,e.stateNode):Wm(o,n,e.memoizedProps))}break;case 27:Au(t,e,n),Nu(e),a&512&&(U||r===null||Ol(r,r.return)),r!==null&&a&4&&Fl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=su,su=!1,Au(t,e,n),su=o,Nu(e),a&512&&(U||r===null||Ol(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),R=!0}catch(t){q(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Fl(e,t,r===null?t:r.memoizedProps)),a&1024&&(cu=!0);break;case 6:if(Au(t,e,n),Nu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,R=!0}catch(t){q(e,e.return,t)}}break;case 3:if(R=!1,Jm=null,o=ju,ju=wm(t.containerInfo),Au(t,e,n),ju=o,Nu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Kh(t.containerInfo)}catch(t){q(e,e.return,t)}cu&&(cu=!1,Pu(e)),R=!1;break;case 4:a=su,su=ou,r=qt(),o=ju,ju=wm(e.stateNode.containerInfo),Au(t,e,n),Nu(e),ju=o,R&&fu&&(pu=!0),R=r,su=a;break;case 12:Au(t,e,n),Nu(e);break;case 31:Au(t,e,n),Nu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 13:Au(t,e,n),Nu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(vd=Ve()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ou,l=U,u=su;ou=c||o,su=u||o,U=l||s,Au(t,e,n),U=l,su=u,ou=c,Nu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ou||U||(t=s||U,n=ou,r=U,ou=o||ou,U=t,Ru(e,2),ou=n,U=r),!o&&su||vu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ku(e,n))));break;case 19:Au(t,e,n),Nu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 30:a&512&&(U||r===null||Ol(r,r.return)),a=qt(),o=fu,s=(n&335544064)===n,c=e.memoizedProps,fu=s&&vi(c.default,c.update)!==`none`,Au(t,e,n),Nu(e),s&&r!==null&&R&&(e.flags|=4),fu=o,R=a;break;case 21:break;case 7:a&512&&(U||r===null||Ol(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Au(t,e,n),Nu(e)}}function Nu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Il(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Nl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ml(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;zl(e,Ll(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),zl(e,Ll(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Rl(e,Ll(e),u,s);break;default:throw Error(i(161))}}catch(t){q(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,bh=!0,t.reset(),bh=!1),e=e.sibling}}function Fu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Iu(t,e),t=t.sibling;else au(t,!1)}function Iu(e,t){var n=e.alternate;if(n===null)Zl(e,!1);else switch(e.tag){case 3:if(mu=du=!1,Gl(),Fu(t,e),!du&&!pu){if(e=Wl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ap(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),mu=!0}Wl=null;break;case 5:Fu(t,e);break;case 4:r=du,du=!1,Fu(t,e),du&&(pu=!0),du=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Fu(t,e):Zl(e,!1));break;case 30:r=du,i=Gl(),du=!1,Fu(t,e),du&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=gi(a,o),o=gi(n.memoizedProps,o);var s=vi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Kl=0,t=iu(e,n,t,o,s,a,!0),Kl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ld(e,e.memoizedProps.onUpdate),Wl=i):i!==null&&(i.push.apply(i,Wl),Wl=i),du=e.flags&32?!0:r;break;default:Fu(t,e)}}function Lu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_u(e,t.alternate,t),t=t.sibling}function Ru(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),Ru(n,r);break;case 1:Ol(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&El(n,n.return,i),Ru(n,r);break;case 27:r&2&&bm(n.stateNode,n.type,n.memoizedProps);case 5:Ol(n,n.return),n.tag!==5&&n.tag!==27||jl(n),Ru(n,r);break;case 6:jl(n);break;case 26:Ol(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||U||i.parentNode.removeChild(i),Ru(n,r);break;case 22:n.memoizedState===null&&Ru(n,r);break;case 30:Ol(n,n.return),Ru(n,r);break;case 7:Ol(n,n.return);default:Ru(n,r)}e=e.sibling}}function zu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:zu(i,a,n),Cl(4,a);break;case 1:if(zu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){q(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Co(l[i],c)}catch(e){q(r,r.return,e)}}s&&o&64&&Tl(a),Dl(a,a.return);break;case 27:n&2&&Bl(a);case 5:a.tag!==5&&a.tag!==27||Al(a),zu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 6:Al(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ou||Xm(wm(c.ownerDocument),a.type,c),zu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 12:zu(i,a,n);break;case 31:zu(i,a,n),s&&o&4&&Eu(i,a);break;case 13:zu(i,a,n),s&&o&4&&Du(i,a);break;case 22:a.memoizedState===null&&zu(i,a,n),Dl(a,a.return);break;case 30:zu(i,a,n),Dl(a,a.return);break;case 7:Dl(a,a.return);default:zu(i,a,n)}t=t.sibling}}function Bu(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&&Ma(n))}function Vu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ma(e))}function Hu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Uu(e,t,n,r),t=t.sibling;else i&&ru(t)}function Uu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&nu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Hu(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Hu(e,t,n,r);break;case 3:Hu(e,t,n,r),i&&mu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ma(a)));break;case 12:if(a&2048){Hu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){q(t,t.return,e)}}else Hu(e,t,n,r);break;case 31:Hu(e,t,n,r);break;case 13:Hu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&nu(t),o._visibility&2?Hu(e,t,n,r):(o._visibility|=2,Wu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&nu(s),o._visibility&2?Hu(e,t,n,r):Gu(e,t)),a&2048&&Bu(s,t);break;case 24:Hu(e,t,n,r),a&2048&&Vu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Yl(a.child,!0),Yl(t.child,!0))),Hu(e,t,n,r);break;default:Hu(e,t,n,r)}}function Wu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!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:Wu(a,o,s,c,i),Cl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Wu(a,o,s,c,i)):u._visibility&2?Wu(a,o,s,c,i):Gu(a,o),i&&l&2048&&Bu(o.alternate,o);break;case 24:Wu(a,o,s,c,i),i&&l&2048&&Vu(o.alternate,o);break;default:Wu(a,o,s,c,i)}t=t.sibling}}function Gu(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:Gu(n,r),i&2048&&Bu(r.alternate,r);break;case 24:Gu(n,r),i&2048&&Vu(r.alternate,r);break;default:Gu(n,r)}t=t.sibling}}var Ku=8192;function qu(e,t,n){if(e.subtreeFlags&Ku)for(e=e.child;e!==null;)Ju(e,t,n),e=e.sibling}function Ju(e,t,n){switch(e.tag){case 26:qu(e,t,n),e.flags&Ku&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&th(n,e)):nh(n,ju,e.memoizedState,e.memoizedProps));break;case 5:qu(e,t,n),e.flags&Ku&&(e=e.stateNode,(t&335544128)===t&&th(n,e));break;case 3:case 4:var r=ju;ju=wm(e.stateNode.containerInfo),qu(e,t,n),ju=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ku,Ku=16777216,qu(e,t,n),Ku=r):qu(e,t,n));break;case 30:if((e.flags&Ku)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Hl===null&&(Hl=new Map),Hl.set(r,i)}qu(e,t,n);break;default:qu(e,t,n)}}function Yu(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 Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zu(e),e=e.sibling}function Zu(e){switch(e.tag){case 0:case 11:case 15:Xu(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Xu(e);break;case 12:Xu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qu(e)):Xu(e);break;default:Xu(e)}}function Qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wl(8,t,t.return),Qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Qu(t));break;default:Qu(t)}e=e.sibling}}function $u(e,t){for(;uu!==null;){var n=uu;switch(n.tag){case 0:case 11:case 15:wl(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:Ma(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,uu=r;else a:for(n=e;uu!==null;){r=uu;var i=r.sibling,a=r.return;if(xu(r),r===n){uu=null;break a}if(i!==null){i.return=a,uu=i;break a}uu=a}}}var ed={getCacheForType:function(e){var t=wa(Aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return wa(Aa).controller.signal}},td=typeof WeakMap==`function`?WeakMap:Map,W=0,nd=null,G=null,K=0,rd=0,id=null,ad=!1,od=!1,sd=!1,cd=0,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=null,gd=null,_d=!1,vd=0,yd=0,bd=1/0,xd=null,Sd=null,Cd=0,wd=null,Td=null,Ed=0,Dd=0,Od=null,kd=null,Ad=null,jd=null,Md=null,Nd=0,Pd=null;function Fd(){return W&2&&K!==0?K&-K:P.T===null?bt():Rf()}function Id(){if(pd===0){if(!(K&536870912)||V){var e=it;it<<=1,!(it&3932160)&&(it=262144),pd=e}else pd=536870912}return e=Ao.current,e!==null&&(e.flags|=32),pd}function Ld(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Rp(gi(e.memoizedProps,n))),jd===null&&(jd=[]),jd.push(t.bind(null,r))}}function Rd(e,t,n){(e===nd&&(rd===2||rd===9)||e.cancelPendingCommit!==null)&&(Gd(e,0),Hd(e,K,pd,!1)),pt(e,n),(!(W&2)||e!==nd)&&(e===nd&&(!(W&2)&&(dd|=n),ld===4&&Hd(e,K,pd,!1)),Af(e))}function zd(e,t,n){if(W&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ct(e,t),a=r?$d(e,t):Zd(e,t,!0),o=r;do{if(a===0){od&&!r&&Hd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Vd(n)){a=Zd(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=hd;var l=c.current.memoizedState.isDehydrated;if(l&&(Gd(c,s).flags|=256),s=Zd(c,s,!1),s!==2&&s!==6){if(sd&&!l){c.errorRecoveryDisabledLanes|=o,dd|=o,a=4;break a}o=gd,gd=a,o!==null&&(gd===null?gd=o:gd.push.apply(gd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Gd(e,0),Hd(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&&(t&62914560)!==t)break;case 6:Hd(r,t,pd,!ad);break a;case 2:gd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=vd+300-Ve(),10<a)){if(Hd(r,t,pd,!ad),st(r,0,!0)!==0)break a;Ed=t,r.timeoutHandle=bp(Bd.bind(null,r,n,gd,xd,_d,t,pd,dd,md,ad,o,`Throttled`,-0,0),a);break a}Bd(r,n,gd,xd,_d,t,pd,dd,md,ad,o,null,-0,0)}break}while(1);Af(e)}function Bd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},Hl=null,Ju(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=oh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?vd-Ve():(a&4194048)===a?yd-Ve():0,m=ih(d,m),m!==null)){Ed=a,e.cancelPendingCommit=m(sf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Hd(e,a,o,!l);return}sf(e,t,a,n,r,i,o,s,c,l,u,d)}function Vd(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(!Br(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 Hd(e,t,n,r){t=lt(e,t),t&=~fd,t&=~dd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-$e(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ht(e,n,t)}function Ud(){return W&6?!0:(jf(0,!1),!1)}function Wd(){if(G!==null){if(rd===0)var e=G.return;else e=G,ga=ha=null,as(e),io=null,ao=0,e=G;for(;e!==null;)Sl(e.alternate,e),e=e.return;G=null}}function Gd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,xp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ed=0,Wd(),nd=e,G=n=Ni(e.current,null),K=t,rd=0,id=null,ad=!1,od=ct(e,t),sd=!1,md=pd=fd=dd=ud=ld=0,gd=hd=null,_d=!1,cd=lt(e,t),Ci(),n}function Kd(e,t){H=null,P.H=hc,t===Ja||t===Xa?(t=no(),rd=3):t===Ya?(t=no(),rd=4):rd=t===Nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,id=t,G===null&&(ld=1,Dc(e,Vi(t,e.current)))}function qd(){var e=Ao.current;return e===null?!0:(K&4194048)===K?jo===null:(K&62914560)===K||K&536870912?e===jo:!1}function Jd(){var e=P.H;return P.H=hc,e===null?hc:e}function Yd(){var e=P.A;return P.A=ed,e}function Xd(){ld=4,ad||(K&4194048)!==K&&Ao.current!==null||(od=!0),!(ud&134217727)&&!(dd&134217727)||nd===null||Hd(nd,K,pd,!1)}function Zd(e,t,n){var r=W;W|=2;var i=Jd(),a=Yd();(nd!==e||K!==t)&&(xd=null,Gd(e,t)),t=!1;var o=ld;a:do try{if(rd!==0&&G!==null){var s=G,c=id;switch(rd){case 8:Wd(),o=6;break a;case 3:case 2:case 9:case 6:Ao.current===null&&(t=!0);var l=rd;if(rd=0,id=null,rf(e,s,c,l),n&&od){o=0;break a}break;default:l=rd,rd=0,id=null,rf(e,s,c,l)}}Qd(),o=ld;break}catch(t){Kd(e,t)}while(1);return t&&e.shellSuspendCounter++,ga=ha=null,W=r,P.H=i,P.A=a,G===null&&(nd=null,K=0,Ci()),o}function Qd(){for(;G!==null;)tf(G)}function $d(e,t){var n=W;W|=2;var r=Jd(),a=Yd();nd!==e||K!==t?(xd=null,bd=Ve()+500,Gd(e,t)):od=ct(e,t);a:do try{if(rd!==0&&G!==null){t=G;var o=id;b:switch(rd){case 1:rd=0,id=null,rf(e,t,o,1);break;case 2:case 9:if(Qa(o)){rd=0,id=null,nf(t);break}t=function(){rd!==2&&rd!==9||nd!==e||(rd=7),Af(e)},o.then(t,t);break a;case 3:rd=7;break a;case 4:rd=5;break a;case 7:Qa(o)?(rd=0,id=null,nf(t)):(rd=0,id=null,rf(e,t,o,7));break;case 5:var s=null;switch(G.tag){case 26:s=G.memoizedState;case 5:case 27:var c=G;if(s?$m(s):c.stateNode.complete){rd=0,id=null;var l=c.sibling;if(l!==null)G=l;else{var u=c.return;u===null?G=null:(G=u,af(u))}break b}}rd=0,id=null,rf(e,t,o,5);break;case 6:rd=0,id=null,rf(e,t,o,6);break;case 8:Wd(),ld=6;break a;default:throw Error(i(462))}}ef();break}catch(t){Kd(e,t)}while(1);return ga=ha=null,P.H=r,P.A=a,W=n,G===null?(nd=null,K=0,Ci(),ld):0}function ef(){for(;G!==null&&!ze();)tf(G)}function tf(e){var t=pl(e.alternate,e,cd);e.memoizedProps=e.pendingProps,t===null?af(e):G=t}function nf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=qc(n,t,t.pendingProps,t.type,void 0,K);break;case 11:t=qc(n,t,t.pendingProps,t.type.render,t.ref,K);break;case 5:as(t);var r=t;r===na&&(V?(la(r),r.tag===5&&r.stateNode!=null&&(ra=r.stateNode)):(la(r),V=!0));default:Sl(n,t),t=G=Pi(t,cd),t=pl(n,t,cd)}e.memoizedProps=e.pendingProps,t===null?af(e):G=t}function rf(e,t,n,r){ga=ha=null,as(t),io=null,ao=0;var i=t.return;try{if(Mc(e,i,t,n,K)){ld=1,Dc(e,Vi(n,e.current)),G=null;return}}catch(t){if(i!==null)throw G=i,t;ld=1,Dc(e,Vi(n,e.current)),G=null;return}t.flags&32768?(V||r===1?e=!0:od||K&536870912?e=!1:(ad=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ao.current,r!==null&&r.tag===13&&(r.flags|=16384))),of(t,e)):af(t)}function af(e){var t=e;do{if(t.flags&32768){of(t,ad);return}e=t.return;var n=bl(t.alternate,t,cd);if(n!==null){G=n;return}if(t=t.sibling,t!==null){G=t;return}G=t=e}while(t!==null);ld===0&&(ld=5)}function of(e,t){do{var n=xl(e.alternate,e);if(n!==null){n.flags&=32767,G=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){G=e;return}G=e=n}while(e!==null);ld=6,G=null}function sf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do hf();while(Cd!==0);if(W&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===nd&&(G=nd=null,K=0),Td=t,wd=e,Ed=n,Od=a,kd=r,cf(e,t,n,s,c,l,f)}}function cf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Dd=s,s|=Si,mt(e,n,s,r,i,a),jd=null,(n&335544064)===n?(Md=Fa(e),r=10262):(Md=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Cf(Ge,function(){return gf(),null})):(e.callbackNode=null,e.callbackPriority=0),Vl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=P.T,P.T=null,i=F.p,F.p=2,a=W,W|=4;try{hu(e,t,n)}finally{W=a,F.p=i,P.T=r}}Cd=1,Vl?Ad=Ip(o,e.containerInfo,Md,df,ff,uf,pf,gf,lf,null,null):(df(),ff(),pf())}function lf(e){if(Cd!==0){var t=wd.onRecoverableError;t(e,{componentStack:null})}}function uf(){Cd===3&&(Cd=0,Iu(Td,wd),Cd=4)}function df(){if(Cd===1){Cd=0;var e=wd,t=Td,n=Ed,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=P.T,P.T=null;var i=F.p;F.p=2;var a=W;W|=4;try{fu=pu=!1,Mu(t,e,n),n=fp;var o=Kr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Gr(s.ownerDocument.documentElement,s)){if(c!==null&&qr(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 _=Wr(s,h),v=Wr(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}}bh=!!dp,fp=dp=null}finally{W=a,F.p=i,P.T=r}}e.current=t,Cd=2}}function ff(){if(Cd===2){Cd=0;var e=wd,t=Td,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=W;W|=4;try{_u(e,t.alternate,t)}finally{W=i,F.p=r,P.T=n}}Cd=3}}function pf(){if(Cd===4||Cd===3){Cd=0;var e=Ad;Ad=null,Be();var t=wd,n=Td,r=Ed,i=kd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Cd=5:(Cd=0,Td=wd=null,mf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Sd=null),yt(r),n=n.stateNode,Ze&&typeof Ze.onCommitFiberRoot==`function`)try{Ze.onCommitFiberRoot(Xe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=P.T,a=F.p,F.p=2,P.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{P.T=n,F.p=a}}if(i=jd,o=Md,Md=null,i!==null&&(jd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Ed&3&&hf(),Af(t),a=t.pendingLanes,r&261930&&a&42?t===Pd?Nd++:(Nd=0,Pd=t):(Nd=0,Pd=null),jf(0,!1)}}function mf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ma(t)))}function hf(){return Ad!==null&&(Ad.skipTransition(),Ad=null),df(),ff(),pf(),gf()}function gf(){if(Cd!==5)return!1;var e=wd,t=Dd;Dd=0;var n=yt(Ed),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=Od,Od=null;var o=wd,s=Ed;if(Cd=0,Td=wd=null,Ed=0,W&6)throw Error(i(331));var c=W;if(W|=4,Zu(o.current),Uu(o,o.current,s,n),W=c,jf(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot==`function`)try{Ze.onPostCommitFiberRoot(Xe,o)}catch{}return!0}finally{F.p=a,P.T=r,mf(e,t)}}function _f(e,t,n){t=Vi(n,t),t=kc(e.stateNode,t,2),e=_o(e,t,2),e!==null&&(pt(e,2),Af(e))}function q(e,t,n){if(e.tag===3)_f(e,e,n);else for(;t!==null;){if(t.tag===3){_f(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Sd===null||!Sd.has(r))){e=Vi(n,e),n=Ac(2),r=_o(t,n,2),r!==null&&(jc(n,r,t,e),pt(r,2),Af(r));break}}t=t.return}}function vf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new td;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)||(sd=!0,i.add(n),e=yf.bind(null,e,t,n),t.then(e,e))}function yf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,nd===e&&(K&n)===n&&(ld===4||ld===3&&(K&62914560)===K&&300>Ve()-vd?W&2?fd|=n:Gd(e,0):fd|=n,md===K&&(md=0)),Af(e)}function bf(e,t){t===0&&(t=dt()),e=Ei(e,t),e!==null&&(pt(e,t),Af(e))}function xf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bf(e,n)}function Sf(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),bf(e,n)}function Cf(e,t){return Le(e,t)}var wf=null,Tf=null,Ef=!1,Df=!1,Of=!1,kf=0;function Af(e){e!==Tf&&e.next===null&&(Tf===null?wf=Tf=e:Tf=Tf.next=e),Df=!0,Ef||(Ef=!0,Lf())}function jf(e,t){if(!Of&&Df){Of=!0;do for(var n=!1,r=wf;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-$e(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,If(r,a))}else a=K,a=st(r,r===nd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ct(r,a)||(n=!0,If(r,a))}r=r.next}while(n);Of=!1}}function Mf(){Nf()}function Nf(){Df=Ef=!1;var e=0;kf!==0&&yp()&&(e=kf);for(var t=Ve(),n=null,r=wf;r!==null;){var i=r.next,a=Pf(r,t);a===0?(r.next=null,n===null?wf=i:n.next=i,i===null&&(Tf=n)):(n=r,(e!==0||a&3)&&(Df=!0)),r=i}Cd!==0&&Cd!==5||jf(e,!1),kf!==0&&(kf=0)}function Pf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-$e(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ut(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=nd,n=K,n=st(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(rd===2||rd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Re(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ct(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Re(r),yt(n)){case 2:case 8:n=We;break;case 32:n=Ge;break;case 268435456:n=qe;break;default:n=Ge}return r=Ff.bind(null,e),n=Le(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Re(r),e.callbackPriority=2,e.callbackNode=null,2}function Ff(e,t){if(Cd!==0&&Cd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(hf()&&e.callbackNode!==n)return null;var r=K;return r=st(e,e===nd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(zd(e,r,t),Pf(e,Ve()),e.callbackNode!=null&&e.callbackNode===n?Ff.bind(null,e):null)}function If(e,t){if(hf())return null;zd(e,t,!0)}function Lf(){wp(function(){W&6?Le(Ue,Mf):Nf()})}function Rf(){if(kf===0){var e=Ra;e===0&&(e=rt,rt<<=1,!(rt&261888)&&(rt=256)),kf=e}return kf}function zf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:vn(e)}function Bf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=zf((i[wt]||null).action),o=r.submitter;o&&(t=(t=o[wt]||null)?zf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(kf!==0){var e=new FormData(i,o);tc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),tc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Vf=0;Vf<pi.length;Vf++){var Hf=pi[Vf];mi(Hf.toLowerCase(),`on`+(Hf[0].toUpperCase()+Hf.slice(1)))}mi(ai,`onAnimationEnd`),mi(oi,`onAnimationIteration`),mi(si,`onAnimationStart`),mi(`dblclick`,`onDoubleClick`),mi(`focusin`,`onFocus`),mi(`focusout`,`onBlur`),mi(ci,`onTransitionRun`),mi(li,`onTransitionStart`),mi(ui,`onTransitionCancel`),mi(di,`onTransitionEnd`),Ht(`onMouseEnter`,[`mouseout`,`mouseover`]),Ht(`onMouseLeave`,[`mouseout`,`mouseover`]),Ht(`onPointerEnter`,[`pointerout`,`pointerover`]),Ht(`onPointerLeave`,[`pointerout`,`pointerover`]),Vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Uf=`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(` `),Wf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Uf));function Gf(e,t){t=!!(t&4);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){yi(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){yi(e)}i.currentTarget=null,a=c}}}}function J(e,t){var n=t[Et];n===void 0&&(n=t[Et]=new Set);var r=e+`__bubble`;n.has(r)||(Jf(t,e,2,!1),n.add(r))}function Kf(e,t,n){var r=0;t&&(r|=4),Jf(n,e,r,t)}var Y=`_reactListening`+Math.random().toString(36).slice(2);function qf(e){if(!e[Y]){e[Y]=!0,zt.forEach(function(t){t!==`selectionchange`&&(Wf.has(t)||Kf(t,!1,e),Kf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Y]||(t[Y]=!0,Kf(`selectionchange`,!1,t))}}function Jf(e,t,n,r){switch(Dh(t)){case 2:var i=xh;break;case 8:i=Sh;break;default:i=Ch}n=i.bind(null,t,n,e),i=void 0,!kn||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 Yf(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=Nt(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=xn(n),s=[];a:{var c=fi.get(e);if(c!==void 0){var l=Bn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:l=rr;break;case`focusin`:u=`focus`,l=Jn;break;case`focusout`:u=`blur`,l=Jn;break;case`beforeblur`:case`afterblur`:l=Jn;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=Kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=qn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=or;break;case ai:case oi:case si:l=Yn;break;case di:l=sr;break;case`scroll`:case`scrollend`:l=Hn;break;case`wheel`:l=cr;break;case`copy`:case`cut`:case`paste`:l=Xn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ir;break;case`submit`:l=ar;break;case`toggle`:case`beforetoggle`:l=lr}var d=!!(t&4),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=Dn(m,p),g!=null&&d.push(Xf(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(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==bn&&(u=n.relatedTarget||n.fromElement)&&(Nt(u)||u[Tt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Nt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ir,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ft(c),h=l==null?u:Ft(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Nt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Qf):null,c!==null&&$f(s,u,c,d,!1),l!==null&&f!==null&&$f(s,f,l,d,!0)))}a:{if(c=r?Ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Or;else if(Sr(c)){if(kr)_=Rr;else{_=Ir;var v=Fr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&hn(r.elementType)&&(_=Or):_=Lr;if(_&&=_(e,r)){Cr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ft(r):window,e){case`focusin`:(Sr(v)||v.contentEditable===`true`)&&(Yr=v,Xr=r,Zr=null);break;case`focusout`:Zr=Xr=Yr=null;break;case`mousedown`:Qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Qr=!1,$r(s,n,i);break;case`selectionchange`:if(Jr)break;case`keydown`:case`keyup`:$r(s,n,i)}var y;if(dr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else yr?_r(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(mr&&n.locale!==`ko`&&(yr||b!==`onCompositionStart`?b===`onCompositionEnd`&&yr&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,yr=!0)),v=Zf(r,b),0<v.length&&(b=new Zn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=vr(n),y!==null&&(b.data=y)))),(y=pr?B(e,n):br(e,n))&&(b=Zf(r,`onBeforeInput`),0<b.length&&(v=new Zn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Bf(s,e,r,n,i)}Gf(s,t)})}function Xf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zf(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=Dn(e,n),i!=null&&r.unshift(Xf(e,i,a)),i=Dn(e,t),i!=null&&r.push(Xf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Qf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $f(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=Dn(n,a),l!=null&&o.unshift(Xf(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push(Xf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ep=/\r\n?/g,tp=/\u0000|\uFFFD/g;function np(e){return(typeof e==`string`?e:``+e).replace(ep,`
9
+ `).replace(tp,``)}function rp(e,t){return t=np(t),np(e)===t}function ip(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(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=vn(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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ip(e,t,`name`,a.name,a,null),ip(e,t,`formEncType`,a.formEncType,a,null),ip(e,t,`formMethod`,a.formMethod,a,null),ip(e,t,`formTarget`,a.formTarget,a,null)):(ip(e,t,`encType`,a.encType,a,null),ip(e,t,`method`,a.method,a,null),ip(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&J(`scroll`,e);return;case`onScrollEnd`:r!=null&&J(`scrollend`,e);return;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));o?.__html!==n&&(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=vn(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`credentialless`: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`:J(`beforetoggle`,e),J(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Jt(e,n,r);else return}R=!0}function ap(e,t,n,r,a,o){switch(n){case`style`:mn(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&J(`scroll`,e);return;case`onScrollEnd`:r!=null&&J(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[wt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}R=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}R=!0}function op(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:J(`error`,e),J(`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:ip(e,t,o,s,n,null)}}a&&ip(e,t,`srcSet`,n.srcSet,n,null),r&&ip(e,t,`src`,n.src,n,null);return;case`input`:J(`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:ip(e,t,r,d,n,null)}}on(e,o,c,l,u,s,a,!1);return;case`select`:for(a in J(`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:ip(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in J(`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:ip(e,t,s,c,n,null)}un(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:ip(e,t,l,r,n,null)}return;case`dialog`:J(`beforetoggle`,e),J(`toggle`,e),J(`cancel`,e),J(`close`,e);break;case`iframe`:case`object`:J(`load`,e);break;case`video`:case`audio`:for(r=0;r<Uf.length;r++)J(Uf[r],e);break;case`image`:J(`error`,e),J(`load`,e);break;case`details`:J(`toggle`,e);break;case`embed`:case`source`:case`link`:J(`error`,e),J(`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:ip(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&ap(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ip(e,t,c,r,n,null))}var sp={};function cp(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)||ip(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`:m!==f&&(R=!0),o=m;break;case`name`:m!==f&&(R=!0),a=m;break;case`checked`:m!==f&&(R=!0),u=m;break;case`defaultChecked`:m!==f&&(R=!0),d=m;break;case`value`:m!==f&&(R=!0),s=m;break;case`defaultValue`:m!==f&&(R=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ip(e,t,p,m,r,f)}}an(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)||ip(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`:o!==l&&(R=!0),p=o;break;case`defaultValue`:o!==l&&(R=!0),c=o;break;case`multiple`:o!==l&&(R=!0),s=o;default:o!==l&&ip(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(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:ip(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`:a!==o&&(R=!0),p=a;break;case`defaultValue`:a!==o&&(R=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ip(e,t,s,a,r,o)}ln(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:ip(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`:p!==m&&(R=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ip(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)&&ip(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:ip(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&ap(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||ap(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ip(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||ip(e,t,f,p,r,m)}function lp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function up(){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&&lp(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&&lp(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 dp=null,fp=null;function pp(e){return e.nodeType===9?e:e.ownerDocument}function mp(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 hp(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 gp(e,t,n,r){return n=pp(n).createElement(e),n[Ct]=r,n[wt]=t,op(n,e,t),Lt(n),n}function _p(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 vp=null;function yp(){var e=window.event;return e&&e.type===`popstate`?e!==vp&&(vp=e,!0):(vp=null,!1)}var bp=typeof setTimeout==`function`?setTimeout:void 0,xp=typeof clearTimeout==`function`?clearTimeout:void 0,Sp=typeof Promise==`function`?Promise:void 0,Cp=typeof requestAnimationFrame==`function`?requestAnimationFrame:bp,wp=typeof queueMicrotask==`function`?queueMicrotask:Sp===void 0?bp:function(e){return Sp.resolve(null).then(e).catch(Tp)};function Tp(e){setTimeout(function(){throw e})}function Ep(e){return e===`head`}function Dp(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),Kh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)xm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,xm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[At]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&xm(e.ownerDocument.body)}n=i}while(n);Kh(t)}function Op(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 kp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ap(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function jp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Mp(e){return jp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Np(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return jp(t,n,e)}function Pp(e){return e.documentElement.clientHeight}function Fp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Ip(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Pp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=eh(f),u>rh){s.length=o;break}f=new Promise(Fp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Lp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Lp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Lp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Lp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Rp(e){return{name:e,group:new Lp(`group`,e),imagePair:new Lp(`image-pair`,e),old:new Lp(`old`,e),new:new Lp(`new`,e)}}function zp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}zp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Wp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Hp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Bp,e,s,r)}this._eventListeners=a}};function Bp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}zp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Wp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Hp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Vp,e,n,i),r.splice(t,1),a!==null&&a()}};function Vp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Hp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Up(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Wp(e,t,n,r){if(e.length===0)return-1;r=Up(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Up(a.optionsOrUseCapture)===r)return i}return-1}zp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Hp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Hp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},zp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag!==6&&(e=b(e),_m(e,t))}zp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Kp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Gp(t[n],e);n--);};function Kp(e,t){return t.push(e),!1}zp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=pp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,qp,e,void 0,void 0))};function qp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}zp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}zp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0);for(var n=t=0;n<Xp.length;n++){var r=Xp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Xp[t++]=r}Xp.length=t}};function Yp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var Xp=[],Zp=!1;function Qp(e,t,n){Xp.push({fragmentInstance:e,observer:t,instance:n}),Zp||(Zp=!0,vm(function(){Zp=!1;var e=Xp;Xp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}zp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,$p,e,void 0,void 0),e};function $p(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}zp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},zp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Kp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||em(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function em(e,t,n,r,i){var a=Nt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function tm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}zp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Kp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),tm(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),tm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function nm(e,t){return e=b(e),rm(e,t),!1}function rm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function im(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Xp.length;i++){var a=Xp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Xp[r++]=a)}Xp.length=r,n.observe(e)}),rm(e,t))}function am(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Qp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function om(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`:om(n),Mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sm(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[At])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=pm(e.nextSibling),e===null)break}return null}function cm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pm(e.nextSibling),e===null))return null;return e}function lm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pm(e.nextSibling),e===null))return null;return e}function um(e){return e.data===`$?`||e.data===`$~`}function dm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function fm(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 pm(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 mm=null;function hm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gm(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 _m(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function vm(e){Cp(function(){Cp(function(t){return e(t)})})}function ym(e,t,n){switch(t=pp(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 bm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ip(e,t,r,null,sp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),Mt(e)}function xm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mt(e)}var Sm=new Map,Cm=new Set;function wm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Tm=F.d;F.d={f:Em,r:Dm,D:Am,C:jm,L:Mm,m:Nm,X:Fm,S:Pm,M:Im};function Em(){var e=Tm.f(),t=Ud();return e||t}function Dm(e){var t=Pt(e);t!==null&&t.tag===5&&t.type===`form`?rc(t):Tm.r(e)}var Om=typeof document>`u`?null:document;function km(e,t,n){var r=Om;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Cm.has(i)||(Cm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),op(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Am(e){Tm.D(e),km(`dns-prefetch`,e,null)}function jm(e,t){Tm.C(e,t),km(`preconnect`,e,t)}function Mm(e,t,n){Tm.L(e,t,n);var r=Om;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Rm(e);break;case`script`:a=Hm(e)}if(!(Sm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Sm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(zm(a))||t===`script`&&r.querySelector(Um(a))))){var o=r.createElement(`link`);op(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function Nm(e,t){Tm.m(e,t);var n=Om;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Hm(e)}if(!Sm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Sm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Um(a)))return}r=n.createElement(`link`),op(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function Pm(e,t,n){Tm.S(e,t,n);var r=Om;if(r&&e){var i=It(r).hoistableStyles,a=Rm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(zm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Sm.get(a))&&Km(e,n);var c=o=r.createElement(`link`);Lt(c),op(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,Gm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Fm(e,t){Tm.X(e,t);var n=Om;if(n&&e){var r=It(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),Lt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Im(e,t){Tm.M(e,t);var n=Om;if(n&&e){var r=It(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),Lt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lm(e,t,n,r){var a=(a=we.current)?wm(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`?(n=Rm(n.href),t=It(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Rm(n.href);var o=It(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(zm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Sm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Sm.set(e,o)),Vm(a,e,o,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`?(n=Hm(n),t=It(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Rm(e){return`href="`+rn(e)+`"`}function zm(e){return`link[rel="stylesheet"][`+e+`]`}function Bm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Vm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),op(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Hm(e){return`[src="`+rn(e)+`"]`}function Um(e){return`script[async]`+e}function Wm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),op(r,`style`,a),Gm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Rm(n.href);var o=e.querySelector(zm(a));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Bm(n),(a=Sm.get(a))&&Km(r,a),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),op(o,`link`,r),t.state.loading|=4,Gm(o,n.precedence,e),t.instance=o;case`script`:return o=Hm(n.src),(a=e.querySelector(Um(o)))?(t.instance=a,Lt(a),a):(r=n,(a=Sm.get(o))&&(r=D({},n),qm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Lt(a),op(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,Gm(r,n.precedence,e));return t.instance}function Gm(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 Km(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Jm=null;function Ym(e,t,n){if(Jm===null){var r=new Map,i=Jm=new Map;i.set(n,r)}else i=Jm,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[At]||a[Ct]||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 Xm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Zm(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 Qm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function $m(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function eh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function th(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=eh(t),e.suspenseyImages.push(t)),e=sh.bind(e),t.decode().then(e,e))}function nh(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=Rm(r.href),a=t.querySelector(zm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=oh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Bm(r),(i=Sm.get(i))&&Km(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),op(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=oh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var rh=0;function ih(e,t){return e.stylesheets&&e.count===0&&lh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&rh===0&&(rh=62500*up());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>rh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ah(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)lh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function oh(){this.count--,ah(this)}function sh(){this.imgCount--,ah(this)}var ch=null;function lh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ch=new Map,t.forEach(uh,e),ch=null,oh.call(e))}function uh(e,t){if(!(t.state.loading&4)){var n=ch.get(e);if(n)var r=n.get(null);else{n=new Map,ch.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=oh.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 dh={$$typeof:M,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function fh(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=ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.hiddenUpdates=ft(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function ph(e,t,n,r,i,a,o,s,c,l,u,d){return e=new fh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ji(3,null,null,t),e.current=a,a.stateNode=e,t=ja(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},mo(a),e}function mh(e){return e?(e=ki,e):ki}function hh(e,t,n,r,i,a){i=mh(i),r.context===null?r.context=i:r.pendingContext=i,r=go(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=_o(e,r,t),n!==null&&(Rd(n,e,t),vo(n,e,t))}function gh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function _h(e,t){gh(e,t),(e=e.alternate)&&gh(e,t)}function vh(e){if(e.tag===13||e.tag===31){var t=Ei(e,67108864);t!==null&&Rd(t,e,67108864),_h(e,67108864)}}function yh(e){if(e.tag===13||e.tag===31){var t=Fd();t=vt(t);var n=Ei(e,t);n!==null&&Rd(n,e,t),_h(e,t)}}var bh=!0;function xh(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,Ch(e,t,n,r)}finally{F.p=a,P.T=i}}function Sh(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,Ch(e,t,n,r)}finally{F.p=a,P.T=i}}function Ch(e,t,n,r){if(bh){var i=wh(r);if(i===null)Yf(e,t,r,Th,n),Ih(e,r);else if(Rh(i,e,t,n,r))r.stopPropagation();else if(Ih(e,r),t&4&&-1<Fh.indexOf(e)){for(;i!==null;){var a=Pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ot(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-$e(o);s.entanglements[1]|=c,o&=~c}Af(a),!(W&6)&&(bd=Ve()+500,jf(0,!1))}}break;case 31:case 13:s=Ei(a,2),s!==null&&Rd(s,a,2),Ud(),_h(a,2)}if(a=wh(r),a===null&&Yf(e,t,r,Th,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Yf(e,t,r,null,n)}}function wh(e){return e=xn(e),Eh(e)}var Th=null;function Eh(e){if(Th=null,e=Nt(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 Th=e,null}function Dh(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Oh=!1,kh=null,Ah=null,jh=null,Mh=new Map,Nh=new Map,Ph=[],Fh=`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 Ih(e,t){switch(e){case`focusin`:case`focusout`:kh=null;break;case`dragenter`:case`dragleave`:Ah=null;break;case`mouseover`:case`mouseout`:jh=null;break;case`pointerover`:case`pointerout`:Mh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Nh.delete(t.pointerId)}}function Lh(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=Pt(t),t!==null&&vh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Rh(e,t,n,r,i){switch(t){case`focusin`:return kh=Lh(kh,e,t,n,r,i),!0;case`dragenter`:return Ah=Lh(Ah,e,t,n,r,i),!0;case`mouseover`:return jh=Lh(jh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Mh.set(a,Lh(Mh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Nh.set(a,Lh(Nh.get(a)||null,e,t,n,r,i)),!0}return!1}function zh(e){var t=Nt(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,xt(e.priority,function(){yh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,xt(e.priority,function(){yh(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 Bh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Pt(n),t!==null&&vh(t),e.blockedOn=n,!1;t.shift()}return!0}function Vh(e,t,n){Bh(e)&&n.delete(t)}function Hh(){Oh=!1,kh!==null&&Bh(kh)&&(kh=null),Ah!==null&&Bh(Ah)&&(Ah=null),jh!==null&&Bh(jh)&&(jh=null),Mh.forEach(Vh),Nh.forEach(Vh)}function Uh(e,n){e.blockedOn===n&&(e.blockedOn=null,Oh||(Oh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Hh)))}var Wh=null;function Gh(e){Wh!==e&&(Wh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Wh===e&&(Wh=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(Eh(r||n)===null)continue;break}var a=Pt(n);a!==null&&(e.splice(t,3),t-=3,tc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Kh(e){function t(t){return Uh(t,e)}kh!==null&&Uh(kh,e),Ah!==null&&Uh(Ah,e),jh!==null&&Uh(jh,e),Mh.forEach(t),Nh.forEach(t);for(var n=0;n<Ph.length;n++){var r=Ph[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ph.length&&(n=Ph[0],n.blockedOn===null);)zh(n),n.blockedOn===null&&Ph.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[wt]||null;if(typeof a==`function`)o||Gh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[wt]||null)s=o.formAction;else if(Eh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Gh(n)}}}function qh(){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 Jh(e){this._internalRoot=e}Yh.prototype.render=Jh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;hh(n,Fd(),e,t,null,null)},Yh.prototype.unmount=Jh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hh(e.current,2,null,e,null,null),Ud(),t[Tt]=null}};function Yh(e){this._internalRoot=e}Yh.prototype.unstable_scheduleHydration=function(e){if(e){var t=bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ph.length&&t!==0&&t<Ph[n].priority;n++);Ph.splice(n,0,e),n===0&&zh(e)}};var Xh=n.version;if(Xh!==`19.3.0`)throw Error(i(527,Xh,`19.3.0`));F.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:f(e),e=e===null?null:e.stateNode,e};var Zh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Qh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qh.isDisabled&&Qh.supportsFiber)try{Xe=Qh.inject(Zh),Ze=Qh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=wc,s=Tc,c=Ec;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=ph(e,1,!1,null,null,n,r,null,o,s,c,qh),e[Tt]=t.current,qf(e),new Jh(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_();function b(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var x=o((e=>{var t=d();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 f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),S=o(((e,t)=>{t.exports=x()}))(),C=v.useInsertionEffect,w=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?v.useLayoutEffect:v.useEffect,T=C||w,E=e=>{let t=v.useRef([e,(...e)=>t[0](...e)]).current;return T(()=>{t[0]=e}),t[1]},D=[`popstate`,`pushState`,`replaceState`,`hashchange`],O=[],k=()=>O.forEach(e=>e()),A=e=>(O.push(e)===1&&D.forEach(e=>addEventListener(e,k)),()=>{O=O.filter(t=>t!==e),O.length||D.forEach(e=>removeEventListener(e,k))}),j=(e,t)=>(0,S.useSyncExternalStore)(A,e,t),ee=()=>location.search,te=({ssrSearch:e}={})=>j(ee,e==null?ee:()=>e),ne=()=>location.pathname,M=({ssrPath:e}={})=>j(ne,e==null?ne:()=>e),re=(e,{replace:t=!1,state:n=null}={})=>history[t?`replaceState`:`pushState`](n,``,e),ie=e=>[M(e),re],N=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[N]===void 0){for(let e of[`pushState`,`replaceState`]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,N,{value:!0})}var ae=(e=``)=>e===`/`?``:e,oe=(e,t)=>e[0]===`~`?e.slice(1):ae(t)+e,se=(e,t)=>(e=ce(ae(e)),t=ce(t),!e||!t.toLowerCase().indexOf(e.toLowerCase())?t.slice(e.length)||`/`:`~`+t),ce=e=>{try{return e.includes(`%`)?decodeURI(e):e}catch{return e}},le={hook:ie,searchHook:te,parser:b,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},ue=(0,v.createContext)(le),de=()=>(0,v.useContext)(ue),fe={},pe=(0,v.createContext)(fe),me=()=>(0,v.useContext)(pe),he=(e,t=e.base)=>se(t,e.hook(e)[0]),ge=e=>{let[t,n]=e.hook(e);return[se(e.base,t),E((t,r)=>e.aroundNav(n,oe(t,e.base),r))]},P=()=>ge(de()),F=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{pattern:t}:e(t||`*`,r),o=i.exec(n);if(!o)return[!1,null];let s={};for(let e=1;e<o.length;e++)s[e-1]=o[e];if(a)for(let e=0;e<a.length;e++)s[a[e]]=o[e+1];else Object.assign(s,o.groups);return r?[!0,s,o[0]]:[!0,s]},_e=({children:e,...t})=>{let n=de(),r=t.hook?le:n,i=r;if(t.ssrPath){let[e,n=t.ssrSearch??``]=t.ssrPath.split(`?`);e&&(t.ssrSearch=n,t.ssrPath=e)}t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let a=(0,v.useRef)(r),o=a.current,s=o;for(let e in r){let n=e===`base`?r[e]+(t[e]??``):t[e]??r[e];n!==s[e]&&(o===s&&(a.current=s={...s}),s[e]=n),(n!==r[e]||n!==i[e])&&(i=s)}return(0,v.createElement)(ue.Provider,{value:i},e)},ve=({children:e,component:t},n)=>t?(0,v.createElement)(t,{params:n}):typeof e==`function`?e(n):e,ye=e=>{let t=(0,v.useRef)(fe),n=t.current,r=Object.keys(e);return t.current=r.length!==Object.keys(n).length||r.some(t=>e[t]!==n[t])?e:n},I=({path:e,nest:t,match:n,...r})=>{let i=de(),a=he(i),[o,s,c]=n??F(i.parser,e,a,t),l=ye({...me(),...s});if(!o)return null;let u=ve(r,l);return(0,v.createElement)(pe.Provider,{value:l},c?(0,v.createElement)(_e,{base:c},u):u)},be=(0,v.forwardRef)((e,t)=>{let n=de(),[r,i]=ge(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e;return m.onClick=E(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),m.href=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n),u!==void 0&&(m.className=u?.call?u(r===o):u),t&&(m.ref=t),c&&(0,v.isValidElement)(l)?(0,v.cloneElement)(l,m):(0,v.createElement)(`a`,m,l)}),xe=(e,t=[])=>{if(Array.isArray(e))for(let n of e)xe(n&&n.type===v.Fragment?n.props.children:n,t);else t.push(e);return t},Se=({children:e,location:t})=>{let n=de(),r=he(n);for(let i of xe(e)){let e=0;if((0,v.isValidElement)(i)&&(e=F(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,v.cloneElement)(i,{match:e})}return null},Ce=e=>{let{to:t,href:n=t}=e,r=de(),[,i]=ge(r),a=E(()=>i(t||n,e)),{ssrContext:o}=r;return w(()=>{a()},[]),o&&(o.redirectTo=t),null},we=[],Te=()=>we.forEach(e=>e()),Ee=e=>(we.push(e)===1&&addEventListener(`hashchange`,Te),()=>{we=we.filter(t=>t!==e),we.length||removeEventListener(`hashchange`,Te)}),De=/^#?\/?/,Oe=()=>`/`+location.hash.replace(De,``),ke=(e,{state:t=null,replace:n=!1}={})=>{let r=location.href,[i,a]=e.replace(De,``).split(`?`),o=new URL(r);o.hash=`/${i}`,a!==void 0&&(o.search=a);let s=o.href;history[n?`replaceState`:`pushState`](t,``,s);let c=typeof HashChangeEvent<`u`?new HashChangeEvent(`hashchange`,{oldURL:r,newURL:s}):new Event(`hashchange`,{detail:{oldURL:r,newURL:s}});dispatchEvent(c)},Ae=({ssrPath:e=`/`}={})=>[(0,S.useSyncExternalStore)(Ee,Oe,()=>e),ke];Ae.hrefs=e=>`#`+e;var je=o((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})),L=o(((e,t)=>{t.exports=je()}))(),Me=v.createContext(void 0),Ne=e=>{let t=v.useContext(Me);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Pe=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,L.jsx)(Me.Provider,{value:e,children:t})),Fe={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ie=new class{#e=Fe;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Le(e){setTimeout(e,0)}var Re=typeof window>`u`||`Deno`in globalThis;function ze(){}function Be(e,t){return typeof e==`function`?e(t):e}function Ve(e){return typeof e==`number`&&e>=0&&e!==1/0}function He(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ue(e,t){return typeof e==`function`?e(t):e}function We(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Ke(o,t.options))return!1}else if(!Je(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ge(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(qe(t.options.mutationKey)!==qe(a))return!1}else if(!Je(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ke(e,t){return(t?.queryKeyHashFn||qe)(e)}function qe(e){return JSON.stringify(e,(e,t)=>$e(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Je(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!Je(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Je(e[r],t[r]))return!1;return!0}return!1}var Ye=Object.prototype.hasOwnProperty;function Xe(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Qe(e)&&Qe(t);if(!r&&!($e(e)&&$e(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Ye.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Xe(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Ze(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Qe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $e(e){if(!et(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!et(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function et(e){return Object.prototype.toString.call(e)===`[object Object]`}function tt(e){return new Promise(t=>{Ie.setTimeout(t,e)})}function nt(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Xe(e,t)}function rt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function it(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var at=Symbol();function ot(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===at?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function st(e,t){return typeof e==`function`?e(...t):!!e}function ct(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var lt=()=>Re,ut=()=>lt(),dt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ft=new class extends dt{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},pt=Le;function mt(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=pt,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ht=mt(),gt=new class extends dt{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function _t(e){return Math.min(1e3*2**e,3e4)}function vt(e){return(e??`online`)!==`online`||gt.isOnline()}var yt=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function bt(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(ze);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new yt(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>ft.isFocused()&&(e.networkMode===`always`||gt.isOnline())&&e.canRun(),p=()=>vt(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(ut()?0:3),a=e.retryDelay??_t,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),tt(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var xt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ve(this.gcTime)&&(this.#e=Ie.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ut()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Ie.clearTimeout(this.#e),this.#e=void 0)}};function St(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ct(e,()=>t.signal,()=>n=!0)},u=ot(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?it:rt;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?wt:Ct,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ct(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Ct(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function wt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Tt=class extends xt{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Ot(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ot(this.options);e.data!==void 0&&(this.setState(Dt(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=nt(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(ze).catch(ze):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ue(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===at||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Ue(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!He(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ot(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?St(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=bt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof yt&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof yt){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Et(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Dt(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ht.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Et(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vt(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Dt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ot(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var kt=class extends dt{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),jt(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Ue(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Ze(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Nt(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Ue(this.options.enabled,this.#t)!==Ue(t.enabled,this.#t)||Ue(this.options.staleTime,this.#t)!==Ue(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Ue(this.options.enabled,this.#t)!==Ue(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Ze(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ze)),t}#h(e){return!ut()&&Ue(this.options.enabled,this.#t)!==!1&&Ve(e)}#g(){this.#b();let e=Ue(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=He(this.#r.dataUpdatedAt,e)+1;this.#u=Ie.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Ue(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=Ie.setInterval(()=>{(this.options.refetchIntervalInBackground||ft.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Ie.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Ie.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&jt(e,t),o=i&&Nt(e,n,t,r);(a||o)&&(l={...l,...Et(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=nt(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=nt(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Pt(e,t),refetch:this.refetch,isEnabled:Ue(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Ze(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();ht.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function At(e,t){return Ue(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Ue(t.retryOnMount,e)!==!1)}function jt(e,t){return At(e,t)||e.state.data!==void 0&&Mt(e,t,t.refetchOnMount)}function Mt(e,t,n){if(Ue(t.enabled,e)!==!1&&Ue(t.staleTime,e)!==`static`){let r=Ue(n,e);return r===`always`||r!==!1&&Pt(e,t)}return!1}function Nt(e,t,n,r){return(e!==t||Ue(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Pt(e,n)}function Pt(e,t){return Ue(t.enabled,e)!==!1&&e.isStaleByTime(Ue(t.staleTime,e))}var Ft=class extends xt{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||It(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=bt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ht.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function It(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Lt=class extends dt{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Ft({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Rt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Rt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Rt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Rt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ht.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ge(t,e))}findAll(e={}){return this.getAll().filter(t=>Ge(e,t))}notify(e){ht.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ht.batch(()=>Promise.all(e.map(e=>e.continue().catch(ze))))}};function Rt(e){return e.options.scope?.id}var zt=class extends dt{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Ke(r,t),a=this.get(i);return a||(a=new Tt({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ht.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>We(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>We(e,t)):t}notify(e){ht.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ht.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ht.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Bt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new zt,this.#t=e.mutationCache||new Lt,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ft.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=gt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ue(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Be(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ht.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ht.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ht.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=ht.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(ze).catch(ze)}invalidateQueries(e,t={}){return ht.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ht.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(ze)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(ze)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Ue(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ue(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ze).catch(ze)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ze).catch(ze)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return gt.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(qe(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Je(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(qe(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Je(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Ke(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===at&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Vt=v.createContext(!1),Ht=()=>v.useContext(Vt);Vt.Provider;function Ut(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Wt=v.createContext(Ut()),Gt=()=>v.useContext(Wt),Kt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?st(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},R=e=>{v.useEffect(()=>{e.clearReset()},[e])},qt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||st(n,[e.error,r])),Jt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Yt=(e,t)=>e?.suspense&&t.isPending,Xt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Zt(e,t,n){let r=Ht(),i=Gt(),a=Ne(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Jt(o),Kt(o,i,s),R(i);let[l]=v.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(v.useSyncExternalStore(v.useCallback(e=>{let t=d?l.subscribe(ht.batchCalls(e)):ze;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o)},[o,l]),Yt(o,u))throw Xt(o,l,i);if(qt({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Qt(e,t){return Zt(e,kt,t)}var $t=(0,v.createContext)({});function en(e){let t=(0,v.useRef)(null);return t.current===null&&(t.current=e()),t.current}var tn=typeof window<`u`?v.useLayoutEffect:v.useEffect,nn=(0,v.createContext)(null);function rn(e,t){e.indexOf(t)===-1&&e.push(t)}function an(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var on=(e,t,n)=>n>t?t:n<e?e:n,sn={},cn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ln=e=>typeof e==`object`&&!!e,un=e=>/^0[^.\s]+$/u.test(e);function dn(e){let t;return()=>(t===void 0&&(t=e()),t)}var fn=e=>e,pn=(...e)=>e.reduce((e,t)=>n=>t(e(n))),mn=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},hn=class{constructor(){this.subscriptions=[]}add(e){return rn(this.subscriptions,e),()=>this.remove(e)}remove(e){an(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}},gn=e=>e*1e3,_n=e=>e/1e3,vn=(e,t)=>t?1e3/t*e:0,yn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,bn=1e-7,xn=12;function Sn(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=yn(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>bn&&++s<xn);return o}function Cn(e,t,n,r){if(e===t&&n===r)return fn;let i=t=>Sn(t,0,1,e,n);return e=>e===0||e===1?e:yn(i(e),t,r)}var wn=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Tn=e=>t=>1-e(1-t),En=Cn(.33,1.53,.69,.99),Dn=Tn(En),On=wn(Dn),kn=e=>e>=1?1:(e*=2)<1?.5*Dn(e):.5*(2-2**(-10*(e-1))),An=e=>1-Math.sin(Math.acos(e)),jn=Tn(An),Mn=wn(An),Nn=Cn(.42,0,1,1),Pn=Cn(0,0,.58,1),Fn=Cn(.42,0,.58,1),In=e=>Array.isArray(e)&&typeof e[0]!=`number`,Ln=e=>Array.isArray(e)&&typeof e[0]==`number`,Rn={linear:fn,easeIn:Nn,easeInOut:Fn,easeOut:Pn,circIn:An,circInOut:Mn,circOut:jn,backIn:Dn,backInOut:On,backOut:En,anticipate:kn},zn=e=>typeof e==`string`,Bn=e=>{if(Ln(e)){e.length;let[t,n,r,i]=e;return Cn(t,n,r,i)}return zn(e)?(Rn[e],`${e}`,Rn[e]):e},Vn=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Hn(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Un=40;function Wn(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Vn.reduce((e,t)=>(e[t]=Hn(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=sn.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,Un),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:Vn.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<Vn.length;t++)o[Vn[t]].cancel(e)},state:i,steps:o}}var{schedule:z,cancel:Gn,state:Kn,steps:qn}=Wn(typeof requestAnimationFrame<`u`?requestAnimationFrame:fn,!0),Jn;function Yn(){Jn=void 0}var Xn={now:()=>(Jn===void 0&&Xn.set(Kn.isProcessing||sn.useManualTiming?Kn.timestamp:performance.now()),Jn),set:e=>{Jn=e,queueMicrotask(Yn)}},Zn=e=>Math.round(e*1e5)/1e5,Qn=e=>t=>typeof t==`string`&&t.startsWith(e),$n=Qn(`--`),er=Qn(`var(--`),tr=e=>er(e)?nr.test(e.split(`/*`)[0].trim()):!1,nr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function rr(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var ir={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},ar={...ir,transform:e=>on(0,1,e)},or={...ir,default:1},sr=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function cr(e){return e==null}var lr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ur=(e,t)=>n=>!!(typeof n==`string`&&lr.test(n)&&n.startsWith(e)||t&&!cr(n)&&Object.prototype.hasOwnProperty.call(n,t)),dr=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(sr);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},fr=e=>on(0,255,e),pr={...ir,transform:e=>Math.round(fr(e))},mr={test:ur(`rgb`,`red`),parse:dr(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+pr.transform(e)+`, `+pr.transform(t)+`, `+pr.transform(n)+`, `+Zn(ar.transform(r))+`)`};function hr(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 gr={test:ur(`#`),parse:hr,transform:mr.transform},_r=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),vr=_r(`deg`),yr=_r(`%`),B=_r(`px`),br=_r(`vh`),xr=_r(`vw`),Sr={...yr,parse:e=>yr.parse(e)/100,transform:e=>yr.transform(e*100)},Cr={test:ur(`hsl`,`hue`),parse:dr(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+yr.transform(Zn(t))+`, `+yr.transform(Zn(n))+`, `+Zn(ar.transform(r))+`)`},wr={test:e=>mr.test(e)||gr.test(e)||Cr.test(e),parse:e=>mr.test(e)?mr.parse(e):Cr.test(e)?Cr.parse(e):gr.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?mr.transform(e):Cr.transform(e),getAnimatableNone:e=>{let t=wr.parse(e);return t.alpha=0,wr.transform(t)}},Tr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Er=new RegExp(sr.source),Dr=new RegExp(Tr.source,`i`);function Or(e){return isNaN(e)&&typeof e==`string`&&(Er.test(e)||Dr.test(e))}var kr=`number`,Ar=`color`,jr=`var`,Mr=`var(`,Nr="${}",Pr=/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 Fr(e){let t=e.toString();return Er.test(t)||Dr.test(t)}function Ir(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Pr,e=>(wr.test(e)?(r.color.push(a),i.push(Ar),n.push(wr.parse(e))):e.startsWith(Mr)?(r.var.push(a),i.push(jr),n.push(e)):(r.number.push(a),i.push(kr),n.push(parseFloat(e))),++a,Nr)).split(Nr),indexes:r,types:i}}function Lr(e){return Ir(e).values}function Rr({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];i+=e===kr?Zn(r[a]):e===Ar?wr.transform(r[a]):r[a]}return i}}function zr(e){return Rr(Ir(e))}var Br=e=>typeof e==`number`?0:wr.test(e)?wr.getAnimatableNone(e):e,Vr=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Br(e);function Hr(e){let t=Ir(e);return Rr(t)(t.values.map((e,n)=>Vr(e,t.split[n])))}var Ur={test:Or,parse:Lr,createTransformer:zr,getAnimatableNone:Hr};function Wr(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 Gr({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=Wr(s,r,e+1/3),a=Wr(s,r,e),o=Wr(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Kr(e,t){return n=>n>0?t:e}var qr=(e,t,n)=>e+(t-e)*n,Jr=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Yr=[gr,mr,Cr],Xr=e=>Yr.find(t=>t.test(e));function Zr(e){let t=Xr(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===Cr&&(n=Gr(n)),n}var Qr=(e,t)=>{let n=Zr(e),r=Zr(t);if(!n||!r)return Kr(e,t);let i={...n};return e=>(i.red=Jr(n.red,r.red,e),i.green=Jr(n.green,r.green,e),i.blue=Jr(n.blue,r.blue,e),i.alpha=qr(n.alpha,r.alpha,e),mr.transform(i))},$r=new Set([`none`,`hidden`]);function ei(e,t){return $r.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ti(e,t){return n=>qr(e,t,n)}function ni(e){return typeof e==`number`?ti:typeof e==`string`?tr(e)?Kr:wr.test(e)?Qr:oi:Array.isArray(e)?ri:typeof e==`object`?wr.test(e)?Qr:ii:Kr}function ri(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ni(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function ii(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ni(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function ai(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]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var oi=(e,t)=>{let n=Ur.createTransformer(t),r=Ir(e),i=Ir(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?$r.has(e)&&!i.values.length||$r.has(t)&&!r.values.length?ei(e,t):pn(ri(ai(r,i),i.values),n):(`${e}${t}`,Kr(e,t))},si=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function ci(e,t){let n=si.exec(e);if(!n)return;let r=si.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Zn(qr(a,o,e))+i}function li(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return qr(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=ci(e,t);if(n)return n}return ni(e)(e,t)}var ui=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>z.update(t,e),stop:()=>Gn(t),now:()=>Kn.isProcessing?Kn.timestamp:Xn.now()}},di=(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)})`},fi=2e4;function pi(e,t=50,n=fi,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function mi(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(pi(r),fi);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:_n(i)}}var hi={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 gi(e,t){return e*Math.sqrt(1-t*t)}var _i=12;function vi(e,t,n){let r=n;for(let n=1;n<_i;n++)r-=e(r)/t(r);return r}var yi=.001;function bi({duration:e=hi.duration,bounce:t=hi.bounce,velocity:n=hi.velocity,mass:r=hi.mass}){let i,a;hi.maxDuration;let o=1-t;o=on(hi.minDamping,hi.maxDamping,o),e=on(hi.minDuration,hi.maxDuration,_n(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=gi(t,o),c=Math.exp(-i);return yi-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o*o*t*t*e,c=Math.exp(-r),l=gi(t*t,o);return(-i(t)+yi>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=vi(i,a,s);if(e=gn(e),isNaN(c))return{stiffness:hi.stiffness,damping:hi.damping,duration:e};{let t=c*c*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var xi=[`duration`,`bounce`];function Si(e,t){return t.some(t=>e[t]!==void 0)}var Ci=(e,t)=>(t?e>=0:e>0)&&e<1/0;function wi(e,t){if(Ci(e,t))return e}function Ti(e){let t=wi(e.stiffness),n=wi(e.damping,!0),r=wi(e.mass),i={...e,stiffness:t??hi.stiffness,damping:n??hi.damping,mass:r??hi.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&Si(e,xi)};if(i.isTimeDefined){if(i.velocity=0,e.visualDuration){let t=e.visualDuration,n=2*Math.PI/(t*1.2),r=n*n,a=2*on(.05,1,1-(e.bounce||0))*Math.sqrt(r);i={...i,mass:hi.mass,stiffness:r,damping:a}}else{let e=bi(i);i={...i,...e,mass:hi.mass},i.isResolvedFromDuration=!0}(!Ci(i.stiffness)||!Ci(i.damping,!0))&&(i.stiffness=hi.stiffness,i.damping=hi.damping)}return i}function Ei(e=hi.visualDuration,t=hi.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,velocity:u,isResolvedFromDuration:d,isTimeDefined:f}=Ti({...n,velocity:-_n(n.velocity||0)}),p=s/(2*Math.sqrt(o*c)),m=_n(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:u||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?hi.restSpeed.granular:hi.restSpeed.default),g.restDelta=n.restDelta||(e?hi.restDelta.granular:hi.restDelta.default)};_();let v,y,b;if(p<1){let e=gi(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1);v=t=>{let n=Math.exp(-h*t),r=Math.min(e*t,300);return g.target-n*((g.velocity+h*g.delta)*Math.sinh(r)+e*g.delta*Math.cosh(r))/e};let t={P:0,sinh:0,cosh:0};b=()=>{t.P=(g.velocity+h*g.delta)/e,t.sinh=h*t.P-g.delta*e,t.cosh=h*g.delta-t.P*e},y=n=>{let r=Math.exp(-h*n),i=Math.min(e*n,300);return r*(t.sinh*Math.sinh(i)+t.cosh*Math.cosh(i))}}b();let x=d&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f?0:-_n(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>gn(y(e)),next:e=>{let t=v(e);if(d)a.done=e>=l;else{let n=gn(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(pi(S),fi),t=di(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Ei.applyToOptions=e=>{let t=mi(e,100,Ei);return e.ease=t.ease,e.duration=gn(t.duration),e.type=`keyframes`,e};function Di({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=>e<s||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=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Ei({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Oi(e,t,n){let r=[],i=n||sn.mix||li,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=pn(Array.isArray(t)?t[n]||fn:t,a)),r.push(a)}return r}function ki(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=Oi(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=mn(e[r],e[r+1],n);return s[r](i)};return n?t=>l(on(e[0],e[a-1],t)):l}function Ai(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=mn(0,t,r);e.push(qr(n,1,i))}}function ji(e){let t=[0];return Ai(t,e.length-1),t}function Mi(e,t){return e.map(e=>e*t)}function Ni(e,t){return e.map(()=>t||Fn).splice(0,e.length-1)}function Pi({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=In(r)?r.map(Bn):Bn(r)||Fn,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(sn.mix||li)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?on(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=ki(Mi(n&&n.length===t.length?n:ji(t),e),t,{ease:Array.isArray(i)?i:Ni(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Fi=5;function Ii(e,t,n){let r=Math.max(t-Fi,0);return vn(n-e(r),t-r)}function Li(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Ii(t=>e.next(t).value,t,e.next(t).value)}var Ri=e=>e!==null;function zi(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Ri),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Bi={decay:Di,inertia:Di,tween:Pi,keyframes:Pi,spring:Ei};function Vi(e){typeof e.type==`string`&&(e.type=Bi[e.type])}function Hi(e,t){return{kind:e,animation:t,timestamp:Xn.now(),frameTimestamp:Kn.timestamp,frameIsProcessing:Kn.isProcessing}}function Ui(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Hi(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Wi(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Hi(`layout-animation-start`,e),node:t})}catch{}}var Gi=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Ki=e=>e/100,qi=class extends Gi{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!==Xn.now()&&this.tick(Xn.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Ui(this,this.options)}initAnimation(){let{options:e}=this;Vi(e);let{type:t=Pi,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Pi;s!==Pi&&typeof o[0]!=`number`&&(this.mixKeyframes=pn(Ki,li(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=pi(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.currentTime=this.holdTime===null?t: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=on(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!==Di&&(b.value=zi(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 _n(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+_n(e)}get time(){return _n(this.currentTime)}set time(e){e=gn(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(){return Li(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Xn.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=_n(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=ui,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(Xn.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}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)}},Ji=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Yi(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(sr)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Ji.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Xi=/\b([a-z-]*)\(.*?\)/gu,Zi={...Ur,getAnimatableNone:e=>{let t=e.match(Xi);return t?t.map(Yi).join(` `):e}},Qi={...Ur,getAnimatableNone:e=>{let t=Ur.parse(e);return Ur.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},$i={...ir,transform:Math.round},ea={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,inset:B,insetBlock:B,insetBlockStart:B,insetBlockEnd:B,insetInline:B,insetInlineStart:B,insetInlineEnd:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,paddingBlock:B,paddingBlockStart:B,paddingBlockEnd:B,paddingInline:B,paddingInlineStart:B,paddingInlineEnd:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,marginBlock:B,marginBlockStart:B,marginBlockEnd:B,marginInline:B,marginInlineStart:B,marginInlineEnd:B,fontSize:B,backgroundPositionX:B,backgroundPositionY:B,rotate:vr,pathRotation:vr,rotateX:vr,rotateY:vr,rotateZ:vr,scale:or,scaleX:or,scaleY:or,scaleZ:or,skew:vr,skewX:vr,skewY:vr,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:ar,originX:Sr,originY:Sr,originZ:B,zIndex:$i,fillOpacity:ar,strokeOpacity:ar,numOctaves:$i},ta={...ea,color:wr,backgroundColor:wr,outlineColor:wr,fill:wr,stroke:wr,borderColor:wr,borderTopColor:wr,borderRightColor:wr,borderBottomColor:wr,borderLeftColor:wr,filter:Zi,WebkitFilter:Zi,mask:Qi,WebkitMask:Qi},na=e=>ta[e],ra=new Set([Zi,Qi]);function V(e,t){let n=na(e);return ra.has(n)||(n=Ur),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function ia(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var aa=e=>e*180/Math.PI,oa=e=>ca(aa(Math.atan2(e[1],e[0]))),sa={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:oa,rotateZ:oa,skewX:e=>aa(Math.atan(e[1])),skewY:e=>aa(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ca=e=>(e%=360,e<0&&(e+=360),e),la=oa,ua=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),da=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),fa={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ua,scaleY:da,scale:e=>(ua(e)+da(e))/2,rotateX:e=>ca(aa(Math.atan2(e[6],e[5]))),rotateY:e=>ca(aa(Math.atan2(-e[2],e[0]))),rotateZ:la,rotate:la,skewX:e=>aa(Math.atan(e[4])),skewY:e=>aa(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function pa(e){return+!!e.includes(`scale`)}function ma(e,t){if(!e||e===`none`)return pa(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=fa,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=sa,i=t}if(!i)return pa(t);let a=r[t],o=i[1].split(`,`).map(ga);return typeof a==`function`?a(o):o[a]}var ha=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return ma(n,t)};function ga(e){return parseFloat(e.trim())}var _a=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],va=new Set([..._a,`pathRotation`]),ya=e=>e===ir||e===B,ba=new Set([`x`,`y`,`z`]),xa=_a.filter(e=>!ba.has(e));function Sa(e){let t=[];return xa.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Ca=new Set([`bottom`,`right`]);function wa(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var Ta={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>wa(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>wa(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>ma(e,`x`),y:({transform:e})=>ma(e,`y`)};Ta.translateX=Ta.x,Ta.translateY=Ta.y;var Ea=new Set,Da=!1,Oa=!1,ka=!1;function Aa(){if(Oa){let e=[],t=new Set,n=new Set;Ea.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Ca.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=Sa(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.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)})}Oa=!1,Da=!1,Ea.forEach(e=>e.complete(ka)),Ea.clear()}function ja(){Ea.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Oa=!0)})}function Ma(){ka=!0,ja(),Aa(),ka=!1}function Na(e,t,n){if(typeof e==`string`){if(cn(e)||un(e))return parseFloat(e);if(!Ur.test(e)&&Ur.test(n))return V(t,n)}return e??void 0}var Pa=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?(Ea.add(this),Da||(Da=!0,z.read(ja),z.resolveKeyframes(Aa))):(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=Na(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}ia(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Ea.delete(this)}cancel(){this.state===`scheduled`&&(Ea.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Fa=e=>e.startsWith(`--`);function Ia(e,t,n){Fa(t)?e.style.setProperty(t,n):e.style[t]=n}var La={};function Ra(e,t){let n=dn(e);return()=>La[t]??n()}var za=Ra(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Ba=Ra(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Va=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Ha={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Va([0,.65,.55,1]),circOut:Va([.55,0,1,.45]),backIn:Va([.31,.01,.66,-.59]),backOut:Va([.33,1.53,.69,.99])};function Ua(e,t){if(e)return typeof e==`function`?Ba()?di(e,t):`ease-out`:Ln(e)?Va(e):Array.isArray(e)?e.map(e=>Ua(e,t)||Ha.easeOut):Ha[e]}function Wa(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=Ua(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Ga(e){return typeof e==`function`&&`applyToOptions`in e}function Ka({type:e,...t}){return Ga(e)&&Ba()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var qa=class extends Gi{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=Ka(e);this.animation=Wa(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=zi(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Ia(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Ui(this,e,c)}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 _n(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+_n(e)}get time(){return _n(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=gn(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&&za()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),fn):r(this)}},Ja={anticipate:kn,backInOut:On,circInOut:Mn};function Ya(e){return e in Ja}function Xa(e){typeof e.ease==`string`&&Ya(e.ease)&&(e.ease=Ja[e.ease])}var Za=10,Qa=class extends qa{constructor(e){Xa(e),Vi(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 qi({...a,autoplay:!1}),s=Math.max(Za,Xn.now()-this.startTime),c=on(0,Za,s-Za),l=o.sample(s).value,{name:u}=this.options;i&&u&&Ia(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},$a=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Ur.test(e)||e===`0`)&&!e.startsWith(`url(`));function eo(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 to(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=$a(i,t),s=$a(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):eo(e)||(n===`spring`||Ga(n))&&r}function no(e){e.duration=0,e.type=`keyframes`}var ro=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),io=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ao(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&io.test(e[t]))return!0;return!1}var oo=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),so=dn(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function co(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(ro.has(n)||oo.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return so()&&(ro.has(n)||oo.has(n)&&ao(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var lo=40,uo=class extends Gi{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Xn.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Pa;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),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=Xn.now();let u=!0;to(e,i,a,o)||(u=!1,(sn.instantAnimations||!s)&&l?.(zi(e,n,t)),e[0]=e[e.length-1],no(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>lo?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&co(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new Qa(n)}catch{m=new qi(n)}}else m=new qi(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ma()),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 fo(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 po=30,mo=e=>!isNaN(parseFloat(e)),ho={current:void 0},go=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Xn.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),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=Xn.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=mo(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new hn)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new hn,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){z.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;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.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return ho.current&&ho.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Xn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>po)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,po);return vn(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function _o(e,t){return new go(e,t)}function vo(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function yo(e,t){let n=e?.[t]??e?.default??e;return n===e?n:vo(n,e)}var bo={type:`spring`,stiffness:500,damping:25,restSpeed:10},xo=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),So={type:`keyframes`,duration:.8},Co={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},wo=(e,{keyframes:t})=>t.length>2?So:va.has(e)?e.startsWith(`scale`)?xo(t[1]):bo:Co,To=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Eo(e){for(let t in e)if(!To.has(t))return!0;return!1}var Do=(e,t,n,r={},i,a)=>o=>{let s=yo(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=gn(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};Eo(s)||Object.assign(u,wo(e,u)),u.duration&&=gn(u.duration),u.repeatDelay&&=gn(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(no(u),u.delay===0&&(d=!0)),(sn.instantAnimations||sn.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,no(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=zi(u.keyframes,s);if(e!==void 0){z.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new qi(u):new uo(u)},Oo=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ko(e){let t=Oo.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Ao(e,t,n=1){`${e}`;let[r,i]=ko(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return cn(e)?parseFloat(e):e}return tr(i)?Ao(i,t,n+1):i}function jo(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Mo(e,t,n,r){if(typeof t==`function`){let[i,a]=jo(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]=jo(r);t=t(n===void 0?e.custom:n,i,a)}return t}function No(e,t,n){let r=e.getProps();return Mo(r,t,n===void 0?r.custom:n,e)}var Po=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,..._a]),Fo=e=>Array.isArray(e);function Io(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_o(n))}function Lo(e){return Fo(e)?e[e.length-1]||0:e}function Ro(e,t){let{transitionEnd:n={},transition:r={},...i}=No(e,t)||{};i={...i,...n};for(let t in i)Io(e,t,Lo(i[t]))}var zo=e=>!!(e&&e.getVelocity);function Bo(e){return!!(zo(e)&&e.add)}function Vo(e,t){let n=e.getValue(`willChange`);if(Bo(n))return n.add(t);if(!n&&sn.WillChange){let n=new sn.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function H(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Ho=`data-`+H(`framerAppearId`);function Uo(e){return e.props[Ho]}var Wo=typeof window<`u`;function Go({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ko(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?vo(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&&Go(f,t))continue;let o={delay:n,...yo(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){z.update(()=>r.set(i));continue}let p=!1;if(Wo&&window.MotionHandoffAnimation){let n=Uo(e);if(n){let e=window.MotionHandoffAnimation(n,t,z);e!==null&&(o.startTime=e,p=!0)}}Vo(e,t);let m=l??e.shouldReduceMotion;r.start(Do(t,r,i,m&&Po.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>z.update(()=>{o&&Ro(e,o)});d.length?Promise.all(d).then(t):t()}return d}function qo(e,t,n={}){let r=No(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(Ko(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Jo(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())}return Promise.all([a(),o(n.delay)])}function Jo(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(qo(c,t,{...o,delay:n+(typeof r==`function`?0:r)+fo(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Yo(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>qo(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=qo(e,t,n);else{let i=typeof t==`function`?No(e,t,n.custom):t;r=Promise.all(Ko(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Xo={test:e=>e===`auto`,parse:e=>e},Zo=e=>t=>t.test(e),Qo=[ir,B,yr,vr,xr,br,Xo],$o=e=>Qo.find(Zo(e));function es(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||un(e)}var ts=new Set([`auto`,`none`,`0`]);function ns(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!ts.has(t)&&Fr(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=V(n,i))}var rs=class extends Pa{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(),tr(r))){let i=Ao(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Po.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=$o(r),o=$o(i);if(rr(r)!==rr(i)&&Ta[n]){this.needsMeasurement=!0;return}if(a!==o){if(ya(a)&&ya(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Ta[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||es(e[t]))&&n.push(t);n.length&&ns(e,n,t)}measure(){let{element:e,name:t}=this;return Ta[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},is=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function as(e){return ln(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function os(e){return ln(e)&&`ownerSVGElement`in e}var ss=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function cs(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 ls={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},us=_a.length;function ds(e,t,n){let r=``,i=!0;for(let a=0;a<us;a++){let o=_a[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=ss(s,ea[o]);if(!c){i=!1;let t=ls[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${ss(a,ea.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function fs(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(va.has(e)){o=!0;continue}if($n(e)){i[e]=n;continue}{let t=ss(n,ea[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=ds(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var ps={offset:`stroke-dashoffset`,array:`stroke-dasharray`},ms={offset:`strokeDashoffset`,array:`strokeDasharray`};function hs(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?ps:ms;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var gs=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function _s(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(fs(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;for(let e of gs)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&hs(d,i,a,o,!1)}function vs({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ys({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function bs(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 xs(e){return e===void 0||e===1}function Ss({scale:e,scaleX:t,scaleY:n}){return!xs(e)||!xs(t)||!xs(n)}function Cs(e){return Ss(e)||ws(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ws(e){return Ts(e.x)||Ts(e.y)}function Ts(e){return e&&e!==`0%`}function Es(e,t,n){return n+t*(e-n)}function Ds(e,t,n,r,i){return i!==void 0&&(e=Es(e,i,r)),Es(e,n,r)+t}function Os(e,t=0,n=1,r,i){e.min=Ds(e.min,t,n,r,i),e.max=Ds(e.max,t,n,r,i)}function ks(e,{x:t,y:n}){Os(e.x,t.translate,t.scale,t.originPoint),Os(e.y,n.translate,n.scale,n.originPoint)}var As=.999999999999,js=1.0000000000001;function Ms(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&&(Ns(e.x,-a.scroll.offset.x),Ns(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ks(e,o)),r&&Cs(a.latestValues)&&Is(e,a.latestValues,a.layout?.layoutBox))}t.x<js&&t.x>As&&(t.x=1),t.y<js&&t.y>As&&(t.y=1)}function Ns(e,t){e.min+=t,e.max+=t}function Ps(e,t,n,r,i=.5){Os(e,t,n,qr(e.min,e.max,i),r)}function Fs(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Is(e,t,n){let r=n??e;Ps(e.x,Fs(t.x,r.x),t.scaleX,t.scale,t.originX),Ps(e.y,Fs(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ls(e,t){return vs(bs(e.getBoundingClientRect(),t))}function Rs(e,t,n){let r=Ls(e,n),{scroll:i}=t;return i&&(Ns(r.x,i.offset.x),Ns(r.y,i.offset.y)),r}var{schedule:zs,cancel:Bs}=Wn(queueMicrotask,!1),Vs={x:!1,y:!1};function Hs(){return Vs.x||Vs.y}function Us(e){return e===`x`||e===`y`?Vs[e]?null:(Vs[e]=!0,()=>{Vs[e]=!1}):Vs.x||Vs.y?null:(Vs.x=Vs.y=!0,()=>{Vs.x=Vs.y=!1})}function Ws(e,t){let n=cs(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Gs(e){return!(e.pointerType===`touch`||Hs())}function Ks(e,t,n={}){let[r,i,a]=Ws(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(!Gs(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 qs=(e,t)=>t?e===t||qs(e,t.parentElement):!1,Js=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Ys=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Xs(e){return Ys.has(e.tagName)||e.isContentEditable===!0}var Zs=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Qs(e){return Zs.has(e.tagName)||e.isContentEditable===!0}var $s=new WeakSet;function ec(e){return t=>{t.key===`Enter`&&e(t)}}function tc(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var nc=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=ec(()=>{if($s.has(n))return;tc(n,`down`);let e=ec(()=>{tc(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>tc(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function rc(e){return Js(e)&&!Hs()}var ic=new WeakSet;function ac(e,t,n={}){let[r,i,a]=Ws(e,n),o=e=>{let r=e.currentTarget;if(!rc(e)||ic.has(e))return;$s.add(r),n.stopPropagation&&ic.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),$s.has(r)&&$s.delete(r),rc(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||qs(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),as(e)&&(e.addEventListener(`focus`,e=>nc(e,i)),!Xs(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var oc=new WeakMap,sc,cc=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:os(r)&&`getBBox`in r?r.getBBox()[t]:r[n],lc=cc(`inline`,`width`,`offsetWidth`),uc=cc(`block`,`height`,`offsetHeight`);function dc({target:e,borderBoxSize:t}){oc.get(e)?.forEach(n=>{n(e,{get width(){return lc(e,t)},get height(){return uc(e,t)}})})}function fc(e){e.forEach(dc)}function pc(){typeof ResizeObserver<`u`&&(sc=new ResizeObserver(fc))}function mc(e,t){sc||pc();let n=cs(e);return n.forEach(e=>{let n=oc.get(e);n||(n=new Set,oc.set(e,n)),n.add(t),sc?.observe(e)}),()=>{n.forEach(e=>{let n=oc.get(e);n?.delete(t),n?.size||sc?.unobserve(e)})}}var hc=new Set,gc;function _c(){gc=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};hc.forEach(t=>t(e))},window.addEventListener(`resize`,gc)}function vc(e){return hc.add(e),gc||_c(),()=>{hc.delete(e),!hc.size&&typeof gc==`function`&&(window.removeEventListener(`resize`,gc),gc=void 0)}}function yc(e,t){return typeof e==`function`?vc(e):mc(e,t)}var bc={value:null,addProjectionMetrics:null};function xc(e){return os(e)&&e.tagName===`svg`}var Sc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Cc=()=>({x:Sc(),y:Sc()}),wc=()=>({min:0,max:0}),Tc=()=>({x:wc(),y:wc()}),Ec=new WeakMap;function Dc(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Oc(e){return typeof e==`string`||Array.isArray(e)}var kc=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Ac=[`initial`,...kc];function jc(e){if(Dc(e.animate))return!0;for(let t=0;t<Ac.length;t++)if(Oc(e[Ac[t]]))return!0;return!1}function Mc(e){return!!(jc(e)||e.variants)}function Nc(e,t,n){for(let r in t){let i=t[r],a=n[r];if(zo(i))e.addValue(r,i);else if(zo(a))e.addValue(r,_o(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,_o(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Pc={current:null},Fc={current:!1},Ic=typeof window<`u`;function Lc(){if(Fc.current=!0,Ic){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Pc.current=e.matches;e.addEventListener(`change`,t),t()}else Pc.current=!1}}var Rc=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],zc={};function Bc(e){zc=e}function Vc(){return zc}var Hc=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=Pa,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=Xn.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,z.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=jc(t),this.isVariantNode=Mc(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&&zo(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,Ec.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:(Fc.current||Lc(),this.shouldReduceMotion=Pc.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(),Gn(this.notifyUpdate),Gn(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&&ro.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new qa({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:gn(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=va.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&z.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 zc){let t=zc[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):Tc()}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<Rc.length;t++){let n=Rc[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=Nc(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=_o(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`&&(cn(n)||un(n))?n=parseFloat(n):typeof n!=`number`&&!Ur.test(n)&&Ur.test(t)&&(n=V(e,t)),this.setBaseTarget(e,zo(n)?n.get():n)),zo(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=Mo(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&&!zo(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 hn),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){zs.render(this.render)}},Uc=class extends Hc{constructor(){super(...arguments),this.KeyframeResolver=rs}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;zo(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Wc=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Gc(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 Kc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var qc={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(B.test(e))e=parseFloat(e);else return e}return`${Kc(e,t.target.x)}% ${Kc(e,t.target.y)}%`}},Jc={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Ur.parse(e);if(i.length>5)return r;let a=Ur.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=qr(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Yc={borderRadius:{...qc,applyTo:[...is]},borderTopLeftRadius:qc,borderTopRightRadius:qc,borderBottomLeftRadius:qc,borderBottomRightRadius:qc,boxShadow:Jc};function Xc(e,{layout:t,layoutId:n}){return va.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Yc[e]||e===`opacity`)}function Zc(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(zo(r[t])||i&&zo(i[t])||Xc(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Qc(e){return window.getComputedStyle(e)}var $c=class extends Uc{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Gc}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(va.has(t))return this.projection?.isProjecting?pa(t):ha(e,t);{let n=Qc(e),r=($n(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ls(e,t)}build(e,t,n){fs(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Zc(e,t,n)}},el=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`]),tl=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function nl(e,t,n,r){Gc(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(el.has(n)?n:H(n),t.attrs[n])}function rl(e,t,n){let r=Zc(e,t,n);for(let n in e)if(zo(e[n])||zo(t[n])){let t=_a.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var il=class extends Uc{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Tc}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(va.has(t)){let e=na(t);return e&&e.default||0}if(gs.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=el.has(t)?t:H(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return rl(e,t,n)}build(e,t,n){_s(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){nl(e,t,n,r)}mount(e){this.isSVGTag=tl(e.tagName),super.mount(e)}},al=Ac.length;function ol(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&ol(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<al;n++){let r=Ac[n],i=e.props[r];(Oc(i)||i===!1)&&(t[r]=i)}return t}function sl(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 cl=[...kc].reverse(),ll=kc.length;function ul(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Yo(e,t,n)))}function dl(e){let t=ul(e),n=ml(),r=!0,i=!1,a=t=>(n,r)=>{let i=No(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=ol(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<ll;t++){let p=cl[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Oc(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||Dc(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=fl(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=Fo(t)&&Fo(n)?!sl(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=No(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=fo(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=No(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=ml(),i=!0}}}function fl(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!sl(t,e):!1}function pl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ml(){return{animate:pl(!0),whileInView:pl(),whileHover:pl(),whileTap:pl(),whileDrag:pl(),whileFocus:pl(),exit:pl()}}function hl(e,t){e.min=t.min,e.max=t.max}function gl(e,t){hl(e.x,t.x),hl(e.y,t.y)}function _l(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var vl=.9999,yl=1.0001,bl=-.01,xl=.01;function Sl(e){return e.max-e.min}function Cl(e,t,n){return Math.abs(e-t)<=n}function wl(e,t,n,r=.5){e.origin=r,e.originPoint=qr(t.min,t.max,e.origin),e.scale=Sl(n)/Sl(t),e.translate=qr(n.min,n.max,e.origin)-e.originPoint,(e.scale>=vl&&e.scale<=yl||isNaN(e.scale))&&(e.scale=1),(e.translate>=bl&&e.translate<=xl||isNaN(e.translate))&&(e.translate=0)}function Tl(e,t,n,r){wl(e.x,t.x,n.x,r?r.originX:void 0),wl(e.y,t.y,n.y,r?r.originY:void 0)}function El(e,t,n,r=0){e.min=(r?qr(n.min,n.max,r):n.min)+t.min,e.max=e.min+Sl(t)}function Dl(e,t,n,r){El(e.x,t.x,n.x,r?.x),El(e.y,t.y,n.y,r?.y)}function Ol(e,t,n,r=0){let i=r?qr(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Sl(t)}function kl(e,t,n,r){Ol(e.x,t.x,n.x,r?.x),Ol(e.y,t.y,n.y,r?.y)}function Al(e,t,n,r,i){return e-=t,e=Es(e,1/n,r),i!==void 0&&(e=Es(e,1/i,r)),e}function jl(e,t=0,n=1,r=.5,i,a=e,o=e){if(yr.test(t)&&(t=parseFloat(t),t=qr(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=qr(a.min,a.max,r);e===a&&(s-=t),e.min=Al(e.min,t,n,s,i),e.max=Al(e.max,t,n,s,i)}function Ml(e,t,[n,r,i],a,o){jl(e,t[n],t[r],t[i],t.scale,a,o)}var Nl=[`x`,`scaleX`,`originX`],Pl=[`y`,`scaleY`,`originY`];function Fl(e,t,n,r){Ml(e.x,t,Nl,n?n.x:void 0,r?r.x:void 0),Ml(e.y,t,Pl,n?n.y:void 0,r?r.y:void 0)}function Il(e){return e.translate===0&&e.scale===1}function Ll(e){return Il(e.x)&&Il(e.y)}function Rl(e,t){return e.min===t.min&&e.max===t.max}function zl(e,t){return Rl(e.x,t.x)&&Rl(e.y,t.y)}function Bl(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Vl(e,t){return Bl(e.x,t.x)&&Bl(e.y,t.y)}function Hl(e){return Sl(e.x)/Sl(e.y)}function Ul(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Wl(e){return[e(`x`),e(`y`)]}function Gl(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 Kl=is.length,ql=e=>typeof e==`string`?parseFloat(e):e,Jl=e=>typeof e==`number`||B.test(e);function Yl(e,t,n,r,i,a){i?(e.opacity=qr(0,n.opacity??1,Zl(r)),e.opacityExit=qr(t.opacity??1,0,Ql(r))):a&&(e.opacity=qr(t.opacity??1,n.opacity??1,r));for(let i=0;i<Kl;i++){let a=is[i],o=Xl(t,a),s=Xl(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Jl(o)===Jl(s)?(e[a]=Math.max(qr(ql(o),ql(s),r),0),(yr.test(s)||yr.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=qr(t.rotate||0,n.rotate||0,r))}function Xl(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Zl=$l(0,.5,jn),Ql=$l(.5,.95,fn);function $l(e,t,n){return r=>r<e?0:r>t?1:n(mn(e,t,r))}function eu(e,t,n){let r=zo(e)?e:_o(e);return r.start(Do(``,r,t,n)),r.animation}function tu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var nu=(e,t)=>e.depth-t.depth,ru=class{constructor(){this.children=[],this.isDirty=!1}add(e){rn(this.children,e),this.isDirty=!0}remove(e){an(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(nu),this.isDirty=!1,this.children.forEach(e)}};function iu(e,t){let n=Xn.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Gn(r),e(a-t))};return z.setup(r,!0),()=>Gn(r)}function au(e){return zo(e)?e.get():e}var ou=class{constructor(){this.members=[]}add(e){rn(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&&(an(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(an(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)}},U={hasAnimatedSinceResize:!0,hasEverUpdated:!1},su={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},cu=[``,`X`,`Y`,`Z`],lu=1e3,uu=0;function du(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function fu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Uo(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,z,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&fu(r)}function pu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=uu++,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,bc.value&&(su.nodes=su.calculatedTargetDeltas=su.calculatedProjections=0),this.nodes.forEach(gu),this.nodes.forEach(Tu),this.nodes.forEach(Eu),this.nodes.forEach(_u),bc.addProjectionMetrics&&bc.addProjectionMetrics(su)},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 ru)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new hn),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=os(t)&&!xc(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;z.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=iu(i,250),U.hasAnimatedSinceResize&&(U.hasAnimatedSinceResize=!1,this.nodes.forEach(wu)))})}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()||Nu,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Vl(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={...yo(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||wu(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(),Gn(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(Du),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&&fu(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(bu),this.nodes.forEach(yu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(xu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Su),this.nodes.forEach(Cu),this.nodes.forEach(mu),this.nodes.forEach(hu)):this.nodes.forEach(xu),this.clearAllSnapshots();let e=Xn.now();Kn.delta=on(0,1e3/60,e-Kn.timestamp),Kn.timestamp=e,Kn.isProcessing=!0,qn.update.process(Kn),qn.preRender.process(Kn),qn.render.process(Kn),Kn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(vu),this.sharedNodes.forEach(Ou)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,z.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){z.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!Sl(this.snapshot.measuredBox.x)&&!Sl(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||=Tc(),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&&!Ll(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Cs(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)),Lu(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Tc();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(zu))){let{scroll:e}=this.root;e&&(Ns(t.x,e.offset.x),Ns(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Tc();if(gl(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&&gl(t,e),Ns(t.x,i.offset.x),Ns(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Tc();gl(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&&(Ns(r.x,-n.scroll.offset.x),Ns(r.y,-n.scroll.offset.y)),Cs(n.latestValues)&&Is(r,n.latestValues,n.layout?.layoutBox)}return Cs(this.latestValues)&&Is(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Tc();gl(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Cs(n.latestValues))continue;let r;n.instance&&(Ss(n.latestValues)&&n.updateSnapshot(),r=Tc(),gl(r,n.measurePageBox())),Fl(t,n.latestValues,n.snapshot?.layoutBox,r)}return Cs(this.latestValues)&&Fl(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||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!==Kn.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=Kn.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=Tc(),this.targetWithTransforms=Tc()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Dl(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):gl(this.target,this.layout.layoutBox),ks(this.target,this.targetDelta)):gl(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),bc.value&&su.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Ss(this.parent.latestValues)||ws(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=Tc(),this.relativeTargetOrigin=Tc(),kl(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),gl(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===Kn.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;gl(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Ms(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=Tc());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(_l(this.prevProjectionDelta.x,this.projectionDelta.x),_l(this.prevProjectionDelta.y,this.projectionDelta.y)),Tl(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Ul(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ul(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),bc.value&&su.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=Cc(),this.projectionDelta=Cc(),this.projectionDeltaWithTransform=Cc()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Cc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Tc(),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(Mu));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=qr(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=qr(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(ku(o.x,e.x,n),ku(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(kl(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),ju(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&zl(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Tc(),gl(f,this.relativeTarget)),c&&(this.animationValues=a,Yl(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&&=(Gn(this.pendingAnimation),void 0),this.pendingAnimation=z.update(()=>{U.hasAnimatedSinceResize=!0,this.motionValue||=_o(0),this.motionValue.jump(0,!1),this.currentAnimation=eu(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),Wi(this.currentAnimation,this),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(lu),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Ru(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Tc();let t=Sl(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=Sl(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}gl(t,i),Is(t,r),Tl(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ou),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}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&&du(`z`,e,r,this.animationValues);for(let t=0;t<cu.length;t++)du(`rotate${cu[t]}`,e,r,this.animationValues),du(`skew${cu[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=au(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=au(t?.pointerEvents)||``),this.hasProjected&&!Cs(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Gl(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`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Yc){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Yc[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?au(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(yu),this.root.sharedNodes.clear()}}}function mu(e){e.updateLayout()}function hu(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`)Wl(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Sl(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;hl(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Ru(i,t.layoutBox,n)&&Wl(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Sl(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=Cc();Tl(o,n,t.layoutBox);let s=Cc();a?Tl(s,e.applyTransform(r,!0),t.measuredBox):Tl(s,n,t.layoutBox);let c=!Ll(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=Tc();kl(s,t.layoutBox,i.layoutBox,o);let c=Tc();kl(c,n,a.layoutBox,o),Vl(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 gu(e){bc.value&&su.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 _u(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function vu(e){e.clearSnapshot()}function yu(e){e.clearMeasurements()}function bu(e){e.isLayoutDirty=!0,e.updateLayout()}function xu(e){e.isLayoutDirty=!1}function Su(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Cu(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function wu(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Tu(e){e.resolveTargetDelta()}function Eu(e){e.calcProjection()}function Du(e){e.resetSkewAndRotation()}function Ou(e){e.removeLeadSnapshot()}function ku(e,t,n){e.translate=qr(t.translate,0,n),e.scale=qr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Au(e,t,n,r){e.min=qr(t.min,n.min,r),e.max=qr(t.max,n.max,r)}function ju(e,t,n,r){Au(e.x,t.x,n.x,r),Au(e.y,t.y,n.y,r)}function Mu(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Nu={duration:.45,ease:[.4,0,.1,1]},Pu=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Fu=Pu(`applewebkit/`)&&!Pu(`chrome/`)?Math.round:fn;function Iu(e){e.min=Fu(e.min),e.max=Fu(e.max)}function Lu(e){Iu(e.x),Iu(e.y)}function Ru(e,t,n){return e===`position`||e===`preserve-aspect`&&!Cl(Hl(t),Hl(n),.2)}function zu(e){return e!==e.root&&e.scroll?.wasRoot}var Bu=pu({attachResizeListener:(e,t)=>tu(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Vu={current:void 0},Hu=pu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Vu.current){let e=new Bu({});e.mount(window),e.setOptions({layoutScroll:!0}),Vu.current=e}return Vu.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Uu=(0,v.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Wu(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Gu(...e){return t=>{let n=!1,r=e.map(e=>{let r=Wu(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():Wu(e[t],null)}}}}function Ku(...e){return v.useCallback(Gu(...e),e)}var qu=class extends v.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(as(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=as(e)&&e.offsetWidth||0,r=as(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 Ju({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,v.useId)(),s=(0,v.useRef)(null),c=(0,v.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,v.useContext)(Uu),u=Ku(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,v.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(`
10
10
  [data-motion-pop-id="${o}"] {
11
11
  position: absolute !important;
12
12
  width: ${e}px !important;
@@ -14,7 +14,7 @@ Error generating stack: `+e.message+`
14
14
  ${_}px !important;
15
15
  ${v}px !important;
16
16
  }
17
- `),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,L.jsx)(Ku,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:v.cloneElement(e,{ref:u})})}var Ju=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=en(Yu),d=(0,v.useId)(),f=(0,v.useRef)(n),p=(0,v.useRef)(r);tn(()=>{f.current=n,p.current=r});let m=!0,h=(0,v.useMemo)(()=>(m=!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),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,v.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),v.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,L.jsx)(qu,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,L.jsx)(nn.Provider,{value:h,children:e})};function Yu(){return new Map}function Xu(e=!0){let t=(0,v.useContext)(nn);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,v.useId)();(0,v.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,v.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Zu=e=>e.key||``;function Qu(e){let t=[];return v.Children.forEach(e,e=>{(0,v.isValidElement)(e)&&t.push(e)}),t}var $u=({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]=Xu(o),f=(0,v.useMemo)(()=>Qu(e),[e]),p=o&&!u?[]:f.map(Zu),m=(0,v.useRef)(!0),h=(0,v.useRef)(f),g=en(()=>new Map),_=(0,v.useRef)(new Set),[y,b]=(0,v.useState)(f),[x,S]=(0,v.useState)(f);tn(()=>{o&&!u&&!x.length&&d?.()},[u,o,x.length,d]),tn(()=>{m.current=!1,h.current=f;for(let e=0;e<x.length;e++){let t=Zu(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!==y){let e=[...f],t=0;for(let n of x){let r=p.indexOf(Zu(n));r===-1?(e.splice(t++,0,n),C.push(n)):t=r+C.length+1}return a===`wait`&&C.length&&(e=C),S(Qu(e)),b(f),null}let{forceRender:w}=(0,v.useContext)($t);return(0,L.jsx)(L.Fragment,{children:x.map(e=>{let v=Zu(e),y=o&&!u?!1:f===x||p.includes(v);return(0,L.jsx)(Ju,{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)})})},ed=(0,v.createContext)({strict:!1}),G={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`]},td=!1;function K(){if(td)return;let e={};for(let t in G)e[t]={isEnabled:e=>G[t].some(t=>!!e[t])};zc(e),td=!0}function q(){return K(),Bc()}function nd(e){let t=q();for(let n in e)t[n]={...t[n],...e[n]};zc(t)}function rd({children:e,...t}){let n=(0,v.useContext)(Hu);t={...n,...t},t.transition=_o(t.transition,n.transition),t.isStatic=en(()=>t.isStatic);let r=(0,v.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,L.jsx)(Hu.Provider,{value:r,children:e})}var id=(0,v.createContext)({});function ad(e,t){if(Ac(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Dc(t)?t:void 0,animate:Dc(n)?n:void 0}}return e.inherit===!1?{}:t}function od(e){let{initial:t,animate:n}=ad(e,(0,v.useContext)(id));return(0,v.useMemo)(()=>({initial:t,animate:n}),[sd(t),sd(n)])}function sd(e){return Array.isArray(e)?e.join(` `):e}var cd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ld(e,t,n){for(let r in t)!Ro(t[r])&&!Yc(r,n)&&(e[r]=t[r])}function ud({transformTemplate:e},t){return(0,v.useMemo)(()=>{let n=cd();return ds(n,t,e),Object.assign({},n.vars,n.style)},[t])}function dd(e,t){let n=e.style||{},r={};return ld(r,n,e),Object.assign(r,ud(e,t)),r}function fd(e,t){let n={},r=dd(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 pd=()=>({...cd(),attrs:{}});function md(e,t,n,r){let i=(0,v.useMemo)(()=>{let n=pd();return gs(n,t,el(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};ld(t,e.style,e),i.style={...t,...i.style}}return i}var hd=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 gd(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||hd.has(e)}function _d(e,t){return e.startsWith(`on`)?!gd(e):t?.(e)??!gd(e)}function vd(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(Ro(e[a])||(_d(a,r)||n===!0&&gd(a)||!t&&!gd(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var yd=[`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 bd(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(yd.indexOf(e)>-1||/[A-Z]/u.test(e))}function xd(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??bd(e)?md:fd)(t,r,i,e),l=vd(t,typeof e==`string`,a,s),u=e===v.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,v.useMemo)(()=>Ro(d)?d.get():d,[d]);return(0,v.createElement)(e,{...u,children:f})}function Sd({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Cd(n,r,i,e),renderState:t()}}function Cd(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=iu(a[e]);let{initial:o,animate:s}=e,c=Ac(e),l=jc(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`&&!Ec(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=jo(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 wd=e=>(t,n)=>{let r=(0,v.useContext)(id),i=(0,v.useContext)(nn),a=()=>Sd(e,t,r,i);return n?a():en(a)},Td=wd({scrapeMotionValuesFromProps:Xc,createRenderState:cd}),Ed=wd({scrapeMotionValuesFromProps:nl,createRenderState:pd}),Dd=Symbol.for(`motionComponentSymbol`);function Od(e,t,n){let r=(0,v.useRef)(n);(0,v.useInsertionEffect)(()=>{r.current=n});let i=(0,v.useRef)(null);return(0,v.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 kd=(0,v.createContext)({});function Ad(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function jd(e,t,n,r,i,a){let{visualElement:o}=(0,v.useContext)(id),s=(0,v.useContext)(ed),c=(0,v.useContext)(nn),l=(0,v.useContext)(Hu),u=l.reducedMotion,d=l.skipAnimations,f=(0,v.useRef)(null),p=(0,v.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,v.useContext)(kd);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Md(f.current,n,i,h);let g=(0,v.useRef)(!1);(0,v.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[Vo],y=(0,v.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return tn(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),tn(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),(0,v.useEffect)(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function Md(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:Nd(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Ad(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Nd(e){if(e)return e.options.allowProjection===!1?Nd(e.parent):e.projection}function Pd(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&nd(r);let a=n?n===`svg`:bd(e),o=a?Ed:Td;function s(n,s){let c,l={...(0,v.useContext)(Hu),...n,layoutId:Fd(n)},{isStatic:u,isValidProp:d}=l,f=od(n),p=o(n,u);if(!u&&typeof window<`u`){Id(l,r);let t=Ld(l);c=t.MeasureLayout,f.visualElement=jd(e,p,l,i,t.ProjectionNode,a)}return(0,L.jsxs)(id.Provider,{value:f,children:[c&&f.visualElement?(0,L.jsx)(c,{visualElement:f.visualElement,...l}):null,xd(e,n,Od(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,v.forwardRef)(s);return c[Dd]=e,c}function Fd({layoutId:e}){let t=(0,v.useContext)($t).id;return t&&e!==void 0?t+`-`+e:e}function Id(e,t){(0,v.useContext)(ed).strict}function Ld(e){let{drag:t,layout:n}=q();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Rd(e,t){if(typeof Proxy>`u`)return Pd;let n=new Map,r=(n,r)=>Pd(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Pd(a,void 0,e,t)),n.get(a))})}var zd=(e,t)=>t.isSVG??bd(e)?new rl(t):new Qc(t,{allowProjection:e!==v.Fragment}),Bd=class extends Uc{constructor(e){super(e),e.animationState||=ul(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Ec(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?.()}},Vd=0,Hd={animation:{Feature:Bd},exit:{Feature:class extends Uc{constructor(){super(...arguments),this.id=Vd++,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=Mo(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.blockInitialAnimation=!1,this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1,this.exitAnimation=void 0;return}let r=this.exitAnimation=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.exitAnimation===r&&(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 Ud(e){return{point:{x:e.pageX,y:e.pageY}}}var Wd=e=>t=>qs(t)&&e(t,Ud(t));function Gd(e,t,n,r){return eu(e,t,Wd(n),r)}var Kd=({current:e})=>e?e.ownerDocument.defaultView:null,qd=(e,t)=>Math.abs(e-t);function Jd(e,t){let n=qd(e.x,t.x),r=qd(e.y,t.y);return Math.sqrt(n**2+r**2)}var Yd=new Set([`auto`,`scroll`]),Xd=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.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Zd(this.lastRawMoveEventInfo,this.transformPagePoint));let e=$d(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Jd(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:Xn.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Zd(t,this.transformPagePoint),this.hasPendingMove=!0,z.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),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=$d(e.type===`pointercancel`?this.lastMoveEventInfo:Zd(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!qs(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Zd(Ud(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Kn;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,$d(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=pn(Gd(this.contextWindow,`pointermove`,this.handlePointerMove,d),Gd(this.contextWindow,`pointerup`,this.handlePointerUp,d),Gd(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Yd.has(e.overflowX)||Yd.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),z.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Gn(this.updatePoint)}};function Zd(e,t){return t?{point:t(e.point)}:e}function Qd(e,t){return{x:e.x-t.x,y:e.y-t.y}}function $d({point:e},t){return{point:e,delta:Qd(e,tf(t)),offset:Qd(e,ef(t)),velocity:nf(t,.1)}}function ef(e){return e[0]}function tf(e){return e[e.length-1]}function nf(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=tf(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>gn(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>gn(t)*2&&(r=e[1]);let a=_n(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 rf(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?V(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?V(n,e,r.max):Math.min(e,n)),e}function af(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 of(e,{top:t,left:n,bottom:r,right:i}){return{x:af(e.x,n,i),y:af(e.y,t,r)}}function sf(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 cf(e,t){return{x:sf(e.x,t.x),y:sf(e.y,t.y)}}function lf(e,t){let n=.5,r=xl(e),i=xl(t);return i>r?n=mn(t.min,t.max-r,e.min):r>i&&(n=mn(e.min,e.max-i,t.min)),on(0,1,n)}function uf(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 df=.35;function ff(e=df){return e===!1?e=0:e===!0&&(e=df),{x:pf(e,`left`,`right`),y:pf(e,`top`,`bottom`)}}function pf(e,t,n){return{min:mf(e,t),max:mf(e,n)}}function mf(e,t){return typeof e==`number`?e:e[t]||0}var hf=new WeakMap,gf=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(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Hs(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),Ul(e=>{let t=this.getAxisMotionValue(e).get()||0;if(yr.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=xl(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&z.update(()=>i(e,t),!1,!0),Bo(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=bf(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&&z.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 Xd(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Kd(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&&z.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||!yf(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=rf(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&&Ad(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?of(n.layoutBox,e):!1,this.elastic=ff(t),r!==this.constraints&&!Ad(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Ul(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=uf(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Ad(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=Ls(n,r.root,this.visualElement.getTransformPagePoint()),a=cf(r.layout.layoutBox,i);if(t){let e=t(vs(a));this.hasMutatedConstraints=!!e,e&&(a=_s(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Ul(o=>{if(!yf(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 Bo(this.visualElement,e),n.start(Eo(e,n,0,t,this.visualElement,!1))}stopAnimation(){Ul(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({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Ul(e=>{if(!yf(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-V(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Ad(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Ul(e=>{let t=this.getAxisMotionValue(e).get();i[e]=lf({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ul(t=>{let n=this.getAxisMotionValue(t);if(!yf(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(V(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;hf.set(this.visualElement,this);let e=this.visualElement.current,t=Gd(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Zs(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Ad(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=vf(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),z.read(r);let o=eu(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Ul(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=df,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function _f(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function vf(e,t,n){let r=vc(e,_f(n)),i=vc(t,_f(n));return()=>{r(),i()}}function yf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function bf(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var xf=class extends Uc{constructor(e){super(e),this.removeGroupControls=fn,this.removeListeners=fn,this.controls=new gf(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fn}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()}},Sf=e=>(t,n)=>{e&&z.update(()=>e(t,n),!1,!0)},Cf=class extends Uc{constructor(){super(...arguments),this.removePointerDownListener=fn}onPointerDown(e){this.session=new Xd(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Kd(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Sf(e),onStart:Sf(t),onMove:Sf(n),onEnd:(e,t)=>{delete this.session,r&&z.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Gd(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},wf=!1,Tf=class extends v.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),wf&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),W.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}),wf=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||z.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(),Rs.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;wf=!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 Ef(e){let[t,n]=Xu(),r=(0,v.useContext)($t);return(0,L.jsx)(Tf,{...e,layoutGroup:r,switchLayoutGroup:(0,v.useContext)(kd),isPresent:t,safeToRemove:n})}var Df={pan:{Feature:Cf},drag:{Feature:xf,ProjectionNode:Vu,MeasureLayout:Ef}};function Of(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&z.postRender(()=>i(t,Ud(t)))}var kf=class extends Uc{mount(){let{current:e}=this.node;e&&(this.unmount=Gs(e,(e,t)=>(Of(this.node,t,`Start`),e=>Of(this.node,e,`End`))))}unmount(){}},Af=class extends Uc{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=pn(eu(this.node.current,`focus`,()=>this.onFocus()),eu(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function jf(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&&z.postRender(()=>i(t,Ud(t)))}var Mf=class extends Uc{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=ic(e,(e,t)=>(jf(this.node,t,`Start`),(e,{success:t})=>jf(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Nf=new WeakMap,Pf=new WeakMap,Ff=e=>{let t=Nf.get(e.target);t&&t(e)},If=e=>{e.forEach(Ff)};function Lf({root:e,...t}){let n=e||document;Pf.has(n)||Pf.set(n,{});let r=Pf.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(If,{root:e,...t})),r[i]}function Rf(e,t,n){let r=Lf(t);return Nf.set(e,n),r.observe(e),()=>{Nf.delete(e),r.unobserve(e)}}var zf={some:0,all:1},Bf=class extends Uc{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:zf[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=Rf(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(Vf(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Vf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Hf={inView:{Feature:Bf},tap:{Feature:Mf},focus:{Feature:Af},hover:{Feature:kf}},Uf={layout:{ProjectionNode:Vu,MeasureLayout:Ef}},Wf=Rd({...Hd,...Hf,...Df,...Uf},zd),Gf=Object.defineProperty,J=(e,t)=>Gf(e,`name`,{value:t,configurable:!0}),Kf=!!(typeof window<`u`&&window.document&&window.document.createElement);function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return J(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}J(Y,`composeEventHandlers`);function qf(e){if(!Kf)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}J(qf,`getOwnerWindow`);function Jf(e){if(!Kf)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}J(Jf,`getOwnerDocument`);function Yf(e,t=!1){let{activeElement:n}=Jf(e);if(!n?.nodeName)return null;if(Xf(n)&&n.contentDocument)return Yf(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Jf(n).getElementById(e);if(t)return t}}return n}J(Yf,`getActiveElement`);function Xf(e){return e.tagName===`IFRAME`}J(Xf,`isFrame`);var Zf=Object.defineProperty,Qf=(e,t)=>Zf(e,`name`,{value:t,configurable:!0});function $f(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Qf($f,`setRef`);function ep(...e){return t=>{let n=!1,r=e.map(e=>{let r=$f(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():$f(e[t],null)}}}}Qf(ep,`composeRefs`);function tp(...e){return v.useCallback(ep(...e),e)}Qf(tp,`useComposedRefs`);var np=Object.defineProperty,rp=(e,t)=>np(e,`name`,{value:t,configurable:!0});function ip(e,t){let n=v.createContext(t);n.displayName=e+`Context`;let r=rp(e=>{let{children:t,...r}=e,i=v.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=v.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return rp(i,`useContext`),[r,i]}rp(ip,`createContext`);function ap(e,t=[]){let n=[];function r(t,r){let i=v.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=rp(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=v.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=v.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return rp(s,`useContext`),[o,s]}rp(r,`createContext`);let i=rp(()=>{let t=n.map(e=>v.createContext(e));return rp(function(n){let r=n?.[e]||t;return v.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,op(i,...t)]}rp(ap,`createContextScope`);function op(...e){let t=e[0];if(e.length===1)return t;let n=rp(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return rp(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}rp(op,`composeContextScopes`);var sp=globalThis?.document?v.useLayoutEffect:()=>{},cp=Object.defineProperty,lp=(e,t)=>cp(e,`name`,{value:t,configurable:!0}),up=v.useId||(()=>void 0),dp=0;function fp(e){let[t,n]=v.useState(up());return sp(()=>{e||n(e=>e??String(dp++))},[e]),e||(t?`radix-${t}`:``)}lp(fp,`useId`);var pp=Object.defineProperty,mp=(e,t)=>pp(e,`name`,{value:t,configurable:!0}),hp=v.useEffectEvent,gp=v.useInsertionEffect;function _p(e){if(typeof hp==`function`)return hp(e);let t=v.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof gp==`function`?gp(()=>{t.current=e}):sp(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}mp(_p,`useEffectEvent`);var vp=Object.defineProperty,yp=(e,t)=>vp(e,`name`,{value:t,configurable:!0}),bp=v.useInsertionEffect||sp;function xp({prop:e,defaultProp:t,onChange:n=yp(()=>{},`onChange`),caller:r}){let[i,a,o]=Sp({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,v.useCallback(t=>{if(s){let n=Cp(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}yp(xp,`useControllableState`);function Sp({defaultProp:e,onChange:t}){let[n,r]=v.useState(e),i=v.useRef(n),a=v.useRef(t);return bp(()=>{a.current=t},[t]),v.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}yp(Sp,`useUncontrolledState`);function Cp(e){return typeof e==`function`}yp(Cp,`isFunction`);var wp=Symbol(`RADIX:SYNC_STATE`);function Tp(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=_p(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=v.useReducer((t,n)=>{if(n.type===wp)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=v.useRef(p);v.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=v.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return v.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:wp,state:i})},[i,d.state,c]),[h,f]}yp(Tp,`useControllableStateReducer`);var Ep=l(h(),1),Dp=Object.defineProperty,Op=(e,t)=>Dp(e,`name`,{value:t,configurable:!0});function kp(e){let t=v.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Lp(r)&&typeof Vp==`function`&&(r=Vp(r._payload)),v.Children.forEach(r,e=>{if(Fp(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Lp(n)&&typeof Vp==`function`&&(n=Vp(n._payload)),a=Mp(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=v.cloneElement(a,void 0,s):!o&&v.Children.count(r)===1&&v.isValidElement(r)&&(a=r);let c=a?Pp(a):void 0,l=tp(n,c);if(!a){if(r||r===0)throw Error(o?Bp(e):zp(e));return r}let u=Np(i,a.props??{});return a.type!==v.Fragment&&(u.ref=n?l:c),v.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Op(kp,`createSlot`);var Ap=Symbol.for(`radix.slottable`);function jp(e){let t=Op(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Ap,t}Op(jp,`createSlottable`);var Mp=Op((e,t)=>{if(`child`in e.props){let t=e.props.child;return v.isValidElement(t)?v.cloneElement(t,void 0,e.props.children(t.props.children)):null}return v.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Np(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}}Op(Np,`mergeProps`);function Pp(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)}Op(Pp,`getElementRef`);function Fp(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ap}Op(Fp,`isSlottable`);var Ip=Symbol.for(`react.lazy`);function Lp(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ip&&`_payload`in e&&Rp(e._payload)}Op(Lp,`isLazyComponent`);function Rp(e){return typeof e==`object`&&!!e&&`then`in e}Op(Rp,`isPromiseLike`);var zp=Op(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Bp=Op(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Vp=v.use,Hp=Object.defineProperty,Up=(e,t)=>Hp(e,`name`,{value:t,configurable:!0}),Wp=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=kp(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Gp(e,t){e&&Ep.flushSync(()=>e.dispatchEvent(t))}Up(Gp,`dispatchDiscreteCustomEvent`);var Kp=Object.defineProperty,qp=(e,t)=>Kp(e,`name`,{value:t,configurable:!0});function Jp(e){let t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}qp(Jp,`useCallbackRef`);var Yp=Object.defineProperty,Xp=(e,t)=>Yp(e,`name`,{value:t,configurable:!0}),Zp=`dismissableLayer.update`,Qp=`dismissableLayer.pointerDownOutside`,$p=`dismissableLayer.focusOutside`,em,tm=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nm=v.forwardRef(Xp(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=v.useContext(tm),[d,f]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=v.useState({}),h=tp(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=_?g.indexOf(_):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=v.useRef(!1),w=am(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=om(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Jp(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return v.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(em=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),sm(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=em))}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),sm())},[d,u]),v.useEffect(()=>{let e=Xp(()=>m({}),`handleUpdate`);return document.addEventListener(Zp,e),()=>document.removeEventListener(Zp,e)},[]),(0,L.jsx)(Wp.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function rm(){let e=v.useContext(tm),[t,n]=v.useState(null);return v.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Xp(rm,`useDismissableLayerSurface`);var im=Xp(()=>!0,`IS_TRUE`);function am(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=im}=t,s=Jp(e),c=v.useRef(!1),l=v.useRef(!1),u=v.useRef(new Map),d=v.useRef(()=>{});return v.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Xp(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Xp(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Xp(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Xp(p,`handleInteractionBubble`);let m=Xp(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||cm(Qp,s,p,{discrete:!0})};if(Xp(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Xp(()=>c.current=!0,`onPointerDownCapture`)}}Xp(am,`usePointerDownOutside`);function om(e,t=globalThis?.document){let n=Jp(e),r=v.useRef(!1);return v.useEffect(()=>{let e=Xp(e=>{e.target&&!r.current&&cm($p,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Xp(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Xp(()=>r.current=!1,`onBlurCapture`)}}Xp(om,`useFocusOutside`);function sm(){let e=new CustomEvent(Zp);document.dispatchEvent(e)}Xp(sm,`dispatchUpdate`);function cm(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?Gp(i,a):i.dispatchEvent(a)}Xp(cm,`handleAndDispatchCustomEvent`);var lm=Object.defineProperty,um=(e,t)=>lm(e,`name`,{value:t,configurable:!0}),dm=`focusScope.autoFocusOnMount`,fm=`focusScope.autoFocusOnUnmount`,pm={bubbles:!1,cancelable:!0},mm=v.forwardRef(um(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=v.useState(null),l=Jp(i),u=Jp(a),d=v.useRef(null),f=tp(t,c),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:xm(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||xm(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xm(s)};um(e,`handleFocusIn`),um(t,`handleFocusOut`),um(n,`handleMutations`),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]),v.useEffect(()=>{if(s){Sm.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(dm,pm);s.addEventListener(dm,l),s.dispatchEvent(t),t.defaultPrevented||(hm(Tm(_m(s)),{select:!0}),document.activeElement===e&&xm(s))}return()=>{s.removeEventListener(dm,l),setTimeout(()=>{let t=new CustomEvent(fm,pm);s.addEventListener(fm,u),s.dispatchEvent(t),t.defaultPrevented||xm(e??document.body,{select:!0}),s.removeEventListener(fm,u),Sm.remove(p)},0)}}},[s,l,u,p]);let m=v.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]=gm(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&xm(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&xm(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(Wp.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function hm(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xm(r,{select:t}),document.activeElement!==n)return}um(hm,`focusFirst`);function gm(e){let t=_m(e);return[vm(t,e),vm(t.reverse(),e)]}um(gm,`getTabbableEdges`);function _m(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:um(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},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}um(_m,`getTabbableCandidates`);function vm(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):ym(r,{upTo:t})))return r}um(vm,`findVisible`);function ym(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}um(ym,`isHidden`);function bm(e){return e instanceof HTMLInputElement&&`select`in e}um(bm,`isSelectableInput`);function xm(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bm(e)&&t&&e.select()}}um(xm,`focus`);var Sm=Cm();function Cm(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=wm(e,t),e.unshift(t)},remove(t){e=wm(e,t),e[0]?.resume()}}}um(Cm,`createFocusScopesStack`);function wm(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}um(wm,`arrayRemove`);function Tm(e){return e.filter(e=>e.tagName!==`A`)}um(Tm,`removeLinks`);var Em=Object.defineProperty,Dm=v.forwardRef(((e,t)=>Em(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=v.useState(!1);sp(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Ep.createPortal((0,L.jsx)(Wp.div,{...r,ref:t}),o):null},`Portal`)),Om=Object.defineProperty,km=(e,t)=>Om(e,`name`,{value:t,configurable:!0});function Am(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}km(Am,`useStateMachine`);var jm=km(e=>{let{present:t,children:n}=e,r=Mm(t),i=typeof n==`function`?n({present:r.isPresent}):v.Children.only(n),a=Pm(r.ref,Im(i));return typeof n==`function`||r.isPresent?v.cloneElement(i,{ref:a}):null},`Presence`);function Mm(e){let[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),a=v.useRef(`none`),o=v.useRef(void 0),[s,c]=Am(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return v.useEffect(()=>{s===`mounted`?(a.current=o.current??Fm(r.current),o.current=void 0):a.current=`none`},[s]),sp(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Fm(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),sp(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=km(a=>{let o=Fm(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=km(e=>{e.target===t&&(a.current=Fm(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:v.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Fm(t)}else r.current=null;n(e)},[])}}km(Mm,`usePresence`);function Nm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}km(Nm,`setRef`);function Pm(...e){let t=v.useRef(e);return t.current=e,v.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Nm(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Nm(n[e],null)}}},[])}km(Pm,`useStableComposedRefs`);function Fm(e){return e?.animationName||`none`}km(Fm,`getAnimationName`);function Im(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)}km(Im,`getElementRef`);var Lm=Object.defineProperty,Rm=(e,t)=>Lm(e,`name`,{value:t,configurable:!0}),zm=0,Bm=null;function Vm(e){return Hm(),e.children}Rm(Vm,`FocusGuards`);function Hm(){v.useEffect(()=>{Bm||={start:Um(),end:Um()};let{start:e,end:t}=Bm;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),zm++,()=>{zm===1&&(Bm?.start.remove(),Bm?.end.remove(),Bm=null),zm=Math.max(0,zm-1)}},[])}Rm(Hm,`useFocusGuards`);function Um(){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}Rm(Um,`createFocusGuard`);var Wm=function(){return Wm=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},Wm.apply(this,arguments)};function Gm(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 Km(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 qm=`right-scroll-bar-position`,Jm=`width-before-scroll-bar`,Ym=`with-scroll-bars-hidden`,Xm=`--removed-body-scroll-bar-size`;function Zm(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Qm(e,t){var n=(0,v.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 $m=typeof window<`u`?v.useLayoutEffect:v.useEffect,eh=new WeakMap;function th(e,t){var n=Qm(t||null,function(t){return e.forEach(function(e){return Zm(e,t)})});return $m(function(){var t=eh.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Zm(e,null)}),i.forEach(function(e){r.has(e)||Zm(e,a)})}eh.set(n,e)},[e]),n}function nh(e){return e}function rh(e,t){t===void 0&&(t=nh);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 ih(e){e===void 0&&(e={});var t=rh(null);return t.options=Wm({async:!0,ssr:!1},e),t}var ah=function(e){var t=e.sideCar,n=Gm(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 v.createElement(r,Wm({},n))};ah.isSideCarExport=!0;function oh(e,t){return e.useMedium(t),ah}var sh=ih(),ch=function(){},lh=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:ch,onWheelCapture:ch,onTouchMoveCapture:ch}),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,y=_===void 0?`div`:_,b=e.gapMode,x=Gm(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=th([n,t]),w=Wm(Wm({},x),i);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:sh,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?v.cloneElement(v.Children.only(s),Wm(Wm({},w),{ref:C})):v.createElement(y,Wm({},w,{className:c,ref:C}),s))});lh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lh.classNames={fullWidth:Jm,zeroRight:qm};var uh=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function dh(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=uh();return t&&e.setAttribute(`nonce`,t),e}function fh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ph(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var mh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=dh())&&(fh(t,n),ph(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hh=function(){var e=mh();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},gh=function(){var e=hh();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},_h={left:0,top:0,right:0,gap:0},vh=function(e){return parseInt(e||``,10)||0},yh=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[vh(n),vh(r),vh(i)]},bh=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return _h;var t=yh(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])}},xh=gh(),Sh=`data-scroll-locked`,Ch=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
17
+ `),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,L.jsx)(qu,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:v.cloneElement(e,{ref:u})})}var Yu=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=en(Xu),d=(0,v.useId)(),f=(0,v.useRef)(n),p=(0,v.useRef)(r);tn(()=>{f.current=n,p.current=r});let m=!0,h=(0,v.useMemo)(()=>(m=!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),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,v.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),v.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,L.jsx)(Ju,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,L.jsx)(nn.Provider,{value:h,children:e})};function Xu(){return new Map}function Zu(e=!0){let t=(0,v.useContext)(nn);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,v.useId)();(0,v.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,v.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Qu=e=>e.key||``;function $u(e){let t=[];return v.Children.forEach(e,e=>{(0,v.isValidElement)(e)&&t.push(e)}),t}var ed=({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]=Zu(o),f=(0,v.useMemo)(()=>$u(e),[e]),p=o&&!u?[]:f.map(Qu),m=(0,v.useRef)(!0),h=(0,v.useRef)(f),g=en(()=>new Map),_=(0,v.useRef)(new Set),[y,b]=(0,v.useState)(f),[x,S]=(0,v.useState)(f);tn(()=>{o&&!u&&!x.length&&d?.()},[u,o,x.length,d]),tn(()=>{m.current=!1,h.current=f;for(let e=0;e<x.length;e++){let t=Qu(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!==y){let e=[...f],t=0;for(let n of x){let r=p.indexOf(Qu(n));r===-1?(e.splice(t++,0,n),C.push(n)):t=r+C.length+1}return a===`wait`&&C.length&&(e=C),S($u(e)),b(f),null}let{forceRender:w}=(0,v.useContext)($t);return(0,L.jsx)(L.Fragment,{children:x.map(e=>{let v=Qu(e),y=o&&!u?!1:f===x||p.includes(v);return(0,L.jsx)(Yu,{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)})})},td=(0,v.createContext)({strict:!1}),W={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`]},nd=!1;function G(){if(nd)return;let e={};for(let t in W)e[t]={isEnabled:e=>W[t].some(t=>!!e[t])};Bc(e),nd=!0}function K(){return G(),Vc()}function rd(e){let t=K();for(let n in e)t[n]={...t[n],...e[n]};Bc(t)}function id({children:e,...t}){let n=(0,v.useContext)(Uu);t={...n,...t},t.transition=vo(t.transition,n.transition),t.isStatic=en(()=>t.isStatic);let r=(0,v.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,L.jsx)(Uu.Provider,{value:r,children:e})}var ad=(0,v.createContext)({});function od(e,t){if(jc(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Oc(t)?t:void 0,animate:Oc(n)?n:void 0}}return e.inherit===!1?{}:t}function sd(e){let{initial:t,animate:n}=od(e,(0,v.useContext)(ad));return(0,v.useMemo)(()=>({initial:t,animate:n}),[cd(t),cd(n)])}function cd(e){return Array.isArray(e)?e.join(` `):e}var ld=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ud(e,t,n){for(let r in t)!zo(t[r])&&!Xc(r,n)&&(e[r]=t[r])}function dd({transformTemplate:e},t){return(0,v.useMemo)(()=>{let n=ld();return fs(n,t,e),Object.assign({},n.vars,n.style)},[t])}function fd(e,t){let n=e.style||{},r={};return ud(r,n,e),Object.assign(r,dd(e,t)),r}function pd(e,t){let n={},r=fd(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 md=()=>({...ld(),attrs:{}});function hd(e,t,n,r){let i=(0,v.useMemo)(()=>{let n=md();return _s(n,t,tl(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};ud(t,e.style,e),i.style={...t,...i.style}}return i}var gd=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 _d(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||gd.has(e)}function vd(e,t){return e.startsWith(`on`)?!_d(e):t?.(e)??!_d(e)}function yd(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(zo(e[a])||(vd(a,r)||n===!0&&_d(a)||!t&&!_d(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var bd=[`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 xd(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(bd.indexOf(e)>-1||/[A-Z]/u.test(e))}function Sd(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??xd(e)?hd:pd)(t,r,i,e),l=yd(t,typeof e==`string`,a,s),u=e===v.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,v.useMemo)(()=>zo(d)?d.get():d,[d]);return(0,v.createElement)(e,{...u,children:f})}function Cd({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:wd(n,r,i,e),renderState:t()}}function wd(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=au(a[e]);let{initial:o,animate:s}=e,c=jc(e),l=Mc(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`&&!Dc(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Mo(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 Td=e=>(t,n)=>{let r=(0,v.useContext)(ad),i=(0,v.useContext)(nn),a=()=>Cd(e,t,r,i);return n?a():en(a)},Ed=Td({scrapeMotionValuesFromProps:Zc,createRenderState:ld}),Dd=Td({scrapeMotionValuesFromProps:rl,createRenderState:md}),Od=Symbol.for(`motionComponentSymbol`);function kd(e,t,n){let r=(0,v.useRef)(n);(0,v.useInsertionEffect)(()=>{r.current=n});let i=(0,v.useRef)(null);return(0,v.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 Ad=(0,v.createContext)({});function jd(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Md(e,t,n,r,i,a){let{visualElement:o}=(0,v.useContext)(ad),s=(0,v.useContext)(td),c=(0,v.useContext)(nn),l=(0,v.useContext)(Uu),u=l.reducedMotion,d=l.skipAnimations,f=(0,v.useRef)(null),p=(0,v.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,v.useContext)(Ad);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Nd(f.current,n,i,h);let g=(0,v.useRef)(!1);(0,v.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[Ho],y=(0,v.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return tn(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),tn(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),(0,v.useEffect)(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function Nd(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:Pd(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&jd(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Pd(e){if(e)return e.options.allowProjection===!1?Pd(e.parent):e.projection}function Fd(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&rd(r);let a=n?n===`svg`:xd(e),o=a?Dd:Ed;function s(n,s){let c,l={...(0,v.useContext)(Uu),...n,layoutId:Id(n)},{isStatic:u,isValidProp:d}=l,f=sd(n),p=o(n,u);if(!u&&typeof window<`u`){Ld(l,r);let t=Rd(l);c=t.MeasureLayout,f.visualElement=Md(e,p,l,i,t.ProjectionNode,a)}return(0,L.jsxs)(ad.Provider,{value:f,children:[c&&f.visualElement?(0,L.jsx)(c,{visualElement:f.visualElement,...l}):null,Sd(e,n,kd(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,v.forwardRef)(s);return c[Od]=e,c}function Id({layoutId:e}){let t=(0,v.useContext)($t).id;return t&&e!==void 0?t+`-`+e:e}function Ld(e,t){(0,v.useContext)(td).strict}function Rd(e){let{drag:t,layout:n}=K();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function zd(e,t){if(typeof Proxy>`u`)return Fd;let n=new Map,r=(n,r)=>Fd(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Fd(a,void 0,e,t)),n.get(a))})}var Bd=(e,t)=>t.isSVG??xd(e)?new il(t):new $c(t,{allowProjection:e!==v.Fragment}),Vd=class extends Wc{constructor(e){super(e),e.animationState||=dl(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Dc(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?.()}},Hd=0,Ud={animation:{Feature:Vd},exit:{Feature:class extends Wc{constructor(){super(...arguments),this.id=Hd++,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=No(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.blockInitialAnimation=!1,this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1,this.exitAnimation=void 0;return}let r=this.exitAnimation=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.exitAnimation===r&&(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 Wd(e){return{point:{x:e.pageX,y:e.pageY}}}var Gd=e=>t=>Js(t)&&e(t,Wd(t));function Kd(e,t,n,r){return tu(e,t,Gd(n),r)}var qd=({current:e})=>e?e.ownerDocument.defaultView:null,Jd=(e,t)=>Math.abs(e-t);function Yd(e,t){let n=Jd(e.x,t.x),r=Jd(e.y,t.y);return Math.sqrt(n**2+r**2)}var Xd=new Set([`auto`,`scroll`]),Zd=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.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Qd(this.lastRawMoveEventInfo,this.transformPagePoint));let e=ef(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Yd(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:Xn.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Qd(t,this.transformPagePoint),this.hasPendingMove=!0,z.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),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=ef(e.type===`pointercancel`?this.lastMoveEventInfo:Qd(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Js(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Qd(Wd(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Kn;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,ef(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=pn(Kd(this.contextWindow,`pointermove`,this.handlePointerMove,d),Kd(this.contextWindow,`pointerup`,this.handlePointerUp,d),Kd(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Xd.has(e.overflowX)||Xd.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),z.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Gn(this.updatePoint)}};function Qd(e,t){return t?{point:t(e.point)}:e}function $d(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ef({point:e},t){return{point:e,delta:$d(e,nf(t)),offset:$d(e,tf(t)),velocity:rf(t,.1)}}function tf(e){return e[0]}function nf(e){return e[e.length-1]}function rf(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=nf(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>gn(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>gn(t)*2&&(r=e[1]);let a=_n(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 af(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?qr(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?qr(n,e,r.max):Math.min(e,n)),e}function of(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 sf(e,{top:t,left:n,bottom:r,right:i}){return{x:of(e.x,n,i),y:of(e.y,t,r)}}function cf(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 lf(e,t){return{x:cf(e.x,t.x),y:cf(e.y,t.y)}}function uf(e,t){let n=.5,r=Sl(e),i=Sl(t);return i>r?n=mn(t.min,t.max-r,e.min):r>i&&(n=mn(e.min,e.max-i,t.min)),on(0,1,n)}function df(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 ff=.35;function pf(e=ff){return e===!1?e=0:e===!0&&(e=ff),{x:mf(e,`left`,`right`),y:mf(e,`top`,`bottom`)}}function mf(e,t,n){return{min:hf(e,t),max:hf(e,n)}}function hf(e,t){return typeof e==`number`?e:e[t]||0}var gf=new WeakMap,_f=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=Tc(),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(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Us(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),Wl(e=>{let t=this.getAxisMotionValue(e).get()||0;if(yr.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Sl(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&z.update(()=>i(e,t),!1,!0),Vo(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=bf(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&&z.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 Zd(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:qd(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&&z.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||!yf(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=af(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&&jd(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?sf(n.layoutBox,e):!1,this.elastic=pf(t),r!==this.constraints&&!jd(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Wl(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=df(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!jd(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=Rs(n,r.root,this.visualElement.getTransformPagePoint()),a=lf(r.layout.layoutBox,i);if(t){let e=t(ys(a));this.hasMutatedConstraints=!!e,e&&(a=vs(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Wl(o=>{if(!yf(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 Vo(this.visualElement,e),n.start(Do(e,n,0,t,this.visualElement,!1))}stopAnimation(){Wl(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({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Wl(e=>{if(!yf(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-qr(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!jd(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Wl(e=>{let t=this.getAxisMotionValue(e).get();i[e]=uf({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Wl(t=>{let n=this.getAxisMotionValue(t);if(!yf(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(qr(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;gf.set(this.visualElement,this);let e=this.visualElement.current,t=Kd(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Qs(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();jd(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=vf(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),z.read(r);let o=tu(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Wl(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=ff,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function q(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function vf(e,t,n){let r=yc(e,q(n)),i=yc(t,q(n));return()=>{r(),i()}}function yf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function bf(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var xf=class extends Wc{constructor(e){super(e),this.removeGroupControls=fn,this.removeListeners=fn,this.controls=new _f(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fn}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()}},Sf=e=>(t,n)=>{e&&z.update(()=>e(t,n),!1,!0)},Cf=class extends Wc{constructor(){super(...arguments),this.removePointerDownListener=fn}onPointerDown(e){this.session=new Zd(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qd(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Sf(e),onStart:Sf(t),onMove:Sf(n),onEnd:(e,t)=>{delete this.session,r&&z.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Kd(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},wf=!1,Tf=class extends v.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),wf&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),U.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}),wf=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||z.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(),zs.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;wf=!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 Ef(e){let[t,n]=Zu(),r=(0,v.useContext)($t);return(0,L.jsx)(Tf,{...e,layoutGroup:r,switchLayoutGroup:(0,v.useContext)(Ad),isPresent:t,safeToRemove:n})}var Df={pan:{Feature:Cf},drag:{Feature:xf,ProjectionNode:Hu,MeasureLayout:Ef}};function Of(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&z.postRender(()=>i(t,Wd(t)))}var kf=class extends Wc{mount(){let{current:e}=this.node;e&&(this.unmount=Ks(e,(e,t)=>(Of(this.node,t,`Start`),e=>Of(this.node,e,`End`))))}unmount(){}},Af=class extends Wc{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=pn(tu(this.node.current,`focus`,()=>this.onFocus()),tu(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function jf(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&&z.postRender(()=>i(t,Wd(t)))}var Mf=class extends Wc{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=ac(e,(e,t)=>(jf(this.node,t,`Start`),(e,{success:t})=>jf(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Nf=new WeakMap,Pf=new WeakMap,Ff=e=>{let t=Nf.get(e.target);t&&t(e)},If=e=>{e.forEach(Ff)};function Lf({root:e,...t}){let n=e||document;Pf.has(n)||Pf.set(n,{});let r=Pf.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(If,{root:e,...t})),r[i]}function Rf(e,t,n){let r=Lf(t);return Nf.set(e,n),r.observe(e),()=>{Nf.delete(e),r.unobserve(e)}}var zf={some:0,all:1},Bf=class extends Wc{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:zf[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=Rf(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(Vf(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Vf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Hf={inView:{Feature:Bf},tap:{Feature:Mf},focus:{Feature:Af},hover:{Feature:kf}},Uf={layout:{ProjectionNode:Hu,MeasureLayout:Ef}},Wf=zd({...Ud,...Hf,...Df,...Uf},Bd),Gf=Object.defineProperty,J=(e,t)=>Gf(e,`name`,{value:t,configurable:!0}),Kf=!!(typeof window<`u`&&window.document&&window.document.createElement);function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return J(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}J(Y,`composeEventHandlers`);function qf(e){if(!Kf)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}J(qf,`getOwnerWindow`);function Jf(e){if(!Kf)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}J(Jf,`getOwnerDocument`);function Yf(e,t=!1){let{activeElement:n}=Jf(e);if(!n?.nodeName)return null;if(Xf(n)&&n.contentDocument)return Yf(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Jf(n).getElementById(e);if(t)return t}}return n}J(Yf,`getActiveElement`);function Xf(e){return e.tagName===`IFRAME`}J(Xf,`isFrame`);var Zf=Object.defineProperty,Qf=(e,t)=>Zf(e,`name`,{value:t,configurable:!0});function $f(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Qf($f,`setRef`);function ep(...e){return t=>{let n=!1,r=e.map(e=>{let r=$f(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():$f(e[t],null)}}}}Qf(ep,`composeRefs`);function tp(...e){return v.useCallback(ep(...e),e)}Qf(tp,`useComposedRefs`);var np=Object.defineProperty,rp=(e,t)=>np(e,`name`,{value:t,configurable:!0});function ip(e,t){let n=v.createContext(t);n.displayName=e+`Context`;let r=rp(e=>{let{children:t,...r}=e,i=v.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=v.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return rp(i,`useContext`),[r,i]}rp(ip,`createContext`);function ap(e,t=[]){let n=[];function r(t,r){let i=v.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=rp(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=v.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=v.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return rp(s,`useContext`),[o,s]}rp(r,`createContext`);let i=rp(()=>{let t=n.map(e=>v.createContext(e));return rp(function(n){let r=n?.[e]||t;return v.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,op(i,...t)]}rp(ap,`createContextScope`);function op(...e){let t=e[0];if(e.length===1)return t;let n=rp(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return rp(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}rp(op,`composeContextScopes`);var sp=globalThis?.document?v.useLayoutEffect:()=>{},cp=Object.defineProperty,lp=(e,t)=>cp(e,`name`,{value:t,configurable:!0}),up=v.useId||(()=>void 0),dp=0;function fp(e){let[t,n]=v.useState(up());return sp(()=>{e||n(e=>e??String(dp++))},[e]),e||(t?`radix-${t}`:``)}lp(fp,`useId`);var pp=Object.defineProperty,mp=(e,t)=>pp(e,`name`,{value:t,configurable:!0}),hp=v.useEffectEvent,gp=v.useInsertionEffect;function _p(e){if(typeof hp==`function`)return hp(e);let t=v.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof gp==`function`?gp(()=>{t.current=e}):sp(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}mp(_p,`useEffectEvent`);var vp=Object.defineProperty,yp=(e,t)=>vp(e,`name`,{value:t,configurable:!0}),bp=v.useInsertionEffect||sp;function xp({prop:e,defaultProp:t,onChange:n=yp(()=>{},`onChange`),caller:r}){let[i,a,o]=Sp({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,v.useCallback(t=>{if(s){let n=Cp(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}yp(xp,`useControllableState`);function Sp({defaultProp:e,onChange:t}){let[n,r]=v.useState(e),i=v.useRef(n),a=v.useRef(t);return bp(()=>{a.current=t},[t]),v.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}yp(Sp,`useUncontrolledState`);function Cp(e){return typeof e==`function`}yp(Cp,`isFunction`);var wp=Symbol(`RADIX:SYNC_STATE`);function Tp(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=_p(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=v.useReducer((t,n)=>{if(n.type===wp)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=v.useRef(p);v.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=v.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return v.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:wp,state:i})},[i,d.state,c]),[h,f]}yp(Tp,`useControllableStateReducer`);var Ep=l(h(),1),Dp=Object.defineProperty,Op=(e,t)=>Dp(e,`name`,{value:t,configurable:!0});function kp(e){let t=v.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Lp(r)&&typeof Vp==`function`&&(r=Vp(r._payload)),v.Children.forEach(r,e=>{if(Fp(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Lp(n)&&typeof Vp==`function`&&(n=Vp(n._payload)),a=Mp(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=v.cloneElement(a,void 0,s):!o&&v.Children.count(r)===1&&v.isValidElement(r)&&(a=r);let c=a?Pp(a):void 0,l=tp(n,c);if(!a){if(r||r===0)throw Error(o?Bp(e):zp(e));return r}let u=Np(i,a.props??{});return a.type!==v.Fragment&&(u.ref=n?l:c),v.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Op(kp,`createSlot`);var Ap=Symbol.for(`radix.slottable`);function jp(e){let t=Op(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Ap,t}Op(jp,`createSlottable`);var Mp=Op((e,t)=>{if(`child`in e.props){let t=e.props.child;return v.isValidElement(t)?v.cloneElement(t,void 0,e.props.children(t.props.children)):null}return v.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Np(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}}Op(Np,`mergeProps`);function Pp(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)}Op(Pp,`getElementRef`);function Fp(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ap}Op(Fp,`isSlottable`);var Ip=Symbol.for(`react.lazy`);function Lp(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ip&&`_payload`in e&&Rp(e._payload)}Op(Lp,`isLazyComponent`);function Rp(e){return typeof e==`object`&&!!e&&`then`in e}Op(Rp,`isPromiseLike`);var zp=Op(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Bp=Op(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Vp=v.use,Hp=Object.defineProperty,Up=(e,t)=>Hp(e,`name`,{value:t,configurable:!0}),Wp=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=kp(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Gp(e,t){e&&Ep.flushSync(()=>e.dispatchEvent(t))}Up(Gp,`dispatchDiscreteCustomEvent`);var Kp=Object.defineProperty,qp=(e,t)=>Kp(e,`name`,{value:t,configurable:!0});function Jp(e){let t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}qp(Jp,`useCallbackRef`);var Yp=Object.defineProperty,Xp=(e,t)=>Yp(e,`name`,{value:t,configurable:!0}),Zp=`dismissableLayer.update`,Qp=`dismissableLayer.pointerDownOutside`,$p=`dismissableLayer.focusOutside`,em,tm=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nm=v.forwardRef(Xp(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=v.useContext(tm),[d,f]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=v.useState({}),h=tp(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=_?g.indexOf(_):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=v.useRef(!1),w=am(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=om(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Jp(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return v.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(em=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),sm(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=em))}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),sm())},[d,u]),v.useEffect(()=>{let e=Xp(()=>m({}),`handleUpdate`);return document.addEventListener(Zp,e),()=>document.removeEventListener(Zp,e)},[]),(0,L.jsx)(Wp.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function rm(){let e=v.useContext(tm),[t,n]=v.useState(null);return v.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Xp(rm,`useDismissableLayerSurface`);var im=Xp(()=>!0,`IS_TRUE`);function am(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=im}=t,s=Jp(e),c=v.useRef(!1),l=v.useRef(!1),u=v.useRef(new Map),d=v.useRef(()=>{});return v.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Xp(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Xp(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Xp(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Xp(p,`handleInteractionBubble`);let m=Xp(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||cm(Qp,s,p,{discrete:!0})};if(Xp(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Xp(()=>c.current=!0,`onPointerDownCapture`)}}Xp(am,`usePointerDownOutside`);function om(e,t=globalThis?.document){let n=Jp(e),r=v.useRef(!1);return v.useEffect(()=>{let e=Xp(e=>{e.target&&!r.current&&cm($p,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Xp(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Xp(()=>r.current=!1,`onBlurCapture`)}}Xp(om,`useFocusOutside`);function sm(){let e=new CustomEvent(Zp);document.dispatchEvent(e)}Xp(sm,`dispatchUpdate`);function cm(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?Gp(i,a):i.dispatchEvent(a)}Xp(cm,`handleAndDispatchCustomEvent`);var lm=Object.defineProperty,um=(e,t)=>lm(e,`name`,{value:t,configurable:!0}),dm=`focusScope.autoFocusOnMount`,fm=`focusScope.autoFocusOnUnmount`,pm={bubbles:!1,cancelable:!0},mm=v.forwardRef(um(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=v.useState(null),l=Jp(i),u=Jp(a),d=v.useRef(null),f=tp(t,c),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:xm(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||xm(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xm(s)};um(e,`handleFocusIn`),um(t,`handleFocusOut`),um(n,`handleMutations`),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]),v.useEffect(()=>{if(s){Sm.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(dm,pm);s.addEventListener(dm,l),s.dispatchEvent(t),t.defaultPrevented||(hm(Tm(_m(s)),{select:!0}),document.activeElement===e&&xm(s))}return()=>{s.removeEventListener(dm,l),setTimeout(()=>{let t=new CustomEvent(fm,pm);s.addEventListener(fm,u),s.dispatchEvent(t),t.defaultPrevented||xm(e??document.body,{select:!0}),s.removeEventListener(fm,u),Sm.remove(p)},0)}}},[s,l,u,p]);let m=v.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]=gm(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&xm(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&xm(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(Wp.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function hm(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xm(r,{select:t}),document.activeElement!==n)return}um(hm,`focusFirst`);function gm(e){let t=_m(e);return[vm(t,e),vm(t.reverse(),e)]}um(gm,`getTabbableEdges`);function _m(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:um(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},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}um(_m,`getTabbableCandidates`);function vm(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):ym(r,{upTo:t})))return r}um(vm,`findVisible`);function ym(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}um(ym,`isHidden`);function bm(e){return e instanceof HTMLInputElement&&`select`in e}um(bm,`isSelectableInput`);function xm(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bm(e)&&t&&e.select()}}um(xm,`focus`);var Sm=Cm();function Cm(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=wm(e,t),e.unshift(t)},remove(t){e=wm(e,t),e[0]?.resume()}}}um(Cm,`createFocusScopesStack`);function wm(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}um(wm,`arrayRemove`);function Tm(e){return e.filter(e=>e.tagName!==`A`)}um(Tm,`removeLinks`);var Em=Object.defineProperty,Dm=v.forwardRef(((e,t)=>Em(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=v.useState(!1);sp(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Ep.createPortal((0,L.jsx)(Wp.div,{...r,ref:t}),o):null},`Portal`)),Om=Object.defineProperty,km=(e,t)=>Om(e,`name`,{value:t,configurable:!0});function Am(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}km(Am,`useStateMachine`);var jm=km(e=>{let{present:t,children:n}=e,r=Mm(t),i=typeof n==`function`?n({present:r.isPresent}):v.Children.only(n),a=Pm(r.ref,Im(i));return typeof n==`function`||r.isPresent?v.cloneElement(i,{ref:a}):null},`Presence`);function Mm(e){let[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),a=v.useRef(`none`),o=v.useRef(void 0),[s,c]=Am(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return v.useEffect(()=>{s===`mounted`?(a.current=o.current??Fm(r.current),o.current=void 0):a.current=`none`},[s]),sp(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Fm(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),sp(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=km(a=>{let o=Fm(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=km(e=>{e.target===t&&(a.current=Fm(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:v.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Fm(t)}else r.current=null;n(e)},[])}}km(Mm,`usePresence`);function Nm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}km(Nm,`setRef`);function Pm(...e){let t=v.useRef(e);return t.current=e,v.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Nm(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Nm(n[e],null)}}},[])}km(Pm,`useStableComposedRefs`);function Fm(e){return e?.animationName||`none`}km(Fm,`getAnimationName`);function Im(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)}km(Im,`getElementRef`);var Lm=Object.defineProperty,Rm=(e,t)=>Lm(e,`name`,{value:t,configurable:!0}),zm=0,Bm=null;function Vm(e){return Hm(),e.children}Rm(Vm,`FocusGuards`);function Hm(){v.useEffect(()=>{Bm||={start:Um(),end:Um()};let{start:e,end:t}=Bm;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),zm++,()=>{zm===1&&(Bm?.start.remove(),Bm?.end.remove(),Bm=null),zm=Math.max(0,zm-1)}},[])}Rm(Hm,`useFocusGuards`);function Um(){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}Rm(Um,`createFocusGuard`);var Wm=function(){return Wm=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},Wm.apply(this,arguments)};function Gm(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 Km(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 qm=`right-scroll-bar-position`,Jm=`width-before-scroll-bar`,Ym=`with-scroll-bars-hidden`,Xm=`--removed-body-scroll-bar-size`;function Zm(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Qm(e,t){var n=(0,v.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 $m=typeof window<`u`?v.useLayoutEffect:v.useEffect,eh=new WeakMap;function th(e,t){var n=Qm(t||null,function(t){return e.forEach(function(e){return Zm(e,t)})});return $m(function(){var t=eh.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Zm(e,null)}),i.forEach(function(e){r.has(e)||Zm(e,a)})}eh.set(n,e)},[e]),n}function nh(e){return e}function rh(e,t){t===void 0&&(t=nh);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 ih(e){e===void 0&&(e={});var t=rh(null);return t.options=Wm({async:!0,ssr:!1},e),t}var ah=function(e){var t=e.sideCar,n=Gm(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 v.createElement(r,Wm({},n))};ah.isSideCarExport=!0;function oh(e,t){return e.useMedium(t),ah}var sh=ih(),ch=function(){},lh=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:ch,onWheelCapture:ch,onTouchMoveCapture:ch}),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,y=_===void 0?`div`:_,b=e.gapMode,x=Gm(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=th([n,t]),w=Wm(Wm({},x),i);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:sh,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?v.cloneElement(v.Children.only(s),Wm(Wm({},w),{ref:C})):v.createElement(y,Wm({},w,{className:c,ref:C}),s))});lh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lh.classNames={fullWidth:Jm,zeroRight:qm};var uh=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function dh(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=uh();return t&&e.setAttribute(`nonce`,t),e}function fh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ph(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var mh=function(){var e=0,t=null;return{add:function(n){e==0&&(t=dh())&&(fh(t,n),ph(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hh=function(){var e=mh();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},gh=function(){var e=hh();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},_h={left:0,top:0,right:0,gap:0},vh=function(e){return parseInt(e||``,10)||0},yh=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[vh(n),vh(r),vh(i)]},bh=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return _h;var t=yh(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])}},xh=gh(),Sh=`data-scroll-locked`,Ch=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
18
18
  .${Ym} {
19
19
  overflow: hidden ${r};
20
20
  padding-right: ${s}px ${r};
@@ -54,15 +54,15 @@ Error generating stack: `+e.message+`
54
54
  `},wh=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Th=function(){v.useEffect(function(){return document.body.setAttribute(Sh,(wh()+1).toString()),function(){var e=wh()-1;e<=0?document.body.removeAttribute(Sh):document.body.setAttribute(Sh,e.toString())}},[])},Eh=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Th();var a=v.useMemo(function(){return bh(i)},[i]);return v.createElement(xh,{styles:Ch(a,!t,i,n?``:`!important`)})},Dh=!1;if(typeof window<`u`)try{var Oh=Object.defineProperty({},"passive",{get:function(){return Dh=!0,!0}});window.addEventListener(`test`,Oh,Oh),window.removeEventListener(`test`,Oh,Oh)}catch{Dh=!1}var kh=Dh?{passive:!1}:!1,Ah=function(e){return e.tagName===`TEXTAREA`},jh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ah(e)&&n[t]===`visible`)},Mh=function(e){return jh(e,`overflowY`)},Nh=function(e){return jh(e,`overflowX`)},Ph=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Lh(e,r)){var i=Rh(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Fh=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ih=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Lh=function(e,t){return e===`v`?Mh(t):Nh(t)},Rh=function(e,t){return e===`v`?Fh(t):Ih(t)},zh=function(e,t){return e===`h`&&t===`rtl`?-1:1},Bh=function(e,t,n,r,i){var a=zh(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=Rh(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Lh(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},Vh=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Hh=function(e){return[e.deltaX,e.deltaY]},Uh=function(e){return e&&`current`in e?e.current:e},Wh=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Gh=function(e){return`
55
55
  .block-interactivity-${e} {pointer-events: none;}
56
56
  .allow-interactivity-${e} {pointer-events: all;}
57
- `},Kh=0,qh=[];function Jh(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Kh++)[0],a=v.useState(gh)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Km([e.lockRef.current],(e.shards||[]).map(Uh),!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=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Vh(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=Ph(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ph(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 Bh(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(qh.length&&qh[qh.length-1]===a){var r=`deltaY`in n?Hh(n):Vh(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Wh(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Uh).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=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Yh(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=Vh(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,Hh(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,Vh(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return qh.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,kh),document.addEventListener(`touchmove`,c,kh),document.addEventListener(`touchstart`,u,kh),function(){qh=qh.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,kh),document.removeEventListener(`touchmove`,c,kh),document.removeEventListener(`touchstart`,u,kh)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:Gh(i)}):null,p?v.createElement(Eh,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Yh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Xh=oh(sh,Jh),Zh=v.forwardRef(function(e,t){return v.createElement(lh,Wm({},e,{ref:t,sideCar:Xh}))});Zh.classNames=lh.classNames;var Qh=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},$h=new WeakMap,eg=new WeakMap,tg={},ng=0,rg=function(e){return e&&(e.host||rg(e.parentNode))},ig=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=rg(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})},ag=function(e,t,n,r){var i=ig(t,Array.isArray(e)?e:[e]);tg[n]||(tg[n]=new WeakMap);var a=tg[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=($h.get(e)||0)+1,l=(a.get(e)||0)+1;$h.set(e,c),a.set(e,l),o.push(e),c===1&&i&&eg.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(),ng++,function(){o.forEach(function(e){var t=$h.get(e)-1,i=a.get(e)-1;$h.set(e,t),a.set(e,i),t||(eg.has(e)||e.removeAttribute(r),eg.delete(e)),i||e.removeAttribute(n)}),ng--,ng||($h=new WeakMap,$h=new WeakMap,eg=new WeakMap,tg={})}},og=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Qh(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ag(r,i,n,`aria-hidden`)):function(){return null}},sg=Object.defineProperty,cg=(e,t)=>sg(e,`name`,{value:t,configurable:!0}),lg=`Dialog`,[ug,dg]=ap(lg),[fg,pg]=ug(lg),mg=cg(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=xp({prop:r,defaultProp:i??!1,onChange:a,caller:lg}),[d,f]=v.useState(0),[p,m]=v.useState(0);return(0,L.jsx)(fg,{scope:t,triggerRef:s,contentRef:c,contentId:fp(),titleId:fp(),descriptionId:fp(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),hg=`DialogPortal`,[gg,_g]=ug(hg,{forceMount:void 0}),vg=cg(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=pg(hg,t);return(0,L.jsx)(gg,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,L.jsx)(jm,{present:n||a.open,children:(0,L.jsx)(Dm,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),yg=`DialogOverlay`,bg=v.forwardRef(cg(function(e,t){let n=_g(yg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=pg(yg,e.__scopeDialog);return a.modal?(0,L.jsx)(jm,{present:r||a.open,children:(0,L.jsx)(Sg,{...i,ref:t})}):null},`DialogOverlay`)),xg=kp(`DialogOverlay.RemoveScroll`),Sg=v.forwardRef(cg(function(e,t){let{__scopeDialog:n,...r}=e,i=pg(yg,n),a=tp(t,rm());return(0,L.jsx)(Zh,{as:xg,allowPinchZoom:!0,shards:[i.contentRef],children:(0,L.jsx)(Wp.div,{"data-state":Mg(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Cg=`DialogContent`,wg=v.forwardRef(cg(function(e,t){let n=_g(Cg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=pg(Cg,e.__scopeDialog);return(0,L.jsx)(jm,{present:r||a.open,children:a.modal?(0,L.jsx)(Tg,{...i,ref:t}):(0,L.jsx)(Eg,{...i,ref:t})})},`DialogContent`)),Tg=v.forwardRef(cg(function(e,t){let n=pg(Cg,e.__scopeDialog),r=v.useRef(null),i=tp(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return og(e)},[]),(0,L.jsx)(Dg,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Y(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Eg=v.forwardRef(cg(function(e,t){let n=pg(Cg,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,L.jsx)(Dg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Dg=v.forwardRef(cg(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=pg(Cg,n);return Hm(),(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(mm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(nm,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Mg(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Og=`DialogTitle`,kg=v.forwardRef(cg(function(e,t){let{__scopeDialog:n,...r}=e,i=pg(Og,n),{setTitleCount:a}=i;return sp(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(Wp.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Ag=`DialogClose`,jg=v.forwardRef(cg(function(e,t){let{__scopeDialog:n,...r}=e,i=pg(Ag,n);return(0,L.jsx)(Wp.button,{type:`button`,...r,ref:t,onClick:Y(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Mg(e){return e?`open`:`closed`}cg(Mg,`getState`);var Ng=window.__DESIGN_STATIC__===!0,Pg=class extends Error{status;constructor(e,t){super(t),this.status=e}};async function Fg(e,t){let n=await fetch(e,{cache:t});if(!n.ok){let e=`${n.status} ${n.statusText}`;try{let t=await n.json();t.error&&(e=t.error)}catch{}throw new Pg(n.status,e)}return await n.json()}async function Ig(e){try{return await e}catch(e){if(e instanceof Pg&&e.status===404)return null;throw e}}var Lg=``;function Rg(e){return Lg!==e.version&&(Lg=e.version,console.info(`foss-design ${e.version}${Ng?` (static build)`:``}`)),e}var zg={live:!0,project:()=>Fg(`/api/project`,`no-store`).then(Rg),canvas:async e=>({doc:await Fg(`/api/canvas/${encodeURIComponent(e)}`,`no-store`),base:``}),system:async()=>{let e=await Ig(Fg(`/api/system`,`no-store`));return e?{doc:e,base:``}:null},async source(e){let t=await fetch(`/api/source?path=${encodeURIComponent(e)}`,{cache:`no-store`});if(!t.ok)throw new Pg(t.status,`Could not read ${e}`);return t.text()},async setIcon(e){let t=await fetch(`/api/icon`,{method:e?`PUT`:`DELETE`,headers:e?{"content-type":e.type||`application/octet-stream`}:void 0,body:e});if(!t.ok){let e=await t.json().catch(()=>({}));throw new Pg(t.status,e.error??`${t.status} ${t.statusText}`)}}},Bg=null,Vg={live:!1,project:()=>Fg(`api/project.json`,`default`).then(Rg),canvas:async e=>({doc:await Fg(`api/canvas/${encodeURIComponent(e)}.json`,`default`),base:``}),system:async()=>{let e=await Ig(Fg(`api/system.json`,`default`));return e?{doc:e,base:``}:null},async source(e){Bg??=Fg(`api/sources.json`,`default`).catch(()=>({}));let t=(await Bg)[e];if(t===void 0)throw new Pg(404,`${e} is not in this build`);return t}};function Hg(e,t){if(!t)return e;try{let n=new URL(t.endsWith(`/`)?t:`${t}/`,document.baseURI);return new URL(e,n).href}catch{return e}}function Ug(e,t){if(!t)return e;let n=e=>Hg(e,t);return{...e,pages:e.pages.map(e=>({...e,sections:e.sections.map(e=>({...e,items:e.items.map(e=>{if(e.kind===`screen`){let t=e=>e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t&&n(t)])):void 0;return{...e,url:n(e.url),snapshots:t(e.snapshots),thumbs:t(e.thumbs)}}return e.kind===`image`?{...e,url:n(e.url)}:e})}))}))}}function Wg(e,t){if(!t)return e;let n=e=>Hg(e,t);return{...e,components:e.components.map(e=>({...e,url:n(e.url)})),assets:e.assets.map(e=>({...e,url:n(e.url)})),typographyUrl:e.typographyUrl&&n(e.typographyUrl)}}function Gg(e){return{all:[`design`,e],project:[`design`,e,`project`],canvas:t=>[`design`,e,`canvas`,t],system:[`design`,e,`system`],sources:[`design`,e,`source`],source:(t,n)=>[`design`,e,`source`,t,n]}}var Kg=new WeakMap,qg=0;function Jg(e){let t=Kg.get(e);return t||(qg+=1,t=String(qg),Kg.set(e,t)),t}var Yg=(0,v.createContext)(null);function Xg(){let e=(0,v.useContext)(Yg);if(!e)throw Error(`foss-design: this component renders inside <DesignViewer>`);return e}function Zg(e,t){if(e===t)return!0;try{return decodeURIComponent(e)===t}catch{return!1}}function Qg(e){return new Bt({defaultOptions:{queries:{staleTime:e?0:1/0,retry:1,refetchOnWindowFocus:!1}}})}function $g(){let{source:e,keys:t,scope:n}=Xg();return Qt({queryKey:t.project,queryFn:()=>e.project(),enabled:!n})}function e_(e,t=!0){let{source:n,keys:r}=Xg();return Qt({queryKey:r.canvas(e),queryFn:async()=>{let{doc:t,base:r}=await n.canvas(e);return Ug(t,r)},placeholderData:e=>e,enabled:t})}function t_(e=!0){let{source:t,keys:n}=Xg();return Qt({queryKey:n.system,queryFn:async()=>{let e=await t.system();return e?Wg(e.doc,e.base):null},enabled:e})}function n_(e,t=`system`){let{source:n,keys:r}=Xg();return Qt({queryKey:r.source(t,e??``),queryFn:()=>n.source(e,t),enabled:!!e})}function r_(e,t){let n=null,r=!1;return n=new EventSource(`/api/events`),n.onopen=()=>{r&&(r=!1,e.invalidateQueries({queryKey:t.all}))},n.onerror=()=>{r=!0},n.onmessage=n=>{let r;try{r=JSON.parse(n.data)}catch{return}if(r.type===`project`)e.invalidateQueries({queryKey:t.project});else if(r.type===`system`)e.invalidateQueries({queryKey:t.system}),e.invalidateQueries({queryKey:t.sources});else if(r.type===`canvas`||r.type===`snapshot`){let n=r.type===`canvas`?r.id:r.canvas;e.invalidateQueries({queryKey:t.canvas(n)}),r.type===`snapshot`&&e.invalidateQueries({queryKey:t.project})}},()=>n?.close()}function X(...e){return e.filter(Boolean).join(` `)}var i_=null;function a_(e,t){i_={canvas:e,item:t},window.dispatchEvent(new CustomEvent(`design:focus`,{detail:i_}))}function o_(e){if(!i_||i_.canvas!==e)return null;let t=i_.item;return i_=null,t}var s_=class{value;listeners=new Set;constructor(e){this.value=e}get=()=>this.value;set=e=>{let t=typeof e==`function`?e(this.value):e;if(!Object.is(t,this.value)){this.value=t;for(let e of this.listeners)e()}};subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})};function c_(e,t=e=>e){return(0,v.useSyncExternalStore)(e.subscribe,()=>t(e.get()),()=>t(e.get()))}var l_=`foss-design.theme`;function u_(){try{let e=localStorage.getItem(l_);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`system`}var d_=new s_(u_()),f_=window.matchMedia(`(prefers-color-scheme: dark)`);function p_(e){return e===`system`?f_.matches?`dark`:`light`:e}function m_(){document.documentElement.dataset.theme=p_(d_.get())}f_.addEventListener(`change`,m_),d_.subscribe(m_),m_();function h_(e){try{localStorage.setItem(l_,e)}catch{}d_.set(e)}function g_(){return c_(d_)}function __(){let e=c_(d_),t=(0,v.useSyncExternalStore)(e=>(f_.addEventListener(`change`,e),()=>f_.removeEventListener(`change`,e)),()=>f_.matches);return e===`system`?t?`dark`:`light`:e}var v_={plus:`<path d="M5 12h14"/><path d="M12 5v14"/>`,check:`<path d="M20 6 9 17l-5-5"/>`,x:`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`,"chevron-down":`<path d="m6 9 6 6 6-6"/>`,"chevron-up":`<path d="m18 15-6-6-6 6"/>`,"chevron-right":`<path d="m9 18 6-6-6-6"/>`,"arrow-right":`<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>`,chevrons:`<path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/>`,copy:`<rect width="14" height="14" x="8" y="8" rx="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>`,search:`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>`,bell:`<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/>`,refresh:`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>`,"up-right":`<path d="M7 7h10v10"/><path d="M7 17 17 7"/>`,"down-left":`<path d="M17 7 7 17"/><path d="M17 17H7V7"/>`,external:`<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>`,"user-plus":`<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M19 8v6"/><path d="M22 11h-6"/>`,user:`<circle cx="12" cy="8" r="5"/><path d="M20 21a8 8 0 0 0-16 0"/>`,trash:`<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>`,more:`<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>`,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"/><path d="M12 9v4"/><path d="M12 17h.01"/>`,info:`<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>`,upload:`<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m17 8-5-5-5 5"/><path d="M12 3v12"/>`,download:`<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10 5 5 5-5"/><path d="M12 15V3"/>`,shield:`<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"/><path d="m9 12 2 2 4-4"/>`,logout:`<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><path d="m16 17 5-5-5-5"/><path d="M21 12H9"/>`,loader:`<path d="M21 12a9 9 0 1 1-6.219-8.56"/>`,"circle-check":`<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>`,"circle-dashed":`<circle cx="12" cy="12" r="9" stroke-dasharray="3 3"/>`,clock:`<circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/>`,mail:`<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>`,send:`<path d="m22 2-7 20-4-9-9-4Z"/><path d="M22 2 11 13"/>`,chat:`<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>`,wallet:`<path d="M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1"/><path d="M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"/>`,"file-code":`<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="m10 13-2 2 2 2"/><path d="m14 17 2-2-2-2"/>`,ban:`<circle cx="12" cy="12" r="10"/><path d="m4.9 4.9 14.2 14.2"/>`,code:`<path d="m16 18 6-6-6-6"/><path d="m8 6-6 6 6 6"/>`,"chevron-left":`<path d="m15 18-6-6 6-6"/>`,bluetooth:`<path d="m7 7 10 10-5 5V2l5 5L7 17"/>`,face:`<path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><path d="M9 9h.01"/><path d="M15 9h.01"/>`,eye:`<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/>`,clipboard:`<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><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"/>`,grip:`<circle cx="9" cy="5" r="1"/><circle cx="9" cy="12" r="1"/><circle cx="9" cy="19" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="15" cy="19" r="1"/>`,list:`<path d="M3 12h.01"/><path d="M3 18h.01"/><path d="M3 6h.01"/><path d="M8 12h13"/><path d="M8 18h13"/><path d="M8 6h13"/>`,lock:`<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>`,hw:`<rect width="20" height="10" x="2" y="7" rx="2"/><path d="M15 7v10"/><circle cx="8" cy="12" r="1.5"/>`,link:`<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>`,signal:`<path d="M2 20h.01"/><path d="M7 20v-4"/><path d="M12 20v-8"/><path d="M17 20V8"/>`,grid:`<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>`,coins:`<circle cx="8" cy="8" r="6"/><path d="M18.09 10.37A6 6 0 1 1 10.34 18"/><path d="M7 6h1v4"/><path d="m16.71 13.88.7.71-2.82 2.82"/>`,arrows:`<path d="M8 3 4 7l4 4"/><path d="M4 7h16"/><path d="m16 21 4-4-4-4"/><path d="M20 17H4"/>`,key:`<path d="m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"/><path d="m21 2-9.6 9.6"/><circle cx="7.5" cy="15.5" r="5.5"/>`,blocks:`<rect width="7" height="7" x="14" y="3" rx="1"/><path d="M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3"/>`,settings:`<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>`,qr:`<rect width="5" height="5" x="3" y="3" rx="1"/><rect width="5" height="5" x="16" y="3" rx="1"/><rect width="5" height="5" x="3" y="16" rx="1"/><path d="M21 16h-3a2 2 0 0 0-2 2v3"/><path d="M21 21v.01"/><path d="M12 7v3a2 2 0 0 1-2 2H7"/><path d="M3 12h.01"/><path d="M12 3h.01"/><path d="M12 16v.01"/><path d="M16 12h1"/><path d="M21 12v.01"/><path d="M12 21v-1"/>`,edit:`<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"/>`,star:`<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"/>`,home:`<path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"/><path d="M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>`,moon:`<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>`,sun:`<circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/>`,languages:`<path d="m5 8 6 6"/><path d="m4 14 6-6 2-3"/><path d="M2 5h12"/><path d="M7 2h1"/><path d="m22 22-5-10-5 10"/><path d="M14 18h6"/>`,"arrow-left":`<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>`,play:`<polygon points="6 3 20 12 6 21 6 3"/>`,"zoom-in":`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/><path d="M11 8v6"/><path d="M8 11h6"/>`,"zoom-out":`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/><path d="M8 11h6"/>`,fit:`<path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/>`,"panel-left":`<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/>`,layers:`<path d="M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"/><path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"/><path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"/>`,file:`<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/>`,palette:`<circle cx="13.5" cy="6.5" r="1"/><circle cx="17.5" cy="10.5" r="1"/><circle cx="8.5" cy="7.5" r="1"/><circle cx="6.5" cy="12.5" r="1"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.93 0 1.65-.75 1.65-1.69 0-.44-.18-.84-.44-1.13-.29-.29-.44-.65-.44-1.13a1.64 1.64 0 0 1 1.67-1.67h2c3.05 0 5.55-2.5 5.55-5.55C21.96 6.01 17.46 2 12 2z"/>`,type:`<path d="M4 7V4h16v3"/><path d="M9 20h6"/><path d="M12 4v16"/>`,shape:`<path d="M5 3a2 2 0 0 0-2 2"/><path d="M19 3a2 2 0 0 1 2 2"/><path d="M21 19a2 2 0 0 1-2 2"/><path d="M5 21a2 2 0 0 1-2-2"/><path d="M9 3h1"/><path d="M9 21h1"/><path d="M14 3h1"/><path d="M14 21h1"/><path d="M3 9v1"/><path d="M21 9v1"/><path d="M3 14v1"/><path d="M21 14v1"/>`,motion:`<path d="M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/><path d="M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/><path d="M2 6c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/>`,book:`<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/>`,image:`<rect width="18" height="18" x="3" y="3" rx="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.09-3.09a2 2 0 0 0-2.82 0L6 21"/>`,monitor:`<rect width="20" height="14" x="2" y="3" rx="2"/><path d="M8 21h8"/><path d="M12 17v4"/>`,smartphone:`<rect width="14" height="20" x="5" y="2" rx="2"/><path d="M12 18h.01"/>`,tablet:`<rect width="16" height="20" x="4" y="2" rx="2"/><path d="M12 18h.01"/>`,note:`<path d="M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z"/><path d="M15 3v4a2 2 0 0 0 2 2h4"/>`,globe:`<circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/>`,pointer:`<path d="M4.04 4.69a.5.5 0 0 1 .65-.65l16 6.5a.5.5 0 0 1-.06.95l-6.12 1.58a2 2 0 0 0-1.44 1.44l-1.58 6.12a.5.5 0 0 1-.95.06z"/>`,component:`<path d="M5.5 8.5 9 12l-3.5 3.5L2 12l3.5-3.5Z"/><path d="m12 2 3.5 3.5L12 9 8.5 5.5 12 2Z"/><path d="M18.5 8.5 22 12l-3.5 3.5L15 12l3.5-3.5Z"/><path d="m12 15 3.5 3.5L12 22l-3.5-3.5L12 15Z"/>`,keyboard:`<rect width="20" height="16" x="2" y="4" rx="2"/><path d="M6 8h.01"/><path d="M10 8h.01"/><path d="M14 8h.01"/><path d="M18 8h.01"/><path d="M8 12h.01"/><path d="M12 12h.01"/><path d="M16 12h.01"/><path d="M7 16h10"/>`,folder:`<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/>`,canvas:`<rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/>`};function Z({name:e,size:t=16,strokeWidth:n=1.75,className:r}){return(0,L.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`shrink-0 ${e===`loader`?`animate-spin`:``} ${r??``}`,dangerouslySetInnerHTML:{__html:v_[e]}})}function Q({children:e,size:t=12.5,className:n,title:r,wrap:i}){return(0,L.jsx)(`span`,{title:r,className:X(i?`break-all`:`whitespace-nowrap`,`font-mono`,n),style:{fontSize:t},children:e})}function y_({children:e}){return(0,L.jsx)(`kbd`,{className:`rounded-[4px] border border-rule bg-surface px-[5px] py-px font-mono text-[11px] text-ink2`,children:e})}function b_({top:e,bottom:t,weight:n=500}){return(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-px`,children:[(0,L.jsx)(`span`,{className:`truncate leading-[1.35]`,style:{fontWeight:n},children:e}),t?(0,L.jsx)(`span`,{className:`flex min-w-0 items-center gap-2.5 overflow-hidden whitespace-nowrap text-[12.5px] leading-[1.35] text-muted`,children:t}):null]})}var x_={canvas:`This canvas`,canvases:`Canvases`,system:`Design system`,actions:`Actions`};function S_(e){let t=/^\/c\/([^/]+)/.exec(e);return t?decodeURIComponent(t[1]):null}function C_({onClose:e}){let[t,n]=P(),r=Xg().scope,i=$g().data,a=r?.canvas??S_(t),o=e_(a??``,!!a).data,s=t_(!!i?.system).data,[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(0),f=t=>()=>{e(),t()},p=[];if(o)for(let e of o.pages){p.push({id:`page:${e.id}`,group:`canvas`,label:e.title,icon:`file`,hint:`Page`,run:f(()=>n(`/c/${encodeURIComponent(o.id)}/p/${encodeURIComponent(e.id)}`))});for(let t of e.sections)for(let r of t.items)(r.kind===`screen`||r.kind===`url`)&&p.push({id:`item:${e.id}:${r.id}`,group:`canvas`,label:r.title,icon:r.kind===`url`?`globe`:`monitor`,hint:t.title?`${e.title} · ${t.title}`:e.title,keywords:`${r.id} ${t.title??``}`,searchOnly:!0,run:f(()=>{n(`/c/${encodeURIComponent(o.id)}/p/${encodeURIComponent(e.id)}`),a_(o.id,r.id)})})}for(let e of i?.canvases??[])e.id!==a&&p.push({id:`canvas:${e.id}`,group:`canvases`,label:e.title,icon:`canvas`,hint:`${e.screens} screens`,keywords:e.id,run:f(()=>n(`/c/${encodeURIComponent(e.id)}`))});if(i?.system){for(let[e,t,r]of[[`Overview`,`/system`,`book`],[`Colors`,`/system/colors`,`palette`],[`Typography`,`/system/typography`,`type`],[`Spacing & shape`,`/system/shape`,`shape`]])p.push({id:`sys:${t}`,group:`system`,label:e,icon:r,run:f(()=>n(t))});for(let e of s?.components??[])p.push({id:`component:${e.id}`,group:`system`,label:e.title,icon:`component`,hint:e.group,searchOnly:!0,run:f(()=>n(`/system/components/${encodeURIComponent(e.id)}`))});for(let e of s?.guidelines??[])p.push({id:`guide:${e.slug}`,group:`system`,label:e.title,icon:`book`,hint:`Guideline`,searchOnly:!0,run:f(()=>n(`/system/guidelines/${encodeURIComponent(e.slug)}`))})}r||p.push({id:`home`,group:`actions`,label:`All canvases`,icon:`home`,run:f(()=>n(`/`))}),p.push({id:`light`,group:`actions`,label:`Light appearance`,icon:`sun`,searchOnly:!0,run:f(()=>h_(`light`))},{id:`dark`,group:`actions`,label:`Dark appearance`,icon:`moon`,searchOnly:!0,run:f(()=>h_(`dark`))},{id:`system-theme`,group:`actions`,label:`System appearance`,icon:`monitor`,searchOnly:!0,run:f(()=>h_(`system`))});let m=c.trim().toLowerCase(),h=p.filter(e=>m?`${e.label} ${e.keywords??``} ${typeof e.hint==`string`?e.hint:``}`.toLowerCase().includes(m):!e.searchOnly),g=[`canvas`,`canvases`,`system`,`actions`].map(e=>({group:e,items:h.filter(t=>t.group===e)})).filter(e=>e.items.length),_=g.flatMap(e=>e.items),y=Math.min(u,Math.max(_.length-1,0)),b=-1;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(kg,{className:`sr-only`,children:`Search and jump`}),(0,L.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-2.5 border-b border-rule px-4`,children:[(0,L.jsx)(Z,{name:`search`,size:16,className:`text-muted`}),(0,L.jsx)(`input`,{value:c,onChange:e=>{l(e.target.value),d(0)},onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),d((y+1)%Math.max(_.length,1))):e.key===`ArrowUp`?(e.preventDefault(),d((y-1+_.length)%Math.max(_.length,1))):e.key===`Enter`&&(e.preventDefault(),_[y]?.run())},placeholder:`Canvases, screens, components…`,"aria-label":`Search and jump`,role:`combobox`,"aria-expanded":`true`,"aria-controls":`palette-list`,autoComplete:`off`,spellCheck:!1,className:`h-full min-w-0 grow border-0 bg-transparent text-[15px] text-ink outline-none placeholder:text-muted`}),(0,L.jsx)(y_,{children:`esc`})]}),(0,L.jsx)(`div`,{id:`palette-list`,role:`listbox`,className:`min-h-0 grow overflow-y-auto py-1.5`,children:g.length?g.map(({group:e,items:t})=>(0,L.jsxs)(`div`,{role:`presentation`,children:[(0,L.jsx)(`div`,{className:`px-4 pt-2.5 pb-1 text-[12px] text-muted`,children:x_[e]}),t.map(e=>{b+=1;let t=b,n=t===y;return(0,L.jsxs)(`button`,{type:`button`,role:`option`,tabIndex:-1,"aria-selected":n,ref:n?e=>e?.scrollIntoView({block:`nearest`}):void 0,onMouseMove:()=>n?void 0:d(t),onClick:e.run,className:X(`flex h-10 w-full cursor-pointer items-center gap-3 border-0 px-4 text-left text-[13.5px] text-ink`,n?`bg-soft`:`bg-transparent`),children:[(0,L.jsx)(`span`,{className:`flex w-5 shrink-0 justify-center text-ink2`,children:(0,L.jsx)(Z,{name:e.icon,size:16})}),(0,L.jsx)(`span`,{className:`min-w-0 grow truncate`,children:e.label}),e.hint?(0,L.jsx)(`span`,{className:`flex shrink-0 items-center text-[12.5px] text-muted`,children:e.hint}):null]},e.id)})]},e)):(0,L.jsx)(`div`,{className:`px-6 py-10 text-center text-[13px] text-muted`,children:`Nothing matches.`})}),(0,L.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-4 border-t border-rule bg-soft px-4 text-[12px] text-muted`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(y_,{children:`↑`}),(0,L.jsx)(y_,{children:`↓`}),`move`]}),(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(y_,{children:`↵`}),`open`]})]})]})}function w_(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=()=>t(e=>!e),n=t=>{(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),e())};return window.addEventListener(`keydown`,n),window.addEventListener(`design:palette`,e),()=>{window.removeEventListener(`keydown`,n),window.removeEventListener(`design:palette`,e)}},[]),(0,L.jsx)(mg,{open:e,onOpenChange:t,children:(0,L.jsx)($u,{children:e?(0,L.jsx)(vg,{forceMount:!0,children:(0,L.jsx)(bg,{asChild:!0,forceMount:!0,children:(0,L.jsx)(Wf.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.14},className:`fixed inset-0 z-50 flex items-start justify-center bg-overlay p-6 pt-[12vh]`,children:(0,L.jsx)(wg,{asChild:!0,forceMount:!0,"aria-describedby":void 0,children:(0,L.jsx)(Wf.div,{initial:{opacity:0,scale:.98,y:-6},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,transition:{duration:.1}},transition:{type:`spring`,stiffness:560,damping:40},className:`flex max-h-[min(560px,76vh)] w-[560px] max-w-full flex-col overflow-hidden rounded-[12px] border border-rule bg-surface shadow-pop outline-none`,children:(0,L.jsx)(C_,{onClose:()=>t(!1)})})})})})}):null})})}var T_=/Mac|iPhone|iPad/.test(navigator.platform)?`⌘`:`Ctrl`,E_=[`top`,`right`,`bottom`,`left`],D_=Math.min,O_=Math.max,k_=Math.round,A_=Math.floor,j_=e=>({x:e,y:e}),M_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function N_(e,t,n){return O_(e,D_(t,n))}function P_(e,t){return typeof e==`function`?e(t):e}function F_(e){return e.split(`-`)[0]}function I_(e){return e.split(`-`)[1]}function L_(e){return e===`x`?`y`:`x`}function R_(e){return e===`y`?`height`:`width`}function z_(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function B_(e){return L_(z_(e))}function V_(e,t,n){n===void 0&&(n=!1);let r=I_(e),i=B_(e),a=R_(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=X_(o)),[o,X_(o)]}function H_(e){let t=X_(e);return[U_(e),t,U_(t)]}function U_(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var W_=[`left`,`right`],G_=[`right`,`left`],K_=[`top`,`bottom`],q_=[`bottom`,`top`];function J_(e,t,n){switch(e){case`top`:case`bottom`:return n?t?G_:W_:t?W_:G_;case`left`:case`right`:return t?K_:q_;default:return[]}}function Y_(e,t,n,r){let i=I_(e),a=J_(F_(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(U_)))),a}function X_(e){let t=F_(e);return M_[t]+e.slice(t.length)}function Z_(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Q_(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Z_(e)}function $_(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 ev(e,t,n){let{reference:r,floating:i}=e,a=z_(t),o=B_(t),s=R_(o),c=F_(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}}let m=I_(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function tv(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}=P_(t,e),p=Q_(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=$_(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=$_(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 nv=50,rv=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:tv},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ev(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<nv&&(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}=ev(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},iv=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}=P_(e,t)||{};if(l==null)return{};let d=Q_(u),f={x:n,y:r},p=B_(i),m=R_(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=D_(d[_],T),D=D_(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=N_(E,k,O),j=!c.arrow&&I_(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,ee=j?k<E?k-E:k-O:0;return{[p]:f[p]+ee,data:{[p]:A,centerOffset:k-A-ee,...j&&{alignmentOffset:ee}},reset:j}}}),av=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}=P_(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=F_(r),_=z_(o),v=F_(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[X_(o)]:H_(o)),x=p!==`none`;!d&&x&&b.push(...Y_(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`||_===z_(t)||T.every(e=>z_(e.placement)!==_||e.overflows[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=z_(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}if(r!==n)return{reset:{placement:n}}}return{}}}};function ov(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sv(e){return E_.some(t=>e[t]>=0)}var cv=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=P_(e,t);switch(i){case`referenceHidden`:{let e=ov(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:sv(e)}}}case`escaped`:{let e=ov(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:sv(e)}}}default:return{}}}}},lv=new Set([`left`,`top`]);async function uv(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=F_(n),s=I_(n),c=z_(n)===`y`,l=lv.has(o)?-1:1,u=a&&c?-1:1,d=P_(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 dv=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 uv(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}}}}},fv=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}=P_(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=z_(i),p=L_(f),m=u[p],h=u[f],g=(e,t)=>N_(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},pv=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}=P_(e,t),u={x:n,y:r},d=z_(i),f=L_(d),p=u[f],m=u[d],h=P_(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};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=lv.has(F_(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}}}},mv=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=P_(e,t),c=await i.detectOverflow(t,s),l=F_(n),u=I_(n),d=z_(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=D_(p-c[m],g),y=D_(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*O_(c.left,c.right):S=p-2*O_(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function hv(){return typeof window<`u`}function gv(e){return yv(e)?(e.nodeName||``).toLowerCase():`#document`}function _v(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vv(e){return((yv(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function yv(e){return hv()?e instanceof Node||e instanceof _v(e).Node:!1}function bv(e){return hv()?e instanceof Element||e instanceof _v(e).Element:!1}function xv(e){return hv()?e instanceof HTMLElement||e instanceof _v(e).HTMLElement:!1}function Sv(e){return!hv()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof _v(e).ShadowRoot}function Cv(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Pv(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function wv(e){return/^(table|td|th)$/.test(gv(e))}function Tv(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ev=/transform|translate|scale|rotate|perspective|filter/,Dv=/paint|layout|strict|content/,Ov=e=>!!e&&e!==`none`,kv;function Av(e){let t=bv(e)?Pv(e):e;return Ov(t.transform)||Ov(t.translate)||Ov(t.scale)||Ov(t.rotate)||Ov(t.perspective)||!Mv()&&(Ov(t.backdropFilter)||Ov(t.filter))||Ev.test(t.willChange||``)||Dv.test(t.contain||``)}function jv(e){let t=Iv(e);for(;xv(t)&&!Nv(t);){if(Av(t))return t;if(Tv(t))return null;t=Iv(t)}return null}function Mv(){return kv??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),kv}function Nv(e){return/^(html|body|#document)$/.test(gv(e))}function Pv(e){return _v(e).getComputedStyle(e)}function Fv(e){return bv(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Iv(e){if(gv(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Sv(e)&&e.host||vv(e);return Sv(t)?t.host:t}function Lv(e){let t=Iv(e);return Nv(t)?(e.ownerDocument||e).body:xv(t)&&Cv(t)?t:Lv(t)}function Rv(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Lv(e),i=r===e.ownerDocument?.body,a=_v(r);if(i){let e=zv(a);return t.concat(a,a.visualViewport||[],Cv(r)?r:[],e&&n?Rv(e):[])}return t.concat(r,Rv(r,[],n))}function zv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Bv(e){let t=Pv(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=xv(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=k_(n)!==a||k_(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Vv(e){return bv(e)?e:e.contextElement}function Hv(e){let t=Vv(e);if(!xv(t))return j_(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Bv(t),o=(a?k_(n.width):n.width)/r,s=(a?k_(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Uv=j_(0);function Wv(e){let t=_v(e);return!Mv()||!t.visualViewport?Uv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gv(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===_v(e)}function Kv(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Vv(e),o=j_(1);t&&(r?bv(r)&&(o=Hv(r)):o=Hv(e));let s=Gv(a,n,r)?Wv(a):j_(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&&r){let e=_v(a),t=bv(r)?_v(r):r,n=e,i=zv(n);for(;i&&t!==n;){let e=Hv(i),t=i.getBoundingClientRect(),r=Pv(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=_v(i),i=zv(n)}}return $_({width:u,height:d,x:c,y:l})}function qv(e,t){let n=Fv(e).scrollLeft;return t?t.left+n:Kv(vv(e)).left+n}function Jv(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-qv(e,n),y:n.top+t.scrollTop}}function Yv(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=vv(r),s=t?Tv(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=j_(1),u=j_(0),d=xv(r);if((d||!a)&&((gv(r)!==`body`||Cv(o))&&(c=Fv(r)),d)){let e=Kv(r);l=Hv(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Jv(o,c):j_(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 Xv(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Zv(e){let t=Fv(e),n=e.ownerDocument.body,r=O_(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=O_(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+qv(e),o=-t.scrollTop;return Pv(n).direction===`rtl`&&(a+=O_(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Qv=25;function $v(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=_v(e),a=vv(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Mv()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(qv(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Qv&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ey(e,t){let n=Kv(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Hv(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ty(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=$v(e,n,t);else if(t===`document`)r=Zv(vv(e));else if(bv(t))r=ey(t,n);else{let n=Wv(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $_(r)}function ny(e,t){let n=t.get(e);if(n)return n;let r=Rv(e,[],!1).filter(e=>bv(e)&&gv(e)!==`body`),i=null,a=Pv(e).position===`fixed`,o=a?Iv(e):e;for(;bv(o)&&!Nv(o);){let e=Pv(o),t=Av(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Iv(o)}return t.set(e,r),r}function ry(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Tv(t)?[]:ny(t,this._c):[].concat(n),r],o=ty(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=ty(t,a[e],i);s=O_(n.top,s),c=D_(n.right,c),l=D_(n.bottom,l),u=O_(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function iy(e){let{width:t,height:n}=Bv(e);return{width:t,height:n}}function ay(e,t,n){let r=xv(t),i=vv(t),a=n===`fixed`,o=Kv(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=j_(0);if((r||!a)&&((gv(t)!==`body`||Cv(i))&&(s=Fv(t)),r)){let e=Kv(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=qv(i));let l=i&&!r&&!a?Jv(i,s):j_(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function oy(e){return Pv(e).position===`static`}function sy(e,t){if(!xv(e)||Pv(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return vv(e)===n&&(n=n.ownerDocument.body),n}function cy(e,t){let n=_v(e);if(Tv(e))return n;if(!xv(e)){let t=Iv(e);for(;t&&!Nv(t);){if(bv(t)&&!oy(t))return t;t=Iv(t)}return n}let r=sy(e,t);for(;r&&wv(r)&&oy(r);)r=sy(r,t);return r&&Nv(r)&&oy(r)&&!Av(r)?n:r||jv(e)||n}var ly=async function(e){let t=this.getOffsetParent||cy,n=this.getDimensions,r=await n(e.floating);return{reference:ay(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uy(e){return Pv(e).direction===`rtl`}var dy={convertOffsetParentRelativeRectToViewportRelativeRect:Yv,getDocumentElement:vv,getClippingRect:ry,getOffsetParent:cy,getElementRects:ly,getClientRects:Xv,getDimensions:iy,getScale:Hv,isElement:bv,isRTL:uy};function fy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function py(e,t,n){let r=null,i,a=vv(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=A_(d),h=A_(a.clientWidth-(u+f)),g=A_(a.clientHeight-(d+p)),_=A_(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:O_(0,D_(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!fy(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=_v(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function my(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=Vv(e),u=i||a?[...l?Rv(l):[],...t?Rv(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?py(l,n,a):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?Kv(e):null;c&&g();function g(){let t=Kv(e);h&&!fy(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 hy=dv,gy=fv,_y=av,vy=mv,yy=cv,by=iv,xy=pv,Sy=(e,t,n)=>{let r=new Map,i=n??{},a={...dy,...i.platform,_c:r};return rv(e,t,{...i,platform:a})},Cy=typeof document<`u`?v.useLayoutEffect:function(){};function wy(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(!wy(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)&&!wy(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ty(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ey(e,t){let n=Ty(e);return Math.round(t*n)/n}function Dy(e){let t=v.useRef(e);return Cy(()=>{t.current=e}),t}function Oy(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]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);wy(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=Dy(c),O=Dy(i),k=Dy(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Sy(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!wy(T.current,t)&&(T.current=t,Ep.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Cy(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);Cy(()=>(j.current=!0,()=>{j.current=!1}),[]),Cy(()=>{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 ee=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),te=v.useMemo(()=>({reference:x,floating:S}),[x,S]),ne=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!te.floating)return e;let t=Ey(te.floating,u.x),r=Ey(te.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ty(te.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,te.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:ee,elements:te,floatingStyles:ne}),[u,A,ee,te,ne])}var ky=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?{}:by({element:r.current,padding:i}).fn(n):r?by({element:r,padding:i}).fn(n):{}}}},Ay=(e,t)=>{let n=hy(e);return{name:n.name,fn:n.fn,options:[e,t]}},jy=(e,t)=>{let n=gy(e);return{name:n.name,fn:n.fn,options:[e,t]}},My=(e,t)=>({fn:xy(e).fn,options:[e,t]}),Ny=(e,t)=>{let n=_y(e);return{name:n.name,fn:n.fn,options:[e,t]}},Py=(e,t)=>{let n=vy(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fy=(e,t)=>{let n=yy(e);return{name:n.name,fn:n.fn,options:[e,t]}},Iy=(e,t)=>{let n=ky(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ly=Object.defineProperty,Ry=(e,t)=>Ly(e,`name`,{value:t,configurable:!0});function zy(e){let[t,n]=v.useState(void 0);return sp(()=>{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)}n(void 0)},[e]),t}Ry(zy,`useSize`);var By=Object.defineProperty,Vy=(e,t)=>By(e,`name`,{value:t,configurable:!0}),Hy=`Popper`,[Uy,Wy]=ap(Hy),[Gy,Ky]=Uy(Hy),qy=Vy(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,L.jsx)(Gy,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Jy=`PopperAnchor`,Yy=v.forwardRef(Vy(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Ky(Jy,n),o=v.useRef(null),s=a.onAnchorChange,c=tp(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&nb(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,L.jsx)(Wp.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Xy=`PopperContent`,[Zy,Qy]=Uy(Xy),$y=v.forwardRef(Vy(function(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=Ky(Xy,n),[_,y]=v.useState(null),b=tp(t,y),[x,S]=v.useState(null),C=zy(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(eb),altBoundary:k},{refs:j,floatingStyles:ee,placement:te,isPositioned:ne,middlewareData:M}=Oy({strategy:`fixed`,placement:E,whileElementsMounted:Vy((...e)=>my(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Ay({mainAxis:i+T,alignmentAxis:o}),c&&jy({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?My():void 0,...A}),c&&Ny({...A}),Py({...A,apply:Vy(({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`)},`apply`)}),x&&Iy({element:x,padding:s}),tb({arrowWidth:w,arrowHeight:T}),f&&Fy({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),re=g.setPlacementState;sp(()=>(re(te),()=>{re(void 0)}),[te,re]);let[ie,N]=nb(te),ae=Jp(m);sp(()=>{ne&&ae?.()},[ne,ae]);let oe=M.arrow?.x,se=M.arrow?.y,ce=M.arrow?.centerOffset!==0,[le,ue]=v.useState();return sp(()=>{_&&ue(window.getComputedStyle(_).zIndex)},[_]),(0,L.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:ne?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(` `),...M.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(Zy,{scope:n,placedSide:ie,placedAlign:N,onArrowChange:S,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,L.jsx)(Wp.div,{"data-side":ie,"data-align":N,...h,ref:b,style:{...h.style,animation:ne?h.style?.animation:`none`}})})})},`PopperContent`));function eb(e){return e!==null}Vy(eb,`isNotNull`);var tb=Vy(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]=nb(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}}}}),`transformOrigin`);function nb(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Vy(nb,`getSideAndAlignFromPlacement`);var rb=qy,ib=Yy,ab=$y,ob=Object.defineProperty,sb=(e,t)=>ob(e,`name`,{value:t,configurable:!0}),cb=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`}),lb=v.forwardRef(sb(function(e,t){return(0,L.jsx)(Wp.span,{...e,ref:t,style:{...cb,...e.style}})},`VisuallyHidden`)),ub=Object.defineProperty,db=(e,t)=>ub(e,`name`,{value:t,configurable:!0}),[fb,pb]=ap(`Tooltip`,[Wy]),mb=Wy(),hb=`TooltipProvider`,gb=700,_b=`tooltip.open`,[vb,yb]=fb(hb),bb=db(e=>{let{__scopeTooltip:t,delayDuration:n=gb,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=v.useRef(!0),s=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(vb,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:v.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),xb=`Tooltip`,[Sb,Cb]=fb(xb),wb=db(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=yb(xb,e.__scopeTooltip),l=mb(t),[u,d]=v.useState(null),[f,p]=v.useState(void 0),m=fp(),h=v.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,y=v.useRef(!1),[b,x]=xp({prop:r,defaultProp:i??!1,onChange:db(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(_b))):c.onClose(),a?.(e)},`onChange`),caller:xb}),S=v.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=v.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},_)},[_,x]);v.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,L.jsx)(rb,{...l,children:(0,L.jsx)(Sb,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:v.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),Tb=`TooltipTrigger`,Eb=v.forwardRef(db(function(e,t){let{__scopeTooltip:n,...r}=e,i=Cb(Tb,n),a=yb(Tb,n),o=mb(n),s=tp(t,v.useRef(null),i.onTriggerChange),c=v.useRef(!1),l=v.useRef(!1),u=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,L.jsx)(ib,{asChild:!0,...o,children:(0,L.jsx)(Wp.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)})})},`TooltipTrigger`)),Db=`TooltipPortal`,[Ob,kb]=fb(Db,{forceMount:void 0}),Ab=db(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Cb(Db,t);return(0,L.jsx)(Ob,{scope:t,forceMount:n,children:(0,L.jsx)(jm,{present:n||a.open,children:(0,L.jsx)(Dm,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),jb=`TooltipContent`,Mb=v.forwardRef(db(function(e,t){let n=kb(jb,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Cb(jb,e.__scopeTooltip);return(0,L.jsx)(jm,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(Fb,{side:i,...a,ref:t}):(0,L.jsx)(Nb,{side:i,...a,ref:t})})},`TooltipContent`)),Nb=v.forwardRef(db(function(e,t){let n=Cb(jb,e.__scopeTooltip),r=yb(jb,e.__scopeTooltip),i=v.useRef(null),a=tp(t,i),[o,s]=v.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=v.useCallback(()=>{s(null),d(!1)},[d]),p=v.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Lb(r,Ib(r,n.getBoundingClientRect())),a=Rb(t.getBoundingClientRect()),o=Bb([...i,...a]);s(o),d(!0)},[d]);return v.useEffect(()=>()=>f(),[f]),v.useEffect(()=>{if(c&&u){let e=db(e=>p(e,u),`handleTriggerLeave`),t=db(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),v.useEffect(()=>{if(o){let e=db(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!zb(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(Fb,{...e,ref:a})},`TooltipContentHoverable`)),Pb=jp(`TooltipContent`),Fb=v.forwardRef(db(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Cb(jb,n),u=mb(n),{onClose:d}=l;v.useEffect(()=>(document.addEventListener(_b,d),()=>document.removeEventListener(_b,d)),[d]),v.useEffect(()=>{if(l.trigger){let e=db(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return sp(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,L.jsx)(nm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,L.jsxs)(ab,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.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,L.jsx)(Pb,{children:r}),i?(0,L.jsx)(lb,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function Ib(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`)}}db(Ib,`getExitSideFromRect`);function Lb(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})}return r}db(Lb,`getPaddedExitPoints`);function Rb(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}]}db(Rb,`getPointsFromRect`);function zb(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}db(zb,`isPointInPolygon`);function Bb(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)),Vb(t)}db(Bb,`getHull`);function Vb(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)}db(Vb,`getHullPresorted`);var Hb=bb,Ub=wb,Wb=Eb,Gb=Ab,Kb=Mb;function qb({children:e}){return(0,L.jsx)(Hb,{delayDuration:250,children:e})}var Jb=`z-50 max-w-[280px] rounded-[8px] border border-rule bg-surface px-[10px] py-[7px] text-[12.5px] leading-[1.35] text-ink shadow-pop outline-none data-[state=delayed-open]:animate-[q-pop_120ms_ease-out] data-[state=closed]:animate-[q-pop-out_100ms_ease-in_forwards]`;function Yb({content:e,children:t,side:n=`top`,align:r=`center`,className:i}){return(0,L.jsxs)(Ub,{children:[(0,L.jsx)(Wb,{asChild:!0,children:t}),(0,L.jsx)(Gb,{children:(0,L.jsx)(Kb,{side:n,align:r,sideOffset:6,collisionPadding:12,className:X(Jb,i),children:e})})]})}function Xb(){window.dispatchEvent(new CustomEvent(`design:palette`))}var Zb=T_===`⌘`?`⌘K`:`Ctrl K`;function Qb({width:e=240,label:t=`Search and jump`,compact:n}){if(n)return(0,L.jsx)(Yb,{content:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[t,` `,(0,L.jsx)(y_,{children:Zb})]}),children:(0,L.jsx)(`button`,{type:`button`,onClick:Xb,"aria-label":t,className:`inline-flex h-ctrl w-ctrl shrink-0 cursor-pointer items-center justify-center rounded-[6px] border border-rule bg-soft text-muted transition-colors hover:border-rule-strong`,children:(0,L.jsx)(Z,{name:`search`,size:15})})});let r=n===!1;return(0,L.jsxs)(`button`,{type:`button`,onClick:Xb,style:{width:e},"aria-label":t,className:X(`flex h-ctrl min-w-0 cursor-pointer items-center gap-2 rounded-[6px] border border-rule bg-soft pr-1.5 pl-3 text-ctrl text-muted transition-colors hover:border-rule-strong`,r?`shrink-0`:`shrink max-lg:w-auto! max-md:w-ctrl! max-md:justify-center max-md:border-0! max-md:bg-transparent! max-md:p-0!`),children:[(0,L.jsx)(Z,{name:`search`,size:15}),(0,L.jsx)(`span`,{className:X(`min-w-0 grow truncate text-left`,!r&&`max-lg:hidden`),children:t}),(0,L.jsx)(`span`,{className:X(`flex`,!r&&`max-md:hidden`),children:(0,L.jsx)(y_,{children:Zb})})]})}var $b={primary:`border border-primary bg-primary text-primary-ink hover:opacity-90`,secondary:`border border-rule-strong bg-surface text-ink hover:bg-soft`,ghost:`border border-transparent bg-transparent text-ink2 hover:bg-soft2`,dashed:`border border-dashed border-rule-strong bg-transparent text-ink2 hover:bg-soft`,danger:`border border-danger bg-danger text-on-danger hover:opacity-90`},ex=(e=`secondary`,t)=>X(`inline-flex h-ctrl shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-[6px] px-ctrl text-ctrl font-medium leading-none no-underline transition-[background-color,opacity] duration-100`,`disabled:cursor-not-allowed disabled:opacity-45 aria-disabled:cursor-not-allowed aria-disabled:opacity-45`,$b[e],t),tx=(0,v.forwardRef)(function({kind:e=`secondary`,icon:t,loading:n,disabled:r,className:i,children:a,type:o=`button`,...s},c){return(0,L.jsxs)(`button`,{ref:c,type:o,disabled:r||n,"aria-busy":n||void 0,className:ex(e,i),...s,children:[n?(0,L.jsx)(Z,{name:`loader`,size:15,className:`animate-spin`}):t?(0,L.jsx)(Z,{name:t,size:15}):null,a]})}),nx={ghost:`border border-transparent bg-transparent text-muted hover:bg-soft2 hover:text-ink2`,secondary:`border border-rule-strong bg-surface text-ink2 hover:bg-soft`},rx=(e=`ghost`,t)=>X(`inline-flex h-ctrl w-ctrl shrink-0 cursor-pointer items-center justify-center rounded-[6px] p-0 transition-colors duration-100 disabled:cursor-not-allowed disabled:opacity-45`,nx[e],t),ix=(0,v.forwardRef)(function({icon:e,label:t,kind:n=`ghost`,size:r=16,className:i,type:a=`button`,...o},s){return(0,L.jsx)(`button`,{ref:s,type:a,"aria-label":t,title:t,className:rx(n,i),...o,children:(0,L.jsx)(Z,{name:e,size:r})})});function ax({to:e,kind:t=`secondary`,icon:n,className:r,children:i}){return(0,L.jsxs)(be,{href:e,className:ex(t,r),children:[n?(0,L.jsx)(Z,{name:n,size:15}):null,i]})}function ox({kind:e=`secondary`,icon:t,className:n,children:r,...i}){return(0,L.jsxs)(`a`,{className:ex(e,n),...i,children:[t?(0,L.jsx)(Z,{name:t,size:15}):null,r]})}var sx=Object.defineProperty,cx=(e,t)=>sx(e,`name`,{value:t,configurable:!0});function lx(e){let t=e+`CollectionProvider`,[n,r]=ap(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=cx(e=>{let{scope:t,children:n}=e,r=v.useRef(null),a=v.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=kp(s),l=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=tp(t,a(s,n).collectionRef);return(0,L.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=kp(u),p=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),s=tp(t,o),c=a(u,n);return v.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return v.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 cx(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}cx(lx,`createCollection`);var ux=new WeakMap,dx=class e extends Map{static{cx(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ux.set(this,!0)}set(e,t){return ux.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=mx(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=fx(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=fx(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return fx(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function fx(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=px(e,t);return n===-1?void 0:e[n]}cx(fx,`at`);function px(e,t){let n=e.length,r=mx(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}cx(px,`toSafeIndex`);function mx(e){return e!==e||e===0?0:Math.trunc(e)}cx(mx,`toSafeInteger`);function hx(e){let t=e+`CollectionProvider`,[n,r]=ap(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new dx,setItemMap:cx(()=>void 0,`setItemMap`)}),o=cx(({state:e,...t})=>e?(0,L.jsx)(c,{...t,state:e}):(0,L.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=cx(e=>{let t=h();return(0,L.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=cx(e=>{let{scope:t,children:n,state:r}=e,a=v.useRef(null),[o,s]=v.useState(null),c=tp(a,s),[l,u]=r;return v.useEffect(()=>{if(!o)return;let e=yx(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,L.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=kp(l),d=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=tp(t,a(l,n).collectionRef);return(0,L.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=kp(f),m=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),[s,c]=v.useState(null),l=tp(t,o,c),{setItemMap:u}=a(f,n),d=v.useRef(i);gx(d.current,i)||(d.current=i);let m=d.current;return v.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(vx):(t.set(s,{...e,element:s}),t.toSorted(vx)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new dx(e)))}},[s,m,u]),(0,L.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return v.useState(new dx)}cx(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return cx(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}cx(hx,`createCollection`);function gx(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}cx(gx,`shallowEqual`);function _x(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}cx(_x,`isElementPreceding`);function vx(e,t){return!e[1].element||!t[1].element?0:_x(e[1].element,t[1].element)?-1:1}cx(vx,`sortByDocumentPosition`);function yx(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}cx(yx,`getChildListObserver`);var bx=Object.defineProperty,xx=(e,t)=>bx(e,`name`,{value:t,configurable:!0}),Sx=v.createContext(void 0);function Cx(e){let t=v.useContext(Sx);return e||t||`ltr`}xx(Cx,`useDirection`);var wx=Object.defineProperty,Tx=(e,t)=>wx(e,`name`,{value:t,configurable:!0}),Ex=!1;function Dx(){let[e,t]=v.useState(Ex);return v.useEffect(()=>{Ex||(Ex=!0,t(!0))},[]),e}Tx(Dx,`useIsHydrated`);var Ox=v.useSyncExternalStore;function kx(){return()=>{}}Tx(kx,`subscribe`);function Ax(){return Ox(kx,()=>!0,()=>!1)}Tx(Ax,`useIsHydratedModern`);var jx=typeof Ox==`function`?Ax:Dx,Mx=Object.defineProperty,Nx=(e,t)=>Mx(e,`name`,{value:t,configurable:!0}),Px=`rovingFocusGroup.onEntryFocus`,Fx={bubbles:!1,cancelable:!0},Ix=`RovingFocusGroup`,[Lx,Rx,zx]=lx(Ix),[Bx,Vx]=ap(Ix,[zx]),[Hx,Ux]=Bx(Ix),Wx=v.forwardRef(Nx(function(e,t){return(0,L.jsx)(Lx.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(Lx.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(Gx,{...e,ref:t})})})},`RovingFocusGroup`)),Gx=v.forwardRef(Nx(function(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=v.useRef(null),p=tp(t,f),m=Cx(a),[h,g]=xp({prop:o,defaultProp:s??null,onChange:c,caller:Ix}),[_,y]=v.useState(!1),b=Jp(l),x=Rx(n),S=v.useRef(!1),[C,w]=v.useState(0);return v.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Px,b),()=>e.removeEventListener(Px,b)},[b]),(0,L.jsx)(Hx,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:v.useCallback(e=>g(e),[g]),onItemShiftTab:v.useCallback(()=>y(!0),[]),onFocusableItemAdd:v.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:v.useCallback(()=>w(e=>e-1),[]),children:(0,L.jsx)(Wp.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(Px,Fx);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Zx([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,()=>y(!1))})})},`RovingFocusGroupImpl`)),Kx=`RovingFocusGroupItem`,qx=v.forwardRef(Nx(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=fp(),l=a||c,u=Ux(Kx,n),d=u.currentTabStopId===l,f=Rx(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=jx();return sp(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),v.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,L.jsx)(Lx.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,L.jsx)(Wp.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=Xx(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?Qx(n,r+1):n.slice(r+1)}setTimeout(()=>Zx(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Jx={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Yx(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Nx(Yx,`getDirectionAwareKey`);function Xx(e,t,n){let r=Yx(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Jx[r]}Nx(Xx,`getFocusIntent`);function Zx(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Nx(Zx,`focusFirst`);function Qx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Nx(Qx,`wrapArray`);var $x=Wx,eS=qx,tS=Object.defineProperty,nS=(e,t)=>tS(e,`name`,{value:t,configurable:!0}),rS=[`Enter`,` `],iS=[`ArrowDown`,`PageUp`,`Home`],aS=[`ArrowUp`,`PageDown`,`End`],oS=[...iS,...aS];[...rS],[...rS];var sS=`Menu`,[cS,lS,uS]=lx(sS),[dS,fS]=ap(sS,[uS,Wy,Vx]),pS=Wy(),mS=Vx(),[hS,gS]=dS(sS),[_S,vS]=dS(sS),yS=nS(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=pS(t),[c,l]=v.useState(null),u=v.useRef(!1),d=Jp(a),f=Cx(i);return v.useEffect(()=>{let e=nS(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=nS(()=>u.current=!1,`handlePointer`);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})}},[]),v.useEffect(()=>{if(!n)return;let e=nS(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,L.jsx)(rb,{...s,children:(0,L.jsx)(hS,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,L.jsx)(_S,{scope:t,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),bS=v.forwardRef(nS(function(e,t){let{__scopeMenu:n,...r}=e,i=pS(n);return(0,L.jsx)(ib,{...i,...r,ref:t})},`MenuAnchor`)),xS=`MenuPortal`,[SS,CS]=dS(xS,{forceMount:void 0}),wS=nS(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=gS(xS,t);return(0,L.jsx)(SS,{scope:t,forceMount:n,children:(0,L.jsx)(jm,{present:n||a.open,children:(0,L.jsx)(Dm,{asChild:!0,container:i,children:r})})})},`MenuPortal`),TS=`MenuContent`,[ES,DS]=dS(TS),OS=v.forwardRef(nS(function(e,t){let n=CS(TS,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=gS(TS,e.__scopeMenu),o=vS(TS,e.__scopeMenu);return(0,L.jsx)(cS.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)(jm,{present:r||a.open,children:(0,L.jsx)(cS.Slot,{scope:e.__scopeMenu,children:o.modal?(0,L.jsx)(kS,{...i,ref:t}):(0,L.jsx)(AS,{...i,ref:t})})})})},`MenuContent`)),kS=v.forwardRef(nS(function(e,t){let n=gS(TS,e.__scopeMenu),r=v.useRef(null),i=tp(t,r);return v.useEffect(()=>{let e=r.current;if(e)return og(e)},[]),(0,L.jsx)(MS,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),AS=v.forwardRef(nS(function(e,t){let n=gS(TS,e.__scopeMenu);return(0,L.jsx)(MS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),jS=kp(`MenuContent.ScrollLock`),MS=v.forwardRef(nS(function(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=gS(TS,n),_=vS(TS,n),y=pS(n),b=mS(n),x=lS(n),[S,C]=v.useState(null),w=v.useRef(null),T=tp(t,w,g.onContentChange),E=v.useRef(0),D=v.useRef(``),O=v.useRef(0),k=v.useRef(null),A=v.useRef(`right`),j=v.useRef(0),ee=m?Zh:v.Fragment,te=m?{as:jS,allowPinchZoom:!0}:void 0,ne=nS(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=XS(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;nS((function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);v.useEffect(()=>()=>window.clearTimeout(E.current),[]),Hm();let M=v.useCallback(e=>A.current===k.current?.side&&QS(e,k.current?.area),[]);return(0,L.jsx)(ES,{scope:n,searchRef:D,onItemEnter:v.useCallback(e=>{M(e)&&e.preventDefault()},[M]),onItemLeave:v.useCallback(e=>{M(e)||(w.current?.focus(),C(null))},[M]),onTriggerLeave:v.useCallback(e=>{M(e)&&e.preventDefault()},[M]),pointerGraceTimerRef:O,onPointerGraceIntentChange:v.useCallback(e=>{k.current=e},[]),children:(0,L.jsx)(ee,{...te,children:(0,L.jsx)(mm,{asChild:!0,trapped:i,onMountAutoFocus:Y(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,L.jsx)(nm,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,L.jsx)($x,{asChild:!0,...b,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Y(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,L.jsx)(ab,{role:`menu`,"aria-orientation":`vertical`,"data-state":GS(g.open),"data-radix-menu-content":``,dir:_.dir,...y,...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&&ne(e.key));let i=w.current;if(e.target!==i||!oS.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);aS.includes(e.key)&&a.reverse(),JS(a)}),onBlur:Y(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:Y(e.onPointerMove,$S(e=>{let t=e.target,n=j.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>j.current?`right`:`left`;A.current=t,j.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),NS=v.forwardRef(nS(function(e,t){let{__scopeMenu:n,...r}=e;return(0,L.jsx)(Wp.div,{...r,ref:t})},`MenuLabel`)),PS=`MenuItem`,FS=`menu.itemSelect`,IS=v.forwardRef(nS(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=v.useRef(null),o=vS(PS,e.__scopeMenu),s=DS(PS,e.__scopeMenu),c=tp(t,a),l=v.useRef(!1),u=nS(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(FS,{bubbles:!0,cancelable:!0});e.addEventListener(FS,e=>r?.(e),{once:!0}),Gp(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,L.jsx)(LS,{...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=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&rS.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),LS=v.forwardRef(nS(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=DS(PS,n),s=mS(n),c=v.useRef(null),l=tp(t,c),[u,d]=v.useState(!1),[f,p]=v.useState(``);return v.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,L.jsx)(cS.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,L.jsx)(eS,{asChild:!0,...s,focusable:!r,children:(0,L.jsx)(Wp.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,$S(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Y(e.onPointerLeave,$S(e=>o.onItemLeave(e))),onFocus:Y(e.onFocus,()=>d(!0)),onBlur:Y(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[RS,zS]=dS(`MenuRadioGroup`,{value:void 0,onValueChange:nS(()=>{},`onValueChange`)}),[BS,VS]=dS(`MenuItemIndicator`,{checked:!1}),HS=v.forwardRef(nS(function(e,t){let{__scopeMenu:n,...r}=e;return(0,L.jsx)(Wp.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[US,WS]=dS(`MenuSub`);function GS(e){return e?`open`:`closed`}nS(GS,`getOpenState`);function KS(e){return e===`indeterminate`}nS(KS,`isIndeterminate`);function qS(e){return KS(e)?`indeterminate`:e?`checked`:`unchecked`}nS(qS,`getCheckedState`);function JS(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}nS(JS,`focusFirst`);function YS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}nS(YS,`wrapArray`);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=YS(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}nS(XS,`getNextMatch`);function ZS(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}nS(ZS,`isPointInPolygon`);function QS(e,t){return t?ZS({x:e.clientX,y:e.clientY},t):!1}nS(QS,`isPointerInGraceArea`);function $S(e){return t=>t.pointerType===`mouse`?e(t):void 0}nS($S,`whenMouse`);var eC=yS,tC=bS,nC=wS,rC=OS,iC=NS,aC=IS,oC=HS,sC=Object.defineProperty,cC=(e,t)=>sC(e,`name`,{value:t,configurable:!0}),lC=`DropdownMenu`,[uC,dC]=ap(lC,[fS]),fC=fS(),[pC,mC]=uC(lC),hC=cC(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=fC(t),l=v.useRef(null),[u,d]=xp({prop:i,defaultProp:a??!1,onChange:o,caller:lC});return(0,L.jsx)(pC,{scope:t,triggerId:fp(),triggerRef:l,contentId:fp(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,L.jsx)(eC,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),gC=`DropdownMenuTrigger`,_C=v.forwardRef(cC(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=mC(gC,n),o=fC(n),s=tp(t,a.triggerRef);return(0,L.jsx)(tC,{asChild:!0,...o,children:(0,L.jsx)(Wp.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:s,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())})})})},`DropdownMenuTrigger`)),vC=cC(e=>{let{__scopeDropdownMenu:t,...n}=e,r=fC(t);return(0,L.jsx)(nC,{...r,...n})},`DropdownMenuPortal`),yC=`DropdownMenuContent`,bC=v.forwardRef(cC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=mC(yC,n),a=fC(n),o=v.useRef(!1);return(0,L.jsx)(rC,{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)`}})},`DropdownMenuContent`)),xC=v.forwardRef(cC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=fC(n);return(0,L.jsx)(iC,{...i,...r,ref:t})},`DropdownMenuLabel`)),SC=v.forwardRef(cC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=fC(n);return(0,L.jsx)(aC,{...i,...r,ref:t})},`DropdownMenuItem`)),CC=v.forwardRef(cC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=fC(n);return(0,L.jsx)(oC,{...i,...r,ref:t})},`DropdownMenuSeparator`)),wC=hC,TC=_C,EC=vC,DC=bC,OC=xC,kC=SC,AC=CC,jC=`z-50 overflow-hidden rounded-[8px] border border-rule bg-surface shadow-pop outline-none py-1 data-[state=open]:animate-[q-pop_120ms_ease-out] data-[state=closed]:animate-[q-pop-out_100ms_ease-in_forwards]`;function MC({trigger:e,children:t,width:n=220,align:r=`start`,side:i=`bottom`,sideOffset:a=6,open:o,onOpenChange:s}){return(0,L.jsxs)(wC,{open:o,onOpenChange:s,modal:!1,children:[(0,L.jsx)(TC,{asChild:!0,children:e}),(0,L.jsx)(EC,{children:(0,L.jsx)(DC,{align:r,side:i,sideOffset:a,collisionPadding:12,className:jC,style:{width:n,maxWidth:`calc(100vw - 24px)`},children:t})})]})}var NC=(e,t)=>X(`flex min-h-9 w-full cursor-pointer items-center gap-2.5 border-0 px-3 py-1.5 text-left text-[13.5px] outline-none select-none`,`data-[highlighted]:bg-soft data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,t?`bg-soft`:`bg-transparent`,e?`text-danger-text`:`text-ink`);function PC({children:e,onSelect:t,danger:n,active:r,disabled:i,hint:a,className:o}){return(0,L.jsxs)(kC,{disabled:i,onSelect:t,className:X(NC(n,r),o),children:[e,a?(0,L.jsx)(`span`,{className:`ml-auto pl-3 text-[12px] text-muted`,children:a}):null]})}function FC(){return(0,L.jsx)(AC,{className:`my-1 h-px bg-rule`})}function IC({children:e}){return(0,L.jsx)(OC,{className:`px-3 pt-1.5 pb-1 text-[12px] text-muted`,children:e})}var LC=[{value:`system`,label:`System`,icon:`monitor`},{value:`light`,label:`Light`,icon:`sun`},{value:`dark`,label:`Dark`,icon:`moon`}];function RC(){let e=g_(),t=__();return(0,L.jsxs)(MC,{align:`end`,width:180,trigger:(0,L.jsx)(ix,{icon:t===`dark`?`moon`:`sun`,label:`Appearance`}),children:[(0,L.jsx)(IC,{children:`Appearance`}),LC.map(t=>(0,L.jsxs)(PC,{active:e===t.value,onSelect:()=>h_(t.value),children:[(0,L.jsx)(Z,{name:t.icon,size:15,className:`text-ink2`}),t.label,e===t.value?(0,L.jsx)(Z,{name:`check`,size:15,className:`ml-auto text-ink2`}):null]},t.value))]})}function zC({size:e=24}){return(0,L.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 32 32`,"aria-hidden":`true`,className:`shrink-0`,children:[(0,L.jsx)(`rect`,{width:`32`,height:`32`,rx:`7`,className:`fill-primary`}),(0,L.jsx)(`rect`,{x:`7`,y:`7`,width:`8`,height:`11`,rx:`1.5`,className:`fill-primary-ink`}),(0,L.jsx)(`rect`,{x:`17`,y:`7`,width:`8`,height:`6`,rx:`1.5`,fill:`#f0a040`}),(0,L.jsx)(`rect`,{x:`17`,y:`15`,width:`8`,height:`10`,rx:`1.5`,className:`fill-primary-ink`}),(0,L.jsx)(`rect`,{x:`7`,y:`20`,width:`8`,height:`5`,rx:`1.5`,className:`fill-primary-ink`})]})}function BC({name:e,version:t}){return(0,L.jsxs)(be,{href:`/`,title:t?`foss-design ${t}`:void 0,className:`flex min-w-0 items-center gap-2 text-[14px] font-semibold text-ink no-underline`,children:[(0,L.jsx)(zC,{}),(0,L.jsx)(`span`,{className:`truncate`,children:e??`Design`})]})}function VC({children:e,className:t}){return(0,L.jsx)(`header`,{className:X(`sticky top-0 z-30 flex h-[52px] shrink-0 items-center gap-3 border-b border-rule bg-surface px-4`,t),children:e})}var HC=(0,v.createContext)(!1).Provider;function UC(e,t,n){let[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(0);return(0,v.useLayoutEffect)(()=>{let n=e.current,r=t.current;if(!n||!r)return;let o=()=>{let e=[...n.querySelectorAll(`[data-fit]`)].reduce((e,t)=>e+Math.max(0,t.scrollWidth-t.clientWidth),0),t=r.getBoundingClientRect().left-n.getBoundingClientRect().right;i(n=>n?t-e<a.current-r.offsetWidth+16:(a.current=r.offsetWidth,e>0))};o();let s=new ResizeObserver(o);return s.observe(n.parentElement??n),s.observe(r),()=>s.disconnect()},n),r}var WC=[{to:`/`,label:`Canvases`,match:e=>e===`/`||e.startsWith(`/c/`)},{to:`/system`,label:`Design system`,match:e=>e.startsWith(`/system`)}];function GC({location:e}){let t=(0,v.useRef)(null),n=WC.findIndex(t=>t.match(e)),[r,i]=(0,v.useState)(null);return(0,v.useLayoutEffect)(()=>{let e=t.current;if(!e)return;let r=()=>{let t=e.children[n];if(!t?.offsetWidth){i(null);return}let r=t.offsetLeft+10,a=t.offsetWidth-20;i(e=>e?.tab===n&&e.x===r&&e.width===a?e:{tab:n,x:r,width:a,slide:e!==null&&e.tab!==n})};r();let a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[n]),(0,L.jsxs)(`nav`,{ref:t,className:`relative flex h-[52px] items-stretch gap-0.5 max-md:hidden`,children:[WC.map((e,t)=>(0,L.jsx)(be,{href:e.to,"aria-current":t===n?`page`:void 0,className:X(`flex items-center px-2.5 text-[14px] no-underline transition-colors`,t===n?`font-medium text-ink`:`text-ink2 hover:text-ink`),children:e.label},e.to)),r?(0,L.jsx)(Wf.span,{"aria-hidden":!0,className:`pointer-events-none absolute bottom-0 left-0 h-[2px] bg-action`,initial:!1,animate:{x:r.x,width:r.width},transition:r.slide?{type:`spring`,stiffness:520,damping:42}:{duration:0}}):null]})}function KC(){let e=$g().data,{slots:t}=Xg(),[n]=P();return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(VC,{children:[t.barStart,(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-6`,children:[t.brand??(0,L.jsx)(BC,{name:e?.name,version:e?.version}),(0,L.jsx)(GC,{location:n})]}),(0,L.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,L.jsx)(Qb,{}),(0,L.jsx)(`span`,{className:X(`flex`,t.barEnd?`max-md:hidden`:void 0),children:(0,L.jsx)(RC,{})}),t.barEnd]})]}),(0,L.jsx)(qC,{location:n}),t.belowBar?(0,L.jsx)(`div`,{className:`shrink-0`,children:t.belowBar}):null]})}function qC({location:e}){return(0,L.jsx)(`nav`,{className:`sticky top-[52px] z-30 hidden h-10 shrink-0 items-stretch border-b border-rule bg-surface px-2 max-md:flex`,children:WC.map(t=>{let n=t.match(e);return(0,L.jsxs)(be,{href:t.to,"aria-current":n?`page`:void 0,className:X(`relative flex grow items-center justify-center text-[13.5px] no-underline`,n?`font-medium text-ink`:`text-ink2`),children:[t.label,n?(0,L.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-x-6 bottom-0 h-[2px] rounded-full bg-action`}):null]},t.to)})})}var JC=window.matchMedia(`(max-width: 767px)`),YC=e=>(JC.addEventListener(`change`,e),()=>JC.removeEventListener(`change`,e));function XC(){return(0,v.useSyncExternalStore)(YC,()=>JC.matches)}var ZC=Object.defineProperty,QC=(e,t)=>ZC(e,`name`,{value:t,configurable:!0}),$C=`Popover`,[ew,tw]=ap($C,[Wy]),nw=Wy(),[rw,iw]=ew($C),aw=QC(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=nw(t),c=v.useRef(null),[l,u]=v.useState(!1),[d,f]=xp({prop:r,defaultProp:i??!1,onChange:a,caller:$C});return(0,L.jsx)(rb,{...s,children:(0,L.jsx)(rw,{scope:t,contentId:fp(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>u(!0),[]),onCustomAnchorRemove:v.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),ow=`PopoverTrigger`,sw=v.forwardRef(QC(function(e,t){let{__scopePopover:n,...r}=e,i=iw(ow,n),a=nw(n),o=tp(t,i.triggerRef),s=(0,L.jsx)(Wp.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":vw(i.open),...r,ref:o,onClick:Y(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,L.jsx)(ib,{asChild:!0,...a,children:s})},`PopoverTrigger`)),cw=`PopoverPortal`,[lw,uw]=ew(cw,{forceMount:void 0}),dw=QC(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=iw(cw,t);return(0,L.jsx)(lw,{scope:t,forceMount:n,children:(0,L.jsx)(jm,{present:n||a.open,children:(0,L.jsx)(Dm,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),fw=`PopoverContent`,pw=v.forwardRef(QC(function(e,t){let n=uw(fw,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=iw(fw,e.__scopePopover);return(0,L.jsx)(jm,{present:r||a.open,children:a.modal?(0,L.jsx)(hw,{...i,ref:t}):(0,L.jsx)(gw,{...i,ref:t})})},`PopoverContent`)),mw=kp(`PopoverContent.RemoveScroll`),hw=v.forwardRef(QC(function(e,t){let n=iw(fw,e.__scopePopover),r=v.useRef(null),i=tp(t,r),a=v.useRef(!1);return v.useEffect(()=>{let e=r.current;if(e)return og(e)},[]),(0,L.jsx)(Zh,{as:mw,allowPinchZoom:!0,children:(0,L.jsx)(_w,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Y(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),gw=v.forwardRef(QC(function(e,t){let n=iw(fw,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return(0,L.jsx)(_w,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),_w=v.forwardRef(QC(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=iw(fw,n),p=nw(n);return Hm(),(0,L.jsx)(mm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(nm,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,L.jsx)(ab,{"data-state":vw(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function vw(e){return e?`open`:`closed`}QC(vw,`getState`);var yw=aw,bw=sw,xw=dw,Sw=pw,Cw=new s_([]),ww=1;function Tw(e,t,n=`ok`){let r=ww++;Cw.set(i=>[...i.slice(-2),{id:r,title:e,text:t,tone:n}]),setTimeout(()=>Cw.set(e=>e.filter(e=>e.id!==r)),n===`error`?4200:2200)}var Ew=new s_([]),Dw=1;function Ow(){let[e]=(0,v.useState)(()=>Dw++);(0,v.useEffect)(()=>(Ew.set(t=>[...t,e]),()=>Ew.set(t=>t.filter(t=>t!==e))),[e]);let t=c_(Ew,t=>t[0]===e),n=c_(Cw);return t?(0,L.jsx)(`div`,{className:`pointer-events-none fixed bottom-5 left-1/2 z-[60] flex -translate-x-1/2 flex-col items-center gap-2`,children:(0,L.jsx)($u,{mode:`popLayout`,children:n.map(e=>(0,L.jsxs)(Wf.div,{layout:!0,initial:{opacity:0,y:8,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:4,transition:{duration:.12}},transition:{type:`spring`,stiffness:520,damping:40},className:`flex max-w-[min(420px,calc(100vw-32px))] min-w-0 items-center gap-2.5 rounded-[8px] border border-rule bg-surface px-3 py-2 text-[13px] text-ink shadow-pop`,children:[e.tone===`error`?(0,L.jsx)(Z,{name:`alert`,size:15,className:`text-danger-text`}):e.tone===`info`?(0,L.jsx)(Z,{name:`info`,size:15,className:`text-muted`}):(0,L.jsx)(Z,{name:`check`,size:15,className:`text-ok-text`}),(0,L.jsx)(`span`,{className:`shrink-0 font-medium whitespace-nowrap`,children:e.title}),e.text?(0,L.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[12px] text-muted`,children:e.text}):null]},e.id))})}):null}async function kw(e,t=`Copied`){try{await navigator.clipboard.writeText(e),Tw(t,e.length>64?void 0:e)}catch{Tw(`Could not copy`,`The browser blocked clipboard access`,`error`)}}function Aw(e){return e.split(`/`).filter(Boolean)}function jw(e){return{pattern:e,segments:Aw(e).map(e=>e===`*`?{kind:`splat`}:e.startsWith(`:`)?{kind:`param`,optional:e.endsWith(`?`)}:{kind:`static`,value:e})}}function Mw(e){try{return decodeURIComponent(e)}catch{return e}}function Nw(e,t){let n=Aw(t.split(/[?#]/)[0]??``).map(Mw),r=(t,i)=>{if(t===e.segments.length)return i===n.length?0:null;let a=e.segments[t];if(a.kind===`splat`)return 0;if(a.kind===`static`){if(n[i]!==a.value)return null;let e=r(t+1,i+1);return e===null?null:e+4}if(i<n.length){let e=r(t+1,i+1);if(e!==null)return e+2}return a.optional?r(t+1,i):null};return r(0,0)}function Pw(e,t){let n=null;for(let r of e)for(let e of r.routes){let i=Nw(e,t);i!==null&&(!n||i>n.score)&&(n={score:i,value:r.value})}return n?.value??null}function Fw(e,t=`/`){let n=e.trim();if(!n||n.startsWith(`#`)||/^[a-z][a-z0-9+.-]*:/i.test(n)||n.startsWith(`//`))return null;let r=new URL(n,`http://app.invalid${t.replace(/\/:[^/]+\??|\/\*$/g,`/x`)}`);return r.pathname+r.search+r.hash}var Iw=new Map;window.addEventListener(`message`,e=>{let t=e.data;if(t?.source===`design-runtime`&&e.source)for(let n of Iw.get(e.source)??[])n(t)});function Lw(e,t){let n=null,r=()=>{if(!n)return;let e=Iw.get(n);e?.delete(t),e?.size||Iw.delete(n),n=null},i=()=>{if(r(),n=e.contentWindow,!n)return;let i=Iw.get(n)??new Set;i.add(t),Iw.set(n,i)};return i(),e.addEventListener(`load`,i),()=>{e.removeEventListener(`load`,i),r()}}function Rw(e,t){e?.contentWindow?.postMessage({source:`design-viewer`,...t},`*`)}function zw(e){Rw(e,{type:`canvas`})}function Bw(e,t){Rw(e,{type:`theme`,theme:t})}function Vw(e){e&&(e.src=e.src)}var Hw=(()=>{if(Ng)return``;let{protocol:e,hostname:t,port:n}=window.location,r=t===`localhost`?`127.0.0.1`:t===`127.0.0.1`?`localhost`:null;return r?`${e}//${r}${n?`:${n}`:``}`:``})();function Uw(e,t,n){let[r=``,i=``]=e.split(`?`),a=new URLSearchParams(i);a.set(`theme`,t);for(let[e,t]of Object.entries(n??{}))a.set(e,t);return`${r.startsWith(`/`)?Hw:``}${r}?${a.toString()}`}function Ww(e){return new URL(e,document.baseURI).toString()}function Gw(e,t,n,r){if(e.form){Tw(`Forms are not sent from a screen`,void 0,`info`);return}if(e.path===null){let t=window.open(e.href,`_blank`);t?t.opener=null:Tw(`Link to another site`,e.href,`info`);return}let i=t.pages.flatMap(e=>e.sections.flatMap(e=>e.items.filter(e=>e.kind===`screen`||e.kind===`url`))),a=i.find(e=>e.id===r),o=e.raw===void 0?e.path:Fw(e.raw,a?.routes?.[0]);if(o===null)return;let s=Pw(i.map(e=>({routes:(e.routes??[]).map(jw),value:e.id})),o);if(s){s!==r&&n(s);return}let c=o.split(/[?#]/)[0].replace(/\/+$/,``),l=c.slice(c.lastIndexOf(`/`)+1).replace(/\.html?$/,``);try{l=decodeURIComponent(l)}catch{}l&&l!==r&&i.some(e=>e.id===l)?n(l):e.pushed||Tw(`No screen for this link`,o,`info`)}function Kw(e,t,n){let r=$g().data,i=t_(!!r?.system).data?.tokens,[a,o]=(0,v.useState)(null),s=(0,v.useRef)({enabled:t,tokens:i});s.current={enabled:t,tokens:i};let c=(0,v.useRef)(n.onEscape);c.current=n.onEscape;let l=(0,v.useRef)(e);l.current=e;let u=(0,v.useRef)(new Map),d=(e,t=!1)=>{let{enabled:n,tokens:r}=s.current,i=u.current.get(e);(t||i?.on!==n||i.tokens!==r)&&(u.current.set(e,{on:n,tokens:r}),Rw(e,{type:`inspect`,on:n,tokens:n?r??[]:void 0}))};(0,v.useEffect)(()=>{for(let t of e)d(t);for(let t of u.current.keys())e.includes(t)||u.current.delete(t)},[e,t,i]),(0,v.useEffect)(()=>{let t=e.map(e=>Lw(e,t=>{if(t.type===`ready`)s.current.enabled?d(e,!0):u.current.set(e,{on:!1});else if(t.type===`inspect`){if(t.info){for(let t of l.current)t!==e&&Rw(t,{type:`inspect-select`,ref:null});o({info:t.info,frame:e})}else o(t=>t?.frame===e?null:t)}else t.type===`inspect-escape`&&c.current()}));return()=>{for(let e of t)e()}},[e]);let f=a&&e.includes(a.frame)?a.frame:null;return{info:f?a.info:null,frame:f,select(e){if(e===null){for(let e of l.current)Rw(e,{type:`inspect-select`,ref:null});o(null)}else a&&Rw(a.frame,{type:`inspect-select`,ref:e})}}}function qw(e){let[t,n]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let t=e=>e===`Meta`||e===`Control`,r=!1,i=!1,a,o=()=>{r=!1,clearTimeout(a),n(!1)},s=e=>{if(t(e)){if(r)return;r=!0,i=!1,a=setTimeout(()=>{r&&!i&&n(!0)},150)}else r&&(i=!0,clearTimeout(a),n(!1))},c=e=>s(e.key),l=e=>{t(e.key)&&o()};window.addEventListener(`keydown`,c,!0),window.addEventListener(`keyup`,l,!0),window.addEventListener(`blur`,o);let u=e.map(e=>Lw(e,e=>{e.type===`key`?e.down?s(e.name):t(e.name)&&o():e.type===`blur`&&o()}));return()=>{window.removeEventListener(`keydown`,c,!0),window.removeEventListener(`keyup`,l,!0),window.removeEventListener(`blur`,o);for(let e of u)e();clearTimeout(a)}},[e]),t}function Jw({title:e,children:t,right:n}){return(0,L.jsxs)(`section`,{className:`border-t border-rule pb-2 first:border-t-0`,children:[(0,L.jsxs)(`div`,{className:`flex h-9 items-center justify-between px-4 text-[12px] font-medium text-muted`,children:[e,n]}),t]})}function Yw({label:e,children:t}){return(0,L.jsxs)(`div`,{className:`grid min-h-7 grid-cols-[92px_minmax(0,1fr)] items-center gap-x-3 px-4 py-0.5 text-[12.5px]`,children:[(0,L.jsx)(`span`,{className:`text-muted`,children:e}),(0,L.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-ink`,children:t})]})}function Xw({name:e}){return e?(0,L.jsx)(`button`,{type:`button`,onClick:()=>void kw(`var(${e})`,`Token copied`),title:`Copy var()`,className:`shrink-0 cursor-pointer truncate rounded-[4px] border-0 bg-action-soft px-1.5 py-px font-mono text-[11px] text-action`,children:e}):null}function Zw({children:e,title:t}){return(0,L.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[12px]`,title:t,children:e})}function Qw({label:e,color:t}){return(0,L.jsxs)(Yw,{label:e,children:[(0,L.jsx)(`span`,{className:`size-3.5 shrink-0 rounded-[3px] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)]`,style:{background:t.css}}),(0,L.jsx)(Zw,{title:t.css,children:t.value}),(0,L.jsx)(Xw,{name:t.token})]})}var $w=e=>e?String(e):`–`;function eT({label:e,values:t,className:n,children:r}){let[i,a,o,s]=t;return(0,L.jsxs)(`div`,{className:X(`relative grid grid-cols-[28px_minmax(0,1fr)_28px] grid-rows-[20px_auto_20px] rounded-[4px]`,n),children:[(0,L.jsx)(`span`,{className:`absolute top-1 left-1.5 text-[9.5px] tracking-wide text-muted uppercase`,children:e}),(0,L.jsx)(`span`,{className:`col-start-2 self-center text-center`,children:$w(i)}),(0,L.jsx)(`span`,{className:`row-start-2 self-center text-center`,children:$w(s)}),(0,L.jsx)(`div`,{className:`row-start-2 col-start-2`,children:r}),(0,L.jsx)(`span`,{className:`row-start-2 col-start-3 self-center text-center`,children:$w(a)}),(0,L.jsx)(`span`,{className:`row-start-3 col-start-2 self-center text-center`,children:$w(o)})]})}function tT({info:e}){let t={w:Math.max(0,e.rect.w-e.border[1]-e.border[3]-e.padding[1]-e.padding[3]),h:Math.max(0,e.rect.h-e.border[0]-e.border[2]-e.padding[0]-e.padding[2])};return(0,L.jsx)(`div`,{className:`px-4 pt-1 pb-2 font-mono text-[11px] text-ink2`,children:(0,L.jsx)(eT,{label:`margin`,values:e.margin,className:`border border-dashed border-rule-strong bg-[#f6b26b]/15`,children:(0,L.jsx)(eT,{label:`border`,values:e.border,className:`border border-rule-strong bg-[#f9e27d]/15`,children:(0,L.jsx)(eT,{label:`padding`,values:e.padding,className:`border border-rule-strong bg-[#93c47d]/20`,children:(0,L.jsxs)(`div`,{className:`flex h-8 items-center justify-center rounded-[3px] border border-rule-strong bg-[#6fa8dc]/25 text-ink`,children:[Math.round(t.w*100)/100,` × `,Math.round(t.h*100)/100]})})})})})}function nT({info:e,onSelect:t}){return(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 px-4 pb-2`,children:[e.path.slice(-4).map((e,n)=>(0,L.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>t(e.ref),className:`cursor-pointer rounded-[4px] border-0 bg-soft2 px-1.5 py-0.5 font-mono text-[11px] text-ink2 hover:text-ink`,children:e.label}),(0,L.jsx)(Z,{name:`chevron-right`,size:11,className:`text-muted`})]},n)),(0,L.jsx)(`span`,{className:`rounded-[4px] bg-action-soft px-1.5 py-0.5 font-mono text-[11px] text-action`,children:e.label})]})}function rT({info:e,onSelect:t,onClose:n,active:r}){return(0,L.jsxs)(`aside`,{"data-ui":!0,className:`flex w-[320px] shrink-0 flex-col overflow-hidden border-l border-rule bg-surface`,children:[(0,L.jsxs)(`div`,{className:`flex h-[46px] shrink-0 items-center justify-between border-b border-rule pr-2 pl-4`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-[14px] font-semibold`,children:[(0,L.jsx)(Z,{name:`pointer`,size:15,className:`text-action`}),` Inspect`]}),(0,L.jsx)(ix,{icon:`x`,label:`Close inspector (I)`,onClick:n})]}),e?(0,L.jsxs)(`div`,{className:`min-h-0 grow overflow-y-auto`,children:[(0,L.jsxs)(Jw,{title:`Element`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pb-2`,children:[(0,L.jsx)(`div`,{className:`flex min-w-0 items-baseline gap-1.5`,children:e.component?.owners[0]?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`span`,{className:`truncate font-mono text-[14px] font-medium text-ink`,children:[`<`,e.component.owners[0],`>`]}),(0,L.jsx)(`span`,{className:`truncate font-mono text-[12px] text-muted`,children:e.tag})]}):(0,L.jsx)(`span`,{className:`truncate font-mono text-[14px] font-medium text-ink`,children:e.label})}),e.component&&e.component.owners.length>1?(0,L.jsxs)(`span`,{className:`truncate text-[12px] text-muted`,children:[`in `,e.component.owners.slice(1).join(` ← `)]}):null,e.component?.file?(0,L.jsx)(`button`,{type:`button`,onClick:()=>void kw(e.component.file,`Path copied`),className:`w-fit max-w-full cursor-pointer truncate border-0 bg-transparent p-0 text-left font-mono text-[11.5px] text-muted hover:text-ink2`,title:`Copy path`,children:e.component.file}):null,e.text?(0,L.jsxs)(`span`,{className:`line-clamp-2 text-[12.5px] text-ink2`,children:[`“`,e.text,`”`]}):null]}),(0,L.jsx)(nT,{info:e,onSelect:t})]}),(0,L.jsxs)(Jw,{title:`Box`,children:[(0,L.jsx)(tT,{info:e}),(0,L.jsx)(Yw,{label:`Size`,children:(0,L.jsxs)(Zw,{children:[e.rect.w,` × `,e.rect.h]})}),(0,L.jsx)(Yw,{label:`Position`,children:(0,L.jsxs)(Zw,{children:[`x `,e.rect.x,` · y `,e.rect.y]})})]}),e.layout.length?(0,L.jsx)(Jw,{title:`Layout`,children:e.layout.map(([e,t])=>(0,L.jsx)(Yw,{label:e,children:(0,L.jsx)(Zw,{title:t,children:t})},e))}):null,e.typography?(0,L.jsxs)(Jw,{title:`Typography`,children:[(0,L.jsxs)(Yw,{label:`Font`,children:[(0,L.jsx)(Zw,{title:e.typography.family,children:e.typography.family.split(`,`)[0]?.replace(/["']/g,``)}),(0,L.jsx)(Xw,{name:e.typography.familyToken})]}),(0,L.jsxs)(Yw,{label:`Size`,children:[(0,L.jsxs)(Zw,{children:[e.typography.size,` / `,e.typography.lineHeight]}),(0,L.jsx)(Xw,{name:e.typography.sizeToken})]}),(0,L.jsx)(Yw,{label:`Weight`,children:(0,L.jsx)(Zw,{children:e.typography.weight})}),e.typography.letterSpacing===`normal`?null:(0,L.jsx)(Yw,{label:`Tracking`,children:(0,L.jsx)(Zw,{children:e.typography.letterSpacing})}),(0,L.jsx)(Qw,{label:`Color`,color:e.typography.color}),e.typography.align===`start`?null:(0,L.jsx)(Yw,{label:`Align`,children:(0,L.jsx)(Zw,{children:e.typography.align})}),e.typography.transform?(0,L.jsx)(Yw,{label:`Transform`,children:(0,L.jsx)(Zw,{children:e.typography.transform})}):null]}):null,Object.values(e.appearance).some(Boolean)?(0,L.jsxs)(Jw,{title:`Appearance`,children:[e.appearance.background?(0,L.jsx)(Qw,{label:`Background`,color:e.appearance.background}):null,e.appearance.backgroundImage?(0,L.jsx)(Yw,{label:`Image`,children:(0,L.jsx)(Zw,{title:e.appearance.backgroundImage,children:e.appearance.backgroundImage})}):null,e.appearance.border?(0,L.jsxs)(Yw,{label:`Border`,children:[(0,L.jsx)(`span`,{className:`size-3.5 shrink-0 rounded-[3px] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)]`,style:{background:e.appearance.border.color.css}}),(0,L.jsxs)(Zw,{children:[e.appearance.border.width,` `,e.appearance.border.style,` `,e.appearance.border.color.value]}),(0,L.jsx)(Xw,{name:e.appearance.border.color.token})]}):null,e.appearance.radius?(0,L.jsxs)(Yw,{label:`Radius`,children:[(0,L.jsx)(Zw,{children:e.appearance.radius.value}),(0,L.jsx)(Xw,{name:e.appearance.radius.token})]}):null,e.appearance.shadow?(0,L.jsxs)(Yw,{label:`Shadow`,children:[(0,L.jsx)(Zw,{title:e.appearance.shadow.value,children:e.appearance.shadow.value}),(0,L.jsx)(Xw,{name:e.appearance.shadow.token})]}):null,e.appearance.opacity?(0,L.jsx)(Yw,{label:`Opacity`,children:(0,L.jsx)(Zw,{children:e.appearance.opacity})}):null]}):null,e.classes.length?(0,L.jsx)(Jw,{title:`Classes`,right:(0,L.jsx)(`button`,{type:`button`,onClick:()=>void kw(e.classes.join(` `),`Classes copied`),className:`cursor-pointer border-0 bg-transparent text-[12px] text-muted hover:text-ink2`,children:`Copy`}),children:(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1 px-4 pb-1`,children:e.classes.map(e=>(0,L.jsx)(`span`,{className:`rounded-[4px] bg-soft2 px-1.5 py-0.5 font-mono text-[11px] text-ink2`,children:e},e))})}):null,e.attributes.length?(0,L.jsx)(Jw,{title:`Attributes`,children:e.attributes.map(([e,t])=>(0,L.jsx)(Yw,{label:e,children:(0,L.jsx)(Zw,{title:t,children:t})},e))}):null,e.children.length?(0,L.jsx)(Jw,{title:`Children · ${e.children.length}`,children:(0,L.jsx)(`div`,{className:`flex flex-col px-2 pb-1`,children:e.children.map((e,n)=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(e.ref),className:`flex h-7 cursor-pointer items-center gap-2 rounded-[6px] border-0 bg-transparent px-2 text-left font-mono text-[12px] text-ink2 hover:bg-soft2`,children:[(0,L.jsx)(Z,{name:`chevron-right`,size:12,className:`text-muted`}),(0,L.jsx)(`span`,{className:`truncate`,children:e.label})]},n))})}):null]}):(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-6 py-10 text-center`,children:[(0,L.jsx)(Z,{name:`pointer`,size:22,className:`text-muted`}),(0,L.jsx)(`span`,{className:`text-[13.5px] text-ink2`,children:r?`Click an element in any screen.`:`Hold ${T_} to highlight, click to inspect.`}),(0,L.jsx)(`span`,{className:`text-[12.5px] leading-[1.5] text-muted`,children:`Hover shows margin, padding and content. Clicks go to the inspector, not the screen.`}),(0,L.jsxs)(`span`,{className:`mt-2 flex items-center gap-1.5 text-[12px] text-muted`,children:[(0,L.jsx)(y_,{children:`I`}),` toggle · hold `,(0,L.jsx)(y_,{children:T_}),` · `,(0,L.jsx)(y_,{children:`esc`}),` clear`]})]}),e?(0,L.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-t border-rule bg-soft px-4 py-2.5`,children:(0,L.jsx)(tx,{icon:`copy`,onClick:()=>void kw(e.css,`CSS copied`),className:`grow`,children:`Copy CSS`})}):null]})}var iT={neutral:`bg-soft2 text-ink2`,action:`bg-action-soft text-action`,ok:`bg-ok-soft text-ok-text`,danger:`bg-danger-soft text-danger-text`};function aT({tone:e=`neutral`,children:t,className:n}){return(0,L.jsx)(`span`,{className:X(`inline-flex h-[22px] shrink-0 items-center gap-1 whitespace-nowrap rounded-[6px] px-2 text-[12px] font-medium`,iT[e],n),children:t})}function oT({value:e,tone:t=`neutral`}){return(0,L.jsx)(`span`,{className:X(`inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-[4px] px-[5px] text-[11.5px] font-semibold tabular`,t===`action`?`bg-action-soft text-action`:t===`danger`?`bg-danger-soft text-danger-text`:`bg-soft2 text-ink2`),children:e})}function sT({children:e,className:t,style:n}){return(0,L.jsx)(`section`,{className:X(`min-w-0 shrink-0 overflow-hidden rounded-[10px] border border-rule bg-surface`,t),style:n,children:e})}function cT({title:e,count:t,sub:n,right:r,as:i=`h2`}){return(0,L.jsxs)(`div`,{className:`flex min-h-[46px] items-center justify-between gap-3 px-4`,children:[(0,L.jsxs)(i,{className:`m-0 flex min-w-0 items-center gap-2 whitespace-nowrap text-[14px] font-semibold`,children:[e,t===void 0?null:(0,L.jsx)(oT,{value:t}),n?(0,L.jsx)(`span`,{className:`truncate text-[12.5px] font-normal text-muted`,children:n}):null]}),r?(0,L.jsx)(`div`,{className:`flex items-center gap-2`,children:r}):null]})}function lT({items:e,value:t,onChange:n,right:r}){let i=(0,v.useId)();return(0,L.jsxs)(`div`,{className:`flex h-[46px] items-center justify-between gap-3 px-4`,children:[(0,L.jsx)(`div`,{role:`tablist`,className:`flex gap-5`,children:e.map(e=>{let r=e.value===t;return(0,L.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,onClick:()=>n(e.value),className:X(`relative flex h-[46px] cursor-pointer items-center gap-1.5 border-0 bg-transparent px-0.5 text-[14px] transition-colors`,r?`font-semibold text-ink`:`font-medium text-ink2 hover:text-ink`),children:[e.label,e.count===void 0?null:(0,L.jsx)(oT,{value:e.count}),r?(0,L.jsx)(Wf.span,{layoutId:i,className:`absolute inset-x-0 bottom-0 h-[2px] bg-ink`,transition:{type:`spring`,stiffness:520,damping:42}}):null]},e.value)})}),r?(0,L.jsx)(`div`,{className:`flex items-center gap-2`,children:r}):null]})}function uT({align:e,children:t}){return(0,L.jsx)(`div`,{className:X(`flex min-w-0 items-center gap-2`,e===`r`&&`justify-end text-right`,e===`c`&&`justify-center`),children:t})}function dT(e,t){return v.Children.toArray(e).map((e,n)=>(0,L.jsx)(uT,{align:t?.[n]??`l`,children:e},n))}function fT({cols:e,align:t,labels:n}){return(0,L.jsx)(`div`,{className:`grid h-8 items-center gap-x-4 border-t border-rule bg-soft px-4 text-[12.5px] text-muted`,style:{gridTemplateColumns:e},children:n.map((e,n)=>(0,L.jsx)(uT,{align:t?.[n]??`l`,children:(0,L.jsx)(`span`,{className:`whitespace-nowrap`,children:e})},n))})}var pT=(e,t,n)=>X(`grid items-center gap-x-4 border-rule`,!e&&`border-t`,t&&`cursor-pointer transition-colors hover:bg-soft`,n);function mT({cols:e,align:t,minH:n=44,pad:r=`10px 16px`,children:i,first:a,className:o,onClick:s,title:c}){return(0,L.jsx)(`div`,{className:pT(a,!!s,o),style:{gridTemplateColumns:e,minHeight:n,padding:r},onClick:s,title:c,children:dT(i,t)})}function hT({to:e,cols:t,align:n,minH:r=44,pad:i=`10px 16px`,first:a,className:o,children:s}){return(0,L.jsx)(be,{href:e,className:X(pT(a,!0,o),`text-inherit no-underline`),style:{gridTemplateColumns:t,minHeight:r,padding:i},children:dT(s,n)})}function gT({label:e,children:t,labelWidth:n=180,minH:r=40,end:i=!1}){return(0,L.jsxs)(`div`,{className:`grid content-center items-baseline gap-x-4 border-t border-rule px-4 py-2`,style:{gridTemplateColumns:`min(${n}px, 42%) minmax(0, 1fr)`,minHeight:r},children:[(0,L.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,L.jsx)(`div`,{className:X(`flex min-w-0 flex-wrap items-center gap-2`,i&&`justify-end`),children:t})]})}function _T({children:e,pad:t=`16px`,gap:n=16,top:r=!0,className:i}){return(0,L.jsx)(`div`,{className:X(`flex flex-col`,r&&`border-t border-rule`,i),style:{padding:t,gap:n},children:e})}function vT({issues:e,className:t}){return(0,L.jsx)(`div`,{className:X(`flex flex-col`,t),children:e.map((e,t)=>(0,L.jsxs)(`div`,{className:`flex items-start gap-2.5 border-t border-rule px-4 py-2.5 text-[13px] first:border-t-0`,children:[(0,L.jsx)(Z,{name:e.severity===`error`?`alert`:`info`,size:15,className:X(`mt-0.5`,e.severity===`error`?`text-danger-text`:`text-action`)}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(`span`,{className:`text-ink`,children:e.message}),(0,L.jsxs)(`span`,{className:`font-mono text-[12px] break-all text-muted`,children:[e.file,e.at?` · ${e.at}`:``]})]})]},t))})}function yT({issues:e,title:t=`Problems`}){if(!e.length)return null;let n=e.filter(e=>e.severity===`error`).length;return(0,L.jsxs)(sT,{className:n?`border-danger/40`:void 0,children:[(0,L.jsx)(cT,{title:t,count:e.length,sub:n?`${n} blocking`:`warnings`}),(0,L.jsx)(`div`,{className:`border-t border-rule`,children:(0,L.jsx)(vT,{issues:e})})]})}var bT=[.2,.7,.2,1];function xT({open:e,side:t,width:n,children:r}){return(0,L.jsx)($u,{initial:!1,children:e?(0,L.jsx)(Wf.div,{initial:{width:0,opacity:.6},animate:{width:n,opacity:1},exit:{width:0,opacity:.6},transition:{duration:.22,ease:bT},className:X(`flex min-h-0 shrink-0 overflow-hidden`,t===`right`?`justify-start`:`justify-end`),children:(0,L.jsx)(`div`,{className:`flex min-h-0 shrink-0`,style:{width:n},children:r})},`panel`):null})}function ST({children:e,className:t,gap:n=20,wide:r=!1}){return(0,L.jsx)(`main`,{className:X(`mx-auto flex w-full min-h-0 grow flex-col px-8 pt-6 pb-7 animate-[q-fade-in_160ms_ease-out] max-md:px-4 max-md:pt-4`,r?`max-w-[1440px]`:`max-w-[1200px]`,t),style:{gap:n},children:e})}function CT({title:e,sub:t,right:n,badge:r,crumbs:i}){return(0,L.jsxs)(`div`,{className:`flex shrink-0 items-end justify-between gap-6 max-md:flex-col max-md:items-stretch max-md:gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[i?(0,L.jsx)(`div`,{className:`flex items-center gap-1.5 text-[13px] text-muted`,children:i}):null,(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`h1`,{className:`m-0 text-[22px] font-semibold tracking-[-0.01em]`,children:e}),r]}),t?(0,L.jsx)(`div`,{className:`text-[13px] [overflow-wrap:anywhere] text-muted`,children:t}):null]}),n?(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:n}):null]})}function wT({items:e,label:t}){return(0,L.jsx)(`nav`,{"aria-label":t,className:`flex flex-col gap-0.5`,children:e.map(e=>(0,L.jsxs)(be,{href:e.to,className:e=>X(`flex h-8 items-center gap-2 whitespace-nowrap rounded-[6px] px-3 text-[13.5px] no-underline transition-colors focus-visible:outline-offset-[-2px]`,e?`bg-soft2 font-medium text-ink`:`text-ink2 hover:bg-soft2`),children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),e.hint?(0,L.jsx)(`span`,{className:`ml-auto text-[12px] font-normal text-muted`,children:e.hint}):null]},e.to))})}function TT({children:e}){return(0,L.jsx)(`div`,{className:`px-3 pt-4 pb-1 text-[12px] text-muted`,children:e})}function ET({title:e,text:t,action:n}){return(0,L.jsxs)(sT,{className:`flex w-[480px] max-w-full flex-col items-center gap-2 px-6 py-8 text-center`,children:[(0,L.jsx)(`h1`,{className:`m-0 text-[16px] font-semibold`,children:e}),t?(0,L.jsx)(`div`,{className:`m-0 max-w-[400px] text-[14px] text-ink2`,children:t}):null,n?(0,L.jsx)(`div`,{className:`mt-3 flex flex-wrap justify-center gap-2`,children:n}):null]})}function DT(e){return(0,L.jsx)(`div`,{className:`flex min-h-[50vh] grow items-center justify-center p-6 max-md:px-4`,children:(0,L.jsx)(ET,{...e})})}function OT({title:e=`Nothing here`,text:t}){let n=!!Xg().scope;return(0,L.jsx)(DT,{title:e,text:t??`This address does not match a canvas or a page of the design system.`,action:n?void 0:(0,L.jsx)(ax,{to:`/`,children:`All canvases`})})}var kT=.1,AT=(e,t=kT)=>Math.min(8,Math.max(t,e)),jT=class{camera={x:0,y:0,z:1};minZoom=kT;listeners=new Set;animation=0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}set(e){this.camera={x:e.x,y:e.y,z:AT(e.z,this.minZoom)};for(let e of this.listeners)e(this.camera)}interrupt(){cancelAnimationFrame(this.animation),this.animation=0}panBy(e,t){this.interrupt();let{x:n,y:r,z:i}=this.camera;this.set({x:n+e,y:r+t,z:i})}zoomAt(e,t,n){this.interrupt();let{x:r,y:i,z:a}=this.camera,o=AT(a*n,this.minZoom),s=(e-r)/a,c=(t-i)/a;this.set({x:e-s*o,y:t-c*o,z:o})}animateTo(e,t=320){this.interrupt();let n={...this.camera},r={...e,z:AT(e.z,this.minZoom)};if(t<=0||matchMedia(`(prefers-reduced-motion: reduce)`).matches){this.set(r);return}let i=performance.now(),a=e=>{let o=Math.min(1,(e-i)/t),s=1-(1-o)**3,c=n.z*(r.z/n.z)**s,l=n.z===r.z?s:(c-n.z)/(r.z-n.z);this.set({x:n.x+(r.x-n.x)*l,y:n.y+(r.y-n.y)*l,z:c}),this.animation=o<1?requestAnimationFrame(a):0};this.animation=requestAnimationFrame(a)}toWorld(e,t){let{x:n,y:r,z:i}=this.camera;return{x:(e-n)/i,y:(t-r)/i}}};function MT(e,t,n,r=72,i=1,a=kT){let o=AT(Math.min((t-r*2)/Math.max(e.w,1),(n-r*2)/Math.max(e.h,1),i),a),s=(e,t,n)=>t*o<=n-r*2?n/2-(e+t/2)*o:r-e*o;return{z:o,x:s(e.x,e.w,t),y:s(e.y,e.h,n)}}function NT(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}function PT({items:e,value:t,onChange:n,label:r,stretch:i,size:a=`ctrl`}){let o=(0,v.useId)();return(0,L.jsx)(`div`,{role:`group`,"aria-label":r,className:X(`shrink-0 items-center gap-0.5 rounded-[6px] bg-track p-[3px]`,a===`ctrl`?`h-ctrl`:`h-7`,i?`flex`:`inline-flex`),children:e.map(e=>{let r=e.value===t;return(0,L.jsxs)(`button`,{type:`button`,"aria-pressed":r,title:e.title,onClick:()=>n(e.value),className:X(`relative flex h-full cursor-pointer items-center justify-center whitespace-nowrap rounded-[4px] border-0 bg-transparent font-medium transition-colors`,a===`ctrl`?`px-2.5 text-ctrl`:`px-2 text-[12.5px]`,i&&`flex-1`,r?`text-ink`:`text-muted hover:text-ink2`),children:[r?(0,L.jsx)(Wf.span,{layoutId:o,className:`absolute inset-0 z-0 rounded-[4px] bg-surface shadow-[0_1px_2px_rgba(0,0,0,0.10)]`,transition:{type:`spring`,stiffness:520,damping:42}}):null,(0,L.jsx)(`span`,{className:`relative z-[1] flex items-center gap-1.5`,children:e.label})]},e.value)})})}var FT=(e,t,n)=>`/c/${encodeURIComponent(e)}/full/${encodeURIComponent(t)}?theme=${n}`;function IT(e,t,n){let{frameSandbox:r}=Xg(),{base:i}=de();return t?t.kind===`url`?t.url:Ww(r?`${i}${FT(e,t.id,t.theme??n)}`:Uw(t.url,t.theme??n)):null}function LT({canvasId:e,itemId:t}){let{data:n,error:r,isLoading:i}=e_(e),[,a]=P(),{frameSandbox:o}=Xg(),s=__(),c=(0,v.useRef)(null),l=new URLSearchParams(window.location.search).get(`theme`),u=n?n.pages.flatMap(e=>e.sections.flatMap(e=>e.items.filter(e=>e.kind===`screen`||e.kind===`url`))):[],d=u.find(e=>e.id===t),f=(d?.kind===`screen`?d.theme:void 0)??(l===`light`||l===`dark`?l:n?.theme??s),p=d?d.kind===`screen`?Uw(d.url,f):d.url:``,m=`/c/${encodeURIComponent(e)}`;return(0,v.useEffect)(()=>{d&&(document.title=`${d.title} · ${n?.title??``}`)},[d,n?.title]),(0,v.useEffect)(()=>{let e=e=>{e.key===`Escape`&&a(m)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a,m]),(0,v.useEffect)(()=>{let r=c.current;if(r&&d?.kind===`screen`)return Lw(r,r=>{if(r.type===`keydown`&&r.code===`Escape`)a(m);else if(r.type===`go`){let t=r.target.includes(`/`)?r.target.split(`/`)[1]:r.target;u.some(e=>e.id===t)&&a(FT(e,t,f),{replace:!0})}else r.type===`link`&&n&&Gw(r,n,t=>a(FT(e,t,f),{replace:!0}),t)})},[p,d?.kind]),r?(0,L.jsx)(OT,{title:`Canvas not found`,text:r.message}):i||!n?(0,L.jsx)(`div`,{className:`h-dvh bg-surface`}):d?(0,L.jsxs)(`div`,{className:`group fixed inset-0 bg-surface`,children:[(0,L.jsx)(`iframe`,{ref:c,src:p,title:d.title,allow:`clipboard-read; clipboard-write; fullscreen`,sandbox:o,className:`block h-full w-full border-0`,style:{colorScheme:f},onLoad:()=>d.kind===`screen`&&Bw(c.current,f)},`${d.id}:${d.kind===`screen`?d.rev:d.url}`),(0,L.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 flex justify-end p-3 opacity-0 transition-opacity duration-200 group-hover:opacity-100 focus-within:opacity-100`,children:(0,L.jsxs)(be,{href:m,className:`pointer-events-auto flex h-8 items-center gap-2 rounded-[8px] border border-rule bg-surface px-3 text-[12.5px] text-ink2 no-underline shadow-pop hover:text-ink`,children:[(0,L.jsx)(Z,{name:`x`,size:14}),`Back to `,n.title,(0,L.jsx)(y_,{children:`esc`})]})})]}):(0,L.jsx)(OT,{title:`Screen not found`,text:`No screen "${t}" on this canvas.`})}function RT(e){return e.kind===`note`?`note`:e.kind===`image`?`image`:e.kind===`url`?`globe`:e.frame.width<600?`smartphone`:e.frame.width<1100?`tablet`:`monitor`}function zT(e,t){return`/c/${encodeURIComponent(e.id)}/p/${encodeURIComponent(t.id)}`}function BT({canvas:e,page:t,store:n,onPick:r}){let i=c_(n,e=>e.selected),a=c_(n,e=>e.frames);return(0,L.jsxs)(`aside`,{"data-ui":!0,className:`flex w-[264px] shrink-0 flex-col overflow-hidden border-r border-rule bg-surface`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 border-b border-rule px-4 py-3.5`,children:[(0,L.jsx)(`div`,{className:`truncate text-[14px] font-semibold`,children:e.title}),e.description?(0,L.jsx)(`div`,{className:`line-clamp-3 text-[12.5px] leading-[1.45] text-muted`,children:e.description}):null]}),(0,L.jsxs)(`div`,{className:`min-h-0 grow overflow-y-auto pb-4`,children:[e.pages.length>1?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:`Pages`}),(0,L.jsx)(`nav`,{className:`flex flex-col gap-0.5 px-2`,children:e.pages.map(n=>{let r=n.sections.reduce((e,t)=>e+t.items.filter(e=>e.kind===`screen`||e.kind===`url`).length,0);return(0,L.jsxs)(be,{href:zT(e,n),className:X(`flex h-8 items-center gap-2 rounded-[6px] px-2.5 text-[13.5px] no-underline transition-colors focus-visible:outline-offset-[-2px]`,n.id===t.id?`bg-soft2 font-medium text-ink`:`text-ink2 hover:bg-soft2`),children:[(0,L.jsx)(Z,{name:`file`,size:15,className:`text-muted`}),(0,L.jsx)(`span`,{className:`min-w-0 grow truncate`,children:n.title}),(0,L.jsx)(`span`,{className:`text-[12px] text-muted tabular`,children:r})]},n.id)})})]}):null,(0,L.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:e.pages.length>1?t.title:`Layers`}),(0,L.jsx)(`div`,{className:`flex flex-col px-2`,children:t.sections.map(e=>(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[e.title?(0,L.jsxs)(`div`,{className:`flex h-7 items-center gap-2 px-2.5 pt-1 text-[12px] font-medium text-ink2`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:e.title}),(0,L.jsx)(oT,{value:e.items.length})]}):null,e.items.map(t=>{let n=(a[t.id]?.errors.length??0)>0||t.kind===`screen`&&t.missing;return(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r(t.id),className:X(`flex h-8 w-full cursor-pointer items-center gap-2 rounded-[6px] border-0 px-2.5 text-left text-[13px] transition-colors focus-visible:outline-offset-[-2px]`,e.title&&`pl-4`,i===t.id?`bg-action-soft text-ink`:`bg-transparent text-ink2 hover:bg-soft2`),children:[(0,L.jsx)(Z,{name:RT(t),size:15,className:`text-muted`}),(0,L.jsx)(`span`,{className:`min-w-0 grow truncate`,children:t.title||(t.kind===`note`?`Note`:t.id)}),n?(0,L.jsx)(`span`,{className:`size-[7px] shrink-0 rounded-full bg-danger`}):null]},t.id)})]},e.id))})]})]})}function VT({canvas:e,page:t,theme:n,onTheme:r,sidebar:i,onSidebar:a,onPlay:o,canPlay:s,inspect:c,onInspect:l}){let[,u]=P(),{slots:d,scope:f}=Xg(),p=(0,v.useRef)(null),m=(0,v.useRef)(null),h=UC(p,m,[e.title,t?.title,e.pages.length]);return(0,L.jsxs)(HC,{value:h,children:[(0,L.jsxs)(VC,{children:[d.barStart,d.brand?d.brand:f?(0,L.jsx)(zC,{}):(0,L.jsx)(Yb,{content:`All canvases`,children:(0,L.jsx)(be,{href:`/`,className:`flex items-center`,"aria-label":`All canvases`,children:(0,L.jsx)(zC,{})})}),(0,L.jsx)(ix,{icon:`panel-left`,label:i?`Hide sidebar (⌘\\)`:`Show sidebar (⌘\\)`,onClick:()=>a(!i)}),(0,L.jsxs)(`div`,{ref:p,className:`flex min-w-0 items-center gap-1.5 text-[14px]`,children:[(0,L.jsx)(`span`,{"data-fit":!0,className:`truncate font-semibold`,children:e.title}),t&&e.pages.length>1?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Z,{name:`chevron-right`,size:14,className:`shrink-0 text-muted`}),(0,L.jsxs)(MC,{width:240,trigger:(0,L.jsxs)(`button`,{type:`button`,className:`flex h-ctrl cursor-pointer items-center gap-1 rounded-[6px] border-0 bg-transparent px-2 text-[14px] text-ink2 hover:bg-soft2`,children:[(0,L.jsx)(`span`,{"data-fit":!0,className:`truncate`,children:t.title}),(0,L.jsx)(Z,{name:`chevron-down`,size:14,className:`text-muted`})]}),children:[(0,L.jsx)(IC,{children:`Pages`}),e.pages.map(n=>(0,L.jsxs)(PC,{active:n.id===t.id,onSelect:()=>u(zT(e,n)),children:[(0,L.jsx)(Z,{name:`file`,size:15,className:`text-muted`}),n.title]},n.id))]})]}):null]}),(0,L.jsxs)(`div`,{ref:m,className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,L.jsx)(PT,{label:`Screen theme`,value:n,onChange:r,items:[{value:`light`,label:(0,L.jsx)(Z,{name:`sun`,size:15}),title:`Light screens`},{value:`dark`,label:(0,L.jsx)(Z,{name:`moon`,size:15}),title:`Dark screens`}]}),(0,L.jsx)(UT,{on:c,onChange:l,compact:h}),(0,L.jsx)(Yb,{content:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Play `,(0,L.jsx)(y_,{children:`P`})]}),children:(0,L.jsx)(tx,{kind:`secondary`,icon:`play`,onClick:o,disabled:!s,"aria-label":`Play`,className:h?`w-ctrl px-0`:void 0,children:h?null:`Play`})}),(0,L.jsx)(Qb,{width:180,label:`Search`,compact:h}),(0,L.jsx)(RC,{}),d.barEnd]})]}),d.belowBar?(0,L.jsx)(`div`,{className:`shrink-0`,children:d.belowBar}):null]})}function HT({canvas:e,store:t,layoutItems:n,theme:r,onPlay:i,inspect:a}){let o=c_(t,e=>e.selected),s=c_(t,e=>e.active),c=c_(t,e=>o?e.frames[o]:void 0),l=n.find(e=>e.id===o),u=IT(e.id,l?.kind===`screen`||l?.kind===`url`?l:void 0,r);if(!l)return null;let d=l.kind===`screen`||l.kind===`url`,f=()=>Vw(document.querySelector(`[data-item="${CSS.escape(l.id)}"] iframe`)),p=c?.errors??[];return(0,L.jsx)(`div`,{"data-ui":!0,className:`pointer-events-none absolute inset-x-0 bottom-5 z-20 flex justify-center px-4`,children:(0,L.jsxs)(`div`,{className:`pointer-events-auto flex max-w-full flex-col overflow-hidden rounded-[10px] border border-rule bg-surface shadow-pop animate-[q-pop_120ms_ease-out]`,children:[p.length?(0,L.jsxs)(`div`,{className:`flex max-h-40 items-start gap-2 overflow-y-auto border-b border-rule bg-danger-soft px-3.5 py-2 font-mono text-[12px] whitespace-pre-wrap text-danger-text`,children:[(0,L.jsx)(Z,{name:`alert`,size:14,className:`mt-px`}),(0,L.jsx)(`span`,{className:`min-w-0`,children:p.join(`
58
- `)})]}):null,(0,L.jsxs)(`div`,{className:`flex h-[44px] items-center gap-1 pr-1.5 pl-3.5`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 pr-2`,children:[(0,L.jsx)(`span`,{className:`truncate text-[13.5px] font-medium`,children:l.title||l.id}),d&&s===l.id?(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-[12px] text-muted`,children:[(0,L.jsx)(Z,{name:`pointer`,size:13}),` `,a?`Inspecting`:`Interacting`,` `,(0,L.jsx)(y_,{children:`esc`})]}):d?(0,L.jsx)(`span`,{className:`shrink-0 text-[12px] text-muted`,children:a?`Click an element to inspect it`:`Click the screen to interact`}):null]}),d?(0,L.jsx)(Yb,{content:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Play `,(0,L.jsx)(y_,{children:`↵`})]}),children:(0,L.jsx)(ix,{icon:`play`,label:`Play`,onClick:()=>i(l.id)})}):null,u?(0,L.jsx)(Yb,{content:`Open in a new tab`,children:(0,L.jsx)(`a`,{href:u,target:`_blank`,rel:`noreferrer`,"aria-label":`Open in a new tab`,className:`inline-flex h-ctrl w-ctrl items-center justify-center rounded-[6px] text-muted hover:bg-soft2 hover:text-ink2`,children:(0,L.jsx)(Z,{name:`external`,size:16})})}):null,d?(0,L.jsx)(Yb,{content:`Reload`,children:(0,L.jsx)(ix,{icon:`refresh`,label:`Reload`,onClick:f})}):null,l.kind===`screen`?(0,L.jsx)(Yb,{content:`Copy source path`,children:(0,L.jsx)(ix,{icon:`copy`,label:`Copy source path`,onClick:()=>void kw(l.file,`Path copied`)})}):null,(0,L.jsx)(Yb,{content:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Zoom to `,(0,L.jsx)(y_,{children:`⇧2`})]}),children:(0,L.jsx)(ix,{icon:`fit`,label:`Zoom to`,onClick:()=>window.dispatchEvent(new CustomEvent(`design:focus`,{detail:{canvas:e.id,item:l.id}}))})})]})]})})}function UT({on:e,onChange:t,compact:n=!1}){return(0,L.jsx)(Yb,{content:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Inspect elements `,(0,L.jsx)(y_,{children:`I`})]}),children:(0,L.jsxs)(`button`,{type:`button`,"aria-pressed":e,"aria-label":`Inspect elements`,onClick:()=>t(!e),className:X(`inline-flex h-ctrl shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-[6px] border text-ctrl font-medium`,n?`w-ctrl px-0`:`px-ctrl`,e?`border-action-line bg-action-soft text-action`:`border-rule-strong bg-surface text-ink hover:bg-soft`),children:[(0,L.jsx)(Z,{name:`pointer`,size:15}),n?null:`Inspect`]})})}var WT=280,GT=96,KT=150,qT=110,JT=720,YT=e=>e.kind===`screen`||e.kind===`url`;function XT(e,t){let n=t[e.id];if(e.kind===`screen`||e.kind===`url`){let t=e.frame.width;if(e.frame.height!==`auto`)return{w:t,h:e.frame.height};let r=e.kind===`screen`?e.measuredHeight:void 0;return{w:t,h:n?.h??r??900}}if(e.kind===`note`)return{w:e.width,h:n?.h??Math.max(80,Math.ceil(e.text.length/38)*26+40)};let r=e.width??n?.w??480;return{w:r,h:n?.w?n.h/n.w*r:n?.h??r*.62}}function ZT(e,t){return!e.title&&!e.description?0:t[`section:${e.id}`]?.h??(e.title?56:0)+(e.description?60:0)}function QT(e,t){let n=[],r=[];if(e.layout===`free`){let r=0;for(let i of e.sections)for(let e of i.items){let{w:a,h:o}=XT(e,t),s=e.x??r,c=e.y??0;r=Math.max(r,s+a+GT),n.push({item:e,section:i,x:s,y:c,w:a,h:o})}}else{let i=0;for(let a of e.sections){let e=ZT(a,t),o=i,s=i+(e?e+qT:0),c=0,l=0,u=0,d=0;for(let e of a.items){a.columns&&d===a.columns&&(s+=l+KT,c=0,l=0,d=0);let{w:r,h:i}=XT(e,t);n.push({item:e,section:a,x:c,y:s,w:r,h:i}),c+=r+GT,u=Math.max(u,c-GT),l=Math.max(l,i),d++}let f=s+l;r.push({section:a,x:0,y:o,w:Math.max(u,e?JT:0),h:f-o,header:e}),i=f+WT}}let i=0,a=0,o=0,s=0,c=[...n,...r];return c.length&&(i=Math.min(...c.map(e=>e.x)),a=Math.min(...c.map(e=>e.y)),o=Math.max(...c.map(e=>e.x+e.w)),s=Math.max(...c.map(e=>e.y+e.h))),{items:n,sections:r,bounds:{x:i,y:a,w:o-i,h:s-a}}}function $T(e){return e.items.filter(e=>YT(e.item))}function eE(){return new s_({selected:null,active:null,hovered:null,sizes:{},frames:{},live:[],panning:!1,zoomTiny:!1,frameEls:{},inspecting:!1})}function tE(e,t,n){e.set(e=>{let r=e.sizes[t];return r&&Math.abs(r.h-n.h)<1&&r.w===n.w?e:{...e,sizes:{...e.sizes,[t]:n}}})}function nE(e,t,n){e.set(e=>{let r=e.frames[t]??{ready:!1,errors:[]};return{...e,frames:{...e.frames,[t]:{...r,...n}}}})}function rE(e,t,n){e.set(e=>e.frameEls[t]===n?e:{...e,frameEls:{...e.frameEls,[t]:n}})}function iE(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var aE=iE();function oE(e){aE=e}var sE={exec:()=>null};function cE(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function $(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(uE.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var lE=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),uE={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:cE(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:cE(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:cE(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:cE(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:cE(e=>RegExp(`^ {0,${e}}(?:</?(?:${TE})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:cE(e=>RegExp(`^ {0,${e}}>`))},dE=/^(?:[ \t]*(?:\n|$))+/,fE=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,pE=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,mE=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,hE=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,gE=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,_E=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,vE=$(_E).replace(/bull/g,gE).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),yE=$(_E).replace(/bull/g,gE).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),bE=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,xE=/^[^\n]+/,SE=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,CE=$(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,SE).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),wE=$(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,gE).getRegex(),TE=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,EE=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,DE=$(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,EE).replace(`tag`,TE).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),OE=e=>$(bE).replace(`hr`,mE).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,TE).getRegex(),kE=OE(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),AE=OE(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),jE={blockquote:$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,AE).getRegex(),code:fE,def:CE,fences:pE,heading:hE,hr:mE,html:DE,lheading:vE,list:wE,newline:dE,paragraph:kE,table:sE,text:xE},ME=$(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,mE).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,TE).getRegex(),NE={...jE,lheading:yE,table:ME,paragraph:$(bE).replace(`hr`,mE).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,ME).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,TE).getRegex()},PE={...jE,html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,EE).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:sE,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$(bE).replace(`hr`,mE).replace(`heading`,` *#{1,6} *[^
59
- ]`).replace(`lheading`,vE).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},FE=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,IE=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,LE=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,RE=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,zE=/[\p{P}\p{S}]/u,BE=/[\s\p{P}\p{S}]/u,VE=/[^\s\p{P}\p{S}]/u,HE=$(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,BE).getRegex(),UE=/[\p{Pi}\p{Ps}"']/u,WE=/(?!~)[\p{P}\p{S}]/u,GE=/(?!~)[\s\p{P}\p{S}]/u,KE=/(?:[^\s\p{P}\p{S}]|~)/u,qE=$(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,lE?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),JE=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,YE=$(JE,`u`).replace(/punct/g,zE).getRegex(),XE=$(JE,`u`).replace(/punct/g,WE).getRegex(),ZE=$(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,UE).replace(/punct/g,zE).getRegex(),QE=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,$E=$(QE,`gu`).replace(/notPunctSpace/g,VE).replace(/punctSpace/g,BE).replace(/punct/g,zE).getRegex(),eD=$(QE,`gu`).replace(/notPunctSpace/g,KE).replace(/punctSpace/g,GE).replace(/punct/g,WE).getRegex(),tD=$(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,VE).replace(/punctSpace/g,BE).replace(/punct/g,zE).getRegex(),nD=$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,VE).replace(/punctSpace/g,BE).replace(/punct/g,zE).getRegex(),rD=$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,VE).replace(/punctSpace/g,BE).replace(/punct/g,zE).getRegex(),iD=$(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,zE).getRegex(),aD=$(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,VE).replace(/punctSpace/g,BE).replace(/punct/g,zE).getRegex(),oD=$(/\\(punct)/,`gu`).replace(/punct/g,zE).getRegex(),sD=$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),cD=$(EE).replace(`(?:-->|$)`,`-->`).getRegex(),lD=$(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,cD).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),uD=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,dD=$(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,uD).getRegex(),fD=$(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,dD).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pD=$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,dD).replace(`ref`,SE).getRegex(),mD=$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,SE).getRegex(),hD=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,gD=$(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,uD).getRegex(),_D=$(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,gD).replace(`ref`,hD).getRegex()).replace(`nolink`,$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,hD).getRegex()).getRegex(),vD=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,yD=$(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),bD={_backpedal:sE,anyPunctuation:oD,autolink:sD,blockSkip:qE,br:LE,code:IE,del:sE,delLDelim:sE,delRDelim:sE,emStrongLDelim:YE,emStrongRDelimAst:$E,emStrongRDelimUnd:nD,escape:FE,link:fD,nolink:mD,punctuation:HE,reflink:pD,reflinkSearch:_D,tag:lD,text:RE,url:sE},xD={...bD,emStrongLDelim:ZE,emStrongRDelimAst:tD,emStrongRDelimUnd:rD,link:$(/^!?\[(label)\]\((.*?)\)/).replace(`label`,dD).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,dD).getRegex()},SD={...bD,emStrongRDelimAst:eD,emStrongLDelim:XE,delLDelim:iD,delRDelim:aD,url:$(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,yD).replace(`protocol`,vD).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,vD).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},CD={...SD,br:$(LE).replace(`{2,}`,`*`).getRegex(),text:$(SD.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},wD={normal:jE,gfm:NE,pedantic:PE},TD={normal:bD,gfm:SD,breaks:CD,pedantic:xD},ED={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},DD=e=>ED[e];function OD(e,t){if(t){if(uE.escapeTest.test(e))return e.replace(uE.escapeReplace,DD)}else if(uE.escapeTestNoEncode.test(e))return e.replace(uE.escapeReplaceNoEncode,DD);return e}function kD(e){return e.replace(uE.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function AD(e){try{e=encodeURI(e).replace(uE.percentDecode,`%`)}catch{return null}return e}function jD(e,t){let n=e.replace(uE.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(uE.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(uE.slashPipe,`|`);return n}function MD(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function ND(e){let t=e.split(`
60
- `),n=t.length-1;for(;n>=0&&uE.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
61
- `)}function PD(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function FD(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function ID(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function LD(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function RD(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
57
+ `},Kh=0,qh=[];function Jh(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Kh++)[0],a=v.useState(gh)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Km([e.lockRef.current],(e.shards||[]).map(Uh),!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=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Vh(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=Ph(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ph(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 Bh(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(qh.length&&qh[qh.length-1]===a){var r=`deltaY`in n?Hh(n):Vh(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Wh(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Uh).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=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Yh(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=Vh(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,Hh(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,Vh(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return qh.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,kh),document.addEventListener(`touchmove`,c,kh),document.addEventListener(`touchstart`,u,kh),function(){qh=qh.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,kh),document.removeEventListener(`touchmove`,c,kh),document.removeEventListener(`touchstart`,u,kh)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:Gh(i)}):null,p?v.createElement(Eh,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Yh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Xh=oh(sh,Jh),Zh=v.forwardRef(function(e,t){return v.createElement(lh,Wm({},e,{ref:t,sideCar:Xh}))});Zh.classNames=lh.classNames;var Qh=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},$h=new WeakMap,eg=new WeakMap,tg={},ng=0,rg=function(e){return e&&(e.host||rg(e.parentNode))},ig=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=rg(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})},ag=function(e,t,n,r){var i=ig(t,Array.isArray(e)?e:[e]);tg[n]||(tg[n]=new WeakMap);var a=tg[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=($h.get(e)||0)+1,l=(a.get(e)||0)+1;$h.set(e,c),a.set(e,l),o.push(e),c===1&&i&&eg.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(),ng++,function(){o.forEach(function(e){var t=$h.get(e)-1,i=a.get(e)-1;$h.set(e,t),a.set(e,i),t||(eg.has(e)||e.removeAttribute(r),eg.delete(e)),i||e.removeAttribute(n)}),ng--,ng||($h=new WeakMap,$h=new WeakMap,eg=new WeakMap,tg={})}},og=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Qh(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ag(r,i,n,`aria-hidden`)):function(){return null}},sg=Object.defineProperty,cg=(e,t)=>sg(e,`name`,{value:t,configurable:!0}),lg=`Dialog`,[ug,dg]=ap(lg),[fg,pg]=ug(lg),mg=cg(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=xp({prop:r,defaultProp:i??!1,onChange:a,caller:lg}),[d,f]=v.useState(0),[p,m]=v.useState(0);return(0,L.jsx)(fg,{scope:t,triggerRef:s,contentRef:c,contentId:fp(),titleId:fp(),descriptionId:fp(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),hg=`DialogPortal`,[gg,_g]=ug(hg,{forceMount:void 0}),vg=cg(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=pg(hg,t);return(0,L.jsx)(gg,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,L.jsx)(jm,{present:n||a.open,children:(0,L.jsx)(Dm,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),yg=`DialogOverlay`,bg=v.forwardRef(cg(function(e,t){let n=_g(yg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=pg(yg,e.__scopeDialog);return a.modal?(0,L.jsx)(jm,{present:r||a.open,children:(0,L.jsx)(Sg,{...i,ref:t})}):null},`DialogOverlay`)),xg=kp(`DialogOverlay.RemoveScroll`),Sg=v.forwardRef(cg(function(e,t){let{__scopeDialog:n,...r}=e,i=pg(yg,n),a=tp(t,rm());return(0,L.jsx)(Zh,{as:xg,allowPinchZoom:!0,shards:[i.contentRef],children:(0,L.jsx)(Wp.div,{"data-state":Mg(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Cg=`DialogContent`,wg=v.forwardRef(cg(function(e,t){let n=_g(Cg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=pg(Cg,e.__scopeDialog);return(0,L.jsx)(jm,{present:r||a.open,children:a.modal?(0,L.jsx)(Tg,{...i,ref:t}):(0,L.jsx)(Eg,{...i,ref:t})})},`DialogContent`)),Tg=v.forwardRef(cg(function(e,t){let n=pg(Cg,e.__scopeDialog),r=v.useRef(null),i=tp(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return og(e)},[]),(0,L.jsx)(Dg,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Y(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Eg=v.forwardRef(cg(function(e,t){let n=pg(Cg,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,L.jsx)(Dg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Dg=v.forwardRef(cg(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=pg(Cg,n);return Hm(),(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(mm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(nm,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Mg(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Og=`DialogTitle`,kg=v.forwardRef(cg(function(e,t){let{__scopeDialog:n,...r}=e,i=pg(Og,n),{setTitleCount:a}=i;return sp(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(Wp.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Ag=`DialogClose`,jg=v.forwardRef(cg(function(e,t){let{__scopeDialog:n,...r}=e,i=pg(Ag,n);return(0,L.jsx)(Wp.button,{type:`button`,...r,ref:t,onClick:Y(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Mg(e){return e?`open`:`closed`}cg(Mg,`getState`);var Ng=window.__DESIGN_STATIC__===!0,Pg=class extends Error{status;constructor(e,t){super(t),this.status=e}};async function Fg(e,t){let n=await fetch(e,{cache:t});if(!n.ok){let e=`${n.status} ${n.statusText}`;try{let t=await n.json();t.error&&(e=t.error)}catch{}throw new Pg(n.status,e)}return await n.json()}async function Ig(e){try{return await e}catch(e){if(e instanceof Pg&&e.status===404)return null;throw e}}var Lg=``;function Rg(e){return Lg!==e.version&&(Lg=e.version,console.info(`foss-design ${e.version}${Ng?` (static build)`:``}`)),e}var zg={live:!0,project:()=>Fg(`/api/project`,`no-store`).then(Rg),canvas:async e=>({doc:await Fg(`/api/canvas/${encodeURIComponent(e)}`,`no-store`),base:``}),system:async()=>{let e=await Ig(Fg(`/api/system`,`no-store`));return e?{doc:e,base:``}:null},async source(e){let t=await fetch(`/api/source?path=${encodeURIComponent(e)}`,{cache:`no-store`});if(!t.ok)throw new Pg(t.status,`Could not read ${e}`);return t.text()},async setIcon(e){let t=await fetch(`/api/icon`,{method:e?`PUT`:`DELETE`,headers:e?{"content-type":e.type||`application/octet-stream`}:void 0,body:e});if(!t.ok){let e=await t.json().catch(()=>({}));throw new Pg(t.status,e.error??`${t.status} ${t.statusText}`)}}},Bg=null,Vg={live:!1,project:()=>Fg(`api/project.json`,`default`).then(Rg),canvas:async e=>({doc:await Fg(`api/canvas/${encodeURIComponent(e)}.json`,`default`),base:``}),system:async()=>{let e=await Ig(Fg(`api/system.json`,`default`));return e?{doc:e,base:``}:null},async source(e){Bg??=Fg(`api/sources.json`,`default`).catch(()=>({}));let t=(await Bg)[e];if(t===void 0)throw new Pg(404,`${e} is not in this build`);return t}};function Hg(e,t){if(!t)return e;try{let n=new URL(t.endsWith(`/`)?t:`${t}/`,document.baseURI);return new URL(e,n).href}catch{return e}}function Ug(e,t){if(!t)return e;let n=e=>Hg(e,t);return{...e,pages:e.pages.map(e=>({...e,sections:e.sections.map(e=>({...e,items:e.items.map(e=>{if(e.kind===`screen`){let t=e=>e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t&&n(t)])):void 0;return{...e,url:n(e.url),snapshots:t(e.snapshots),thumbs:t(e.thumbs)}}return e.kind===`image`?{...e,url:n(e.url)}:e})}))}))}}function Wg(e,t){if(!t)return e;let n=e=>Hg(e,t);return{...e,components:e.components.map(e=>({...e,url:n(e.url)})),assets:e.assets.map(e=>({...e,url:n(e.url)})),typographyUrl:e.typographyUrl&&n(e.typographyUrl)}}function Gg(e){return{all:[`design`,e],project:[`design`,e,`project`],canvas:t=>[`design`,e,`canvas`,t],system:[`design`,e,`system`],sources:[`design`,e,`source`],source:(t,n)=>[`design`,e,`source`,t,n]}}var Kg=new WeakMap,qg=0;function Jg(e){let t=Kg.get(e);return t||(qg+=1,t=String(qg),Kg.set(e,t)),t}var Yg=(0,v.createContext)(null);function Xg(){let e=(0,v.useContext)(Yg);if(!e)throw Error(`foss-design: this component renders inside <DesignViewer>`);return e}function Zg(e,t){if(e===t)return!0;try{return decodeURIComponent(e)===t}catch{return!1}}function Qg(e){return new Bt({defaultOptions:{queries:{staleTime:e?0:1/0,retry:1,refetchOnWindowFocus:!1}}})}function $g(){let{source:e,keys:t,scope:n}=Xg();return Qt({queryKey:t.project,queryFn:()=>e.project(),enabled:!n})}function e_(e,t=!0){let{source:n,keys:r}=Xg();return Qt({queryKey:r.canvas(e),queryFn:async()=>{let{doc:t,base:r}=await n.canvas(e);return Ug(t,r)},placeholderData:e=>e,enabled:t})}function t_(e=!0){let{source:t,keys:n}=Xg();return Qt({queryKey:n.system,queryFn:async()=>{let e=await t.system();return e?Wg(e.doc,e.base):null},enabled:e})}function n_(e,t=`system`){let{source:n,keys:r}=Xg();return Qt({queryKey:r.source(t,e??``),queryFn:()=>n.source(e,t),enabled:!!e})}function r_(e,t){let n=null,r=!1;return n=new EventSource(`/api/events`),n.onopen=()=>{r&&(r=!1,e.invalidateQueries({queryKey:t.all}))},n.onerror=()=>{r=!0},n.onmessage=n=>{let r;try{r=JSON.parse(n.data)}catch{return}if(r.type===`project`)e.invalidateQueries({queryKey:t.project});else if(r.type===`system`)e.invalidateQueries({queryKey:t.system}),e.invalidateQueries({queryKey:t.sources});else if(r.type===`canvas`||r.type===`snapshot`){let n=r.type===`canvas`?r.id:r.canvas;e.invalidateQueries({queryKey:t.canvas(n)}),r.type===`snapshot`&&e.invalidateQueries({queryKey:t.project})}},()=>n?.close()}function X(...e){return e.filter(Boolean).join(` `)}var i_=null;function a_(e,t){i_={canvas:e,item:t},window.dispatchEvent(new CustomEvent(`design:focus`,{detail:i_}))}function o_(e){if(!i_||i_.canvas!==e)return null;let t=i_.item;return i_=null,t}var s_=class{value;listeners=new Set;constructor(e){this.value=e}get=()=>this.value;set=e=>{let t=typeof e==`function`?e(this.value):e;if(!Object.is(t,this.value)){this.value=t;for(let e of this.listeners)e()}};subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})};function c_(e,t=e=>e){return(0,v.useSyncExternalStore)(e.subscribe,()=>t(e.get()),()=>t(e.get()))}var l_=`foss-design.theme`;function u_(){try{let e=localStorage.getItem(l_);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`system`}var d_=new s_(u_()),f_=window.matchMedia(`(prefers-color-scheme: dark)`);function p_(e){return e===`system`?f_.matches?`dark`:`light`:e}function m_(){document.documentElement.dataset.theme=p_(d_.get())}f_.addEventListener(`change`,m_),d_.subscribe(m_),m_();function h_(e){try{localStorage.setItem(l_,e)}catch{}d_.set(e)}function g_(){return c_(d_)}function __(){let e=c_(d_),t=(0,v.useSyncExternalStore)(e=>(f_.addEventListener(`change`,e),()=>f_.removeEventListener(`change`,e)),()=>f_.matches);return e===`system`?t?`dark`:`light`:e}var v_={plus:`<path d="M5 12h14"/><path d="M12 5v14"/>`,check:`<path d="M20 6 9 17l-5-5"/>`,x:`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`,"chevron-down":`<path d="m6 9 6 6 6-6"/>`,"chevron-up":`<path d="m18 15-6-6-6 6"/>`,"chevron-right":`<path d="m9 18 6-6-6-6"/>`,"arrow-right":`<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>`,chevrons:`<path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/>`,copy:`<rect width="14" height="14" x="8" y="8" rx="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>`,search:`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>`,bell:`<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/>`,refresh:`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>`,"up-right":`<path d="M7 7h10v10"/><path d="M7 17 17 7"/>`,"down-left":`<path d="M17 7 7 17"/><path d="M17 17H7V7"/>`,external:`<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>`,"user-plus":`<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M19 8v6"/><path d="M22 11h-6"/>`,user:`<circle cx="12" cy="8" r="5"/><path d="M20 21a8 8 0 0 0-16 0"/>`,trash:`<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>`,more:`<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>`,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"/><path d="M12 9v4"/><path d="M12 17h.01"/>`,info:`<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>`,upload:`<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m17 8-5-5-5 5"/><path d="M12 3v12"/>`,download:`<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10 5 5 5-5"/><path d="M12 15V3"/>`,shield:`<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"/><path d="m9 12 2 2 4-4"/>`,logout:`<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><path d="m16 17 5-5-5-5"/><path d="M21 12H9"/>`,loader:`<path d="M21 12a9 9 0 1 1-6.219-8.56"/>`,"circle-check":`<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>`,"circle-dashed":`<circle cx="12" cy="12" r="9" stroke-dasharray="3 3"/>`,clock:`<circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/>`,mail:`<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>`,send:`<path d="m22 2-7 20-4-9-9-4Z"/><path d="M22 2 11 13"/>`,chat:`<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>`,wallet:`<path d="M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1"/><path d="M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"/>`,"file-code":`<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="m10 13-2 2 2 2"/><path d="m14 17 2-2-2-2"/>`,ban:`<circle cx="12" cy="12" r="10"/><path d="m4.9 4.9 14.2 14.2"/>`,code:`<path d="m16 18 6-6-6-6"/><path d="m8 6-6 6 6 6"/>`,"chevron-left":`<path d="m15 18-6-6 6-6"/>`,bluetooth:`<path d="m7 7 10 10-5 5V2l5 5L7 17"/>`,face:`<path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><path d="M9 9h.01"/><path d="M15 9h.01"/>`,eye:`<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/>`,clipboard:`<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><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"/>`,grip:`<circle cx="9" cy="5" r="1"/><circle cx="9" cy="12" r="1"/><circle cx="9" cy="19" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="15" cy="19" r="1"/>`,list:`<path d="M3 12h.01"/><path d="M3 18h.01"/><path d="M3 6h.01"/><path d="M8 12h13"/><path d="M8 18h13"/><path d="M8 6h13"/>`,lock:`<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>`,hw:`<rect width="20" height="10" x="2" y="7" rx="2"/><path d="M15 7v10"/><circle cx="8" cy="12" r="1.5"/>`,link:`<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>`,signal:`<path d="M2 20h.01"/><path d="M7 20v-4"/><path d="M12 20v-8"/><path d="M17 20V8"/>`,grid:`<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>`,coins:`<circle cx="8" cy="8" r="6"/><path d="M18.09 10.37A6 6 0 1 1 10.34 18"/><path d="M7 6h1v4"/><path d="m16.71 13.88.7.71-2.82 2.82"/>`,arrows:`<path d="M8 3 4 7l4 4"/><path d="M4 7h16"/><path d="m16 21 4-4-4-4"/><path d="M20 17H4"/>`,key:`<path d="m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"/><path d="m21 2-9.6 9.6"/><circle cx="7.5" cy="15.5" r="5.5"/>`,blocks:`<rect width="7" height="7" x="14" y="3" rx="1"/><path d="M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3"/>`,settings:`<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>`,qr:`<rect width="5" height="5" x="3" y="3" rx="1"/><rect width="5" height="5" x="16" y="3" rx="1"/><rect width="5" height="5" x="3" y="16" rx="1"/><path d="M21 16h-3a2 2 0 0 0-2 2v3"/><path d="M21 21v.01"/><path d="M12 7v3a2 2 0 0 1-2 2H7"/><path d="M3 12h.01"/><path d="M12 3h.01"/><path d="M12 16v.01"/><path d="M16 12h1"/><path d="M21 12v.01"/><path d="M12 21v-1"/>`,edit:`<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"/>`,star:`<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"/>`,home:`<path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"/><path d="M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>`,moon:`<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>`,sun:`<circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/>`,languages:`<path d="m5 8 6 6"/><path d="m4 14 6-6 2-3"/><path d="M2 5h12"/><path d="M7 2h1"/><path d="m22 22-5-10-5 10"/><path d="M14 18h6"/>`,"arrow-left":`<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>`,play:`<polygon points="6 3 20 12 6 21 6 3"/>`,"zoom-in":`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/><path d="M11 8v6"/><path d="M8 11h6"/>`,"zoom-out":`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/><path d="M8 11h6"/>`,fit:`<path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/>`,"panel-left":`<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/>`,layers:`<path d="M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"/><path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"/><path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"/>`,file:`<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/>`,palette:`<circle cx="13.5" cy="6.5" r="1"/><circle cx="17.5" cy="10.5" r="1"/><circle cx="8.5" cy="7.5" r="1"/><circle cx="6.5" cy="12.5" r="1"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.93 0 1.65-.75 1.65-1.69 0-.44-.18-.84-.44-1.13-.29-.29-.44-.65-.44-1.13a1.64 1.64 0 0 1 1.67-1.67h2c3.05 0 5.55-2.5 5.55-5.55C21.96 6.01 17.46 2 12 2z"/>`,type:`<path d="M4 7V4h16v3"/><path d="M9 20h6"/><path d="M12 4v16"/>`,shape:`<path d="M5 3a2 2 0 0 0-2 2"/><path d="M19 3a2 2 0 0 1 2 2"/><path d="M21 19a2 2 0 0 1-2 2"/><path d="M5 21a2 2 0 0 1-2-2"/><path d="M9 3h1"/><path d="M9 21h1"/><path d="M14 3h1"/><path d="M14 21h1"/><path d="M3 9v1"/><path d="M21 9v1"/><path d="M3 14v1"/><path d="M21 14v1"/>`,motion:`<path d="M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/><path d="M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/><path d="M2 6c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"/>`,book:`<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/>`,image:`<rect width="18" height="18" x="3" y="3" rx="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.09-3.09a2 2 0 0 0-2.82 0L6 21"/>`,monitor:`<rect width="20" height="14" x="2" y="3" rx="2"/><path d="M8 21h8"/><path d="M12 17v4"/>`,smartphone:`<rect width="14" height="20" x="5" y="2" rx="2"/><path d="M12 18h.01"/>`,tablet:`<rect width="16" height="20" x="4" y="2" rx="2"/><path d="M12 18h.01"/>`,note:`<path d="M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z"/><path d="M15 3v4a2 2 0 0 0 2 2h4"/>`,globe:`<circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/>`,pointer:`<path d="M4.04 4.69a.5.5 0 0 1 .65-.65l16 6.5a.5.5 0 0 1-.06.95l-6.12 1.58a2 2 0 0 0-1.44 1.44l-1.58 6.12a.5.5 0 0 1-.95.06z"/>`,component:`<path d="M5.5 8.5 9 12l-3.5 3.5L2 12l3.5-3.5Z"/><path d="m12 2 3.5 3.5L12 9 8.5 5.5 12 2Z"/><path d="M18.5 8.5 22 12l-3.5 3.5L15 12l3.5-3.5Z"/><path d="m12 15 3.5 3.5L12 22l-3.5-3.5L12 15Z"/>`,keyboard:`<rect width="20" height="16" x="2" y="4" rx="2"/><path d="M6 8h.01"/><path d="M10 8h.01"/><path d="M14 8h.01"/><path d="M18 8h.01"/><path d="M8 12h.01"/><path d="M12 12h.01"/><path d="M16 12h.01"/><path d="M7 16h10"/>`,folder:`<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/>`,canvas:`<rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/>`};function Z({name:e,size:t=16,strokeWidth:n=1.75,className:r}){return(0,L.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`shrink-0 ${e===`loader`?`animate-spin`:``} ${r??``}`,dangerouslySetInnerHTML:{__html:v_[e]}})}function Q({children:e,size:t=12.5,className:n,title:r,wrap:i}){return(0,L.jsx)(`span`,{title:r,className:X(i?`break-all`:`whitespace-nowrap`,`font-mono`,n),style:{fontSize:t},children:e})}function y_({children:e}){return(0,L.jsx)(`kbd`,{className:`rounded-[4px] border border-rule bg-surface px-[5px] py-px font-mono text-[11px] text-ink2`,children:e})}function b_({top:e,bottom:t,weight:n=500}){return(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-px`,children:[(0,L.jsx)(`span`,{className:`truncate leading-[1.35]`,style:{fontWeight:n},children:e}),t?(0,L.jsx)(`span`,{className:`flex min-w-0 items-center gap-2.5 overflow-hidden whitespace-nowrap text-[12.5px] leading-[1.35] text-muted`,children:t}):null]})}var x_={canvas:`This canvas`,canvases:`Canvases`,system:`Design system`,actions:`Actions`};function S_(e){let t=/^\/c\/([^/]+)/.exec(e);return t?decodeURIComponent(t[1]):null}function C_({onClose:e}){let[t,n]=P(),r=Xg().scope,i=$g().data,a=r?.canvas??S_(t),o=e_(a??``,!!a).data,s=t_(!!i?.system).data,[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(0),f=t=>()=>{e(),t()},p=[];if(o)for(let e of o.pages){p.push({id:`page:${e.id}`,group:`canvas`,label:e.title,icon:`file`,hint:`Page`,run:f(()=>n(`/c/${encodeURIComponent(o.id)}/p/${encodeURIComponent(e.id)}`))});for(let t of e.sections)for(let r of t.items)(r.kind===`screen`||r.kind===`url`)&&p.push({id:`item:${e.id}:${r.id}`,group:`canvas`,label:r.title,icon:r.kind===`url`?`globe`:`monitor`,hint:t.title?`${e.title} · ${t.title}`:e.title,keywords:`${r.id} ${t.title??``}`,searchOnly:!0,run:f(()=>{n(`/c/${encodeURIComponent(o.id)}/p/${encodeURIComponent(e.id)}`),a_(o.id,r.id)})})}for(let e of i?.canvases??[])e.id!==a&&p.push({id:`canvas:${e.id}`,group:`canvases`,label:e.title,icon:`canvas`,hint:`${e.screens} screens`,keywords:e.id,run:f(()=>n(`/c/${encodeURIComponent(e.id)}`))});if(i?.system){for(let[e,t,r]of[[`Overview`,`/system`,`book`],[`Colors`,`/system/colors`,`palette`],[`Typography`,`/system/typography`,`type`],[`Spacing & shape`,`/system/shape`,`shape`]])p.push({id:`sys:${t}`,group:`system`,label:e,icon:r,run:f(()=>n(t))});for(let e of s?.components??[])p.push({id:`component:${e.id}`,group:`system`,label:e.title,icon:`component`,hint:e.group,searchOnly:!0,run:f(()=>n(`/system/components/${encodeURIComponent(e.id)}`))});for(let e of s?.guidelines??[])p.push({id:`guide:${e.slug}`,group:`system`,label:e.title,icon:`book`,hint:`Guideline`,searchOnly:!0,run:f(()=>n(`/system/guidelines/${encodeURIComponent(e.slug)}`))})}r||p.push({id:`home`,group:`actions`,label:`All canvases`,icon:`home`,run:f(()=>n(`/`))}),p.push({id:`light`,group:`actions`,label:`Light appearance`,icon:`sun`,searchOnly:!0,run:f(()=>h_(`light`))},{id:`dark`,group:`actions`,label:`Dark appearance`,icon:`moon`,searchOnly:!0,run:f(()=>h_(`dark`))},{id:`system-theme`,group:`actions`,label:`System appearance`,icon:`monitor`,searchOnly:!0,run:f(()=>h_(`system`))});let m=c.trim().toLowerCase(),h=p.filter(e=>m?`${e.label} ${e.keywords??``} ${typeof e.hint==`string`?e.hint:``}`.toLowerCase().includes(m):!e.searchOnly),g=[`canvas`,`canvases`,`system`,`actions`].map(e=>({group:e,items:h.filter(t=>t.group===e)})).filter(e=>e.items.length),_=g.flatMap(e=>e.items),y=Math.min(u,Math.max(_.length-1,0)),b=-1;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(kg,{className:`sr-only`,children:`Search and jump`}),(0,L.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-2.5 border-b border-rule px-4`,children:[(0,L.jsx)(Z,{name:`search`,size:16,className:`text-muted`}),(0,L.jsx)(`input`,{value:c,onChange:e=>{l(e.target.value),d(0)},onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),d((y+1)%Math.max(_.length,1))):e.key===`ArrowUp`?(e.preventDefault(),d((y-1+_.length)%Math.max(_.length,1))):e.key===`Enter`&&(e.preventDefault(),_[y]?.run())},placeholder:`Canvases, screens, components…`,"aria-label":`Search and jump`,role:`combobox`,"aria-expanded":`true`,"aria-controls":`palette-list`,autoComplete:`off`,spellCheck:!1,className:`h-full min-w-0 grow border-0 bg-transparent text-[15px] text-ink outline-none placeholder:text-muted`}),(0,L.jsx)(y_,{children:`esc`})]}),(0,L.jsx)(`div`,{id:`palette-list`,role:`listbox`,className:`min-h-0 grow overflow-y-auto py-1.5`,children:g.length?g.map(({group:e,items:t})=>(0,L.jsxs)(`div`,{role:`presentation`,children:[(0,L.jsx)(`div`,{className:`px-4 pt-2.5 pb-1 text-[12px] text-muted`,children:x_[e]}),t.map(e=>{b+=1;let t=b,n=t===y;return(0,L.jsxs)(`button`,{type:`button`,role:`option`,tabIndex:-1,"aria-selected":n,ref:n?e=>e?.scrollIntoView({block:`nearest`}):void 0,onMouseMove:()=>n?void 0:d(t),onClick:e.run,className:X(`flex h-10 w-full cursor-pointer items-center gap-3 border-0 px-4 text-left text-[13.5px] text-ink`,n?`bg-soft`:`bg-transparent`),children:[(0,L.jsx)(`span`,{className:`flex w-5 shrink-0 justify-center text-ink2`,children:(0,L.jsx)(Z,{name:e.icon,size:16})}),(0,L.jsx)(`span`,{className:`min-w-0 grow truncate`,children:e.label}),e.hint?(0,L.jsx)(`span`,{className:`flex shrink-0 items-center text-[12.5px] text-muted`,children:e.hint}):null]},e.id)})]},e)):(0,L.jsx)(`div`,{className:`px-6 py-10 text-center text-[13px] text-muted`,children:`Nothing matches.`})}),(0,L.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-4 border-t border-rule bg-soft px-4 text-[12px] text-muted`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(y_,{children:`↑`}),(0,L.jsx)(y_,{children:`↓`}),`move`]}),(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(y_,{children:`↵`}),`open`]})]})]})}function w_(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=()=>t(e=>!e),n=t=>{(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),e())};return window.addEventListener(`keydown`,n),window.addEventListener(`design:palette`,e),()=>{window.removeEventListener(`keydown`,n),window.removeEventListener(`design:palette`,e)}},[]),(0,L.jsx)(mg,{open:e,onOpenChange:t,children:(0,L.jsx)(ed,{children:e?(0,L.jsx)(vg,{forceMount:!0,children:(0,L.jsx)(bg,{asChild:!0,forceMount:!0,children:(0,L.jsx)(Wf.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.14},className:`fixed inset-0 z-50 flex items-start justify-center bg-overlay p-6 pt-[12vh]`,children:(0,L.jsx)(wg,{asChild:!0,forceMount:!0,"aria-describedby":void 0,children:(0,L.jsx)(Wf.div,{initial:{opacity:0,scale:.98,y:-6},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,transition:{duration:.1}},transition:{type:`spring`,stiffness:560,damping:40},className:`flex max-h-[min(560px,76vh)] w-[560px] max-w-full flex-col overflow-hidden rounded-[12px] border border-rule bg-surface shadow-pop outline-none`,children:(0,L.jsx)(C_,{onClose:()=>t(!1)})})})})})}):null})})}var T_=/Mac|iPhone|iPad/.test(navigator.platform)?`⌘`:`Ctrl`,E_=[`top`,`right`,`bottom`,`left`],D_=Math.min,O_=Math.max,k_=Math.round,A_=Math.floor,j_=e=>({x:e,y:e}),M_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function N_(e,t,n){return O_(e,D_(t,n))}function P_(e,t){return typeof e==`function`?e(t):e}function F_(e){return e.split(`-`)[0]}function I_(e){return e.split(`-`)[1]}function L_(e){return e===`x`?`y`:`x`}function R_(e){return e===`y`?`height`:`width`}function z_(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function B_(e){return L_(z_(e))}function V_(e,t,n){n===void 0&&(n=!1);let r=I_(e),i=B_(e),a=R_(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=X_(o)),[o,X_(o)]}function H_(e){let t=X_(e);return[U_(e),t,U_(t)]}function U_(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var W_=[`left`,`right`],G_=[`right`,`left`],K_=[`top`,`bottom`],q_=[`bottom`,`top`];function J_(e,t,n){switch(e){case`top`:case`bottom`:return n?t?G_:W_:t?W_:G_;case`left`:case`right`:return t?K_:q_;default:return[]}}function Y_(e,t,n,r){let i=I_(e),a=J_(F_(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(U_)))),a}function X_(e){let t=F_(e);return M_[t]+e.slice(t.length)}function Z_(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Q_(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Z_(e)}function $_(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 ev(e,t,n){let{reference:r,floating:i}=e,a=z_(t),o=B_(t),s=R_(o),c=F_(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}}let m=I_(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function tv(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}=P_(t,e),p=Q_(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=$_(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=$_(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 nv=50,rv=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:tv},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ev(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<nv&&(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}=ev(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},iv=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}=P_(e,t)||{};if(l==null)return{};let d=Q_(u),f={x:n,y:r},p=B_(i),m=R_(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=D_(d[_],T),D=D_(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=N_(E,k,O),j=!c.arrow&&I_(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,ee=j?k<E?k-E:k-O:0;return{[p]:f[p]+ee,data:{[p]:A,centerOffset:k-A-ee,...j&&{alignmentOffset:ee}},reset:j}}}),av=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}=P_(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=F_(r),_=z_(o),v=F_(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[X_(o)]:H_(o)),x=p!==`none`;!d&&x&&b.push(...Y_(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`||_===z_(t)||T.every(e=>z_(e.placement)!==_||e.overflows[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=z_(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}if(r!==n)return{reset:{placement:n}}}return{}}}};function ov(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sv(e){return E_.some(t=>e[t]>=0)}var cv=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=P_(e,t);switch(i){case`referenceHidden`:{let e=ov(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:sv(e)}}}case`escaped`:{let e=ov(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:sv(e)}}}default:return{}}}}},lv=new Set([`left`,`top`]);async function uv(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=F_(n),s=I_(n),c=z_(n)===`y`,l=lv.has(o)?-1:1,u=a&&c?-1:1,d=P_(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 dv=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 uv(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}}}}},fv=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}=P_(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=z_(i),p=L_(f),m=u[p],h=u[f],g=(e,t)=>N_(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},pv=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}=P_(e,t),u={x:n,y:r},d=z_(i),f=L_(d),p=u[f],m=u[d],h=P_(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};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=lv.has(F_(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}}}},mv=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=P_(e,t),c=await i.detectOverflow(t,s),l=F_(n),u=I_(n),d=z_(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=D_(p-c[m],g),y=D_(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*O_(c.left,c.right):S=p-2*O_(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function hv(){return typeof window<`u`}function gv(e){return yv(e)?(e.nodeName||``).toLowerCase():`#document`}function _v(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vv(e){return((yv(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function yv(e){return hv()?e instanceof Node||e instanceof _v(e).Node:!1}function bv(e){return hv()?e instanceof Element||e instanceof _v(e).Element:!1}function xv(e){return hv()?e instanceof HTMLElement||e instanceof _v(e).HTMLElement:!1}function Sv(e){return!hv()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof _v(e).ShadowRoot}function Cv(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Pv(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function wv(e){return/^(table|td|th)$/.test(gv(e))}function Tv(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ev=/transform|translate|scale|rotate|perspective|filter/,Dv=/paint|layout|strict|content/,Ov=e=>!!e&&e!==`none`,kv;function Av(e){let t=bv(e)?Pv(e):e;return Ov(t.transform)||Ov(t.translate)||Ov(t.scale)||Ov(t.rotate)||Ov(t.perspective)||!Mv()&&(Ov(t.backdropFilter)||Ov(t.filter))||Ev.test(t.willChange||``)||Dv.test(t.contain||``)}function jv(e){let t=Iv(e);for(;xv(t)&&!Nv(t);){if(Av(t))return t;if(Tv(t))return null;t=Iv(t)}return null}function Mv(){return kv??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),kv}function Nv(e){return/^(html|body|#document)$/.test(gv(e))}function Pv(e){return _v(e).getComputedStyle(e)}function Fv(e){return bv(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Iv(e){if(gv(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Sv(e)&&e.host||vv(e);return Sv(t)?t.host:t}function Lv(e){let t=Iv(e);return Nv(t)?(e.ownerDocument||e).body:xv(t)&&Cv(t)?t:Lv(t)}function Rv(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Lv(e),i=r===e.ownerDocument?.body,a=_v(r);if(i){let e=zv(a);return t.concat(a,a.visualViewport||[],Cv(r)?r:[],e&&n?Rv(e):[])}return t.concat(r,Rv(r,[],n))}function zv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Bv(e){let t=Pv(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=xv(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=k_(n)!==a||k_(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Vv(e){return bv(e)?e:e.contextElement}function Hv(e){let t=Vv(e);if(!xv(t))return j_(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Bv(t),o=(a?k_(n.width):n.width)/r,s=(a?k_(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Uv=j_(0);function Wv(e){let t=_v(e);return!Mv()||!t.visualViewport?Uv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gv(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===_v(e)}function Kv(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Vv(e),o=j_(1);t&&(r?bv(r)&&(o=Hv(r)):o=Hv(e));let s=Gv(a,n,r)?Wv(a):j_(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&&r){let e=_v(a),t=bv(r)?_v(r):r,n=e,i=zv(n);for(;i&&t!==n;){let e=Hv(i),t=i.getBoundingClientRect(),r=Pv(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=_v(i),i=zv(n)}}return $_({width:u,height:d,x:c,y:l})}function qv(e,t){let n=Fv(e).scrollLeft;return t?t.left+n:Kv(vv(e)).left+n}function Jv(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-qv(e,n),y:n.top+t.scrollTop}}function Yv(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=vv(r),s=t?Tv(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=j_(1),u=j_(0),d=xv(r);if((d||!a)&&((gv(r)!==`body`||Cv(o))&&(c=Fv(r)),d)){let e=Kv(r);l=Hv(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Jv(o,c):j_(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 Xv(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Zv(e){let t=Fv(e),n=e.ownerDocument.body,r=O_(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=O_(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+qv(e),o=-t.scrollTop;return Pv(n).direction===`rtl`&&(a+=O_(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Qv=25;function $v(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=_v(e),a=vv(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Mv()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(qv(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Qv&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ey(e,t){let n=Kv(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Hv(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ty(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=$v(e,n,t);else if(t===`document`)r=Zv(vv(e));else if(bv(t))r=ey(t,n);else{let n=Wv(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $_(r)}function ny(e,t){let n=t.get(e);if(n)return n;let r=Rv(e,[],!1).filter(e=>bv(e)&&gv(e)!==`body`),i=null,a=Pv(e).position===`fixed`,o=a?Iv(e):e;for(;bv(o)&&!Nv(o);){let e=Pv(o),t=Av(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Iv(o)}return t.set(e,r),r}function ry(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Tv(t)?[]:ny(t,this._c):[].concat(n),r],o=ty(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=ty(t,a[e],i);s=O_(n.top,s),c=D_(n.right,c),l=D_(n.bottom,l),u=O_(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function iy(e){let{width:t,height:n}=Bv(e);return{width:t,height:n}}function ay(e,t,n){let r=xv(t),i=vv(t),a=n===`fixed`,o=Kv(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=j_(0);if((r||!a)&&((gv(t)!==`body`||Cv(i))&&(s=Fv(t)),r)){let e=Kv(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=qv(i));let l=i&&!r&&!a?Jv(i,s):j_(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function oy(e){return Pv(e).position===`static`}function sy(e,t){if(!xv(e)||Pv(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return vv(e)===n&&(n=n.ownerDocument.body),n}function cy(e,t){let n=_v(e);if(Tv(e))return n;if(!xv(e)){let t=Iv(e);for(;t&&!Nv(t);){if(bv(t)&&!oy(t))return t;t=Iv(t)}return n}let r=sy(e,t);for(;r&&wv(r)&&oy(r);)r=sy(r,t);return r&&Nv(r)&&oy(r)&&!Av(r)?n:r||jv(e)||n}var ly=async function(e){let t=this.getOffsetParent||cy,n=this.getDimensions,r=await n(e.floating);return{reference:ay(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uy(e){return Pv(e).direction===`rtl`}var dy={convertOffsetParentRelativeRectToViewportRelativeRect:Yv,getDocumentElement:vv,getClippingRect:ry,getOffsetParent:cy,getElementRects:ly,getClientRects:Xv,getDimensions:iy,getScale:Hv,isElement:bv,isRTL:uy};function fy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function py(e,t,n){let r=null,i,a=vv(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=A_(d),h=A_(a.clientWidth-(u+f)),g=A_(a.clientHeight-(d+p)),_=A_(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:O_(0,D_(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!fy(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=_v(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function my(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=Vv(e),u=i||a?[...l?Rv(l):[],...t?Rv(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?py(l,n,a):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?Kv(e):null;c&&g();function g(){let t=Kv(e);h&&!fy(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 hy=dv,gy=fv,_y=av,vy=mv,yy=cv,by=iv,xy=pv,Sy=(e,t,n)=>{let r=new Map,i=n??{},a={...dy,...i.platform,_c:r};return rv(e,t,{...i,platform:a})},Cy=typeof document<`u`?v.useLayoutEffect:function(){};function wy(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(!wy(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)&&!wy(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ty(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ey(e,t){let n=Ty(e);return Math.round(t*n)/n}function Dy(e){let t=v.useRef(e);return Cy(()=>{t.current=e}),t}function Oy(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]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);wy(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=Dy(c),O=Dy(i),k=Dy(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Sy(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!wy(T.current,t)&&(T.current=t,Ep.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Cy(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);Cy(()=>(j.current=!0,()=>{j.current=!1}),[]),Cy(()=>{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 ee=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),te=v.useMemo(()=>({reference:x,floating:S}),[x,S]),ne=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!te.floating)return e;let t=Ey(te.floating,u.x),r=Ey(te.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ty(te.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,te.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:ee,elements:te,floatingStyles:ne}),[u,A,ee,te,ne])}var ky=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?{}:by({element:r.current,padding:i}).fn(n):r?by({element:r,padding:i}).fn(n):{}}}},Ay=(e,t)=>{let n=hy(e);return{name:n.name,fn:n.fn,options:[e,t]}},jy=(e,t)=>{let n=gy(e);return{name:n.name,fn:n.fn,options:[e,t]}},My=(e,t)=>({fn:xy(e).fn,options:[e,t]}),Ny=(e,t)=>{let n=_y(e);return{name:n.name,fn:n.fn,options:[e,t]}},Py=(e,t)=>{let n=vy(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fy=(e,t)=>{let n=yy(e);return{name:n.name,fn:n.fn,options:[e,t]}},Iy=(e,t)=>{let n=ky(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ly=Object.defineProperty,Ry=(e,t)=>Ly(e,`name`,{value:t,configurable:!0});function zy(e){let[t,n]=v.useState(void 0);return sp(()=>{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)}n(void 0)},[e]),t}Ry(zy,`useSize`);var By=Object.defineProperty,Vy=(e,t)=>By(e,`name`,{value:t,configurable:!0}),Hy=`Popper`,[Uy,Wy]=ap(Hy),[Gy,Ky]=Uy(Hy),qy=Vy(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,L.jsx)(Gy,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Jy=`PopperAnchor`,Yy=v.forwardRef(Vy(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Ky(Jy,n),o=v.useRef(null),s=a.onAnchorChange,c=tp(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&nb(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,L.jsx)(Wp.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Xy=`PopperContent`,[Zy,Qy]=Uy(Xy),$y=v.forwardRef(Vy(function(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=Ky(Xy,n),[_,y]=v.useState(null),b=tp(t,y),[x,S]=v.useState(null),C=zy(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(eb),altBoundary:k},{refs:j,floatingStyles:ee,placement:te,isPositioned:ne,middlewareData:M}=Oy({strategy:`fixed`,placement:E,whileElementsMounted:Vy((...e)=>my(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Ay({mainAxis:i+T,alignmentAxis:o}),c&&jy({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?My():void 0,...A}),c&&Ny({...A}),Py({...A,apply:Vy(({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`)},`apply`)}),x&&Iy({element:x,padding:s}),tb({arrowWidth:w,arrowHeight:T}),f&&Fy({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),re=g.setPlacementState;sp(()=>(re(te),()=>{re(void 0)}),[te,re]);let[ie,N]=nb(te),ae=Jp(m);sp(()=>{ne&&ae?.()},[ne,ae]);let oe=M.arrow?.x,se=M.arrow?.y,ce=M.arrow?.centerOffset!==0,[le,ue]=v.useState();return sp(()=>{_&&ue(window.getComputedStyle(_).zIndex)},[_]),(0,L.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:ne?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(` `),...M.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(Zy,{scope:n,placedSide:ie,placedAlign:N,onArrowChange:S,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,L.jsx)(Wp.div,{"data-side":ie,"data-align":N,...h,ref:b,style:{...h.style,animation:ne?h.style?.animation:`none`}})})})},`PopperContent`));function eb(e){return e!==null}Vy(eb,`isNotNull`);var tb=Vy(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]=nb(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}}}}),`transformOrigin`);function nb(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Vy(nb,`getSideAndAlignFromPlacement`);var rb=qy,ib=Yy,ab=$y,ob=Object.defineProperty,sb=(e,t)=>ob(e,`name`,{value:t,configurable:!0}),cb=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`}),lb=v.forwardRef(sb(function(e,t){return(0,L.jsx)(Wp.span,{...e,ref:t,style:{...cb,...e.style}})},`VisuallyHidden`)),ub=Object.defineProperty,db=(e,t)=>ub(e,`name`,{value:t,configurable:!0}),[fb,pb]=ap(`Tooltip`,[Wy]),mb=Wy(),hb=`TooltipProvider`,gb=700,_b=`tooltip.open`,[vb,yb]=fb(hb),bb=db(e=>{let{__scopeTooltip:t,delayDuration:n=gb,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=v.useRef(!0),s=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(vb,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:v.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),xb=`Tooltip`,[Sb,Cb]=fb(xb),wb=db(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=yb(xb,e.__scopeTooltip),l=mb(t),[u,d]=v.useState(null),[f,p]=v.useState(void 0),m=fp(),h=v.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,y=v.useRef(!1),[b,x]=xp({prop:r,defaultProp:i??!1,onChange:db(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(_b))):c.onClose(),a?.(e)},`onChange`),caller:xb}),S=v.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=v.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},_)},[_,x]);v.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,L.jsx)(rb,{...l,children:(0,L.jsx)(Sb,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:v.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),Tb=`TooltipTrigger`,Eb=v.forwardRef(db(function(e,t){let{__scopeTooltip:n,...r}=e,i=Cb(Tb,n),a=yb(Tb,n),o=mb(n),s=tp(t,v.useRef(null),i.onTriggerChange),c=v.useRef(!1),l=v.useRef(!1),u=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,L.jsx)(ib,{asChild:!0,...o,children:(0,L.jsx)(Wp.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)})})},`TooltipTrigger`)),Db=`TooltipPortal`,[Ob,kb]=fb(Db,{forceMount:void 0}),Ab=db(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Cb(Db,t);return(0,L.jsx)(Ob,{scope:t,forceMount:n,children:(0,L.jsx)(jm,{present:n||a.open,children:(0,L.jsx)(Dm,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),jb=`TooltipContent`,Mb=v.forwardRef(db(function(e,t){let n=kb(jb,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Cb(jb,e.__scopeTooltip);return(0,L.jsx)(jm,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(Fb,{side:i,...a,ref:t}):(0,L.jsx)(Nb,{side:i,...a,ref:t})})},`TooltipContent`)),Nb=v.forwardRef(db(function(e,t){let n=Cb(jb,e.__scopeTooltip),r=yb(jb,e.__scopeTooltip),i=v.useRef(null),a=tp(t,i),[o,s]=v.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=v.useCallback(()=>{s(null),d(!1)},[d]),p=v.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Lb(r,Ib(r,n.getBoundingClientRect())),a=Rb(t.getBoundingClientRect()),o=Bb([...i,...a]);s(o),d(!0)},[d]);return v.useEffect(()=>()=>f(),[f]),v.useEffect(()=>{if(c&&u){let e=db(e=>p(e,u),`handleTriggerLeave`),t=db(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),v.useEffect(()=>{if(o){let e=db(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!zb(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(Fb,{...e,ref:a})},`TooltipContentHoverable`)),Pb=jp(`TooltipContent`),Fb=v.forwardRef(db(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Cb(jb,n),u=mb(n),{onClose:d}=l;v.useEffect(()=>(document.addEventListener(_b,d),()=>document.removeEventListener(_b,d)),[d]),v.useEffect(()=>{if(l.trigger){let e=db(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return sp(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,L.jsx)(nm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,L.jsxs)(ab,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.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,L.jsx)(Pb,{children:r}),i?(0,L.jsx)(lb,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function Ib(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`)}}db(Ib,`getExitSideFromRect`);function Lb(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})}return r}db(Lb,`getPaddedExitPoints`);function Rb(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}]}db(Rb,`getPointsFromRect`);function zb(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}db(zb,`isPointInPolygon`);function Bb(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)),Vb(t)}db(Bb,`getHull`);function Vb(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)}db(Vb,`getHullPresorted`);var Hb=bb,Ub=wb,Wb=Eb,Gb=Ab,Kb=Mb;function qb({children:e}){return(0,L.jsx)(Hb,{delayDuration:250,children:e})}var Jb=`z-50 max-w-[280px] rounded-[8px] border border-rule bg-surface px-[10px] py-[7px] text-[12.5px] leading-[1.35] text-ink shadow-pop outline-none data-[state=delayed-open]:animate-[q-pop_120ms_ease-out] data-[state=closed]:animate-[q-pop-out_100ms_ease-in_forwards]`;function Yb({content:e,children:t,side:n=`top`,align:r=`center`,className:i}){return(0,L.jsxs)(Ub,{children:[(0,L.jsx)(Wb,{asChild:!0,children:t}),(0,L.jsx)(Gb,{children:(0,L.jsx)(Kb,{side:n,align:r,sideOffset:6,collisionPadding:12,className:X(Jb,i),children:e})})]})}function Xb(){window.dispatchEvent(new CustomEvent(`design:palette`))}var Zb=T_===`⌘`?`⌘K`:`Ctrl K`;function Qb({width:e=240,label:t=`Search and jump`,compact:n}){if(n)return(0,L.jsx)(Yb,{content:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[t,` `,(0,L.jsx)(y_,{children:Zb})]}),children:(0,L.jsx)(`button`,{type:`button`,onClick:Xb,"aria-label":t,className:`inline-flex h-ctrl w-ctrl shrink-0 cursor-pointer items-center justify-center rounded-[6px] border border-rule bg-soft text-muted transition-colors hover:border-rule-strong`,children:(0,L.jsx)(Z,{name:`search`,size:15})})});let r=n===!1;return(0,L.jsxs)(`button`,{type:`button`,onClick:Xb,style:{width:e},"aria-label":t,className:X(`flex h-ctrl min-w-0 cursor-pointer items-center gap-2 rounded-[6px] border border-rule bg-soft pr-1.5 pl-3 text-ctrl text-muted transition-colors hover:border-rule-strong`,r?`shrink-0`:`shrink max-lg:w-auto! max-md:w-ctrl! max-md:justify-center max-md:border-0! max-md:bg-transparent! max-md:p-0!`),children:[(0,L.jsx)(Z,{name:`search`,size:15}),(0,L.jsx)(`span`,{className:X(`min-w-0 grow truncate text-left`,!r&&`max-lg:hidden`),children:t}),(0,L.jsx)(`span`,{className:X(`flex`,!r&&`max-md:hidden`),children:(0,L.jsx)(y_,{children:Zb})})]})}var $b={primary:`border border-primary bg-primary text-primary-ink hover:opacity-90`,secondary:`border border-rule-strong bg-surface text-ink hover:bg-soft`,ghost:`border border-transparent bg-transparent text-ink2 hover:bg-soft2`,dashed:`border border-dashed border-rule-strong bg-transparent text-ink2 hover:bg-soft`,danger:`border border-danger bg-danger text-on-danger hover:opacity-90`},ex=(e=`secondary`,t)=>X(`inline-flex h-ctrl shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-[6px] px-ctrl text-ctrl font-medium leading-none no-underline transition-[background-color,opacity] duration-100`,`disabled:cursor-not-allowed disabled:opacity-45 aria-disabled:cursor-not-allowed aria-disabled:opacity-45`,$b[e],t),tx=(0,v.forwardRef)(function({kind:e=`secondary`,icon:t,loading:n,disabled:r,className:i,children:a,type:o=`button`,...s},c){return(0,L.jsxs)(`button`,{ref:c,type:o,disabled:r||n,"aria-busy":n||void 0,className:ex(e,i),...s,children:[n?(0,L.jsx)(Z,{name:`loader`,size:15,className:`animate-spin`}):t?(0,L.jsx)(Z,{name:t,size:15}):null,a]})}),nx={ghost:`border border-transparent bg-transparent text-muted hover:bg-soft2 hover:text-ink2`,secondary:`border border-rule-strong bg-surface text-ink2 hover:bg-soft`},rx=(e=`ghost`,t)=>X(`inline-flex h-ctrl w-ctrl shrink-0 cursor-pointer items-center justify-center rounded-[6px] p-0 transition-colors duration-100 disabled:cursor-not-allowed disabled:opacity-45`,nx[e],t),ix=(0,v.forwardRef)(function({icon:e,label:t,kind:n=`ghost`,size:r=16,className:i,type:a=`button`,...o},s){return(0,L.jsx)(`button`,{ref:s,type:a,"aria-label":t,title:t,className:rx(n,i),...o,children:(0,L.jsx)(Z,{name:e,size:r})})});function ax({to:e,kind:t=`secondary`,icon:n,className:r,children:i}){return(0,L.jsxs)(be,{href:e,className:ex(t,r),children:[n?(0,L.jsx)(Z,{name:n,size:15}):null,i]})}function ox({kind:e=`secondary`,icon:t,className:n,children:r,...i}){return(0,L.jsxs)(`a`,{className:ex(e,n),...i,children:[t?(0,L.jsx)(Z,{name:t,size:15}):null,r]})}var sx=Object.defineProperty,cx=(e,t)=>sx(e,`name`,{value:t,configurable:!0});function lx(e){let t=e+`CollectionProvider`,[n,r]=ap(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=cx(e=>{let{scope:t,children:n}=e,r=v.useRef(null),a=v.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=kp(s),l=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=tp(t,a(s,n).collectionRef);return(0,L.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=kp(u),p=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),s=tp(t,o),c=a(u,n);return v.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return v.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 cx(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}cx(lx,`createCollection`);var ux=new WeakMap,dx=class e extends Map{static{cx(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ux.set(this,!0)}set(e,t){return ux.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=mx(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=fx(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=fx(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return fx(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function fx(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=px(e,t);return n===-1?void 0:e[n]}cx(fx,`at`);function px(e,t){let n=e.length,r=mx(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}cx(px,`toSafeIndex`);function mx(e){return e!==e||e===0?0:Math.trunc(e)}cx(mx,`toSafeInteger`);function hx(e){let t=e+`CollectionProvider`,[n,r]=ap(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new dx,setItemMap:cx(()=>void 0,`setItemMap`)}),o=cx(({state:e,...t})=>e?(0,L.jsx)(c,{...t,state:e}):(0,L.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=cx(e=>{let t=h();return(0,L.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=cx(e=>{let{scope:t,children:n,state:r}=e,a=v.useRef(null),[o,s]=v.useState(null),c=tp(a,s),[l,u]=r;return v.useEffect(()=>{if(!o)return;let e=yx(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,L.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=kp(l),d=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=tp(t,a(l,n).collectionRef);return(0,L.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=kp(f),m=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),[s,c]=v.useState(null),l=tp(t,o,c),{setItemMap:u}=a(f,n),d=v.useRef(i);gx(d.current,i)||(d.current=i);let m=d.current;return v.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(vx):(t.set(s,{...e,element:s}),t.toSorted(vx)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new dx(e)))}},[s,m,u]),(0,L.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return v.useState(new dx)}cx(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return cx(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}cx(hx,`createCollection`);function gx(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}cx(gx,`shallowEqual`);function _x(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}cx(_x,`isElementPreceding`);function vx(e,t){return!e[1].element||!t[1].element?0:_x(e[1].element,t[1].element)?-1:1}cx(vx,`sortByDocumentPosition`);function yx(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}cx(yx,`getChildListObserver`);var bx=Object.defineProperty,xx=(e,t)=>bx(e,`name`,{value:t,configurable:!0}),Sx=v.createContext(void 0);function Cx(e){let t=v.useContext(Sx);return e||t||`ltr`}xx(Cx,`useDirection`);var wx=Object.defineProperty,Tx=(e,t)=>wx(e,`name`,{value:t,configurable:!0}),Ex=!1;function Dx(){let[e,t]=v.useState(Ex);return v.useEffect(()=>{Ex||(Ex=!0,t(!0))},[]),e}Tx(Dx,`useIsHydrated`);var Ox=v.useSyncExternalStore;function kx(){return()=>{}}Tx(kx,`subscribe`);function Ax(){return Ox(kx,()=>!0,()=>!1)}Tx(Ax,`useIsHydratedModern`);var jx=typeof Ox==`function`?Ax:Dx,Mx=Object.defineProperty,Nx=(e,t)=>Mx(e,`name`,{value:t,configurable:!0}),Px=`rovingFocusGroup.onEntryFocus`,Fx={bubbles:!1,cancelable:!0},Ix=`RovingFocusGroup`,[Lx,Rx,zx]=lx(Ix),[Bx,Vx]=ap(Ix,[zx]),[Hx,Ux]=Bx(Ix),Wx=v.forwardRef(Nx(function(e,t){return(0,L.jsx)(Lx.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(Lx.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(Gx,{...e,ref:t})})})},`RovingFocusGroup`)),Gx=v.forwardRef(Nx(function(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=v.useRef(null),p=tp(t,f),m=Cx(a),[h,g]=xp({prop:o,defaultProp:s??null,onChange:c,caller:Ix}),[_,y]=v.useState(!1),b=Jp(l),x=Rx(n),S=v.useRef(!1),[C,w]=v.useState(0);return v.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Px,b),()=>e.removeEventListener(Px,b)},[b]),(0,L.jsx)(Hx,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:v.useCallback(e=>g(e),[g]),onItemShiftTab:v.useCallback(()=>y(!0),[]),onFocusableItemAdd:v.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:v.useCallback(()=>w(e=>e-1),[]),children:(0,L.jsx)(Wp.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(Px,Fx);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Zx([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,()=>y(!1))})})},`RovingFocusGroupImpl`)),Kx=`RovingFocusGroupItem`,qx=v.forwardRef(Nx(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=fp(),l=a||c,u=Ux(Kx,n),d=u.currentTabStopId===l,f=Rx(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=jx();return sp(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),v.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,L.jsx)(Lx.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,L.jsx)(Wp.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=Xx(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?Qx(n,r+1):n.slice(r+1)}setTimeout(()=>Zx(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Jx={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Yx(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Nx(Yx,`getDirectionAwareKey`);function Xx(e,t,n){let r=Yx(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Jx[r]}Nx(Xx,`getFocusIntent`);function Zx(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Nx(Zx,`focusFirst`);function Qx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Nx(Qx,`wrapArray`);var $x=Wx,eS=qx,tS=Object.defineProperty,nS=(e,t)=>tS(e,`name`,{value:t,configurable:!0}),rS=[`Enter`,` `],iS=[`ArrowDown`,`PageUp`,`Home`],aS=[`ArrowUp`,`PageDown`,`End`],oS=[...iS,...aS];[...rS],[...rS];var sS=`Menu`,[cS,lS,uS]=lx(sS),[dS,fS]=ap(sS,[uS,Wy,Vx]),pS=Wy(),mS=Vx(),[hS,gS]=dS(sS),[_S,vS]=dS(sS),yS=nS(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=pS(t),[c,l]=v.useState(null),u=v.useRef(!1),d=Jp(a),f=Cx(i);return v.useEffect(()=>{let e=nS(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=nS(()=>u.current=!1,`handlePointer`);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})}},[]),v.useEffect(()=>{if(!n)return;let e=nS(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,L.jsx)(rb,{...s,children:(0,L.jsx)(hS,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,L.jsx)(_S,{scope:t,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),bS=v.forwardRef(nS(function(e,t){let{__scopeMenu:n,...r}=e,i=pS(n);return(0,L.jsx)(ib,{...i,...r,ref:t})},`MenuAnchor`)),xS=`MenuPortal`,[SS,CS]=dS(xS,{forceMount:void 0}),wS=nS(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=gS(xS,t);return(0,L.jsx)(SS,{scope:t,forceMount:n,children:(0,L.jsx)(jm,{present:n||a.open,children:(0,L.jsx)(Dm,{asChild:!0,container:i,children:r})})})},`MenuPortal`),TS=`MenuContent`,[ES,DS]=dS(TS),OS=v.forwardRef(nS(function(e,t){let n=CS(TS,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=gS(TS,e.__scopeMenu),o=vS(TS,e.__scopeMenu);return(0,L.jsx)(cS.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)(jm,{present:r||a.open,children:(0,L.jsx)(cS.Slot,{scope:e.__scopeMenu,children:o.modal?(0,L.jsx)(kS,{...i,ref:t}):(0,L.jsx)(AS,{...i,ref:t})})})})},`MenuContent`)),kS=v.forwardRef(nS(function(e,t){let n=gS(TS,e.__scopeMenu),r=v.useRef(null),i=tp(t,r);return v.useEffect(()=>{let e=r.current;if(e)return og(e)},[]),(0,L.jsx)(MS,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),AS=v.forwardRef(nS(function(e,t){let n=gS(TS,e.__scopeMenu);return(0,L.jsx)(MS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),jS=kp(`MenuContent.ScrollLock`),MS=v.forwardRef(nS(function(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=gS(TS,n),_=vS(TS,n),y=pS(n),b=mS(n),x=lS(n),[S,C]=v.useState(null),w=v.useRef(null),T=tp(t,w,g.onContentChange),E=v.useRef(0),D=v.useRef(``),O=v.useRef(0),k=v.useRef(null),A=v.useRef(`right`),j=v.useRef(0),ee=m?Zh:v.Fragment,te=m?{as:jS,allowPinchZoom:!0}:void 0,ne=nS(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=XS(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;nS((function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);v.useEffect(()=>()=>window.clearTimeout(E.current),[]),Hm();let M=v.useCallback(e=>A.current===k.current?.side&&QS(e,k.current?.area),[]);return(0,L.jsx)(ES,{scope:n,searchRef:D,onItemEnter:v.useCallback(e=>{M(e)&&e.preventDefault()},[M]),onItemLeave:v.useCallback(e=>{M(e)||(w.current?.focus(),C(null))},[M]),onTriggerLeave:v.useCallback(e=>{M(e)&&e.preventDefault()},[M]),pointerGraceTimerRef:O,onPointerGraceIntentChange:v.useCallback(e=>{k.current=e},[]),children:(0,L.jsx)(ee,{...te,children:(0,L.jsx)(mm,{asChild:!0,trapped:i,onMountAutoFocus:Y(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,L.jsx)(nm,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,L.jsx)($x,{asChild:!0,...b,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Y(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,L.jsx)(ab,{role:`menu`,"aria-orientation":`vertical`,"data-state":GS(g.open),"data-radix-menu-content":``,dir:_.dir,...y,...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&&ne(e.key));let i=w.current;if(e.target!==i||!oS.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);aS.includes(e.key)&&a.reverse(),JS(a)}),onBlur:Y(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:Y(e.onPointerMove,$S(e=>{let t=e.target,n=j.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>j.current?`right`:`left`;A.current=t,j.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),NS=v.forwardRef(nS(function(e,t){let{__scopeMenu:n,...r}=e;return(0,L.jsx)(Wp.div,{...r,ref:t})},`MenuLabel`)),PS=`MenuItem`,FS=`menu.itemSelect`,IS=v.forwardRef(nS(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=v.useRef(null),o=vS(PS,e.__scopeMenu),s=DS(PS,e.__scopeMenu),c=tp(t,a),l=v.useRef(!1),u=nS(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(FS,{bubbles:!0,cancelable:!0});e.addEventListener(FS,e=>r?.(e),{once:!0}),Gp(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,L.jsx)(LS,{...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=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&rS.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),LS=v.forwardRef(nS(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=DS(PS,n),s=mS(n),c=v.useRef(null),l=tp(t,c),[u,d]=v.useState(!1),[f,p]=v.useState(``);return v.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,L.jsx)(cS.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,L.jsx)(eS,{asChild:!0,...s,focusable:!r,children:(0,L.jsx)(Wp.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,$S(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Y(e.onPointerLeave,$S(e=>o.onItemLeave(e))),onFocus:Y(e.onFocus,()=>d(!0)),onBlur:Y(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[RS,zS]=dS(`MenuRadioGroup`,{value:void 0,onValueChange:nS(()=>{},`onValueChange`)}),[BS,VS]=dS(`MenuItemIndicator`,{checked:!1}),HS=v.forwardRef(nS(function(e,t){let{__scopeMenu:n,...r}=e;return(0,L.jsx)(Wp.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[US,WS]=dS(`MenuSub`);function GS(e){return e?`open`:`closed`}nS(GS,`getOpenState`);function KS(e){return e===`indeterminate`}nS(KS,`isIndeterminate`);function qS(e){return KS(e)?`indeterminate`:e?`checked`:`unchecked`}nS(qS,`getCheckedState`);function JS(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}nS(JS,`focusFirst`);function YS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}nS(YS,`wrapArray`);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=YS(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}nS(XS,`getNextMatch`);function ZS(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}nS(ZS,`isPointInPolygon`);function QS(e,t){return t?ZS({x:e.clientX,y:e.clientY},t):!1}nS(QS,`isPointerInGraceArea`);function $S(e){return t=>t.pointerType===`mouse`?e(t):void 0}nS($S,`whenMouse`);var eC=yS,tC=bS,nC=wS,rC=OS,iC=NS,aC=IS,oC=HS,sC=Object.defineProperty,cC=(e,t)=>sC(e,`name`,{value:t,configurable:!0}),lC=`DropdownMenu`,[uC,dC]=ap(lC,[fS]),fC=fS(),[pC,mC]=uC(lC),hC=cC(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=fC(t),l=v.useRef(null),[u,d]=xp({prop:i,defaultProp:a??!1,onChange:o,caller:lC});return(0,L.jsx)(pC,{scope:t,triggerId:fp(),triggerRef:l,contentId:fp(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,L.jsx)(eC,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),gC=`DropdownMenuTrigger`,_C=v.forwardRef(cC(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=mC(gC,n),o=fC(n),s=tp(t,a.triggerRef);return(0,L.jsx)(tC,{asChild:!0,...o,children:(0,L.jsx)(Wp.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:s,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())})})})},`DropdownMenuTrigger`)),vC=cC(e=>{let{__scopeDropdownMenu:t,...n}=e,r=fC(t);return(0,L.jsx)(nC,{...r,...n})},`DropdownMenuPortal`),yC=`DropdownMenuContent`,bC=v.forwardRef(cC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=mC(yC,n),a=fC(n),o=v.useRef(!1);return(0,L.jsx)(rC,{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)`}})},`DropdownMenuContent`)),xC=v.forwardRef(cC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=fC(n);return(0,L.jsx)(iC,{...i,...r,ref:t})},`DropdownMenuLabel`)),SC=v.forwardRef(cC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=fC(n);return(0,L.jsx)(aC,{...i,...r,ref:t})},`DropdownMenuItem`)),CC=v.forwardRef(cC(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=fC(n);return(0,L.jsx)(oC,{...i,...r,ref:t})},`DropdownMenuSeparator`)),wC=hC,TC=_C,EC=vC,DC=bC,OC=xC,kC=SC,AC=CC,jC=`z-50 overflow-hidden rounded-[8px] border border-rule bg-surface shadow-pop outline-none py-1 data-[state=open]:animate-[q-pop_120ms_ease-out] data-[state=closed]:animate-[q-pop-out_100ms_ease-in_forwards]`;function MC({trigger:e,children:t,width:n=220,align:r=`start`,side:i=`bottom`,sideOffset:a=6,open:o,onOpenChange:s}){return(0,L.jsxs)(wC,{open:o,onOpenChange:s,modal:!1,children:[(0,L.jsx)(TC,{asChild:!0,children:e}),(0,L.jsx)(EC,{children:(0,L.jsx)(DC,{align:r,side:i,sideOffset:a,collisionPadding:12,className:jC,style:{width:n,maxWidth:`calc(100vw - 24px)`},children:t})})]})}var NC=(e,t)=>X(`flex min-h-9 w-full cursor-pointer items-center gap-2.5 border-0 px-3 py-1.5 text-left text-[13.5px] outline-none select-none`,`data-[highlighted]:bg-soft data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,t?`bg-soft`:`bg-transparent`,e?`text-danger-text`:`text-ink`);function PC({children:e,onSelect:t,danger:n,active:r,disabled:i,hint:a,className:o}){return(0,L.jsxs)(kC,{disabled:i,onSelect:t,className:X(NC(n,r),o),children:[e,a?(0,L.jsx)(`span`,{className:`ml-auto pl-3 text-[12px] text-muted`,children:a}):null]})}function FC(){return(0,L.jsx)(AC,{className:`my-1 h-px bg-rule`})}function IC({children:e}){return(0,L.jsx)(OC,{className:`px-3 pt-1.5 pb-1 text-[12px] text-muted`,children:e})}var LC=[{value:`system`,label:`System`,icon:`monitor`},{value:`light`,label:`Light`,icon:`sun`},{value:`dark`,label:`Dark`,icon:`moon`}];function RC(){let e=g_(),t=__();return(0,L.jsxs)(MC,{align:`end`,width:180,trigger:(0,L.jsx)(ix,{icon:t===`dark`?`moon`:`sun`,label:`Appearance`}),children:[(0,L.jsx)(IC,{children:`Appearance`}),LC.map(t=>(0,L.jsxs)(PC,{active:e===t.value,onSelect:()=>h_(t.value),children:[(0,L.jsx)(Z,{name:t.icon,size:15,className:`text-ink2`}),t.label,e===t.value?(0,L.jsx)(Z,{name:`check`,size:15,className:`ml-auto text-ink2`}):null]},t.value))]})}function zC({size:e=24}){return(0,L.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 32 32`,"aria-hidden":`true`,className:`shrink-0`,children:[(0,L.jsx)(`rect`,{width:`32`,height:`32`,rx:`7`,className:`fill-primary`}),(0,L.jsx)(`rect`,{x:`7`,y:`7`,width:`8`,height:`11`,rx:`1.5`,className:`fill-primary-ink`}),(0,L.jsx)(`rect`,{x:`17`,y:`7`,width:`8`,height:`6`,rx:`1.5`,fill:`#f0a040`}),(0,L.jsx)(`rect`,{x:`17`,y:`15`,width:`8`,height:`10`,rx:`1.5`,className:`fill-primary-ink`}),(0,L.jsx)(`rect`,{x:`7`,y:`20`,width:`8`,height:`5`,rx:`1.5`,className:`fill-primary-ink`})]})}function BC({name:e,version:t}){return(0,L.jsxs)(be,{href:`/`,title:t?`foss-design ${t}`:void 0,className:`flex min-w-0 items-center gap-2 text-[14px] font-semibold text-ink no-underline`,children:[(0,L.jsx)(zC,{}),(0,L.jsx)(`span`,{className:`truncate`,children:e??`Design`})]})}function VC({children:e,className:t}){return(0,L.jsx)(`header`,{className:X(`sticky top-0 z-30 flex h-[52px] shrink-0 items-center gap-3 border-b border-rule bg-surface px-4`,t),children:e})}var HC=(0,v.createContext)(!1).Provider;function UC(e,t,n){let[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(0);return(0,v.useLayoutEffect)(()=>{let n=e.current,r=t.current;if(!n||!r)return;let o=()=>{let e=[...n.querySelectorAll(`[data-fit]`)].reduce((e,t)=>e+Math.max(0,t.scrollWidth-t.clientWidth),0),t=r.getBoundingClientRect().left-n.getBoundingClientRect().right;i(n=>n?t-e<a.current-r.offsetWidth+16:(a.current=r.offsetWidth,e>0))};o();let s=new ResizeObserver(o);return s.observe(n.parentElement??n),s.observe(r),()=>s.disconnect()},n),r}var WC=[{to:`/`,label:`Canvases`,match:e=>e===`/`||e.startsWith(`/c/`)},{to:`/system`,label:`Design system`,match:e=>e.startsWith(`/system`)}];function GC({location:e}){let t=(0,v.useRef)(null),n=WC.findIndex(t=>t.match(e)),[r,i]=(0,v.useState)(null);return(0,v.useLayoutEffect)(()=>{let e=t.current;if(!e)return;let r=()=>{let t=e.children[n];if(!t?.offsetWidth){i(null);return}let r=t.offsetLeft+10,a=t.offsetWidth-20;i(e=>e?.tab===n&&e.x===r&&e.width===a?e:{tab:n,x:r,width:a,slide:e!==null&&e.tab!==n})};r();let a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[n]),(0,L.jsxs)(`nav`,{ref:t,className:`relative flex h-[52px] items-stretch gap-0.5 max-md:hidden`,children:[WC.map((e,t)=>(0,L.jsx)(be,{href:e.to,"aria-current":t===n?`page`:void 0,className:X(`flex items-center px-2.5 text-[14px] no-underline transition-colors`,t===n?`font-medium text-ink`:`text-ink2 hover:text-ink`),children:e.label},e.to)),r?(0,L.jsx)(Wf.span,{"aria-hidden":!0,className:`pointer-events-none absolute bottom-0 left-0 h-[2px] bg-action`,initial:!1,animate:{x:r.x,width:r.width},transition:r.slide?{type:`spring`,stiffness:520,damping:42}:{duration:0}}):null]})}function KC(){let e=$g().data,{slots:t}=Xg(),[n]=P();return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(VC,{children:[t.barStart,(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-6`,children:[t.brand??(0,L.jsx)(BC,{name:e?.name,version:e?.version}),(0,L.jsx)(GC,{location:n})]}),(0,L.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,L.jsx)(Qb,{}),(0,L.jsx)(`span`,{className:X(`flex`,t.barEnd?`max-md:hidden`:void 0),children:(0,L.jsx)(RC,{})}),t.barEnd]})]}),(0,L.jsx)(qC,{location:n}),t.belowBar?(0,L.jsx)(`div`,{className:`shrink-0`,children:t.belowBar}):null]})}function qC({location:e}){return(0,L.jsx)(`nav`,{className:`sticky top-[52px] z-30 hidden h-10 shrink-0 items-stretch border-b border-rule bg-surface px-2 max-md:flex`,children:WC.map(t=>{let n=t.match(e);return(0,L.jsxs)(be,{href:t.to,"aria-current":n?`page`:void 0,className:X(`relative flex grow items-center justify-center text-[13.5px] no-underline`,n?`font-medium text-ink`:`text-ink2`),children:[t.label,n?(0,L.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-x-6 bottom-0 h-[2px] rounded-full bg-action`}):null]},t.to)})})}var JC=window.matchMedia(`(max-width: 767px)`),YC=e=>(JC.addEventListener(`change`,e),()=>JC.removeEventListener(`change`,e));function XC(){return(0,v.useSyncExternalStore)(YC,()=>JC.matches)}var ZC=Object.defineProperty,QC=(e,t)=>ZC(e,`name`,{value:t,configurable:!0}),$C=`Popover`,[ew,tw]=ap($C,[Wy]),nw=Wy(),[rw,iw]=ew($C),aw=QC(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=nw(t),c=v.useRef(null),[l,u]=v.useState(!1),[d,f]=xp({prop:r,defaultProp:i??!1,onChange:a,caller:$C});return(0,L.jsx)(rb,{...s,children:(0,L.jsx)(rw,{scope:t,contentId:fp(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>u(!0),[]),onCustomAnchorRemove:v.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),ow=`PopoverTrigger`,sw=v.forwardRef(QC(function(e,t){let{__scopePopover:n,...r}=e,i=iw(ow,n),a=nw(n),o=tp(t,i.triggerRef),s=(0,L.jsx)(Wp.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":vw(i.open),...r,ref:o,onClick:Y(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,L.jsx)(ib,{asChild:!0,...a,children:s})},`PopoverTrigger`)),cw=`PopoverPortal`,[lw,uw]=ew(cw,{forceMount:void 0}),dw=QC(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=iw(cw,t);return(0,L.jsx)(lw,{scope:t,forceMount:n,children:(0,L.jsx)(jm,{present:n||a.open,children:(0,L.jsx)(Dm,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),fw=`PopoverContent`,pw=v.forwardRef(QC(function(e,t){let n=uw(fw,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=iw(fw,e.__scopePopover);return(0,L.jsx)(jm,{present:r||a.open,children:a.modal?(0,L.jsx)(hw,{...i,ref:t}):(0,L.jsx)(gw,{...i,ref:t})})},`PopoverContent`)),mw=kp(`PopoverContent.RemoveScroll`),hw=v.forwardRef(QC(function(e,t){let n=iw(fw,e.__scopePopover),r=v.useRef(null),i=tp(t,r),a=v.useRef(!1);return v.useEffect(()=>{let e=r.current;if(e)return og(e)},[]),(0,L.jsx)(Zh,{as:mw,allowPinchZoom:!0,children:(0,L.jsx)(_w,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Y(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),gw=v.forwardRef(QC(function(e,t){let n=iw(fw,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return(0,L.jsx)(_w,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),_w=v.forwardRef(QC(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=iw(fw,n),p=nw(n);return Hm(),(0,L.jsx)(mm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(nm,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,L.jsx)(ab,{"data-state":vw(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function vw(e){return e?`open`:`closed`}QC(vw,`getState`);var yw=aw,bw=sw,xw=dw,Sw=pw,Cw=new s_([]),ww=1;function Tw(e,t,n=`ok`){let r=ww++;Cw.set(i=>[...i.slice(-2),{id:r,title:e,text:t,tone:n}]),setTimeout(()=>Cw.set(e=>e.filter(e=>e.id!==r)),n===`error`?4200:2200)}var Ew=new s_([]),Dw=1;function Ow(){let[e]=(0,v.useState)(()=>Dw++);(0,v.useEffect)(()=>(Ew.set(t=>[...t,e]),()=>Ew.set(t=>t.filter(t=>t!==e))),[e]);let t=c_(Ew,t=>t[0]===e),n=c_(Cw);return t?(0,L.jsx)(`div`,{className:`pointer-events-none fixed bottom-5 left-1/2 z-[60] flex -translate-x-1/2 flex-col items-center gap-2`,children:(0,L.jsx)(ed,{mode:`popLayout`,children:n.map(e=>(0,L.jsxs)(Wf.div,{layout:!0,initial:{opacity:0,y:8,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:4,transition:{duration:.12}},transition:{type:`spring`,stiffness:520,damping:40},className:`flex max-w-[min(420px,calc(100vw-32px))] min-w-0 items-center gap-2.5 rounded-[8px] border border-rule bg-surface px-3 py-2 text-[13px] text-ink shadow-pop`,children:[e.tone===`error`?(0,L.jsx)(Z,{name:`alert`,size:15,className:`text-danger-text`}):e.tone===`info`?(0,L.jsx)(Z,{name:`info`,size:15,className:`text-muted`}):(0,L.jsx)(Z,{name:`check`,size:15,className:`text-ok-text`}),(0,L.jsx)(`span`,{className:`shrink-0 font-medium whitespace-nowrap`,children:e.title}),e.text?(0,L.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[12px] text-muted`,children:e.text}):null]},e.id))})}):null}async function kw(e,t=`Copied`){try{await navigator.clipboard.writeText(e),Tw(t,e.length>64?void 0:e)}catch{Tw(`Could not copy`,`The browser blocked clipboard access`,`error`)}}function Aw(e){return e.split(`/`).filter(Boolean)}function jw(e){return{pattern:e,segments:Aw(e).map(e=>e===`*`?{kind:`splat`}:e.startsWith(`:`)?{kind:`param`,optional:e.endsWith(`?`)}:{kind:`static`,value:e})}}function Mw(e){try{return decodeURIComponent(e)}catch{return e}}function Nw(e,t){let n=Aw(t.split(/[?#]/)[0]??``).map(Mw),r=(t,i)=>{if(t===e.segments.length)return i===n.length?0:null;let a=e.segments[t];if(a.kind===`splat`)return 0;if(a.kind===`static`){if(n[i]!==a.value)return null;let e=r(t+1,i+1);return e===null?null:e+4}if(i<n.length){let e=r(t+1,i+1);if(e!==null)return e+2}return a.optional?r(t+1,i):null};return r(0,0)}function Pw(e,t){let n=null;for(let r of e)for(let e of r.routes){let i=Nw(e,t);i!==null&&(!n||i>n.score)&&(n={score:i,value:r.value})}return n?.value??null}function Fw(e,t=`/`){let n=e.trim();if(!n||n.startsWith(`#`)||/^[a-z][a-z0-9+.-]*:/i.test(n)||n.startsWith(`//`))return null;let r=new URL(n,`http://app.invalid${t.replace(/\/:[^/]+\??|\/\*$/g,`/x`)}`);return r.pathname+r.search+r.hash}var Iw=new Map;window.addEventListener(`message`,e=>{let t=e.data;if(t?.source===`design-runtime`&&e.source)for(let n of Iw.get(e.source)??[])n(t)});function Lw(e,t){let n=null,r=()=>{if(!n)return;let e=Iw.get(n);e?.delete(t),e?.size||Iw.delete(n),n=null},i=()=>{if(r(),n=e.contentWindow,!n)return;let i=Iw.get(n)??new Set;i.add(t),Iw.set(n,i)};return i(),e.addEventListener(`load`,i),()=>{e.removeEventListener(`load`,i),r()}}function Rw(e,t){e?.contentWindow?.postMessage({source:`design-viewer`,...t},`*`)}function zw(e){Rw(e,{type:`canvas`})}function Bw(e,t){for(let n=e.parentElement;n;n=n.parentElement){let e=getComputedStyle(n),r=e=>/(auto|scroll|overlay)/.test(e),i=r(e.overflowY)&&n.scrollHeight>n.clientHeight,a=r(e.overflowX)&&n.scrollWidth>n.clientWidth;if(i||a){n.scrollBy({left:a?t.deltaX:0,top:i?t.deltaY:0,behavior:`instant`});return}}window.scrollBy({left:t.deltaX,top:t.deltaY,behavior:`instant`})}function Vw(e,t){Rw(e,{type:`theme`,theme:t})}function Hw(e){e&&(e.src=e.src)}var Uw=(()=>{if(Ng)return``;let{protocol:e,hostname:t,port:n}=window.location,r=t===`localhost`?`127.0.0.1`:t===`127.0.0.1`?`localhost`:null;return r?`${e}//${r}${n?`:${n}`:``}`:``})();function Ww(e,t,n){let[r=``,i=``]=e.split(`?`),a=new URLSearchParams(i);a.set(`theme`,t);for(let[e,t]of Object.entries(n??{}))a.set(e,t);return`${r.startsWith(`/`)?Uw:``}${r}?${a.toString()}`}function Gw(e){return new URL(e,document.baseURI).toString()}function Kw(e,t,n,r){if(e.form){Tw(`Forms are not sent from a screen`,void 0,`info`);return}if(e.path===null){let t=window.open(e.href,`_blank`);t?t.opener=null:Tw(`Link to another site`,e.href,`info`);return}let i=t.pages.flatMap(e=>e.sections.flatMap(e=>e.items.filter(e=>e.kind===`screen`||e.kind===`url`))),a=i.find(e=>e.id===r),o=e.raw===void 0?e.path:Fw(e.raw,a?.routes?.[0]);if(o===null)return;let s=Pw(i.map(e=>({routes:(e.routes??[]).map(jw),value:e.id})),o);if(s){s!==r&&n(s);return}let c=o.split(/[?#]/)[0].replace(/\/+$/,``),l=c.slice(c.lastIndexOf(`/`)+1).replace(/\.html?$/,``);try{l=decodeURIComponent(l)}catch{}l&&l!==r&&i.some(e=>e.id===l)?n(l):e.pushed||Tw(`No screen for this link`,o,`info`)}function qw(e,t,n){let r=$g().data,i=t_(!!r?.system).data?.tokens,[a,o]=(0,v.useState)(null),s=(0,v.useRef)({enabled:t,tokens:i});s.current={enabled:t,tokens:i};let c=(0,v.useRef)(n.onEscape);c.current=n.onEscape;let l=(0,v.useRef)(e);l.current=e;let u=(0,v.useRef)(new Map),d=(e,t=!1)=>{let{enabled:n,tokens:r}=s.current,i=u.current.get(e);(t||i?.on!==n||i.tokens!==r)&&(u.current.set(e,{on:n,tokens:r}),Rw(e,{type:`inspect`,on:n,tokens:n?r??[]:void 0}))};(0,v.useEffect)(()=>{for(let t of e)d(t);for(let t of u.current.keys())e.includes(t)||u.current.delete(t)},[e,t,i]),(0,v.useEffect)(()=>{let t=e.map(e=>Lw(e,t=>{if(t.type===`ready`)s.current.enabled?d(e,!0):u.current.set(e,{on:!1});else if(t.type===`inspect`){if(t.info){for(let t of l.current)t!==e&&Rw(t,{type:`inspect-select`,ref:null});o({info:t.info,frame:e})}else o(t=>t?.frame===e?null:t)}else t.type===`inspect-escape`&&c.current()}));return()=>{for(let e of t)e()}},[e]);let f=a&&e.includes(a.frame)?a.frame:null;return{info:f?a.info:null,frame:f,select(e){if(e===null){for(let e of l.current)Rw(e,{type:`inspect-select`,ref:null});o(null)}else a&&Rw(a.frame,{type:`inspect-select`,ref:e})}}}function Jw(e){let[t,n]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let t=e=>e===`Meta`||e===`Control`,r=!1,i=!1,a,o=()=>{r=!1,clearTimeout(a),n(!1)},s=e=>{if(t(e)){if(r)return;r=!0,i=!1,a=setTimeout(()=>{r&&!i&&n(!0)},150)}else r&&(i=!0,clearTimeout(a),n(!1))},c=e=>s(e.key),l=e=>{t(e.key)&&o()};window.addEventListener(`keydown`,c,!0),window.addEventListener(`keyup`,l,!0),window.addEventListener(`blur`,o);let u=e.map(e=>Lw(e,e=>{e.type===`key`?e.down?s(e.name):t(e.name)&&o():e.type===`blur`&&o()}));return()=>{window.removeEventListener(`keydown`,c,!0),window.removeEventListener(`keyup`,l,!0),window.removeEventListener(`blur`,o);for(let e of u)e();clearTimeout(a)}},[e]),t}function Yw({title:e,children:t,right:n}){return(0,L.jsxs)(`section`,{className:`border-t border-rule pb-2 first:border-t-0`,children:[(0,L.jsxs)(`div`,{className:`flex h-9 items-center justify-between px-4 text-[12px] font-medium text-muted`,children:[e,n]}),t]})}function Xw({label:e,children:t}){return(0,L.jsxs)(`div`,{className:`grid min-h-7 grid-cols-[92px_minmax(0,1fr)] items-center gap-x-3 px-4 py-0.5 text-[12.5px]`,children:[(0,L.jsx)(`span`,{className:`text-muted`,children:e}),(0,L.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-ink`,children:t})]})}function Zw({name:e}){return e?(0,L.jsx)(`button`,{type:`button`,onClick:()=>void kw(`var(${e})`,`Token copied`),title:`Copy var()`,className:`shrink-0 cursor-pointer truncate rounded-[4px] border-0 bg-action-soft px-1.5 py-px font-mono text-[11px] text-action`,children:e}):null}function Qw({children:e,title:t}){return(0,L.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[12px]`,title:t,children:e})}function $w({label:e,color:t}){return(0,L.jsxs)(Xw,{label:e,children:[(0,L.jsx)(`span`,{className:`size-3.5 shrink-0 rounded-[3px] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)]`,style:{background:t.css}}),(0,L.jsx)(Qw,{title:t.css,children:t.value}),(0,L.jsx)(Zw,{name:t.token})]})}var eT=e=>e?String(e):`–`;function tT({label:e,values:t,className:n,children:r}){let[i,a,o,s]=t;return(0,L.jsxs)(`div`,{className:X(`relative grid grid-cols-[28px_minmax(0,1fr)_28px] grid-rows-[20px_auto_20px] rounded-[4px]`,n),children:[(0,L.jsx)(`span`,{className:`absolute top-1 left-1.5 text-[9.5px] tracking-wide text-muted uppercase`,children:e}),(0,L.jsx)(`span`,{className:`col-start-2 self-center text-center`,children:eT(i)}),(0,L.jsx)(`span`,{className:`row-start-2 self-center text-center`,children:eT(s)}),(0,L.jsx)(`div`,{className:`row-start-2 col-start-2`,children:r}),(0,L.jsx)(`span`,{className:`row-start-2 col-start-3 self-center text-center`,children:eT(a)}),(0,L.jsx)(`span`,{className:`row-start-3 col-start-2 self-center text-center`,children:eT(o)})]})}function nT({info:e}){let t={w:Math.max(0,e.rect.w-e.border[1]-e.border[3]-e.padding[1]-e.padding[3]),h:Math.max(0,e.rect.h-e.border[0]-e.border[2]-e.padding[0]-e.padding[2])};return(0,L.jsx)(`div`,{className:`px-4 pt-1 pb-2 font-mono text-[11px] text-ink2`,children:(0,L.jsx)(tT,{label:`margin`,values:e.margin,className:`border border-dashed border-rule-strong bg-[#f6b26b]/15`,children:(0,L.jsx)(tT,{label:`border`,values:e.border,className:`border border-rule-strong bg-[#f9e27d]/15`,children:(0,L.jsx)(tT,{label:`padding`,values:e.padding,className:`border border-rule-strong bg-[#93c47d]/20`,children:(0,L.jsxs)(`div`,{className:`flex h-8 items-center justify-center rounded-[3px] border border-rule-strong bg-[#6fa8dc]/25 text-ink`,children:[Math.round(t.w*100)/100,` × `,Math.round(t.h*100)/100]})})})})})}function rT({info:e,onSelect:t}){return(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 px-4 pb-2`,children:[e.path.slice(-4).map((e,n)=>(0,L.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>t(e.ref),className:`cursor-pointer rounded-[4px] border-0 bg-soft2 px-1.5 py-0.5 font-mono text-[11px] text-ink2 hover:text-ink`,children:e.label}),(0,L.jsx)(Z,{name:`chevron-right`,size:11,className:`text-muted`})]},n)),(0,L.jsx)(`span`,{className:`rounded-[4px] bg-action-soft px-1.5 py-0.5 font-mono text-[11px] text-action`,children:e.label})]})}function iT({info:e,onSelect:t,onClose:n,active:r}){return(0,L.jsxs)(`aside`,{"data-ui":!0,className:`flex w-[320px] shrink-0 flex-col overflow-hidden border-l border-rule bg-surface`,children:[(0,L.jsxs)(`div`,{className:`flex h-[46px] shrink-0 items-center justify-between border-b border-rule pr-2 pl-4`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-[14px] font-semibold`,children:[(0,L.jsx)(Z,{name:`pointer`,size:15,className:`text-action`}),` Inspect`]}),(0,L.jsx)(ix,{icon:`x`,label:`Close inspector (I)`,onClick:n})]}),e?(0,L.jsxs)(`div`,{className:`min-h-0 grow overflow-y-auto`,children:[(0,L.jsxs)(Yw,{title:`Element`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pb-2`,children:[(0,L.jsx)(`div`,{className:`flex min-w-0 items-baseline gap-1.5`,children:e.component?.owners[0]?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`span`,{className:`truncate font-mono text-[14px] font-medium text-ink`,children:[`<`,e.component.owners[0],`>`]}),(0,L.jsx)(`span`,{className:`truncate font-mono text-[12px] text-muted`,children:e.tag})]}):(0,L.jsx)(`span`,{className:`truncate font-mono text-[14px] font-medium text-ink`,children:e.label})}),e.component&&e.component.owners.length>1?(0,L.jsxs)(`span`,{className:`truncate text-[12px] text-muted`,children:[`in `,e.component.owners.slice(1).join(` ← `)]}):null,e.component?.file?(0,L.jsx)(`button`,{type:`button`,onClick:()=>void kw(e.component.file,`Path copied`),className:`w-fit max-w-full cursor-pointer truncate border-0 bg-transparent p-0 text-left font-mono text-[11.5px] text-muted hover:text-ink2`,title:`Copy path`,children:e.component.file}):null,e.text?(0,L.jsxs)(`span`,{className:`line-clamp-2 text-[12.5px] text-ink2`,children:[`“`,e.text,`”`]}):null]}),(0,L.jsx)(rT,{info:e,onSelect:t})]}),(0,L.jsxs)(Yw,{title:`Box`,children:[(0,L.jsx)(nT,{info:e}),(0,L.jsx)(Xw,{label:`Size`,children:(0,L.jsxs)(Qw,{children:[e.rect.w,` × `,e.rect.h]})}),(0,L.jsx)(Xw,{label:`Position`,children:(0,L.jsxs)(Qw,{children:[`x `,e.rect.x,` · y `,e.rect.y]})})]}),e.layout.length?(0,L.jsx)(Yw,{title:`Layout`,children:e.layout.map(([e,t])=>(0,L.jsx)(Xw,{label:e,children:(0,L.jsx)(Qw,{title:t,children:t})},e))}):null,e.typography?(0,L.jsxs)(Yw,{title:`Typography`,children:[(0,L.jsxs)(Xw,{label:`Font`,children:[(0,L.jsx)(Qw,{title:e.typography.family,children:e.typography.family.split(`,`)[0]?.replace(/["']/g,``)}),(0,L.jsx)(Zw,{name:e.typography.familyToken})]}),(0,L.jsxs)(Xw,{label:`Size`,children:[(0,L.jsxs)(Qw,{children:[e.typography.size,` / `,e.typography.lineHeight]}),(0,L.jsx)(Zw,{name:e.typography.sizeToken})]}),(0,L.jsx)(Xw,{label:`Weight`,children:(0,L.jsx)(Qw,{children:e.typography.weight})}),e.typography.letterSpacing===`normal`?null:(0,L.jsx)(Xw,{label:`Tracking`,children:(0,L.jsx)(Qw,{children:e.typography.letterSpacing})}),(0,L.jsx)($w,{label:`Color`,color:e.typography.color}),e.typography.align===`start`?null:(0,L.jsx)(Xw,{label:`Align`,children:(0,L.jsx)(Qw,{children:e.typography.align})}),e.typography.transform?(0,L.jsx)(Xw,{label:`Transform`,children:(0,L.jsx)(Qw,{children:e.typography.transform})}):null]}):null,Object.values(e.appearance).some(Boolean)?(0,L.jsxs)(Yw,{title:`Appearance`,children:[e.appearance.background?(0,L.jsx)($w,{label:`Background`,color:e.appearance.background}):null,e.appearance.backgroundImage?(0,L.jsx)(Xw,{label:`Image`,children:(0,L.jsx)(Qw,{title:e.appearance.backgroundImage,children:e.appearance.backgroundImage})}):null,e.appearance.border?(0,L.jsxs)(Xw,{label:`Border`,children:[(0,L.jsx)(`span`,{className:`size-3.5 shrink-0 rounded-[3px] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)]`,style:{background:e.appearance.border.color.css}}),(0,L.jsxs)(Qw,{children:[e.appearance.border.width,` `,e.appearance.border.style,` `,e.appearance.border.color.value]}),(0,L.jsx)(Zw,{name:e.appearance.border.color.token})]}):null,e.appearance.radius?(0,L.jsxs)(Xw,{label:`Radius`,children:[(0,L.jsx)(Qw,{children:e.appearance.radius.value}),(0,L.jsx)(Zw,{name:e.appearance.radius.token})]}):null,e.appearance.shadow?(0,L.jsxs)(Xw,{label:`Shadow`,children:[(0,L.jsx)(Qw,{title:e.appearance.shadow.value,children:e.appearance.shadow.value}),(0,L.jsx)(Zw,{name:e.appearance.shadow.token})]}):null,e.appearance.opacity?(0,L.jsx)(Xw,{label:`Opacity`,children:(0,L.jsx)(Qw,{children:e.appearance.opacity})}):null]}):null,e.classes.length?(0,L.jsx)(Yw,{title:`Classes`,right:(0,L.jsx)(`button`,{type:`button`,onClick:()=>void kw(e.classes.join(` `),`Classes copied`),className:`cursor-pointer border-0 bg-transparent text-[12px] text-muted hover:text-ink2`,children:`Copy`}),children:(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1 px-4 pb-1`,children:e.classes.map(e=>(0,L.jsx)(`span`,{className:`rounded-[4px] bg-soft2 px-1.5 py-0.5 font-mono text-[11px] text-ink2`,children:e},e))})}):null,e.attributes.length?(0,L.jsx)(Yw,{title:`Attributes`,children:e.attributes.map(([e,t])=>(0,L.jsx)(Xw,{label:e,children:(0,L.jsx)(Qw,{title:t,children:t})},e))}):null,e.children.length?(0,L.jsx)(Yw,{title:`Children · ${e.children.length}`,children:(0,L.jsx)(`div`,{className:`flex flex-col px-2 pb-1`,children:e.children.map((e,n)=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(e.ref),className:`flex h-7 cursor-pointer items-center gap-2 rounded-[6px] border-0 bg-transparent px-2 text-left font-mono text-[12px] text-ink2 hover:bg-soft2`,children:[(0,L.jsx)(Z,{name:`chevron-right`,size:12,className:`text-muted`}),(0,L.jsx)(`span`,{className:`truncate`,children:e.label})]},n))})}):null]}):(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-6 py-10 text-center`,children:[(0,L.jsx)(Z,{name:`pointer`,size:22,className:`text-muted`}),(0,L.jsx)(`span`,{className:`text-[13.5px] text-ink2`,children:r?`Click an element in any screen.`:`Hold ${T_} to highlight, click to inspect.`}),(0,L.jsx)(`span`,{className:`text-[12.5px] leading-[1.5] text-muted`,children:`Hover shows margin, padding and content. Clicks go to the inspector, not the screen.`}),(0,L.jsxs)(`span`,{className:`mt-2 flex items-center gap-1.5 text-[12px] text-muted`,children:[(0,L.jsx)(y_,{children:`I`}),` toggle · hold `,(0,L.jsx)(y_,{children:T_}),` · `,(0,L.jsx)(y_,{children:`esc`}),` clear`]})]}),e?(0,L.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-t border-rule bg-soft px-4 py-2.5`,children:(0,L.jsx)(tx,{icon:`copy`,onClick:()=>void kw(e.css,`CSS copied`),className:`grow`,children:`Copy CSS`})}):null]})}var aT={neutral:`bg-soft2 text-ink2`,action:`bg-action-soft text-action`,ok:`bg-ok-soft text-ok-text`,danger:`bg-danger-soft text-danger-text`};function oT({tone:e=`neutral`,children:t,className:n}){return(0,L.jsx)(`span`,{className:X(`inline-flex h-[22px] shrink-0 items-center gap-1 whitespace-nowrap rounded-[6px] px-2 text-[12px] font-medium`,aT[e],n),children:t})}function sT({value:e,tone:t=`neutral`}){return(0,L.jsx)(`span`,{className:X(`inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-[4px] px-[5px] text-[11.5px] font-semibold tabular`,t===`action`?`bg-action-soft text-action`:t===`danger`?`bg-danger-soft text-danger-text`:`bg-soft2 text-ink2`),children:e})}function cT({children:e,className:t,style:n}){return(0,L.jsx)(`section`,{className:X(`min-w-0 shrink-0 overflow-hidden rounded-[10px] border border-rule bg-surface`,t),style:n,children:e})}function lT({title:e,count:t,sub:n,right:r,as:i=`h2`}){return(0,L.jsxs)(`div`,{className:`flex min-h-[46px] items-center justify-between gap-3 px-4`,children:[(0,L.jsxs)(i,{className:`m-0 flex min-w-0 items-center gap-2 whitespace-nowrap text-[14px] font-semibold`,children:[e,t===void 0?null:(0,L.jsx)(sT,{value:t}),n?(0,L.jsx)(`span`,{className:`truncate text-[12.5px] font-normal text-muted`,children:n}):null]}),r?(0,L.jsx)(`div`,{className:`flex items-center gap-2`,children:r}):null]})}function uT({items:e,value:t,onChange:n,right:r}){let i=(0,v.useId)();return(0,L.jsxs)(`div`,{className:`flex h-[46px] items-center justify-between gap-3 px-4`,children:[(0,L.jsx)(`div`,{role:`tablist`,className:`flex gap-5`,children:e.map(e=>{let r=e.value===t;return(0,L.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,onClick:()=>n(e.value),className:X(`relative flex h-[46px] cursor-pointer items-center gap-1.5 border-0 bg-transparent px-0.5 text-[14px] transition-colors`,r?`font-semibold text-ink`:`font-medium text-ink2 hover:text-ink`),children:[e.label,e.count===void 0?null:(0,L.jsx)(sT,{value:e.count}),r?(0,L.jsx)(Wf.span,{layoutId:i,className:`absolute inset-x-0 bottom-0 h-[2px] bg-ink`,transition:{type:`spring`,stiffness:520,damping:42}}):null]},e.value)})}),r?(0,L.jsx)(`div`,{className:`flex items-center gap-2`,children:r}):null]})}function dT({align:e,children:t}){return(0,L.jsx)(`div`,{className:X(`flex min-w-0 items-center gap-2`,e===`r`&&`justify-end text-right`,e===`c`&&`justify-center`),children:t})}function fT(e,t){return v.Children.toArray(e).map((e,n)=>(0,L.jsx)(dT,{align:t?.[n]??`l`,children:e},n))}function pT({cols:e,align:t,labels:n}){return(0,L.jsx)(`div`,{className:`grid h-8 items-center gap-x-4 border-t border-rule bg-soft px-4 text-[12.5px] text-muted`,style:{gridTemplateColumns:e},children:n.map((e,n)=>(0,L.jsx)(dT,{align:t?.[n]??`l`,children:(0,L.jsx)(`span`,{className:`whitespace-nowrap`,children:e})},n))})}var mT=(e,t,n)=>X(`grid items-center gap-x-4 border-rule`,!e&&`border-t`,t&&`cursor-pointer transition-colors hover:bg-soft`,n);function hT({cols:e,align:t,minH:n=44,pad:r=`10px 16px`,children:i,first:a,className:o,onClick:s,title:c}){return(0,L.jsx)(`div`,{className:mT(a,!!s,o),style:{gridTemplateColumns:e,minHeight:n,padding:r},onClick:s,title:c,children:fT(i,t)})}function gT({to:e,cols:t,align:n,minH:r=44,pad:i=`10px 16px`,first:a,className:o,children:s}){return(0,L.jsx)(be,{href:e,className:X(mT(a,!0,o),`text-inherit no-underline`),style:{gridTemplateColumns:t,minHeight:r,padding:i},children:fT(s,n)})}function _T({label:e,children:t,labelWidth:n=180,minH:r=40,end:i=!1}){return(0,L.jsxs)(`div`,{className:`grid content-center items-baseline gap-x-4 border-t border-rule px-4 py-2`,style:{gridTemplateColumns:`min(${n}px, 42%) minmax(0, 1fr)`,minHeight:r},children:[(0,L.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,L.jsx)(`div`,{className:X(`flex min-w-0 flex-wrap items-center gap-2`,i&&`justify-end`),children:t})]})}function vT({children:e,pad:t=`16px`,gap:n=16,top:r=!0,className:i}){return(0,L.jsx)(`div`,{className:X(`flex flex-col`,r&&`border-t border-rule`,i),style:{padding:t,gap:n},children:e})}function yT({issues:e,className:t}){return(0,L.jsx)(`div`,{className:X(`flex flex-col`,t),children:e.map((e,t)=>(0,L.jsxs)(`div`,{className:`flex items-start gap-2.5 border-t border-rule px-4 py-2.5 text-[13px] first:border-t-0`,children:[(0,L.jsx)(Z,{name:e.severity===`error`?`alert`:`info`,size:15,className:X(`mt-0.5`,e.severity===`error`?`text-danger-text`:`text-action`)}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(`span`,{className:`text-ink`,children:e.message}),(0,L.jsxs)(`span`,{className:`font-mono text-[12px] break-all text-muted`,children:[e.file,e.at?` · ${e.at}`:``]})]})]},t))})}function bT({issues:e,title:t=`Problems`}){if(!e.length)return null;let n=e.filter(e=>e.severity===`error`).length;return(0,L.jsxs)(cT,{className:n?`border-danger/40`:void 0,children:[(0,L.jsx)(lT,{title:t,count:e.length,sub:n?`${n} blocking`:`warnings`}),(0,L.jsx)(`div`,{className:`border-t border-rule`,children:(0,L.jsx)(yT,{issues:e})})]})}var xT=[.2,.7,.2,1];function ST({open:e,side:t,width:n,children:r}){return(0,L.jsx)(ed,{initial:!1,children:e?(0,L.jsx)(Wf.div,{initial:{width:0,opacity:.6},animate:{width:n,opacity:1},exit:{width:0,opacity:.6},transition:{duration:.22,ease:xT},className:X(`flex min-h-0 shrink-0 overflow-hidden`,t===`right`?`justify-start`:`justify-end`),children:(0,L.jsx)(`div`,{className:`flex min-h-0 shrink-0`,style:{width:n},children:r})},`panel`):null})}function CT({children:e,className:t,gap:n=20,wide:r=!1}){return(0,L.jsx)(`main`,{className:X(`mx-auto flex w-full min-h-0 grow flex-col px-8 pt-6 pb-7 animate-[q-fade-in_160ms_ease-out] max-md:px-4 max-md:pt-4`,r?`max-w-[1440px]`:`max-w-[1200px]`,t),style:{gap:n},children:e})}function wT({title:e,sub:t,right:n,badge:r,crumbs:i}){return(0,L.jsxs)(`div`,{className:`flex shrink-0 items-end justify-between gap-6 max-md:flex-col max-md:items-stretch max-md:gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[i?(0,L.jsx)(`div`,{className:`flex items-center gap-1.5 text-[13px] text-muted`,children:i}):null,(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`h1`,{className:`m-0 text-[22px] font-semibold tracking-[-0.01em]`,children:e}),r]}),t?(0,L.jsx)(`div`,{className:`text-[13px] [overflow-wrap:anywhere] text-muted`,children:t}):null]}),n?(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:n}):null]})}function TT({items:e,label:t}){let[n]=P();return(0,L.jsx)(`nav`,{"aria-label":t,className:`flex flex-col gap-0.5`,children:e.map(e=>{let t=n===e.to;return(0,L.jsxs)(be,{href:e.to,"aria-current":t?`page`:void 0,className:X(`relative flex h-8 items-center gap-2 whitespace-nowrap rounded-[6px] px-3 text-[13.5px] no-underline transition-colors focus-visible:outline-offset-[-2px]`,t?`font-medium text-ink`:`text-ink2 hover:bg-soft2`),children:[t?(0,L.jsx)(Wf.span,{layoutId:`sub-nav-active`,"aria-hidden":!0,className:`absolute inset-0 z-0 rounded-[6px] bg-soft2`,transition:{type:`spring`,stiffness:520,damping:42}}):null,(0,L.jsx)(`span`,{className:`relative z-[1] min-w-0 truncate`,children:e.label}),e.hint?(0,L.jsx)(`span`,{className:`relative z-[1] ml-auto text-[12px] font-normal text-muted`,children:e.hint}):null]},e.to)})})}function ET({children:e}){return(0,L.jsx)(`div`,{className:`px-3 pt-4 pb-1 text-[12px] text-muted`,children:e})}function DT({title:e,text:t,action:n}){return(0,L.jsxs)(cT,{className:`flex w-[480px] max-w-full flex-col items-center gap-2 px-6 py-8 text-center`,children:[(0,L.jsx)(`h1`,{className:`m-0 text-[16px] font-semibold`,children:e}),t?(0,L.jsx)(`div`,{className:`m-0 max-w-[400px] text-[14px] text-ink2`,children:t}):null,n?(0,L.jsx)(`div`,{className:`mt-3 flex flex-wrap justify-center gap-2`,children:n}):null]})}function OT(e){return(0,L.jsx)(`div`,{className:`flex min-h-[50vh] grow items-center justify-center p-6 max-md:px-4`,children:(0,L.jsx)(DT,{...e})})}function kT({title:e=`Nothing here`,text:t}){let n=!!Xg().scope;return(0,L.jsx)(OT,{title:e,text:t??`This address does not match a canvas or a page of the design system.`,action:n?void 0:(0,L.jsx)(ax,{to:`/`,children:`All canvases`})})}var AT=.1,jT=(e,t=AT)=>Math.min(8,Math.max(t,e)),MT=class{camera={x:0,y:0,z:1};minZoom=AT;listeners=new Set;animation=0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}set(e){this.camera={x:e.x,y:e.y,z:jT(e.z,this.minZoom)};for(let e of this.listeners)e(this.camera)}interrupt(){cancelAnimationFrame(this.animation),this.animation=0}panBy(e,t){this.interrupt();let{x:n,y:r,z:i}=this.camera;this.set({x:n+e,y:r+t,z:i})}zoomAt(e,t,n){this.interrupt();let{x:r,y:i,z:a}=this.camera,o=jT(a*n,this.minZoom),s=(e-r)/a,c=(t-i)/a;this.set({x:e-s*o,y:t-c*o,z:o})}animateTo(e,t=320){this.interrupt();let n={...this.camera},r={...e,z:jT(e.z,this.minZoom)};if(t<=0||matchMedia(`(prefers-reduced-motion: reduce)`).matches){this.set(r);return}let i=performance.now(),a=e=>{let o=Math.min(1,(e-i)/t),s=1-(1-o)**3,c=n.z*(r.z/n.z)**s,l=n.z===r.z?s:(c-n.z)/(r.z-n.z);this.set({x:n.x+(r.x-n.x)*l,y:n.y+(r.y-n.y)*l,z:c}),this.animation=o<1?requestAnimationFrame(a):0};this.animation=requestAnimationFrame(a)}toWorld(e,t){let{x:n,y:r,z:i}=this.camera;return{x:(e-n)/i,y:(t-r)/i}}};function NT(e,t,n,r=72,i=1,a=AT){let o=jT(Math.min((t-r*2)/Math.max(e.w,1),(n-r*2)/Math.max(e.h,1),i),a),s=(e,t,n)=>t*o<=n-r*2?n/2-(e+t/2)*o:r-e*o;return{z:o,x:s(e.x,e.w,t),y:s(e.y,e.h,n)}}function PT(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}function FT({items:e,value:t,onChange:n,label:r,stretch:i,size:a=`ctrl`}){let o=(0,v.useId)();return(0,L.jsx)(`div`,{role:`group`,"aria-label":r,className:X(`shrink-0 items-center gap-0.5 rounded-[6px] bg-track p-[3px]`,a===`ctrl`?`h-ctrl`:`h-7`,i?`flex`:`inline-flex`),children:e.map(e=>{let r=e.value===t;return(0,L.jsxs)(`button`,{type:`button`,"aria-pressed":r,title:e.title,onClick:()=>n(e.value),className:X(`relative flex h-full cursor-pointer items-center justify-center whitespace-nowrap rounded-[4px] border-0 bg-transparent font-medium transition-colors`,a===`ctrl`?`px-2.5 text-ctrl`:`px-2 text-[12.5px]`,i&&`flex-1`,r?`text-ink`:`text-muted hover:text-ink2`),children:[r?(0,L.jsx)(Wf.span,{layoutId:o,className:`absolute inset-0 z-0 rounded-[4px] bg-surface shadow-[0_1px_2px_rgba(0,0,0,0.10)]`,transition:{type:`spring`,stiffness:520,damping:42}}):null,(0,L.jsx)(`span`,{className:`relative z-[1] flex items-center gap-1.5`,children:e.label})]},e.value)})})}var IT=(e,t,n)=>`/c/${encodeURIComponent(e)}/full/${encodeURIComponent(t)}?theme=${n}`;function LT(e,t,n){let{frameSandbox:r}=Xg(),{base:i}=de();return t?t.kind===`url`?t.url:Gw(r?`${i}${IT(e,t.id,t.theme??n)}`:Ww(t.url,t.theme??n)):null}function RT({canvasId:e,itemId:t}){let{data:n,error:r,isLoading:i}=e_(e),[,a]=P(),{frameSandbox:o}=Xg(),s=__(),c=(0,v.useRef)(null),l=new URLSearchParams(window.location.search).get(`theme`),u=n?n.pages.flatMap(e=>e.sections.flatMap(e=>e.items.filter(e=>e.kind===`screen`||e.kind===`url`))):[],d=u.find(e=>e.id===t),f=(d?.kind===`screen`?d.theme:void 0)??(l===`light`||l===`dark`?l:n?.theme??s),p=d?d.kind===`screen`?Ww(d.url,f):d.url:``,m=`/c/${encodeURIComponent(e)}`;return(0,v.useEffect)(()=>{d&&(document.title=`${d.title} · ${n?.title??``}`)},[d,n?.title]),(0,v.useEffect)(()=>{let e=e=>{e.key===`Escape`&&a(m)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a,m]),(0,v.useEffect)(()=>{let r=c.current;if(r&&d?.kind===`screen`)return Lw(r,r=>{if(r.type===`keydown`&&r.code===`Escape`)a(m);else if(r.type===`go`){let t=r.target.includes(`/`)?r.target.split(`/`)[1]:r.target;u.some(e=>e.id===t)&&a(IT(e,t,f),{replace:!0})}else r.type===`link`&&n&&Kw(r,n,t=>a(IT(e,t,f),{replace:!0}),t)})},[p,d?.kind]),r?(0,L.jsx)(kT,{title:`Canvas not found`,text:r.message}):i||!n?(0,L.jsx)(`div`,{className:`h-dvh bg-surface`}):d?(0,L.jsxs)(`div`,{className:`group fixed inset-0 bg-surface`,children:[(0,L.jsx)(`iframe`,{ref:c,src:p,title:d.title,allow:`clipboard-read; clipboard-write; fullscreen`,sandbox:o,className:`block h-full w-full border-0`,style:{colorScheme:f},onLoad:()=>d.kind===`screen`&&Vw(c.current,f)},`${d.id}:${d.kind===`screen`?d.rev:d.url}`),(0,L.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 flex justify-end p-3 opacity-0 transition-opacity duration-200 group-hover:opacity-100 focus-within:opacity-100`,children:(0,L.jsxs)(be,{href:m,className:`pointer-events-auto flex h-8 items-center gap-2 rounded-[8px] border border-rule bg-surface px-3 text-[12.5px] text-ink2 no-underline shadow-pop hover:text-ink`,children:[(0,L.jsx)(Z,{name:`x`,size:14}),`Back to `,n.title,(0,L.jsx)(y_,{children:`esc`})]})})]}):(0,L.jsx)(kT,{title:`Screen not found`,text:`No screen "${t}" on this canvas.`})}function zT(e){return e.kind===`note`?`note`:e.kind===`image`?`image`:e.kind===`url`?`globe`:e.frame.width<600?`smartphone`:e.frame.width<1100?`tablet`:`monitor`}function BT(e,t){return`/c/${encodeURIComponent(e.id)}/p/${encodeURIComponent(t.id)}`}function VT({canvas:e,page:t,store:n,onPick:r}){let i=c_(n,e=>e.selected),a=c_(n,e=>e.frames);return(0,L.jsxs)(`aside`,{"data-ui":!0,className:`flex w-[264px] shrink-0 flex-col overflow-hidden border-r border-rule bg-surface`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 border-b border-rule px-4 py-3.5`,children:[(0,L.jsx)(`div`,{className:`truncate text-[14px] font-semibold`,children:e.title}),e.description?(0,L.jsx)(`div`,{className:`line-clamp-3 text-[12.5px] leading-[1.45] text-muted`,children:e.description}):null]}),(0,L.jsxs)(`div`,{className:`min-h-0 grow overflow-y-auto pb-4`,children:[e.pages.length>1?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:`Pages`}),(0,L.jsx)(`nav`,{className:`flex flex-col gap-0.5 px-2`,children:e.pages.map(n=>{let r=n.sections.reduce((e,t)=>e+t.items.filter(e=>e.kind===`screen`||e.kind===`url`).length,0);return(0,L.jsxs)(be,{href:BT(e,n),className:X(`flex h-8 items-center gap-2 rounded-[6px] px-2.5 text-[13.5px] no-underline transition-colors focus-visible:outline-offset-[-2px]`,n.id===t.id?`bg-soft2 font-medium text-ink`:`text-ink2 hover:bg-soft2`),children:[(0,L.jsx)(Z,{name:`file`,size:15,className:`text-muted`}),(0,L.jsx)(`span`,{className:`min-w-0 grow truncate`,children:n.title}),(0,L.jsx)(`span`,{className:`text-[12px] text-muted tabular`,children:r})]},n.id)})})]}):null,(0,L.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:e.pages.length>1?t.title:`Layers`}),(0,L.jsx)(`div`,{className:`flex flex-col px-2`,children:t.sections.map(e=>(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[e.title?(0,L.jsxs)(`div`,{className:`flex h-7 items-center gap-2 px-2.5 pt-1 text-[12px] font-medium text-ink2`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:e.title}),(0,L.jsx)(sT,{value:e.items.length})]}):null,e.items.map(t=>{let n=(a[t.id]?.errors.length??0)>0||t.kind===`screen`&&t.missing;return(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r(t.id),className:X(`flex h-8 w-full cursor-pointer items-center gap-2 rounded-[6px] border-0 px-2.5 text-left text-[13px] transition-colors focus-visible:outline-offset-[-2px]`,e.title&&`pl-4`,i===t.id?`bg-action-soft text-ink`:`bg-transparent text-ink2 hover:bg-soft2`),children:[(0,L.jsx)(Z,{name:zT(t),size:15,className:`text-muted`}),(0,L.jsx)(`span`,{className:`min-w-0 grow truncate`,children:t.title||(t.kind===`note`?`Note`:t.id)}),n?(0,L.jsx)(`span`,{className:`size-[7px] shrink-0 rounded-full bg-danger`}):null]},t.id)})]},e.id))})]})]})}function HT({canvas:e,page:t,theme:n,onTheme:r,sidebar:i,onSidebar:a,onPlay:o,canPlay:s,inspect:c,onInspect:l}){let[,u]=P(),{slots:d,scope:f}=Xg(),p=(0,v.useRef)(null),m=(0,v.useRef)(null),h=UC(p,m,[e.title,t?.title,e.pages.length]);return(0,L.jsxs)(HC,{value:h,children:[(0,L.jsxs)(VC,{children:[d.barStart,d.brand?d.brand:f?(0,L.jsx)(zC,{}):(0,L.jsx)(Yb,{content:`All canvases`,children:(0,L.jsx)(be,{href:`/`,className:`flex items-center`,"aria-label":`All canvases`,children:(0,L.jsx)(zC,{})})}),(0,L.jsx)(ix,{icon:`panel-left`,label:i?`Hide sidebar (⌘\\)`:`Show sidebar (⌘\\)`,onClick:()=>a(!i)}),(0,L.jsxs)(`div`,{ref:p,className:`flex min-w-0 items-center gap-1.5 text-[14px]`,children:[(0,L.jsx)(`span`,{"data-fit":!0,className:`truncate font-semibold`,children:e.title}),t&&e.pages.length>1?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Z,{name:`chevron-right`,size:14,className:`shrink-0 text-muted`}),(0,L.jsxs)(MC,{width:240,trigger:(0,L.jsxs)(`button`,{type:`button`,className:`flex h-ctrl cursor-pointer items-center gap-1 rounded-[6px] border-0 bg-transparent px-2 text-[14px] text-ink2 hover:bg-soft2`,children:[(0,L.jsx)(`span`,{"data-fit":!0,className:`truncate`,children:t.title}),(0,L.jsx)(Z,{name:`chevron-down`,size:14,className:`text-muted`})]}),children:[(0,L.jsx)(IC,{children:`Pages`}),e.pages.map(n=>(0,L.jsxs)(PC,{active:n.id===t.id,onSelect:()=>u(BT(e,n)),children:[(0,L.jsx)(Z,{name:`file`,size:15,className:`text-muted`}),n.title]},n.id))]})]}):null]}),(0,L.jsxs)(`div`,{ref:m,className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,L.jsx)(FT,{label:`Screen theme`,value:n,onChange:r,items:[{value:`light`,label:(0,L.jsx)(Z,{name:`sun`,size:15}),title:`Light screens`},{value:`dark`,label:(0,L.jsx)(Z,{name:`moon`,size:15}),title:`Dark screens`}]}),(0,L.jsx)(WT,{on:c,onChange:l,compact:h}),(0,L.jsx)(Yb,{content:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Play `,(0,L.jsx)(y_,{children:`P`})]}),children:(0,L.jsx)(tx,{kind:`secondary`,icon:`play`,onClick:o,disabled:!s,"aria-label":`Play`,className:h?`w-ctrl px-0`:void 0,children:h?null:`Play`})}),(0,L.jsx)(Qb,{width:180,label:`Search`,compact:h}),(0,L.jsx)(RC,{}),d.barEnd]})]}),d.belowBar?(0,L.jsx)(`div`,{className:`shrink-0`,children:d.belowBar}):null]})}function UT({canvas:e,store:t,layoutItems:n,theme:r,onPlay:i,inspect:a}){let o=c_(t,e=>e.selected),s=c_(t,e=>e.active),c=c_(t,e=>o?e.frames[o]:void 0),l=n.find(e=>e.id===o),u=LT(e.id,l?.kind===`screen`||l?.kind===`url`?l:void 0,r);if(!l)return null;let d=l.kind===`screen`||l.kind===`url`,f=()=>Hw(document.querySelector(`[data-item="${CSS.escape(l.id)}"] iframe`)),p=c?.errors??[];return(0,L.jsx)(`div`,{"data-ui":!0,className:`pointer-events-none absolute inset-x-0 bottom-5 z-20 flex justify-center px-4`,children:(0,L.jsxs)(`div`,{className:`pointer-events-auto flex max-w-full flex-col overflow-hidden rounded-[10px] border border-rule bg-surface shadow-pop animate-[q-pop_120ms_ease-out]`,children:[p.length?(0,L.jsxs)(`div`,{className:`flex max-h-40 items-start gap-2 overflow-y-auto border-b border-rule bg-danger-soft px-3.5 py-2 font-mono text-[12px] whitespace-pre-wrap text-danger-text`,children:[(0,L.jsx)(Z,{name:`alert`,size:14,className:`mt-px`}),(0,L.jsx)(`span`,{className:`min-w-0`,children:p.join(`
58
+ `)})]}):null,(0,L.jsxs)(`div`,{className:`flex h-[44px] items-center gap-1 pr-1.5 pl-3.5`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 pr-2`,children:[(0,L.jsx)(`span`,{className:`truncate text-[13.5px] font-medium`,children:l.title||l.id}),d&&s===l.id?(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-[12px] text-muted`,children:[(0,L.jsx)(Z,{name:`pointer`,size:13}),` `,a?`Inspecting`:`Interacting`,` `,(0,L.jsx)(y_,{children:`esc`})]}):d?(0,L.jsx)(`span`,{className:`shrink-0 text-[12px] text-muted`,children:a?`Click an element to inspect it`:`Click the screen to interact`}):null]}),d?(0,L.jsx)(Yb,{content:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Play `,(0,L.jsx)(y_,{children:`↵`})]}),children:(0,L.jsx)(ix,{icon:`play`,label:`Play`,onClick:()=>i(l.id)})}):null,u?(0,L.jsx)(Yb,{content:`Open in a new tab`,children:(0,L.jsx)(`a`,{href:u,target:`_blank`,rel:`noreferrer`,"aria-label":`Open in a new tab`,className:`inline-flex h-ctrl w-ctrl items-center justify-center rounded-[6px] text-muted hover:bg-soft2 hover:text-ink2`,children:(0,L.jsx)(Z,{name:`external`,size:16})})}):null,d?(0,L.jsx)(Yb,{content:`Reload`,children:(0,L.jsx)(ix,{icon:`refresh`,label:`Reload`,onClick:f})}):null,l.kind===`screen`?(0,L.jsx)(Yb,{content:`Copy source path`,children:(0,L.jsx)(ix,{icon:`copy`,label:`Copy source path`,onClick:()=>void kw(l.file,`Path copied`)})}):null,(0,L.jsx)(Yb,{content:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Zoom to `,(0,L.jsx)(y_,{children:`⇧2`})]}),children:(0,L.jsx)(ix,{icon:`fit`,label:`Zoom to`,onClick:()=>window.dispatchEvent(new CustomEvent(`design:focus`,{detail:{canvas:e.id,item:l.id}}))})})]})]})})}function WT({on:e,onChange:t,compact:n=!1}){return(0,L.jsx)(Yb,{content:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Inspect elements `,(0,L.jsx)(y_,{children:`I`})]}),children:(0,L.jsxs)(`button`,{type:`button`,"aria-pressed":e,"aria-label":`Inspect elements`,onClick:()=>t(!e),className:X(`inline-flex h-ctrl shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-[6px] border text-ctrl font-medium`,n?`w-ctrl px-0`:`px-ctrl`,e?`border-action-line bg-action-soft text-action`:`border-rule-strong bg-surface text-ink hover:bg-soft`),children:[(0,L.jsx)(Z,{name:`pointer`,size:15}),n?null:`Inspect`]})})}var GT=280,KT=96,qT=150,JT=110,YT=720,XT=e=>e.kind===`screen`||e.kind===`url`;function ZT(e,t){let n=t[e.id];if(e.kind===`screen`||e.kind===`url`){let t=e.frame.width;if(e.frame.height!==`auto`)return{w:t,h:e.frame.height};let r=e.kind===`screen`?e.measuredHeight:void 0;return{w:t,h:n?.h??r??900}}if(e.kind===`note`)return{w:e.width,h:n?.h??Math.max(80,Math.ceil(e.text.length/38)*26+40)};let r=e.width??n?.w??480;return{w:r,h:n?.w?n.h/n.w*r:n?.h??r*.62}}function QT(e,t){return!e.title&&!e.description?0:t[`section:${e.id}`]?.h??(e.title?56:0)+(e.description?60:0)}function $T(e,t){let n=[],r=[];if(e.layout===`free`){let r=0;for(let i of e.sections)for(let e of i.items){let{w:a,h:o}=ZT(e,t),s=e.x??r,c=e.y??0;r=Math.max(r,s+a+KT),n.push({item:e,section:i,x:s,y:c,w:a,h:o})}}else{let i=0;for(let a of e.sections){let e=QT(a,t),o=i,s=i+(e?e+JT:0),c=0,l=0,u=0,d=0;for(let e of a.items){a.columns&&d===a.columns&&(s+=l+qT,c=0,l=0,d=0);let{w:r,h:i}=ZT(e,t);n.push({item:e,section:a,x:c,y:s,w:r,h:i}),c+=r+KT,u=Math.max(u,c-KT),l=Math.max(l,i),d++}let f=s+l;r.push({section:a,x:0,y:o,w:Math.max(u,e?YT:0),h:f-o,header:e}),i=f+GT}}let i=0,a=0,o=0,s=0,c=[...n,...r];return c.length&&(i=Math.min(...c.map(e=>e.x)),a=Math.min(...c.map(e=>e.y)),o=Math.max(...c.map(e=>e.x+e.w)),s=Math.max(...c.map(e=>e.y+e.h))),{items:n,sections:r,bounds:{x:i,y:a,w:o-i,h:s-a}}}function eE(e){return e.items.filter(e=>XT(e.item))}function tE(){return new s_({selected:null,active:null,hovered:null,sizes:{},frames:{},live:[],panning:!1,zoomTiny:!1,frameEls:{},inspecting:!1})}function nE(e,t,n){e.set(e=>{let r=e.sizes[t];return r&&Math.abs(r.h-n.h)<1&&r.w===n.w?e:{...e,sizes:{...e.sizes,[t]:n}}})}function rE(e,t,n){e.set(e=>{let r=e.frames[t]??{ready:!1,errors:[]};return{...e,frames:{...e.frames,[t]:{...r,...n}}}})}function iE(e,t,n){e.set(e=>e.frameEls[t]===n?e:{...e,frameEls:{...e.frameEls,[t]:n}})}function aE(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var oE=aE();function sE(e){oE=e}var cE={exec:()=>null};function lE(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function $(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(dE.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var uE=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),dE={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:lE(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:lE(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:lE(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:lE(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:lE(e=>RegExp(`^ {0,${e}}(?:</?(?:${EE})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:lE(e=>RegExp(`^ {0,${e}}>`))},fE=/^(?:[ \t]*(?:\n|$))+/,pE=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,mE=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hE=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,gE=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_E=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,vE=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yE=$(vE).replace(/bull/g,_E).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),bE=$(vE).replace(/bull/g,_E).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xE=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,SE=/^[^\n]+/,CE=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,wE=$(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,CE).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),TE=$(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,_E).getRegex(),EE=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,DE=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,OE=$(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,DE).replace(`tag`,EE).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),kE=e=>$(xE).replace(`hr`,hE).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,EE).getRegex(),AE=kE(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),jE=kE(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),ME={blockquote:$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,jE).getRegex(),code:pE,def:wE,fences:mE,heading:gE,hr:hE,html:OE,lheading:yE,list:TE,newline:fE,paragraph:AE,table:cE,text:SE},NE=$(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,hE).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,EE).getRegex(),PE={...ME,lheading:bE,table:NE,paragraph:$(xE).replace(`hr`,hE).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,NE).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,EE).getRegex()},FE={...ME,html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,DE).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:cE,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$(xE).replace(`hr`,hE).replace(`heading`,` *#{1,6} *[^
59
+ ]`).replace(`lheading`,yE).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},IE=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,LE=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,RE=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,zE=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,BE=/[\p{P}\p{S}]/u,VE=/[\s\p{P}\p{S}]/u,HE=/[^\s\p{P}\p{S}]/u,UE=$(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,VE).getRegex(),WE=/[\p{Pi}\p{Ps}"']/u,GE=/(?!~)[\p{P}\p{S}]/u,KE=/(?!~)[\s\p{P}\p{S}]/u,qE=/(?:[^\s\p{P}\p{S}]|~)/u,JE=$(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,uE?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),YE=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,XE=$(YE,`u`).replace(/punct/g,BE).getRegex(),ZE=$(YE,`u`).replace(/punct/g,GE).getRegex(),QE=$(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,WE).replace(/punct/g,BE).getRegex(),$E=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,eD=$($E,`gu`).replace(/notPunctSpace/g,HE).replace(/punctSpace/g,VE).replace(/punct/g,BE).getRegex(),tD=$($E,`gu`).replace(/notPunctSpace/g,qE).replace(/punctSpace/g,KE).replace(/punct/g,GE).getRegex(),nD=$(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,HE).replace(/punctSpace/g,VE).replace(/punct/g,BE).getRegex(),rD=$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,HE).replace(/punctSpace/g,VE).replace(/punct/g,BE).getRegex(),iD=$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,HE).replace(/punctSpace/g,VE).replace(/punct/g,BE).getRegex(),aD=$(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,BE).getRegex(),oD=$(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,HE).replace(/punctSpace/g,VE).replace(/punct/g,BE).getRegex(),sD=$(/\\(punct)/,`gu`).replace(/punct/g,BE).getRegex(),cD=$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),lD=$(DE).replace(`(?:-->|$)`,`-->`).getRegex(),uD=$(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,lD).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),dD=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,fD=$(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,dD).getRegex(),pD=$(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,fD).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),mD=$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,fD).replace(`ref`,CE).getRegex(),hD=$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,CE).getRegex(),gD=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,_D=$(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,dD).getRegex(),vD=$(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,_D).replace(`ref`,gD).getRegex()).replace(`nolink`,$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,gD).getRegex()).getRegex(),yD=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,bD=$(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),xD={_backpedal:cE,anyPunctuation:sD,autolink:cD,blockSkip:JE,br:RE,code:LE,del:cE,delLDelim:cE,delRDelim:cE,emStrongLDelim:XE,emStrongRDelimAst:eD,emStrongRDelimUnd:rD,escape:IE,link:pD,nolink:hD,punctuation:UE,reflink:mD,reflinkSearch:vD,tag:uD,text:zE,url:cE},SD={...xD,emStrongLDelim:QE,emStrongRDelimAst:nD,emStrongRDelimUnd:iD,link:$(/^!?\[(label)\]\((.*?)\)/).replace(`label`,fD).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,fD).getRegex()},CD={...xD,emStrongRDelimAst:tD,emStrongLDelim:ZE,delLDelim:aD,delRDelim:oD,url:$(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,bD).replace(`protocol`,yD).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,yD).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},wD={...CD,br:$(RE).replace(`{2,}`,`*`).getRegex(),text:$(CD.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},TD={normal:ME,gfm:PE,pedantic:FE},ED={normal:xD,gfm:CD,breaks:wD,pedantic:SD},DD={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},OD=e=>DD[e];function kD(e,t){if(t){if(dE.escapeTest.test(e))return e.replace(dE.escapeReplace,OD)}else if(dE.escapeTestNoEncode.test(e))return e.replace(dE.escapeReplaceNoEncode,OD);return e}function AD(e){return e.replace(dE.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function jD(e){try{e=encodeURI(e).replace(dE.percentDecode,`%`)}catch{return null}return e}function MD(e,t){let n=e.replace(dE.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(dE.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(dE.slashPipe,`|`);return n}function ND(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function PD(e){let t=e.split(`
60
+ `),n=t.length-1;for(;n>=0&&dE.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
61
+ `)}function FD(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function ID(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function LD(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function RD(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function zD(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
62
62
  `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
63
- `)}function zD(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var BD=class{options;rules;lexer;constructor(e){this.options=e||aE}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:ND(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=RD(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=MD(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:MD(t[0],`
64
- `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:MD(t[0],`
65
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=MD(t[0],`
63
+ `)}function BD(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var VD=class{options;rules;lexer;constructor(e){this.options=e||oE}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:PD(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=zD(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=ND(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:ND(t[0],`
64
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:ND(t[0],`
65
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=ND(t[0],`
66
66
  `).split(`
67
67
  `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
68
68
  `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
@@ -77,19 +77,19 @@ ${d.join(`
77
77
  `+e.join(`
78
78
  `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
79
79
  `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
80
- `,1)[0],l=t[1].length,u=this.options.pedantic?ID(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>ID(e,l)),d=e.split(`
80
+ `,1)[0],l=t[1].length,u=this.options.pedantic?LD(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>LD(e,l)),d=e.split(`
81
81
  `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
82
82
  `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
83
83
  `,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
84
84
  `+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
85
85
  `+d}f=!d.trim(),r+=l+`
86
- `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=ND(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=PD(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:MD(t[0],`
87
- `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=jD(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
88
- `):[],a={type:`table`,raw:MD(t[0],`
89
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(jD(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:MD(t[0],`
86
+ `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=PD(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=FD(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:ND(t[0],`
87
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=MD(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
88
+ `):[],a={type:`table`,raw:ND(t[0],`
89
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(MD(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:ND(t[0],`
90
90
  `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
91
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&zD(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=MD(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=FD(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),LD(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&zD(e,n[1],r,this.rules))return;let i=t[PD((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return LD(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:kD(t[0]),escaped:e}}}},VD=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||aE,this.options.tokenizer=this.options.tokenizer||new BD,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:uE,block:wD.normal,inline:TD.normal};this.options.pedantic?(t.block=wD.pedantic,t.inline=TD.pedantic):this.options.gfm&&(t.block=wD.gfm,t.inline=this.options.breaks?TD.breaks:TD.gfm),this.tokenizer.rules=t}static get rules(){return{block:wD,inline:TD}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(uE.carriageReturn,`
92
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(uE.tabCharGlobal,` `).replace(uE.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
91
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&BD(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=ND(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=ID(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),RD(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&BD(e,n[1],r,this.rules))return;let i=t[FD((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return RD(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:AD(t[0]),escaped:e}}}},HD=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||oE,this.options.tokenizer=this.options.tokenizer||new VD,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:dE,block:TD.normal,inline:ED.normal};this.options.pedantic?(t.block=TD.pedantic,t.inline=ED.pedantic):this.options.gfm&&(t.block=TD.gfm,t.inline=this.options.breaks?ED.breaks:ED.gfm),this.tokenizer.rules=t}static get rules(){return{block:TD,inline:ED}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(dE.carriageReturn,`
92
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(dE.tabCharGlobal,` `).replace(dE.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
93
93
  `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
94
94
  `)?``:`
95
95
  `)+i.raw,n.text+=`
@@ -102,9 +102,9 @@ ${d.join(`
102
102
  `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
103
103
  `)?``:`
104
104
  `)+i.raw,n.text+=`
105
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,PD(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,PD(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},HD=class{options;parser;constructor(e){this.options=e||aE}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(uE.notSpaceStart)?.[0],i=e?e.replace(uE.endingNewline,``)+`
106
- `:``;return r?`<pre><code class="language-`+OD(r)+`">`+(n?i:OD(i,!0))+`</code></pre>
107
- `:`<pre><code>`+(n?i:OD(i,!0))+`</code></pre>
105
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,FD(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,FD(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},UD=class{options;parser;constructor(e){this.options=e||oE}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(dE.notSpaceStart)?.[0],i=e?e.replace(dE.endingNewline,``)+`
106
+ `:``;return r?`<pre><code class="language-`+kD(r)+`">`+(n?i:kD(i,!0))+`</code></pre>
107
+ `:`<pre><code>`+(n?i:kD(i,!0))+`</code></pre>
108
108
  `}blockquote({tokens:e}){return`<blockquote>
109
109
  ${this.parser.parse(e)}</blockquote>
110
110
  `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
@@ -120,39 +120,39 @@ ${this.parser.parse(e)}</blockquote>
120
120
  `}tablerow({text:e}){return`<tr>
121
121
  ${e}</tr>
122
122
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
123
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${OD(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?OD(n,!0):this.parser.parseInline(r),o=AD(e);if(o===null)return a;e=OD(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+OD(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=AD(e);if(i===null)return OD(n);e=i;let a=`<img src="${OD(e)}" alt="${OD(n)}"`;return t&&(a+=` title="${OD(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:OD(e.text)}},UD=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},WD=class e{options;renderer;textRenderer;constructor(e){this.options=e||aE,this.options.renderer=this.options.renderer||new HD,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new UD}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},GD=class{options;block;constructor(e){this.options=e||aE}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?VD.lex:VD.lexInline}provideParser(e=this.block){return e?WD.parse:WD.parseInline}},KD=class{defaults=iE();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=WD;Renderer=HD;TextRenderer=UD;Lexer=VD;Tokenizer=BD;Hooks=GD;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new HD(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new BD(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new GD;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=GD.passThroughHooks.has(n)?e=>{if(this.defaults.async&&GD.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return VD.lex(e,t??this.defaults)}parser(e,t){return WD.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?VD.lex:VD.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?WD.parse:WD.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?VD.lex:VD.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?WD.parse:WD.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
124
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+OD(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},qD=new KD;function JD(e,t){return qD.parse(e,t)}JD.options=JD.setOptions=function(e){return qD.setOptions(e),JD.defaults=qD.defaults,oE(JD.defaults),JD},JD.getDefaults=iE,JD.defaults=aE;function YD(...e){return qD.use(...e),JD.defaults=qD.defaults,oE(JD.defaults),JD}JD.use=YD,JD.walkTokens=function(e,t){return qD.walkTokens(e,t)},JD.parseInline=qD.parseInline,JD.Parser=WD,JD.parser=WD.parse,JD.Renderer=HD,JD.TextRenderer=UD,JD.Lexer=VD,JD.lexer=VD.lex,JD.Tokenizer=BD,JD.Hooks=GD,JD.parse=JD,JD.options,JD.setOptions,JD.walkTokens,JD.parseInline,WD.parse,VD.lex;var XD=new Set([`http:`,`https:`,`mailto:`]);function ZD(e){let t=e.replace(/[\u0000- \u007f]/g,``),n=/^([a-z][a-z0-9+.-]*):/i.exec(t)?.[1];return!n||XD.has(`${n.toLowerCase()}:`)}function QD(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var $D=new KD({gfm:!0,breaks:!1},{renderer:{html:({text:e})=>QD(e),link(e){return!ZD(e.href)&&this.parser.parseInline(e.tokens)},image(e){return!ZD(e.href)&&QD(e.text)}}});function eO(e){return $D.parse(e,{async:!1}).replace(/<a href=/g,`<a target="_blank" rel="noreferrer" href=`)}function tO({text:e,className:t}){let n=(0,v.useMemo)(()=>eO(e),[e]);return(0,L.jsx)(`div`,{className:X(`prose`,t),dangerouslySetInnerHTML:{__html:n}})}function nO(e,t,n=!0){let r=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{let i=r.current;if(!i||!n)return;let a=new ResizeObserver(()=>tE(e,t,{h:i.offsetHeight}));return a.observe(i),()=>a.disconnect()},[e,t,n]),r}function rO(e){return e<600?`smartphone`:e<1100?`tablet`:`monitor`}var iO=(0,v.memo)(function({placed:e,mode:t,thumb:n,theme:r,store:i,events:a,capture:o}){let{item:s,x:c,y:l,w:u,h:d}=e,f=(0,v.useRef)(null),{frameSandbox:p}=Xg(),m=(0,v.useCallback)(e=>{f.current=e,rE(i,s.id,e)},[i,s.id]),h=c_(i,e=>e.frames[s.id]),g=c_(i,e=>e.active===s.id),_=c_(i,e=>e.inspecting&&s.kind===`screen`),y=s.frame.height===`auto`,b=s.kind===`screen`?s.theme??r:r,x=s.kind===`screen`?s.rev:s.url,[S]=(0,v.useState)(b),C=s.kind===`screen`?Uw(s.url,S,o?{capture:`1`}:void 0):s.url,w=!!h?.ready,T=t===`off`,E=!T&&!(s.kind===`screen`&&s.missing);(0,v.useEffect)(()=>{T&&nE(i,s.id,{ready:!1})},[T,i,s.id]),(0,v.useEffect)(()=>{let e=f.current;if(e&&!T&&s.kind===`screen`)return Lw(e,t=>{switch(t.type){case`ready`:nE(i,s.id,{ready:!0}),zw(e);break;case`size`:y&&tE(i,s.id,{h:Math.max(200,t.height)});break;case`error`:{let e=i.get().frames[s.id]?.errors??[];e.includes(t.message)||nE(i,s.id,{errors:[...e,t.message]});break}case`updated`:nE(i,s.id,{errors:[]});break;case`go`:a.onGo(s.id,t.target);break;case`link`:a.onLink(s.id,t);break;case`wheel`:a.onWheel(e,t);break;case`keydown`:t.code===`Escape`&&a.onEscape()}})},[T,s.id,s.kind,y,i,a,C,x]),(0,v.useEffect)(()=>{s.kind===`screen`&&Bw(f.current,b)},[b,s.kind]);let D=b===`dark`?`light`:`dark`,O=e=>e?.[b]??e?.[D],k=s.kind===`screen`?O(s.snapshots):void 0,A=n&&s.kind===`screen`?O(s.thumbs)??k:k,j=t===`asleep`&&w&&!!A;return(0,L.jsxs)(`div`,{"data-item":s.id,className:`absolute overflow-hidden bg-surface`,style:{left:c,top:l,width:u,height:d,boxShadow:`var(--shadow-frame), 0 0 0 1px var(--rule)`},children:[(!w||j)&&A?(0,L.jsx)(`img`,{src:A,alt:``,draggable:!1,loading:`lazy`,decoding:`async`,className:`absolute inset-0 h-full w-full object-cover object-top select-none`}):null,!w&&!A?(0,L.jsx)(aO,{item:s,loading:E}):null,E?(0,L.jsx)(`div`,{className:`absolute inset-0`,style:{contentVisibility:j?`hidden`:`visible`},children:(0,L.jsx)(`iframe`,{ref:m,src:C,title:s.title,allow:`clipboard-read; clipboard-write; fullscreen`,sandbox:p,className:X(`absolute top-0 left-0 block border-0 transition-opacity duration-200`,w?`opacity-100`:`opacity-0`),style:{width:u,height:d,colorScheme:b},onLoad:()=>{s.kind===`url`?nE(i,s.id,{ready:!0}):(Bw(f.current,b),zw(f.current))}},x)}):null,g||_?null:(0,L.jsx)(`div`,{"data-shield":s.id,className:`absolute inset-0`})]})});function aO({item:e,loading:t}){let n=e.kind===`screen`&&e.missing;return(0,L.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-3 bg-soft text-muted`,children:[(0,L.jsx)(Z,{name:n?`alert`:e.kind===`url`?`globe`:rO(e.frame.width),size:Math.max(24,Math.min(96,e.frame.width/12)),strokeWidth:1.25,className:n?`text-danger-text`:void 0}),(0,L.jsx)(`div`,{className:`max-w-[80%] truncate text-center`,style:{fontSize:Math.max(14,e.frame.width/40)},children:n?`Missing file: ${e.kind===`screen`?e.src:``}`:t?`Loading…`:e.title})]})}var oO=(0,v.memo)(function({placed:e,store:t}){let{item:n,x:r,y:i,w:a}=e,o=nO(t,n.id),s=n.tone===`plain`;return(0,L.jsxs)(`div`,{ref:o,"data-item":n.id,className:X(`absolute`,s?``:`rounded-[10px] border border-note-line bg-note px-6 py-5 shadow-frame`),style:{left:r,top:i,width:a},children:[n.title?(0,L.jsx)(`div`,{className:`mb-2 font-semibold text-ink`,style:{fontSize:s?26:19},children:n.title}):null,(0,L.jsx)(tO,{text:n.text,className:s?`prose-plain`:`prose-note`})]})}),sO=(0,v.memo)(function({placed:e,store:t}){let{item:n,x:r,y:i,w:a,h:o}=e;return(0,L.jsx)(`div`,{"data-item":n.id,className:`absolute overflow-hidden rounded-[6px] bg-surface`,style:{left:r,top:i,width:a,height:o,boxShadow:`0 0 0 1px var(--rule)`},children:n.missing?(0,L.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-danger-text`,children:[(0,L.jsx)(Z,{name:`alert`,size:20}),` Missing image`]}):(0,L.jsx)(`img`,{src:n.url,alt:n.title,draggable:!1,className:`block h-full w-full object-contain select-none`,onLoad:e=>{let r=e.currentTarget;tE(t,n.id,{w:r.naturalWidth,h:r.naturalHeight})}})})}),cO=(0,v.memo)(function({section:e,x:t,y:n,w:r,store:i}){let a=nO(i,`section:${e.id}`);return!e.title&&!e.description?null:(0,L.jsxs)(`div`,{ref:a,className:`canvas-section absolute`,style:{left:t,top:n,width:Math.min(Math.max(r,720),1400)},children:[e.title?(0,L.jsx)(`div`,{className:`text-[40px] leading-[1.15] font-semibold tracking-[-0.015em] text-ink`,children:e.title}):null,e.description?(0,L.jsx)(`div`,{className:`mt-3 max-w-[1100px]`,children:(0,L.jsx)(tO,{text:e.description,className:`prose-plain`})}):null]})}),lO={phone:{width:390,height:844,label:`Phone`},"phone-sm":{width:375,height:667,label:`Phone S`},"phone-lg":{width:430,height:932,label:`Phone L`},tablet:{width:834,height:1194,label:`Tablet`},"tablet-landscape":{width:1194,height:834,label:`Tablet landscape`},laptop:{width:1280,height:800,label:`Laptop`},desktop:{width:1440,height:900,label:`Desktop`},wide:{width:1920,height:1080,label:`Wide`}};Object.keys(lO);var uO=e=>({"--x":e.x,"--y":e.y,"--w":e.w,"--h":e.h});function dO(e){let t=e.item;if(t.kind!==`screen`&&t.kind!==`url`)return``;let n=t.frame.device?lO[t.frame.device]?.label:void 0,r=`${t.frame.width} × ${t.frame.height===`auto`?`auto`:t.frame.height}`;return n?`${n} · ${r}`:r}var fO=(0,v.memo)(function({placed:e,store:t}){let n=e.item.id,r=c_(t,e=>e.selected===n),i=c_(t,e=>e.frames[n]?.errors.length??0);return(0,L.jsxs)(`div`,{"data-at":``,"data-label":n,style:uO(e),className:X(`frame-label pointer-events-auto flex cursor-default items-center gap-1.5 overflow-hidden pb-1.5 text-[12.5px] leading-none whitespace-nowrap select-none`,r?`text-ink`:`text-muted hover:text-ink2`),children:[i?(0,L.jsx)(`span`,{className:`size-[7px] shrink-0 rounded-full bg-danger`,title:`${i} errors`}):null,(0,L.jsx)(`span`,{className:X(`min-w-[3ch] truncate`,r?`font-semibold`:`font-medium`),children:e.item.title}),(0,L.jsx)(`span`,{className:`frame-device min-w-0 shrink-[20] truncate text-[11.5px] text-muted opacity-80`,children:dO(e)})]})});function pO({placed:e,kind:t}){return(0,L.jsx)(`div`,{"data-at":``,style:uO(e),className:X(`frame-outline rounded-[1px]`,t===`hover`?`outline outline-[1.5px] outline-action/60`:`outline-2 outline-action outline`)})}function mO({layout:e,view:t,store:n,overlayRef:r}){let i=c_(n,e=>e.selected),a=c_(n,e=>e.active),o=c_(n,e=>e.hovered),s=c_(n,e=>e.zoomTiny),c=(0,v.useMemo)(()=>e.items.filter(e=>YT(e.item)),[e]),l=(0,v.useMemo)(()=>{if(!t||s)return[];let{x:e,y:n,z:r,w:i,h:a}=t,o={x:-e/r-i/r,y:-n/r-a/r,w:i/r*3,h:a/r*3};return c.filter(e=>NT(e,o))},[c,t,s]),u=t=>t?e.items.find(e=>e.item.id===t):void 0,d=u(i),f=o&&o!==i?u(o):void 0;return(0,L.jsxs)(`div`,{ref:r,className:`canvas-overlay`,"data-tiny":s,children:[l.map(e=>(0,L.jsx)(fO,{placed:e,store:n},e.item.id)),f?(0,L.jsx)(pO,{placed:f,kind:`hover`}):null,d?(0,L.jsx)(pO,{placed:d,kind:a===i?`active`:`selected`}):null]})}var hO=12,gO=20,_O=110,vO=.2,yO=400,bO=.2,xO=3,SO=8e3,CO=14,wO=96;function TO({layout:e,theme:t,store:n,camera:r,events:i,capture:a,apiRef:o,onPlay:s,onSelect:c}){let l=(0,v.useRef)(null),u=(0,v.useRef)(null),d=(0,v.useRef)(null),f=(0,v.useRef)(null),[p,m]=(0,v.useState)(null),h=c_(n,e=>e.panning),g=c_(n,e=>e.selected),_=c_(n,e=>e.active),y=(0,v.useMemo)(()=>e.items.filter(e=>YT(e.item)),[e]);(0,v.useLayoutEffect)(()=>{let e=l.current,t=u.current,i=d.current,a,o,s=!1,c=0,p=()=>m({...r.camera,w:e.clientWidth,h:e.clientHeight,moving:s}),h=e=>{t.style.transform=`translate3d(${e.x}px, ${e.y}px, 0) scale(${e.z})`,s||(s=!0,t.classList.add(`moving`)),clearTimeout(a),a=setTimeout(()=>{s=!1,t.classList.remove(`moving`),p()},160);let r=f.current;r&&(r.style.setProperty(`--tx`,String(e.x)),r.style.setProperty(`--ty`,String(e.y)),r.style.setProperty(`--z`,String(e.z)));let l=24*e.z;for(;l<CO;)l*=4;for(;l>wO;)l/=4;l!==c&&(c=l,i.style.backgroundSize=`${l}px ${l}px`);let u=e=>((e+wO)%l+l)%l-l;i.style.transform=`translate3d(${u(e.x)}px, ${u(e.y)}px, 0)`;let d=e.z<.09;n.get().zoomTiny!==d&&n.set(e=>({...e,zoomTiny:d})),t.classList.toggle(`far`,e.z<.15),o??=setTimeout(()=>{o=void 0,p()},90)};h(r.camera),p();let g=r.subscribe(h),_=e.getBoundingClientRect().left,v=new ResizeObserver(()=>{let t=e.getBoundingClientRect().left;if(t!==_){let e=r.camera;r.set({...e,x:e.x-(t-_)}),_=t}p()});return v.observe(e),()=>{g(),v.disconnect(),clearTimeout(a),clearTimeout(o)}},[r,n]),(0,v.useEffect)(()=>{let t=l.current,n=()=>{let{w:n,h:i}={w:t.clientWidth,h:t.clientHeight},o=e.bounds,s=o.w&&n?Math.min((n-160)/o.w,(i-160)/Math.max(o.h,1)):1;r.minZoom=a?.01:Math.min(.25,Math.max(kT,s*.5))};n();let i=new ResizeObserver(n);return i.observe(t),()=>i.disconnect()},[r,e.bounds,a]),(0,v.useEffect)(()=>{let t=l.current,n=()=>({w:t.clientWidth,h:t.clientHeight});o.current={size:n,openView(){let{w:t,h:i}=n(),a=e.bounds;if(!a.w)return;if(Math.min((t-160)/a.w,(i-160)/Math.max(a.h,1))>=bO)return this.fitAll(!1);let o=e.sections[0]??a,s=Math.min(.5,Math.max(.25,(t-160)/Math.max(o.w,1)));r.set({z:s,x:80-a.x*s,y:80-a.y*s})},fitAll(t=!0){let{w:i,h:a}=n();if(!e.bounds.w)return;let o=MT(e.bounds,i,a,80,1,r.minZoom);t?r.animateTo(o):r.set(o)},fitItem(t,i=!0){let a=e.items.find(e=>e.item.id===t);if(!a)return;let{w:o,h:s}=n(),c=MT(a,o,s,64,1,r.minZoom);i?r.animateTo(c):r.set(c)},zoomBy(e){let{w:t,h:i}=n(),a=r.camera,o=a.z*e,s=(t/2-a.x)/a.z,c=(i/2-a.y)/a.z;r.animateTo({z:o,x:t/2-s*o,y:i/2-c*o},180)},zoomTo(e){let{w:t,h:i}=n(),a=r.camera,o=(t/2-a.x)/a.z,s=(i/2-a.y)/a.z;r.animateTo({z:e,x:t/2-o*e,y:i/2-s*e},220)}}},[o,r,e]);let b=(0,v.useRef)([]),x=(0,v.useRef)(new Map),[S,C]=(0,v.useState)(0),w=c_(n,e=>EO(e.frames)),T=(0,v.useMemo)(()=>{let e=new Map;if(a){for(let t of y)e.set(t.item.id,`live`);return e}if(!p)return e;let{x:t,y:n,z:r,w:i,h:o}=p,s={x:-t/r,y:-n/r,w:i/r,h:o/r},c={x:s.x-s.w*.25,y:s.y-s.h*.25,w:s.w*1.5,h:s.h*1.5},l=s.x+s.w/2,u=s.y+s.h/2,d=e=>Math.max(0,Math.min(e.x+e.w,s.x+s.w)-Math.max(e.x,s.x))*Math.max(0,Math.min(e.y+e.h,s.y+s.h)-Math.max(e.y,s.y)),f=e=>Math.hypot(e.x+e.w/2-l,e.y+e.h/2-u),m=y.filter(e=>r>=vO&&NT(e,c)&&e.w*r>=_O).sort((e,t)=>d(t)-d(e)||f(e)-f(t)).slice(0,hO).map(e=>e.item.id),h=[_,g].filter(e=>!!e),v=new Set(y.map(e=>e.item.id)),S=new Set(w.split(`
125
- `)),C=new Set(b.current),T=performance.now(),E=e=>!S.has(e)&&T-(x.current.get(e)??0)<SO,D=xO-[...C].filter(E).length,O=[];for(let e of new Set([...h,...m]))v.has(e)&&(C.has(e)?O.push(e):(h.includes(e)||!p.moving&&D>0)&&(O.push(e),x.current.set(e,T),D--));let k=[...new Set([...O,...b.current])].filter(e=>v.has(e)).slice(0,gO);b.current=k;for(let e of x.current.keys())k.includes(e)||x.current.delete(e);for(let t of k)e.set(t,O.includes(t)?`live`:`asleep`);return e},[p,y,_,g,a,w,S]);(0,v.useEffect)(()=>{let e=performance.now(),t=new Set(w.split(`
126
- `)),n=[...x.current].filter(([e])=>!t.has(e)).map(([,t])=>t+SO-e).filter(e=>e>0);if(!n.length)return;let r=setTimeout(()=>C(e=>e+1),Math.min(...n)+20);return()=>clearTimeout(r)},[T,w]);let E=(0,v.useRef)(null),D=(0,v.useRef)(new Map),O=(0,v.useRef)(null),k=(0,v.useRef)(!1),A=e=>{n.get().panning!==e&&n.set(t=>({...t,panning:e}))};(0,v.useEffect)(()=>{let e=e=>{e.code===`Space`&&!DO(e.target)&&(k.current=!0,l.current?.classList.add(`cursor-grab`),e.preventDefault())},t=e=>{e.code===`Space`&&(k.current=!1,l.current?.classList.remove(`cursor-grab`))};return window.addEventListener(`keydown`,e),window.addEventListener(`keyup`,t),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`keyup`,t)}},[]);let j=e=>{let t=e;return(t?.closest(`[data-shield]`))?.dataset.shield??(t?.closest(`[data-label]`))?.dataset.label??(t?.closest(`[data-item]`))?.dataset.item??null},ee=e=>{if(e.target.closest(`[data-ui]`)||e.button!==0&&e.button!==1)return;if(l.current.setPointerCapture(e.pointerId),D.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),r.interrupt(),D.current.size===2){let[e,t]=[...D.current.values()];O.current={dist:Math.hypot(e.x-t.x,e.y-t.y),midX:(e.x+t.x)/2,midY:(e.y+t.y)/2},E.current=null,A(!0);return}let t=e.button===1||k.current;E.current={id:t?null:j(e.target),startX:e.clientX,startY:e.clientY,lastX:e.clientX,lastY:e.clientY,moved:t},t&&A(!0)},te=e=>{if(D.current.has(e.pointerId)&&D.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),O.current&&D.current.size===2){let[e,t]=[...D.current.values()],n=Math.hypot(e.x-t.x,e.y-t.y),i=(e.x+t.x)/2,a=(e.y+t.y)/2,o=l.current.getBoundingClientRect();r.panBy(i-O.current.midX,a-O.current.midY),r.zoomAt(i-o.left,a-o.top,n/Math.max(O.current.dist,1)),O.current={dist:n,midX:i,midY:a};return}let t=E.current;if(!t){if(!n.get().panning){let t=j(e.target);n.get().hovered!==t&&n.set(e=>({...e,hovered:t}))}return}!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>3&&(t.moved=!0,A(!0)),t.moved&&r.panBy(e.clientX-t.lastX,e.clientY-t.lastY),t.lastX=e.clientX,t.lastY=e.clientY},ne=e=>{D.current.delete(e.pointerId),D.current.size<2&&(O.current=null);let t=E.current;E.current=null,t&&!t.moved&&c(t.id,{x:e.clientX,y:e.clientY}),D.current.size||A(!1)};(0,v.useEffect)(()=>{let e=l.current,t=t=>{if(t.target.closest(`[data-ui]`))return;t.preventDefault();let n=e.getBoundingClientRect(),i=t.deltaMode===1?16:t.deltaMode===2?n.height:1;if(t.ctrlKey||t.metaKey){let e=t.deltaY*i,a=Math.abs(e)<40?.012:.0025;r.zoomAt(t.clientX-n.left,t.clientY-n.top,Math.exp(-e*a))}else r.panBy(-t.deltaX*i,-t.deltaY*i)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[r]);let M=e.sections;return(0,L.jsxs)(`div`,{ref:l,className:X(`canvas-root relative h-full w-full touch-none overflow-hidden select-none`,h&&`canvas-panning cursor-grabbing`),onPointerDown:ee,onPointerMove:te,onPointerUp:ne,onPointerCancel:ne,onPointerLeave:()=>n.get().hovered&&n.set(e=>({...e,hovered:null})),onDoubleClick:t=>{let n=j(t.target),r=n?e.items.find(e=>e.item.id===n):void 0;r&&YT(r.item)&&s(r.item.id)},children:[(0,L.jsx)(`div`,{ref:d,className:`canvas-grid`}),(0,L.jsxs)(`div`,{ref:u,className:`canvas-world`,children:[M.map(e=>(0,L.jsx)(cO,{section:e.section,x:e.x,y:e.y,w:e.w,store:n},`section:${e.section.id}`)),e.items.map(e=>{let{item:r}=e;return r.kind===`screen`||r.kind===`url`?(0,L.jsx)(iO,{placed:e,mode:T.get(r.id)??`off`,thumb:!a&&!!p&&e.w*p.z*devicePixelRatio<=yO,theme:t,store:n,events:i,capture:a},r.id):r.kind===`note`?(0,L.jsx)(oO,{placed:e,store:n},r.id):(0,L.jsx)(sO,{placed:e,store:n},r.id)})]}),(0,L.jsx)(mO,{layout:e,view:p,store:n,overlayRef:f})]})}function EO(e){return Object.keys(e).filter(t=>e[t].ready).sort().join(`
127
- `)}function DO(e){let t=e;return!!t&&(t.isContentEditable||/^(input|textarea|select)$/i.test(t.tagName))}var OO=new URLSearchParams(window.location.search),kO=OO.has(`capture`),AO=(e,t)=>`foss-design.camera.${e}.${t}`;function jO(e){try{let t=JSON.parse(sessionStorage.getItem(e)??`null`);if(t&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.z))return t}catch{}return null}function MO(e){let t=__(),n=OO.get(`theme`),[r,i]=(0,v.useState)(n===`dark`||n===`light`?n:null);return[r??e?.theme??t,i]}function NO({canvasId:e,pageId:t}){let{data:n,error:r,isLoading:i}=e_(e);if(r)return(0,L.jsx)(OT,{title:`Canvas not found`,text:r.message});if(i||!n)return(0,L.jsx)(`div`,{className:`canvas-dots grow`});let a=t??OO.get(`page`)??void 0,o=n.pages.find(e=>e.id===a)??n.pages[0];return(0,L.jsx)(PO,{canvas:n,page:o},`${n.id}/${o?.id??``}`)}function PO({canvas:e,page:t}){let[,n]=P(),r=(0,v.useMemo)(()=>eE(),[]),i=(0,v.useMemo)(()=>new jT,[]),a=(0,v.useRef)(null),[o,s]=MO(e),[c,l]=(0,v.useState)(()=>!kO&&window.innerWidth>900),[u,d]=(0,v.useState)(!1),f=c_(r,e=>e.sizes),p=(0,v.useMemo)(()=>t?QT(t,f):{items:[],sections:[],bounds:{x:0,y:0,w:0,h:0}},[t,f]),m=RO(c_(r,e=>e.frameEls),p),h=qw(m),g=u||h;(0,v.useEffect)(()=>{r.set(e=>e.inspecting===g?e:{...e,inspecting:g,active:null})},[g,r]);let _=Kw(m,g,{onEscape:()=>d(!1)}),y=!!_.info;(0,v.useEffect)(()=>{y&&d(!0)},[y]),(0,v.useEffect)(()=>{let e=_.frame;if(!e)return;let t=Object.entries(r.get().frameEls).find(([,t])=>t===e)?.[0];t&&r.get().selected!==t&&r.set(e=>({...e,selected:t}))},[_.frame,r]);let b=(0,v.useMemo)(()=>$T(p),[p]),x=AO(e.id,t?.id??``),S=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(S.current||!p.bounds.w)return;S.current=!0;let t=o_(e.id),n=kO?null:jO(x);t?(r.set(e=>({...e,selected:t})),requestAnimationFrame(()=>a.current?.fitItem(t,!1))):n&&n.z>=i.minZoom?i.set(n):requestAnimationFrame(()=>kO?a.current?.fitAll(!1):a.current?.openView())},[p,i,x,e.id,r]),(0,v.useEffect)(()=>{if(kO)return;let e,t=i.subscribe(t=>{clearTimeout(e),e=setTimeout(()=>sessionStorage.setItem(x,JSON.stringify(t)),250)});return()=>{t(),clearTimeout(e)}},[i,x]);let C=(0,v.useCallback)(e=>{let t=e?p.items.find(t=>t.item.id===e)?.item:void 0;r.set(e=>({...e,selected:t?t.id:null,active:t&&YT(t)?t.id:null,hovered:null}))},[p,r]),w=(0,v.useCallback)(e=>{C(e),a.current?.fitItem(e)},[C]),T=(0,v.useCallback)(r=>n(`/c/${encodeURIComponent(e.id)}/play/${encodeURIComponent(r)}${t?`?page=${encodeURIComponent(t.id)}`:``}`),[e.id,t,n]),E=(0,v.useCallback)(()=>{let e=r.get().selected,t=e&&b.find(t=>t.item.id===e)||b[0];t&&T(t.item.id)},[r,b,T]);(0,v.useEffect)(()=>{let t=t=>{let n=t.detail;n.canvas===e.id&&p.items.some(e=>e.item.id===n.item)&&(o_(e.id),w(n.item))};return window.addEventListener(`design:focus`,t),()=>window.removeEventListener(`design:focus`,t)},[e.id,p,w]);let D=(0,v.useMemo)(()=>({onGo(r,i){let[a,o]=i.includes(`/`)?i.split(`/`):[null,i],s=a?e.pages.filter(e=>e.id===a):[t,...e.pages.filter(e=>e!==t)];for(let r of s)if(r&&r.sections.some(e=>e.items.some(e=>e.id===o))){r===t?w(o):(n(zT(e,r)),window.dispatchEvent(new CustomEvent(`design:focus`,{detail:{canvas:e.id,item:o}})));return}console.warn(`[design] go("${i}"): no such screen`)},onLink(t,n){Gw(n,e,e=>this.onGo(t,e),t)},onWheel(e,t){let n=e.closest(`.canvas-root`);if(!n)return;let r=n.getBoundingClientRect(),a=e.getBoundingClientRect(),o=i.camera.z;if(t.zoom){let e=Math.abs(t.deltaY)<40?.012:.0025;i.zoomAt(a.left-r.left+t.x*o,a.top-r.top+t.y*o,Math.exp(-t.deltaY*e))}else i.panBy(-t.deltaX,-t.deltaY)},onEscape(){r.set(e=>({...e,active:null}))}}),[e,t,i,r,w,n]);return(0,v.useEffect)(()=>{if(!kO)return;let e=Date.now(),t=setInterval(()=>{let n=r.get().frames;(b.every(e=>n[e.item.id]?.ready||e.item.kind===`screen`&&e.item.missing)||Date.now()-e>6e4)&&(clearInterval(t),a.current?.fitAll(!1),requestAnimationFrame(()=>requestAnimationFrame(()=>window.__DESIGN_CANVAS_READY__=!0)))},250);return()=>clearInterval(t)},[b,r]),(0,v.useEffect)(()=>{let i=i=>{if(DO(i.target)||document.querySelector(`[role="dialog"]`))return;let o=a.current,s=r.get(),c=i.metaKey||i.ctrlKey;if(i.key===`Escape`)_.info?_.select(null):u?d(!1):s.active?r.set(e=>({...e,active:null})):s.selected&&r.set(e=>({...e,selected:null}));else if(i.key===`i`&&!c&&!i.altKey)d(e=>!e);else if(i.key===`p`&&!c&&!i.altKey)E();else if(i.shiftKey&&i.code===`Digit1`)o?.fitAll();else if(i.shiftKey&&i.code===`Digit2`&&s.selected)o?.fitItem(s.selected);else if(i.shiftKey&&i.code===`Digit0`)o?.zoomTo(1);else if((i.key===`=`||i.key===`+`)&&!i.altKey)i.preventDefault(),o?.zoomBy(1.4);else if(i.key===`-`&&!i.altKey)i.preventDefault(),o?.zoomBy(1/1.4);else if(c&&i.key===`0`)i.preventDefault(),o?.zoomTo(1);else if(c&&i.key===`\\`)i.preventDefault(),l(e=>!e);else if([`ArrowRight`,`ArrowDown`,`ArrowLeft`,`ArrowUp`].includes(i.key)&&b.length){i.preventDefault();let e=b.findIndex(e=>e.item.id===s.selected),t=i.key===`ArrowRight`||i.key===`ArrowDown`?1:-1,n=b[e===-1?0:(e+t+b.length)%b.length];r.set(e=>({...e,selected:n.item.id,active:null})),o?.fitItem(n.item.id)}else if(i.key===`Enter`&&s.selected){let e=p.items.find(e=>e.item.id===s.selected)?.item;e&&YT(e)&&T(e.id)}else if(i.key===`]`||i.key===`[`){let r=t?e.pages.indexOf(t):-1,a=e.pages[r+(i.key===`]`?1:-1)];a&&n(zT(e,a))}};return window.addEventListener(`keydown`,i),()=>window.removeEventListener(`keydown`,i)},[r,b,p,T,E,e,t,n,u,_]),kO?(0,L.jsx)(`div`,{className:`flex h-dvh`,children:(0,L.jsx)(TO,{layout:p,theme:o,store:r,camera:i,events:D,capture:!0,apiRef:a,onPlay:()=>{},onSelect:()=>{}})}):(0,L.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,L.jsx)(VT,{canvas:e,page:t,theme:o,onTheme:s,sidebar:c,onSidebar:l,inspect:u,onInspect:d,onPlay:E,canPlay:b.length>0}),(0,L.jsxs)(`div`,{className:`flex min-h-0 grow basis-0`,children:[(0,L.jsx)(xT,{open:c&&!!t,side:`left`,width:264,children:t?(0,L.jsx)(BT,{canvas:e,page:t,store:r,onPick:w}):null}),(0,L.jsxs)(`div`,{className:`relative min-w-0 grow`,children:[t&&p.items.length?(0,L.jsx)(TO,{layout:p,theme:o,store:r,camera:i,events:D,capture:!1,apiRef:a,onPlay:T,onSelect:C}):(0,L.jsx)(`div`,{className:`canvas-dots flex h-full`,children:(0,L.jsx)(DT,{title:t?`This page is empty`:`This canvas has no pages`,text:(0,L.jsxs)(L.Fragment,{children:[`Add sections and screens to`,` `,(0,L.jsxs)(`code`,{className:`font-mono text-[13px]`,children:[`.design/canvas/`,e.id,`/canvas.json`]}),`.`]})})}),(0,L.jsx)(HT,{canvas:e,store:r,layoutItems:p.items.map(e=>e.item),theme:o,onPlay:T,inspect:g}),(0,L.jsx)(IO,{camera:i,apiRef:a}),e.issues.length?(0,L.jsx)(LO,{canvas:e}):null]}),(0,L.jsx)(xT,{open:u,side:`right`,width:320,children:(0,L.jsx)(rT,{info:_.info,active:!0,onSelect:e=>_.select(e),onClose:()=>{d(!1),_.select(null)}})})]})]})}function FO({camera:e}){let[t,n]=(0,v.useState)(e.camera.z);return(0,v.useEffect)(()=>{let t=0;return e.subscribe(e=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>n(e.z))})},[e]),(0,L.jsxs)(L.Fragment,{children:[Math.round(t*100),`%`]})}function IO({camera:e,apiRef:t}){return(0,L.jsxs)(`div`,{"data-ui":!0,className:`absolute right-4 bottom-5 z-20 flex h-[46px] items-center gap-0.5 rounded-[10px] border border-rule bg-surface px-1.5 shadow-pop`,children:[(0,L.jsx)(ix,{icon:`zoom-out`,label:`Zoom out (−)`,onClick:()=>t.current?.zoomBy(1/1.4)}),(0,L.jsxs)(MC,{side:`top`,align:`end`,width:210,trigger:(0,L.jsx)(`button`,{type:`button`,className:`h-ctrl min-w-[56px] cursor-pointer rounded-[6px] border-0 bg-transparent px-1.5 text-[12.5px] font-medium text-ink2 tabular hover:bg-soft2`,children:(0,L.jsx)(FO,{camera:e})}),children:[(0,L.jsx)(PC,{onSelect:()=>t.current?.fitAll(),hint:`⇧1`,children:`Zoom to fit`}),(0,L.jsx)(PC,{onSelect:()=>t.current?.zoomTo(1),hint:`⇧0`,children:`100%`}),(0,L.jsx)(FC,{}),[.25,.5,2].map(e=>(0,L.jsxs)(PC,{onSelect:()=>t.current?.zoomTo(e),children:[e*100,`%`]},e))]}),(0,L.jsx)(ix,{icon:`zoom-in`,label:`Zoom in (+)`,onClick:()=>t.current?.zoomBy(1.4)}),(0,L.jsx)(`div`,{className:`mx-0.5 h-5 w-px bg-rule`}),(0,L.jsx)(ix,{icon:`fit`,label:`Zoom to fit (⇧1)`,onClick:()=>t.current?.fitAll()})]})}function LO({canvas:e}){let t=e.issues.filter(e=>e.severity===`error`).length;return(0,L.jsxs)(yw,{children:[(0,L.jsx)(bw,{asChild:!0,children:(0,L.jsxs)(`button`,{type:`button`,"data-ui":!0,className:`absolute bottom-5 left-4 z-20 flex h-[46px] cursor-pointer items-center gap-2 rounded-[10px] border border-rule bg-surface px-3.5 text-[13px] font-medium shadow-pop hover:bg-soft`,children:[(0,L.jsx)(Z,{name:`alert`,size:15,className:t?`text-danger-text`:`text-action`}),e.issues.length,` `,e.issues.length===1?`problem`:`problems`,` in canvas.json`]})}),(0,L.jsx)(xw,{children:(0,L.jsx)(Sw,{side:`top`,align:`start`,sideOffset:8,collisionPadding:12,className:`z-50 max-h-[50vh] w-[460px] max-w-[calc(100vw-24px)] overflow-y-auto rounded-[10px] border border-rule bg-surface shadow-pop outline-none data-[state=open]:animate-[q-pop_120ms_ease-out]`,children:(0,L.jsx)(vT,{issues:e.issues})})})]})}function RO(e,t){let n=(0,v.useRef)([]);return(0,v.useMemo)(()=>{let r=new Set(t.items.filter(e=>e.item.kind===`screen`).map(e=>e.item.id)),i=Object.entries(e).filter(e=>!!e[1]&&r.has(e[0])).map(([,e])=>e);return i.length===n.current.length&&i.every((e,t)=>e===n.current[t])||(n.current=i),n.current},[e,t])}function zO({open:e,onOpenChange:t,title:n,children:r}){return(0,L.jsx)(mg,{open:e,onOpenChange:t,children:(0,L.jsx)($u,{children:e?(0,L.jsxs)(vg,{forceMount:!0,children:[(0,L.jsx)(bg,{asChild:!0,forceMount:!0,children:(0,L.jsx)(Wf.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},className:`fixed inset-0 z-50 bg-overlay`})}),(0,L.jsx)(wg,{asChild:!0,forceMount:!0,"aria-describedby":void 0,children:(0,L.jsxs)(Wf.div,{initial:{y:`100%`},animate:{y:0},exit:{y:`100%`,transition:{duration:.18,ease:`easeIn`}},transition:{type:`spring`,stiffness:420,damping:40},className:`fixed inset-x-0 bottom-0 z-50 flex max-h-[82dvh] flex-col rounded-t-[14px] border-t border-rule bg-surface pb-[env(safe-area-inset-bottom)] shadow-pop outline-none`,children:[(0,L.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,L.jsx)(`span`,{"aria-hidden":!0,className:`h-1 w-9 rounded-full bg-rule-strong`})}),(0,L.jsxs)(`div`,{className:`flex min-h-[48px] items-center justify-between gap-3 pr-2 pl-4`,children:[(0,L.jsx)(kg,{className:`m-0 truncate text-[15px] font-semibold`,children:n}),(0,L.jsx)(jg,{asChild:!0,children:(0,L.jsx)(ix,{icon:`x`,label:`Close`})})]}),(0,L.jsx)(`div`,{className:`min-h-0 overflow-y-auto overscroll-contain border-t border-rule`,children:r})]})})]}):null})})}function BO(e,t){return(t?e.pages.filter(e=>e.id===t):e.pages).flatMap(t=>t.sections.flatMap(n=>n.items.filter(e=>e.kind===`screen`||e.kind===`url`).map(r=>({item:r,pageId:t.id,where:[e.pages.length>1?t.title:null,n.title].filter(Boolean).join(` · `)}))))}var VO=(e,t,n)=>`/c/${encodeURIComponent(e)}/play/${encodeURIComponent(t)}?page=${encodeURIComponent(n)}`;function HO({canvasId:e,itemId:t}){let{data:n,error:r,isLoading:i}=e_(e);return r?(0,L.jsx)(OT,{title:`Canvas not found`,text:r.message}):i||!n?null:(0,L.jsx)(UO,{canvas:n,itemId:t})}function UO({canvas:e,itemId:t}){let[,n]=P(),{frameSandbox:r,slots:i}=Xg(),a=new URLSearchParams(window.location.search).get(`page`)??(window.location.hash.split(`?`)[1]?new URLSearchParams(window.location.hash.split(`?`)[1]).get(`page`):null),o=(0,v.useMemo)(()=>BO(e,null),[e]),s=o.find(e=>e.item.id===t),c=a??s?.pageId??null,l=(0,v.useMemo)(()=>c?BO(e,c):o,[e,c,o]),u=l.findIndex(e=>e.item.id===t),d=__(),[f,p]=(0,v.useState)(e.theme??d),[m,h]=(0,v.useState)(`fit`),g=(0,v.useRef)(null),_=(0,v.useRef)(null),[y,b]=(0,v.useState)(null),x=(0,v.useCallback)(e=>{_.current=e,b(e)},[]),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)({w:0,h:0}),[E,D]=(0,v.useState)([]),O=c?`/c/${encodeURIComponent(e.id)}/p/${encodeURIComponent(c)}`:`/c/${encodeURIComponent(e.id)}`,k=t=>{if(!l.length)return;let r=l[(u+t+l.length)%l.length];n(VO(e.id,r.item.id,r.pageId),{replace:!0})};(0,v.useLayoutEffect)(()=>{let e=g.current;if(!e)return;let t=new ResizeObserver(()=>T({w:e.clientWidth,h:e.clientHeight}));return t.observe(e),()=>t.disconnect()},[]),(0,v.useEffect)(()=>{let e=e=>{DO(e.target)||document.querySelector(`[role="dialog"]`)||(e.key===`ArrowRight`?k(1):e.key===`ArrowLeft`?k(-1):e.key===`i`&&!e.metaKey&&!e.ctrlKey&&!e.altKey?C(e=>!e):e.key===`Escape`&&(N.info?N.select(null):S?C(!1):n(O)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});let A=l[u],j=A?.item,ee=j?.kind===`screen`?j.theme??f:f,te=IT(e.id,j,ee),[ne]=(0,v.useState)(ee),M=j?j.kind===`screen`?Uw(j.url,ne):j.url:``,re=(0,v.useMemo)(()=>y&&j?.kind===`screen`?[y]:[],[y,j?.kind]),ie=qw(re),N=Kw(re,S||ie,{onEscape:()=>C(!1)}),ae=!!N.info;if((0,v.useEffect)(()=>{ae&&C(!0)},[ae]),(0,v.useEffect)(()=>{let t=_.current;if(t&&j?.kind===`screen`)return D([]),Lw(t,t=>{if(t.type===`error`)D(e=>e.includes(t.message)?e:[...e,t.message]);else if(t.type===`updated`)D([]);else if(t.type===`keydown`&&t.code===`Escape`)n(O);else if(t.type===`go`){let[r,i]=t.target.includes(`/`)?t.target.split(`/`):[null,t.target],a=o.find(e=>e.item.id===i&&(!r||e.pageId===r));a&&n(VO(e.id,a.item.id,a.pageId))}else t.type===`link`&&Gw(t,e,t=>{let r=o.find(e=>e.item.id===t);r&&n(VO(e.id,r.item.id,r.pageId))},j?.id)})},[j,M,o,e.id,n,O]),(0,v.useEffect)(()=>{j?.kind===`screen`&&Bw(_.current,ee)},[ee,j]),!j)return(0,L.jsx)(OT,{title:`Screen not found`,text:`No screen "${t}" on this canvas.`});let oe=j.frame.width,se=j.frame.height===`auto`?Math.max(w.h-48,400):j.frame.height,ce=m===`fit`?Math.min(1,(w.w-48)/oe,(w.h-48)/se):1,le=oe<=w.w-48&&se<=w.h-48;return(0,L.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,L.jsxs)(VC,{children:[i.barStart,(0,L.jsx)(Yb,{content:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Back to canvas `,(0,L.jsx)(y_,{children:`esc`})]}),children:(0,L.jsx)(be,{href:O,className:`inline-flex h-ctrl w-ctrl items-center justify-center rounded-[6px] text-muted hover:bg-soft2 hover:text-ink2`,"aria-label":`Back to canvas`,children:(0,L.jsx)(Z,{name:`arrow-left`,size:16})})}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col leading-tight`,children:[(0,L.jsx)(`span`,{className:`truncate text-[14px] font-semibold`,children:j.title}),(0,L.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:[e.title,A.where].filter(Boolean).join(` · `)})]}),(0,L.jsxs)(`div`,{className:`mx-auto flex items-center gap-1`,children:[(0,L.jsx)(ix,{icon:`chevron-left`,label:`Previous screen (←)`,onClick:()=>k(-1),disabled:l.length<2}),(0,L.jsxs)(`span`,{className:`min-w-[52px] text-center text-[12.5px] text-muted tabular`,children:[u+1,` / `,l.length]}),(0,L.jsx)(ix,{icon:`chevron-right`,label:`Next screen (→)`,onClick:()=>k(1),disabled:l.length<2})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[le?null:(0,L.jsx)(PT,{label:`Scale`,value:m,onChange:h,items:[{value:`fit`,label:`Fit`},{value:`actual`,label:`100%`}]}),j.kind===`screen`&&!j.theme?(0,L.jsx)(PT,{label:`Screen theme`,value:f,onChange:p,items:[{value:`light`,label:(0,L.jsx)(Z,{name:`sun`,size:15}),title:`Light`},{value:`dark`,label:(0,L.jsx)(Z,{name:`moon`,size:15}),title:`Dark`}]}):null,j.kind===`screen`?(0,L.jsx)(UT,{on:S,onChange:C}):null,(0,L.jsx)(ix,{icon:`refresh`,label:`Reload`,onClick:()=>Vw(_.current)}),te?(0,L.jsx)(`a`,{href:te,target:`_blank`,rel:`noreferrer`,title:`Open in a new tab`,className:`inline-flex h-ctrl w-ctrl items-center justify-center rounded-[6px] text-muted hover:bg-soft2 hover:text-ink2`,children:(0,L.jsx)(Z,{name:`external`,size:16})}):null,(0,L.jsx)(RC,{}),i.barEnd]})]}),i.belowBar?(0,L.jsx)(`div`,{className:`shrink-0`,children:i.belowBar}):null,(0,L.jsxs)(`div`,{className:`flex min-h-0 grow basis-0`,children:[(0,L.jsxs)(`div`,{ref:g,className:`canvas-dots relative min-w-0 grow overscroll-none ${m===`actual`?`overflow-auto`:`overflow-hidden`}`,children:[E.length?(0,L.jsxs)(`div`,{className:`absolute inset-x-0 top-0 z-10 flex items-start gap-2 border-b border-rule bg-danger-soft px-4 py-2 font-mono text-[12px] whitespace-pre-wrap text-danger-text`,children:[(0,L.jsx)(Z,{name:`alert`,size:14,className:`mt-px`}),E.join(`
128
- `)]}):null,(0,L.jsx)(`div`,{className:`flex min-h-full min-w-full items-center justify-center p-6`,style:{width:m===`actual`?oe+48:void 0},children:(0,L.jsx)(`div`,{className:`shrink-0 overflow-hidden bg-surface`,style:{width:oe*ce,height:se*ce,boxShadow:`var(--shadow-frame), 0 0 0 1px var(--rule)`},children:(0,L.jsx)(`iframe`,{ref:x,src:M,title:j.title,allow:`clipboard-read; clipboard-write; fullscreen`,sandbox:r,className:`block border-0`,style:{width:oe,height:se,transform:`scale(${ce})`,transformOrigin:`0 0`,colorScheme:ee},onLoad:()=>j.kind===`screen`&&Bw(_.current,ee)},`${j.id}:${j.kind===`screen`?j.rev:j.url}`)})})]}),(0,L.jsx)(xT,{open:S,side:`right`,width:320,children:(0,L.jsx)(rT,{info:N.info,active:!0,onSelect:e=>N.select(e),onClose:()=>{C(!1),N.select(null)}})})]})]})}var WO=12;function GO({canvasId:e,pageId:t,itemId:n}){let{data:r,error:i,isLoading:a}=e_(e);return i?(0,L.jsx)(OT,{title:`Canvas not found`,text:i.message}):a||!r?(0,L.jsx)(`div`,{className:`canvas-dots h-dvh`}):(0,L.jsx)(KO,{canvas:r,pageId:t,itemId:n})}function KO({canvas:e,pageId:t,itemId:n}){let[,r]=P(),{frameSandbox:i,slots:a,scope:o}=Xg(),s=__(),c=(0,v.useMemo)(()=>BO(e,null),[e]),l=Math.max(0,n?c.findIndex(e=>e.item.id===n):t?c.findIndex(e=>e.pageId===t):0),u=c[l],d=u?.item,[f,p]=(0,v.useState)(e.theme??s),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)([]),[y,b]=(0,v.useState)(0),[x,S]=(0,v.useState)(null),[C,w]=(0,v.useState)(0),[T,E]=(0,v.useState)(!1),D=(0,v.useRef)(null),O=(0,v.useRef)(null),[k,A]=(0,v.useState)(null),j=(0,v.useCallback)(e=>{e&&(O.current=e,A(e))},[]),ee=(0,v.useCallback)((t,n=0)=>{w(n),r(VO(e.id,t.item.id,t.pageId),{replace:!0})},[e.id,r]),te=e=>{c.length<2||ee(c[(l+e+c.length)%c.length],e)},ne=e=>{let t=c.find(t=>t.item.id===e);t&&ee(t,c.indexOf(t)>l?1:-1)};(0,v.useLayoutEffect)(()=>{let e=D.current;if(!e)return;let t=new ResizeObserver(()=>b(e.clientWidth));return t.observe(e),()=>t.disconnect()},[]);let M=d?.kind===`screen`?d.theme??f:f,[re]=(0,v.useState)(M),ie=d?d.kind===`screen`?Uw(d.url,re):d.url:``,N=IT(e.id,d,M);(0,v.useEffect)(()=>{_([]),S(d?.kind===`screen`?d.measuredHeight??null:null),D.current?.scrollTo({top:0});let t=O.current;if(t&&d?.kind===`screen`)return Lw(t,t=>{t.type===`size`?S(t.height):t.type===`error`?_(e=>e.includes(t.message)?e:[...e,t.message]):t.type===`updated`?_([]):t.type===`go`?ne(t.target.includes(`/`)?t.target.split(`/`)[1]:t.target):t.type===`link`&&Gw(t,e,ne,d.id)})},[k,ie]),(0,v.useEffect)(()=>{d?.kind===`screen`&&Bw(O.current,M)},[M,d]),(0,v.useEffect)(()=>{let e=e=>{document.querySelector(`[role="dialog"]`)||(e.key===`ArrowRight`?te(1):e.key===`ArrowLeft`&&te(-1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});let ae=(0,v.useRef)(null),oe=e=>{let t=e.touches[0];ae.current=t?{x:t.clientX,y:t.clientY}:null},se=e=>{let t=ae.current,n=e.changedTouches[0];if(ae.current=null,!t||!n)return;let r=n.clientX-t.x,i=n.clientY-t.y;Math.abs(r)>56&&Math.abs(r)>Math.abs(i)*1.5&&te(r<0?1:-1)};if(!d||!u)return(0,L.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,L.jsx)(JO,{canvas:e,title:e.title,sub:null}),(0,L.jsx)(OT,{title:`No screens here`,text:`This canvas has no screens to show yet.`})]});let ce=d.frame.width,le=y?Math.min(1,(y-24)/ce):0,ue=le>0&&le<.8,de=ue&&T?1:le,fe=d.frame.height===`auto`?Math.max(x??0,480):d.frame.height,pe=d.kind===`screen`&&!d.theme;return(0,L.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,L.jsx)(JO,{canvas:e,title:d.title||d.id,sub:[e.title,u.where].filter(Boolean).join(` · `),back:o?void 0:`/`,end:(0,L.jsxs)(L.Fragment,{children:[ue?(0,L.jsx)(ix,{icon:T?`zoom-out`:`zoom-in`,label:T?`Fit to width`:`Actual size`,onClick:()=>E(e=>!e)}):null,(0,L.jsxs)(MC,{align:`end`,width:220,trigger:(0,L.jsx)(ix,{icon:`more`,label:`Screen options`}),children:[pe?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(IC,{children:`Screen theme`}),(0,L.jsx)(qO,{value:`light`,current:f,onPick:p}),(0,L.jsx)(qO,{value:`dark`,current:f,onPick:p}),(0,L.jsx)(FC,{})]}):null,(0,L.jsxs)(PC,{onSelect:()=>Vw(O.current),children:[(0,L.jsx)(Z,{name:`refresh`,size:15,className:`text-ink2`}),`Reload screen`]}),N?(0,L.jsxs)(PC,{onSelect:()=>window.open(N,`_blank`,`noopener`),children:[(0,L.jsx)(Z,{name:`external`,size:15,className:`text-ink2`}),`Open in a new tab`]}):null,(0,L.jsxs)(PC,{onSelect:()=>h_(s===`dark`?`light`:`dark`),children:[(0,L.jsx)(Z,{name:s===`dark`?`sun`:`moon`,size:15,className:`text-ink2`}),s===`dark`?`Light appearance`:`Dark appearance`]})]}),a.barEnd]})}),a.belowBar?(0,L.jsx)(`div`,{className:`shrink-0`,children:a.belowBar}):null,(0,L.jsxs)(`div`,{ref:D,onTouchStart:oe,onTouchEnd:se,className:X(`canvas-dots relative min-h-0 grow overflow-y-auto overscroll-contain`,ue&&T?`overflow-x-auto`:`overflow-x-hidden`),children:[g.length?(0,L.jsxs)(`div`,{className:`sticky top-0 z-10 flex items-start gap-2 border-b border-rule bg-danger-soft px-4 py-2 font-mono text-[12px] whitespace-pre-wrap text-danger-text`,children:[(0,L.jsx)(Z,{name:`alert`,size:14,className:`mt-px shrink-0`}),(0,L.jsx)(`span`,{className:`min-w-0 break-words`,children:g.join(`
129
- `)})]}):null,(0,L.jsx)($u,{initial:!1,mode:`popLayout`,custom:C,children:(0,L.jsx)(Wf.div,{custom:C,initial:{opacity:0,x:C*40},animate:{opacity:1,x:0},exit:{opacity:0,x:C*-40,transition:{duration:.12}},transition:{type:`spring`,stiffness:420,damping:38},className:X(`flex`,ue&&T?`w-max`:`justify-center`),style:{padding:WO},children:de?(0,L.jsx)(`div`,{className:`shrink-0 overflow-hidden rounded-[6px] bg-surface`,style:{width:ce*de,height:fe*de,boxShadow:`var(--shadow-frame), 0 0 0 1px var(--rule)`},children:(0,L.jsx)(`iframe`,{ref:j,src:ie,title:d.title,allow:`clipboard-read; clipboard-write; fullscreen`,sandbox:i,className:`block border-0`,style:{width:ce,height:fe,transform:`scale(${de})`,transformOrigin:`0 0`,colorScheme:M},onLoad:()=>d.kind===`screen`&&Bw(O.current,M)},`${d.id}:${d.kind===`screen`?d.rev:d.url}`)}):null},d.id)})]}),(0,L.jsxs)(`nav`,{"aria-label":`Screens`,className:`flex shrink-0 items-center gap-1 border-t border-rule bg-surface px-2 pt-1.5 pb-[max(6px,env(safe-area-inset-bottom))]`,children:[(0,L.jsx)(ix,{icon:`chevron-left`,label:`Previous screen`,onClick:()=>te(-1),disabled:c.length<2}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>h(!0),className:`flex h-10 min-w-0 grow cursor-pointer items-center justify-center gap-2 rounded-[8px] border-0 bg-transparent px-3 text-[13.5px] text-ink active:bg-soft2`,children:[(0,L.jsx)(Z,{name:`list`,size:15,className:`shrink-0 text-muted`}),(0,L.jsxs)(`span`,{className:`tabular shrink-0 text-muted`,children:[l+1,` / `,c.length]}),(0,L.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:d.title||d.id})]}),(0,L.jsx)(ix,{icon:`chevron-right`,label:`Next screen`,onClick:()=>te(1),disabled:c.length<2})]}),(0,L.jsx)(zO,{open:m,onOpenChange:h,title:e.title,children:(0,L.jsx)(XO,{canvas:e,current:d.id,onPick:e=>{h(!1),ne(e)}})})]})}function qO({value:e,current:t,onPick:n}){return(0,L.jsxs)(PC,{active:t===e,onSelect:()=>n(e),children:[(0,L.jsx)(Z,{name:e===`dark`?`moon`:`sun`,size:15,className:`text-ink2`}),e===`dark`?`Dark`:`Light`,t===e?(0,L.jsx)(Z,{name:`check`,size:15,className:`ml-auto text-ink2`}):null]})}function JO({canvas:e,title:t,sub:n,back:r,end:i}){let{slots:a}=Xg();return(0,L.jsxs)(`header`,{className:`flex h-[52px] shrink-0 items-center gap-2 border-b border-rule bg-surface pr-2 pl-2 pt-[env(safe-area-inset-top)]`,children:[a.barStart,r?(0,L.jsx)(be,{href:r,"aria-label":`All canvases, leaving ${e.title}`,className:`inline-flex size-10 shrink-0 items-center justify-center rounded-[8px] text-ink2 active:bg-soft2`,children:(0,L.jsx)(Z,{name:`arrow-left`,size:18})}):(0,L.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center`,children:(0,L.jsx)(zC,{})}),(0,L.jsxs)(`div`,{className:`flex min-w-0 grow flex-col leading-tight`,children:[(0,L.jsx)(`span`,{className:`truncate text-[14.5px] font-semibold`,children:t}),n?(0,L.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:n}):null]}),(0,L.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:i})]})}var YO=e=>e.item.kind===`url`?`globe`:e.item.frame.device===`phone`?`smartphone`:e.item.frame.device===`tablet`?`tablet`:`monitor`;function XO({canvas:e,current:t,onPick:n}){let r=(0,v.useRef)(null);(0,v.useEffect)(()=>{r.current?.scrollIntoView({block:`center`})},[]);let i=e.pages.length>1;return(0,L.jsx)(`div`,{className:`flex flex-col pb-2`,children:e.pages.map(a=>{let o=BO(e,a.id);return o.length?(0,L.jsxs)(`section`,{className:`flex flex-col`,children:[i?(0,L.jsx)(`h3`,{className:`sticky top-0 z-[1] m-0 border-b border-rule bg-soft px-4 py-2 text-[12px] font-semibold text-ink2`,children:a.title}):null,a.sections.map(e=>{let i=o.filter(t=>e.items.includes(t.item));return i.length?(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[e.title?(0,L.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:e.title}):null,i.map(e=>{let i=e.item.id===t;return(0,L.jsxs)(`button`,{ref:i?r:void 0,type:`button`,"aria-current":i?`true`:void 0,onClick:()=>n(e.item.id),className:X(`flex min-h-[48px] cursor-pointer items-center gap-3 border-0 bg-transparent px-4 text-left text-[14px] active:bg-soft2`,i?`font-medium text-ink`:`text-ink2`),children:[(0,L.jsx)(`span`,{className:X(`flex size-8 shrink-0 items-center justify-center rounded-[8px]`,i?`bg-action-soft text-action`:`bg-soft2 text-muted`),children:(0,L.jsx)(Z,{name:YO(e),size:15})}),(0,L.jsx)(`span`,{className:`min-w-0 grow truncate`,children:e.item.title||e.item.id}),i?(0,L.jsx)(Z,{name:`check`,size:16,className:`shrink-0 text-action`}):null]},e.item.id)})]},e.id):null})]},a.id):null})})}var ZO=[[`year`,31536e3],[`month`,2592e3],[`week`,604800],[`day`,86400],[`hour`,3600],[`minute`,60]],QO=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`});function $O(e){if(!e)return``;let t=(e-Date.now())/1e3;for(let[e,n]of ZO)if(Math.abs(t)>=n)return QO.format(Math.round(t/n),e);return`just now`}function ek(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(+(e<10240))} KB`:`${(e/1024/1024).toFixed(1)} MB`}function tk(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function nk({className:e,style:t}){return(0,L.jsx)(`span`,{"aria-hidden":`true`,className:X(`block animate-pulse rounded-[6px] bg-soft2`,e),style:t})}function rk({rows:e=3,lead:t=28,minH:n=56}){return(0,L.jsx)(`div`,{role:`status`,"aria-label":`Loading`,children:Array.from({length:e},(e,r)=>(0,L.jsxs)(`div`,{className:`flex items-center gap-3 border-t border-rule px-4`,style:{minHeight:n,opacity:1-r*.18},children:[t?(0,L.jsx)(nk,{style:{width:t,height:Math.min(t,n-20)}}):null,(0,L.jsxs)(`span`,{className:`flex min-w-0 grow flex-col gap-1.5`,children:[(0,L.jsx)(nk,{className:`h-3 w-[38%]`}),(0,L.jsx)(nk,{className:`h-2.5 w-[62%]`})]}),(0,L.jsx)(nk,{className:`h-3 w-14`})]},r))})}function ik({canvas:e}){return(0,L.jsx)(`div`,{className:`flex h-[54px] w-[86px] shrink-0 items-center justify-center overflow-hidden rounded-[6px] border border-rule bg-soft`,children:e.cover?(0,L.jsx)(`img`,{src:e.cover,alt:``,className:`h-full w-full object-cover object-top`}):(0,L.jsx)(Z,{name:`canvas`,size:18,className:`text-muted`})})}function ak({src:e}){return(0,L.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-[6px] border border-rule bg-soft`,children:(0,L.jsx)(`img`,{src:e,alt:``,className:`size-full object-contain`})})}function ok({project:e}){let{source:t,keys:n}=Xg(),r=Ne(),i=(0,v.useRef)(null);if(!t.setIcon||e.static)return null;let a=async e=>{try{await t.setIcon(e),await r.invalidateQueries({queryKey:n.project}),Tw(e?`Icon set`:`Icon removed`,e?`Saved as .design/icon; a linked project takes it to the cloud on its next push or pull.`:void 0)}catch(e){Tw(`Could not change the icon`,e.message,`error`)}};return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`input`,{ref:i,type:`file`,accept:`.svg,.png,.webp,image/svg+xml,image/png,image/webp`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&a(t)}}),(0,L.jsxs)(MC,{trigger:(0,L.jsx)(tx,{children:`Icon`}),align:`end`,width:240,children:[(0,L.jsxs)(PC,{onSelect:()=>i.current?.click(),hint:`≤ 256 KB`,children:[(0,L.jsx)(Z,{name:`upload`,size:15}),e.icon?`Replace icon`:`Upload icon`]}),e.icon?(0,L.jsxs)(PC,{danger:!0,onSelect:()=>void a(null),children:[(0,L.jsx)(Z,{name:`trash`,size:15}),`Remove icon`]}):null]})]})}function sk({actions:e,children:t}){return e?(0,L.jsxs)(`div`,{className:`grid items-center border-t border-rule transition-colors hover:bg-soft`,style:{gridTemplateColumns:`minmax(0,1fr) auto`},children:[t,(0,L.jsx)(`div`,{className:`flex items-center gap-2 pr-4`,children:e})]}):t}function ck({children:e}){return e?(0,L.jsx)(`div`,{className:`flex items-center gap-2.5 border-t border-rule bg-soft px-4 py-3 text-[12.5px] text-muted`,children:e}):null}function lk({project:e}){let{canvasRowActions:t,canvasesFoot:n}=Xg().slots,r=XC();return e.canvases.length?(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Canvases`,count:e.canvases.length}),e.canvases.map(e=>{let n=t?.(e.id);return(0,L.jsx)(sk,{actions:n,children:r?(0,L.jsxs)(hT,{to:`/c/${encodeURIComponent(e.id)}`,cols:`86px minmax(0,1fr)`,align:`ll`,pad:`10px 16px`,minH:74,first:!!n,children:[(0,L.jsx)(ik,{canvas:e}),(0,L.jsx)(b_,{top:e.title,bottom:(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[e.issues?(0,L.jsx)(aT,{tone:`danger`,children:tk(e.issues,`problem`)}):null,(0,L.jsxs)(`span`,{className:`truncate`,children:[tk(e.screens,`screen`),` · `,$O(e.updatedAt)]})]})})]}):(0,L.jsxs)(hT,{to:`/c/${encodeURIComponent(e.id)}`,cols:`86px minmax(0,1fr) auto auto`,align:`llrr`,pad:`10px 16px`,minH:74,first:!!n,children:[(0,L.jsx)(ik,{canvas:e}),(0,L.jsx)(b_,{top:e.title,bottom:(0,L.jsx)(`span`,{className:`truncate`,children:e.description??e.id})}),(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-[12.5px] whitespace-nowrap text-muted`,children:[e.issues?(0,L.jsx)(aT,{tone:`danger`,children:tk(e.issues,`problem`)}):null,tk(e.screens,`screen`),` · `,tk(e.pages,`page`)]}),(0,L.jsx)(`span`,{className:`w-[92px] text-[12.5px] whitespace-nowrap text-muted`,children:$O(e.updatedAt)})]})},e.id)}),(0,L.jsx)(ck,{children:n})]}):(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Canvases`,count:0}),(0,L.jsx)(_T,{children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 py-6 text-center`,children:[(0,L.jsx)(`span`,{className:`text-[14px] text-ink2`,children:`No canvases yet.`}),(0,L.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`Ask your agent to design something, or run `,(0,L.jsx)(Q,{children:`design new <name>`}),` in the project.`]})]})}),(0,L.jsx)(ck,{children:n})]})}function uk({project:e}){let t=e.system;return t?(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Design system`,right:(0,L.jsx)(ax,{to:`/system`,children:`Open`})}),(0,L.jsxs)(_T,{gap:6,children:[(0,L.jsx)(`span`,{className:`text-[15px] font-semibold`,children:t.name}),t.description?(0,L.jsx)(`span`,{className:`text-[13px] text-ink2`,children:t.description}):null]}),(0,L.jsx)(gT,{label:`Tokens`,labelWidth:120,end:!0,children:(0,L.jsx)(oT,{value:t.tokens})}),(0,L.jsx)(gT,{label:`Components`,labelWidth:120,end:!0,children:(0,L.jsx)(oT,{value:t.components})}),(0,L.jsx)(gT,{label:`Guidelines`,labelWidth:120,end:!0,children:(0,L.jsx)(oT,{value:t.guidelines})}),t.issues?(0,L.jsx)(gT,{label:`Problems`,labelWidth:120,end:!0,children:(0,L.jsx)(aT,{tone:`danger`,children:t.issues})}):null]}):(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Design system`}),(0,L.jsx)(_T,{children:(0,L.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`No design system yet. Ask your agent to build one from the codebase, or run `,(0,L.jsx)(Q,{children:`design system init`}),`.`]})})]})}function dk(){return(0,L.jsxs)(ST,{children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-2.5 pt-1 pb-1`,children:[(0,L.jsx)(nk,{className:`h-6 w-[220px]`}),(0,L.jsx)(nk,{className:`h-3.5 w-[300px]`})]}),(0,L.jsxs)(`div`,{className:`grid items-start gap-5 max-lg:grid-cols-1!`,style:{gridTemplateColumns:`minmax(0,1fr) 340px`},children:[(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Canvases`}),(0,L.jsx)(rk,{rows:3,lead:86,minH:74})]}),(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Design system`}),(0,L.jsx)(rk,{rows:3,lead:0,minH:40})]})]})]})}function fk(){let{data:e,error:t,isLoading:n}=$g(),{slots:r}=Xg(),i=XC();return t?(0,L.jsx)(DT,{title:`Could not load the project`,text:t.message}):n||!e?(0,L.jsx)(dk,{}):(0,L.jsxs)(ST,{children:[(0,L.jsx)(CT,{title:e.icon?(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,L.jsx)(ak,{src:e.icon}),e.name]}):e.name,right:i?void 0:r.homeActions??(0,L.jsx)(ok,{project:e}),badge:i&&r.homeActions?(0,L.jsx)(`span`,{className:`ml-auto flex`,children:r.homeActions}):void 0,sub:r.homeSub?r.homeSub:e.static?`Snapshot built with foss-design ${e.version}`:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Q,{size:12.5,wrap:!0,children:[e.root,`/.design`]}),` `,`· foss-design `,e.version]})}),(0,L.jsx)(yT,{issues:e.issues,title:`Problems in design.json`}),(0,L.jsxs)(`div`,{className:`grid items-start gap-5 max-lg:grid-cols-1!`,style:{gridTemplateColumns:`minmax(0,1fr) 340px`},children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5`,children:[(0,L.jsx)(lk,{project:e}),r.canvasesAfter]}),(0,L.jsx)(uk,{project:e})]}),r.homeAfter]})}function pk(e){let t=e.utility;if(t===void 0)return[];let n=t?`-${t}`:``;switch(e.kind){case`color`:return[`bg${n}`,`text${n}`,`border${n}`];case`font`:return[`font${n}`];case`text`:return[`text${n}`];case`weight`:return[`font${n}`];case`leading`:return[`leading${n}`];case`tracking`:return[`tracking${n}`];case`spacing`:return t?[`p${n}`,`gap${n}`]:[`p-1`,`gap-4`,`m-2`];case`radius`:return[`rounded${n}`];case`shadow`:return e.name.startsWith(`--inset-shadow-`)?[`inset-shadow${n}`]:e.name.startsWith(`--drop-shadow-`)?[`drop-shadow${n}`]:e.name.startsWith(`--text-shadow-`)?[`text-shadow${n}`]:[`shadow${n}`];case`blur`:return[`blur${n}`,`backdrop-blur${n}`];case`ease`:return[`ease${n}`];case`animation`:return[`animate${n}`];case`breakpoint`:return e.name.startsWith(`--container-`)?[`@${t}:`,`max-w${n}`]:[`${t}:`];default:return[]}}function mk(e,...t){return e.filter(e=>t.includes(e.kind))}function hk(e){let t=new Map;for(let n of e){let e=t.get(n.group)??[];e.push(n),t.set(n.group,e)}return[...t].map(([e,t])=>({group:e,tokens:t}))}function gk(e){let t=/^(-?[\d.]+)(px|rem|em)?$/.exec(e.trim());if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?t[2]===`rem`||t[2]===`em`?n*16:n:null}function _k(e,t){return(t===`dark`?e.dark?.value:void 0)??e.light?.value}function vk(){let e=__(),[t,n]=(0,v.useState)(null);return[t??e,n]}function yk({value:e,onChange:t}){return(0,L.jsx)(PT,{label:`Theme`,size:`sm`,value:e,onChange:t,items:[{value:`light`,label:(0,L.jsx)(Z,{name:`sun`,size:14}),title:`Light`},{value:`dark`,label:(0,L.jsx)(Z,{name:`moon`,size:14}),title:`Dark`}]})}function bk({items:e}){return e.length?(0,L.jsx)(`span`,{className:`flex min-w-0 flex-wrap gap-x-2 gap-y-0.5`,children:e.map(e=>(0,L.jsx)(Q,{size:12,className:`text-muted`,children:e},e))}):null}function xk({title:e,children:t}){return(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:e}),(0,L.jsx)(_T,{children:(0,L.jsx)(`div`,{className:`py-4 text-[13px] text-muted`,children:t})})]})}var Sk=`.design/system/tokens.css`;function Ck({children:e,className:t}){return(0,L.jsx)(`span`,{className:`font-mono text-[12px] text-muted [overflow-wrap:anywhere] ${t??``}`,children:e})}function wk({asset:e,index:t}){if(e.kind===`image`)return(0,L.jsx)(`span`,{className:`checker flex h-[132px] items-center justify-center overflow-hidden border-b border-rule`,children:(0,L.jsx)(`img`,{src:e.url,alt:``,className:`max-h-[96px] max-w-[80%] object-contain`})});if(e.kind===`font`){let n=`design-asset-font-${t}`;return(0,L.jsxs)(`span`,{className:`flex h-[132px] items-center justify-center border-b border-rule bg-soft`,children:[(0,L.jsx)(`style`,{children:`@font-face{font-family:"${n}";src:url("${e.url.replace(/"/g,`%22`)}")}`}),(0,L.jsx)(`span`,{className:`text-[52px] leading-none text-ink`,style:{fontFamily:`"${n}", var(--font-sans)`},children:`Aa`})]})}return(0,L.jsx)(`span`,{className:`flex h-[132px] items-center justify-center border-b border-rule bg-soft text-muted`,children:(0,L.jsx)(Z,{name:`file`,size:28})})}function Tk({system:e}){return e.assets.length?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(CT,{title:`Assets`,sub:`Click an asset to copy its import path.`}),(0,L.jsx)(`div`,{className:`grid gap-4`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(210px, 1fr))`},children:e.assets.map((e,t)=>(0,L.jsx)(`button`,{type:`button`,title:`Copy the import path`,onClick:()=>kw(`@system/${e.path}`),className:`block cursor-pointer border-0 bg-transparent p-0 text-left`,children:(0,L.jsxs)(sT,{className:`transition-colors hover:border-rule-strong`,children:[(0,L.jsx)(wk,{asset:e,index:t}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 px-3.5 py-2.5`,children:[(0,L.jsx)(`span`,{className:`truncate text-[13.5px] font-medium text-ink`,children:e.name}),(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-[12.5px] text-muted`,children:[(0,L.jsx)(`span`,{className:`shrink-0`,children:ek(e.size)}),(0,L.jsx)(Q,{size:12,className:`truncate`,children:e.path})]})]})]})},e.path))})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(CT,{title:`Assets`}),(0,L.jsxs)(xk,{title:`No assets`,children:[`Put logos, icons, images and font files in `,(0,L.jsx)(Q,{children:`.design/system/assets`}),`; screens import them as`,` `,(0,L.jsx)(Q,{children:`@system/assets/…`}),`.`]})]})}function Ek({color:e,label:t,className:n}){return e?(0,L.jsx)(`span`,{title:`${t}: ${e}`,className:X(`checker relative h-[30px] w-[44px] shrink-0 overflow-hidden rounded-[6px]`,n),children:(0,L.jsx)(`span`,{className:`absolute inset-0 rounded-[6px] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] dark:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.12)]`,style:{background:e}})}):(0,L.jsx)(`span`,{className:X(`h-[30px] w-[44px] shrink-0`,n)})}function Dk({tokens:e}){let t=e.some(e=>e.dark),n=t=>(0,L.jsxs)(`div`,{className:`relative flex h-9 min-w-0 grow overflow-hidden rounded-[6px]`,children:[(0,L.jsx)(`span`,{className:`pointer-events-none absolute inset-0 z-10 rounded-[6px] shadow-[inset_0_0_0_1px_var(--rule-strong)] opacity-60`}),e.map(e=>{let n=t===`dark`?e.dark?.value??e.light?.value:e.light?.value;return(0,L.jsx)(`button`,{type:`button`,title:`${e.name}: ${n}`,onClick:()=>kw(`var(${e.name})`),className:`h-full min-w-0 flex-1 cursor-pointer border-0 p-0 transition-[flex-grow] duration-150 hover:grow-[1.6]`,style:{background:n}},e.name)})]});return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-rule px-4 py-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[t?(0,L.jsx)(`span`,{className:`w-9 shrink-0 text-[12px] text-muted`,children:`Light`}):null,n(`light`)]}),t?(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`span`,{className:`w-9 shrink-0 text-[12px] text-muted`,children:`Dark`}),n(`dark`)]}):null]})}function Ok({token:e}){return(0,L.jsxs)(mT,{cols:`100px minmax(170px, 0.9fr) minmax(0, 1.4fr)`,minH:56,title:`Copy the variable`,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(Ek,{color:e.light?.value,label:`Light`}),e.dark?(0,L.jsx)(Ek,{color:e.dark.value,label:`Dark`}):null]}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,L.jsx)(bk,{items:pk(e).slice(0,2)})]}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-wrap gap-x-3`,children:[(0,L.jsx)(Q,{size:12,className:`text-muted`,children:e.light?.value}),e.dark?(0,L.jsxs)(Q,{size:12,className:`text-muted`,children:[`dark `,e.dark.value]}):null]}),e.description?(0,L.jsx)(`span`,{className:`text-[13px] text-ink2`,children:e.description}):null]})]})}function kk({system:e}){let t=mk(e.tokens,`color`),n=hk(t);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(CT,{title:`Colors`,sub:t.length?`${t.length} tokens · click a color to copy its variable`:void 0}),n.length?n.map(({group:e,tokens:t})=>(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:e,count:t.length}),(0,L.jsx)(Dk,{tokens:t}),t.map(e=>(0,L.jsx)(Ok,{token:e},e.name))]},e)):(0,L.jsxs)(xk,{title:`No color tokens`,children:[`Add them to `,(0,L.jsx)(Q,{children:Sk}),`: light values in `,(0,L.jsx)(Q,{children:`:root`}),`, dark ones in`,` `,(0,L.jsx)(Q,{children:`:root[data-theme="dark"]`}),`, and map them to Tailwind with `,(0,L.jsx)(Q,{children:`--color-*`}),` in`,` `,(0,L.jsx)(Q,{children:`@theme inline`}),`.`]})]})}function Ak({src:e,theme:t,title:n,minHeight:r=120,width:i,className:a}){let o=(0,v.useRef)(null),{frameSandbox:s}=Xg(),[c]=(0,v.useState)(()=>({src:e,theme:t})),l=Uw(e,c.src===e?c.theme:t),[u,d]=(0,v.useState)(r),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)([]);return(0,v.useEffect)(()=>{let e=o.current;if(e)return p(!1),h([]),Lw(e,e=>{e.type===`size`?d(Math.max(r,e.height)):e.type===`ready`?p(!0):e.type===`error`?h(t=>t.includes(e.message)?t:[...t,e.message]):e.type===`updated`&&h([])})},[r,l]),(0,v.useEffect)(()=>{Bw(o.current,t)},[t]),(0,L.jsxs)(`div`,{className:X(`relative`,a),style:{width:i},children:[m.length?(0,L.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-rule bg-danger-soft px-4 py-2.5 text-[12.5px] text-danger-text`,children:[(0,L.jsx)(Z,{name:`alert`,size:15,className:`mt-px`}),(0,L.jsx)(`div`,{className:`min-w-0 font-mono break-words`,children:m.join(`
130
- `)})]}):null,(0,L.jsx)(`iframe`,{ref:o,src:l,title:n,sandbox:s,className:X(`block w-full border-0 transition-opacity duration-150`,f?`opacity-100`:`opacity-0`),style:{height:u,colorScheme:t},onLoad:()=>Bw(o.current,t)},l),f?null:(0,L.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-muted`,children:(0,L.jsx)(Z,{name:`loader`,size:18})})]})}var jk=`identifier keyword string class property entity jsxliterals sign comment break space`.split(` `),[Mk,Nk,Pk,Fk,Ik,Lk,Rk,zk,Bk,Vk,Hk]=jk.map((e,t)=>t);new Map(jk.map((e,t)=>[e,t]));function Uk(e,t){let n=[],r=0,i=[],a=!1;function o(e){n.push({index:r++,value:e.map(([,e])=>e).join(``),tokens:e.map(([e,t])=>({type:jk[e],value:t})),annotations:[]})}for(let e=0;e<t.length;e++){let n=t[e],[r,s]=n;if(r!==Vk){if(s.includes(`
123
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${kD(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?kD(n,!0):this.parser.parseInline(r),o=jD(e);if(o===null)return a;e=kD(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+kD(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=jD(e);if(i===null)return kD(n);e=i;let a=`<img src="${kD(e)}" alt="${kD(n)}"`;return t&&(a+=` title="${kD(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:kD(e.text)}},WD=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},GD=class e{options;renderer;textRenderer;constructor(e){this.options=e||oE,this.options.renderer=this.options.renderer||new UD,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new WD}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},KD=class{options;block;constructor(e){this.options=e||oE}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?HD.lex:HD.lexInline}provideParser(e=this.block){return e?GD.parse:GD.parseInline}},qD=class{defaults=aE();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=GD;Renderer=UD;TextRenderer=WD;Lexer=HD;Tokenizer=VD;Hooks=KD;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new UD(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new VD(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new KD;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=KD.passThroughHooks.has(n)?e=>{if(this.defaults.async&&KD.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return HD.lex(e,t??this.defaults)}parser(e,t){return GD.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?HD.lex:HD.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?GD.parse:GD.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?HD.lex:HD.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?GD.parse:GD.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
124
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+kD(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},JD=new qD;function YD(e,t){return JD.parse(e,t)}YD.options=YD.setOptions=function(e){return JD.setOptions(e),YD.defaults=JD.defaults,sE(YD.defaults),YD},YD.getDefaults=aE,YD.defaults=oE;function XD(...e){return JD.use(...e),YD.defaults=JD.defaults,sE(YD.defaults),YD}YD.use=XD,YD.walkTokens=function(e,t){return JD.walkTokens(e,t)},YD.parseInline=JD.parseInline,YD.Parser=GD,YD.parser=GD.parse,YD.Renderer=UD,YD.TextRenderer=WD,YD.Lexer=HD,YD.lexer=HD.lex,YD.Tokenizer=VD,YD.Hooks=KD,YD.parse=YD,YD.options,YD.setOptions,YD.walkTokens,YD.parseInline,GD.parse,HD.lex;var ZD=new Set([`http:`,`https:`,`mailto:`]);function QD(e){let t=e.replace(/[\u0000- \u007f]/g,``),n=/^([a-z][a-z0-9+.-]*):/i.exec(t)?.[1];return!n||ZD.has(`${n.toLowerCase()}:`)}function $D(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var eO=new qD({gfm:!0,breaks:!1},{renderer:{html:({text:e})=>$D(e),link(e){return!QD(e.href)&&this.parser.parseInline(e.tokens)},image(e){return!QD(e.href)&&$D(e.text)}}});function tO(e){return eO.parse(e,{async:!1}).replace(/<a href=/g,`<a target="_blank" rel="noreferrer" href=`)}function nO({text:e,className:t}){let n=(0,v.useMemo)(()=>tO(e),[e]);return(0,L.jsx)(`div`,{className:X(`prose`,t),dangerouslySetInnerHTML:{__html:n}})}function rO(e,t,n=!0){let r=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{let i=r.current;if(!i||!n)return;let a=new ResizeObserver(()=>nE(e,t,{h:i.offsetHeight}));return a.observe(i),()=>a.disconnect()},[e,t,n]),r}function iO(e){return e<600?`smartphone`:e<1100?`tablet`:`monitor`}var aO=(0,v.memo)(function({placed:e,mode:t,thumb:n,theme:r,store:i,events:a,capture:o}){let{item:s,x:c,y:l,w:u,h:d}=e,f=(0,v.useRef)(null),{frameSandbox:p}=Xg(),m=(0,v.useCallback)(e=>{f.current=e,iE(i,s.id,e)},[i,s.id]),h=c_(i,e=>e.frames[s.id]),g=c_(i,e=>e.active===s.id),_=c_(i,e=>e.inspecting&&s.kind===`screen`),y=s.frame.height===`auto`,b=s.kind===`screen`?s.theme??r:r,x=s.kind===`screen`?s.rev:s.url,[S]=(0,v.useState)(b),C=s.kind===`screen`?Ww(s.url,S,o?{capture:`1`}:void 0):s.url,w=!!h?.ready,T=t===`off`,E=!T&&!(s.kind===`screen`&&s.missing);(0,v.useEffect)(()=>{T&&rE(i,s.id,{ready:!1})},[T,i,s.id]),(0,v.useEffect)(()=>{let e=f.current;if(e&&!T&&s.kind===`screen`)return Lw(e,t=>{switch(t.type){case`ready`:rE(i,s.id,{ready:!0}),zw(e);break;case`size`:y&&nE(i,s.id,{h:Math.max(200,t.height)});break;case`error`:{let e=i.get().frames[s.id]?.errors??[];e.includes(t.message)||rE(i,s.id,{errors:[...e,t.message]});break}case`updated`:rE(i,s.id,{errors:[]});break;case`go`:a.onGo(s.id,t.target);break;case`link`:a.onLink(s.id,t);break;case`wheel`:a.onWheel(e,t);break;case`keydown`:t.code===`Escape`&&a.onEscape()}})},[T,s.id,s.kind,y,i,a,C,x]),(0,v.useEffect)(()=>{s.kind===`screen`&&Vw(f.current,b)},[b,s.kind]);let D=b===`dark`?`light`:`dark`,O=e=>e?.[b]??e?.[D],k=s.kind===`screen`?O(s.snapshots):void 0,A=n&&s.kind===`screen`?O(s.thumbs)??k:k,j=t===`asleep`&&w&&!!A;return(0,L.jsxs)(`div`,{"data-item":s.id,className:`absolute overflow-clip bg-surface`,style:{left:c,top:l,width:u,height:d,boxShadow:`var(--shadow-frame), 0 0 0 1px var(--rule)`},children:[(!w||j)&&A?(0,L.jsx)(`img`,{src:A,alt:``,draggable:!1,loading:`lazy`,decoding:`async`,className:`absolute inset-0 h-full w-full object-cover object-top select-none`}):null,!w&&!A?(0,L.jsx)(oO,{item:s,loading:E}):null,E?(0,L.jsx)(`div`,{className:`absolute inset-0`,style:{contentVisibility:j?`hidden`:`visible`},children:(0,L.jsx)(`iframe`,{ref:m,src:C,title:s.title,allow:`clipboard-read; clipboard-write; fullscreen`,sandbox:p,className:X(`absolute top-0 left-0 block border-0 transition-opacity duration-200`,w?`opacity-100`:`opacity-0`),style:{width:u,height:d,colorScheme:b},onLoad:()=>{s.kind===`url`?rE(i,s.id,{ready:!0}):(Vw(f.current,b),zw(f.current))}},x)}):null,g||_?null:(0,L.jsx)(`div`,{"data-shield":s.id,className:`absolute inset-0`})]})});function oO({item:e,loading:t}){let n=e.kind===`screen`&&e.missing;return(0,L.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-3 bg-soft text-muted`,children:[(0,L.jsx)(Z,{name:n?`alert`:e.kind===`url`?`globe`:iO(e.frame.width),size:Math.max(24,Math.min(96,e.frame.width/12)),strokeWidth:1.25,className:n?`text-danger-text`:void 0}),(0,L.jsx)(`div`,{className:`max-w-[80%] truncate text-center`,style:{fontSize:Math.max(14,e.frame.width/40)},children:n?`Missing file: ${e.kind===`screen`?e.src:``}`:t?`Loading…`:e.title})]})}var sO=(0,v.memo)(function({placed:e,store:t}){let{item:n,x:r,y:i,w:a}=e,o=rO(t,n.id),s=n.tone===`plain`;return(0,L.jsxs)(`div`,{ref:o,"data-item":n.id,className:X(`absolute`,s?``:`rounded-[10px] border border-note-line bg-note px-6 py-5 shadow-frame`),style:{left:r,top:i,width:a},children:[n.title?(0,L.jsx)(`div`,{className:`mb-2 font-semibold text-ink`,style:{fontSize:s?26:19},children:n.title}):null,(0,L.jsx)(nO,{text:n.text,className:s?`prose-plain`:`prose-note`})]})}),cO=(0,v.memo)(function({placed:e,store:t}){let{item:n,x:r,y:i,w:a,h:o}=e;return(0,L.jsx)(`div`,{"data-item":n.id,className:`absolute overflow-clip rounded-[6px] bg-surface`,style:{left:r,top:i,width:a,height:o,boxShadow:`0 0 0 1px var(--rule)`},children:n.missing?(0,L.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-danger-text`,children:[(0,L.jsx)(Z,{name:`alert`,size:20}),` Missing image`]}):(0,L.jsx)(`img`,{src:n.url,alt:n.title,draggable:!1,className:`block h-full w-full object-contain select-none`,onLoad:e=>{let r=e.currentTarget;nE(t,n.id,{w:r.naturalWidth,h:r.naturalHeight})}})})}),lO=(0,v.memo)(function({section:e,x:t,y:n,w:r,store:i}){let a=rO(i,`section:${e.id}`);return!e.title&&!e.description?null:(0,L.jsxs)(`div`,{ref:a,className:`canvas-section absolute`,style:{left:t,top:n,width:Math.min(Math.max(r,720),1400)},children:[e.title?(0,L.jsx)(`div`,{className:`text-[40px] leading-[1.15] font-semibold tracking-[-0.015em] text-ink`,children:e.title}):null,e.description?(0,L.jsx)(`div`,{className:`mt-3 max-w-[1100px]`,children:(0,L.jsx)(nO,{text:e.description,className:`prose-plain`})}):null]})}),uO={phone:{width:390,height:844,label:`Phone`},"phone-sm":{width:375,height:667,label:`Phone S`},"phone-lg":{width:430,height:932,label:`Phone L`},tablet:{width:834,height:1194,label:`Tablet`},"tablet-landscape":{width:1194,height:834,label:`Tablet landscape`},laptop:{width:1280,height:800,label:`Laptop`},desktop:{width:1440,height:900,label:`Desktop`},wide:{width:1920,height:1080,label:`Wide`}};Object.keys(uO);var dO=e=>({"--x":e.x,"--y":e.y,"--w":e.w,"--h":e.h});function fO(e){let t=e.item;if(t.kind!==`screen`&&t.kind!==`url`)return``;let n=t.frame.device?uO[t.frame.device]?.label:void 0,r=`${t.frame.width} × ${t.frame.height===`auto`?`auto`:t.frame.height}`;return n?`${n} · ${r}`:r}var pO=(0,v.memo)(function({placed:e,store:t}){let n=e.item.id,r=c_(t,e=>e.selected===n),i=c_(t,e=>e.frames[n]?.errors.length??0);return(0,L.jsxs)(`div`,{"data-at":``,"data-label":n,style:dO(e),className:X(`frame-label pointer-events-auto flex cursor-default items-center gap-1.5 overflow-hidden pb-1.5 text-[12.5px] leading-none whitespace-nowrap select-none`,r?`text-ink`:`text-muted hover:text-ink2`),children:[i?(0,L.jsx)(`span`,{className:`size-[7px] shrink-0 rounded-full bg-danger`,title:`${i} errors`}):null,(0,L.jsx)(`span`,{className:X(`min-w-[3ch] truncate`,r?`font-semibold`:`font-medium`),children:e.item.title}),(0,L.jsx)(`span`,{className:`frame-device min-w-0 shrink-[20] truncate text-[11.5px] text-muted opacity-80`,children:fO(e)})]})});function mO({placed:e,kind:t}){return(0,L.jsx)(`div`,{"data-at":``,style:dO(e),className:X(`frame-outline rounded-[1px]`,t===`hover`?`outline outline-[1.5px] outline-action/60`:`outline-2 outline-action outline`)})}function hO({layout:e,view:t,store:n,overlayRef:r}){let i=c_(n,e=>e.selected),a=c_(n,e=>e.active),o=c_(n,e=>e.hovered),s=c_(n,e=>e.zoomTiny),c=(0,v.useMemo)(()=>e.items.filter(e=>XT(e.item)),[e]),l=(0,v.useMemo)(()=>{if(!t||s)return[];let{x:e,y:n,z:r,w:i,h:a}=t,o={x:-e/r-i/r,y:-n/r-a/r,w:i/r*3,h:a/r*3};return c.filter(e=>PT(e,o))},[c,t,s]),u=t=>t?e.items.find(e=>e.item.id===t):void 0,d=u(i),f=o&&o!==i?u(o):void 0;return(0,L.jsxs)(`div`,{ref:r,className:`canvas-overlay`,"data-tiny":s,children:[l.map(e=>(0,L.jsx)(pO,{placed:e,store:n},e.item.id)),f?(0,L.jsx)(mO,{placed:f,kind:`hover`}):null,d?(0,L.jsx)(mO,{placed:d,kind:a===i?`active`:`selected`}):null]})}var gO=12,_O=20,vO=110,yO=.2,bO=400,xO=.2,SO=3,CO=8e3,wO=14,TO=96;function EO({layout:e,theme:t,store:n,camera:r,events:i,capture:a,apiRef:o,onPlay:s,onSelect:c}){let l=(0,v.useRef)(null),u=(0,v.useRef)(null),d=(0,v.useRef)(null),f=(0,v.useRef)(null),[p,m]=(0,v.useState)(null),h=c_(n,e=>e.panning),g=c_(n,e=>e.selected),_=c_(n,e=>e.active),y=(0,v.useMemo)(()=>e.items.filter(e=>XT(e.item)),[e]);(0,v.useLayoutEffect)(()=>{let e=l.current,t=u.current,i=d.current,a,o,s=!1,c=0,p=()=>m({...r.camera,w:e.clientWidth,h:e.clientHeight,moving:s}),h=e=>{t.style.transform=`translate3d(${e.x}px, ${e.y}px, 0) scale(${e.z})`,s||(s=!0,t.classList.add(`moving`)),clearTimeout(a),a=setTimeout(()=>{s=!1,t.classList.remove(`moving`),p()},160);let r=f.current;r&&(r.style.setProperty(`--tx`,String(e.x)),r.style.setProperty(`--ty`,String(e.y)),r.style.setProperty(`--z`,String(e.z)));let l=24*e.z;for(;l<wO;)l*=4;for(;l>TO;)l/=4;l!==c&&(c=l,i.style.backgroundSize=`${l}px ${l}px`);let u=e=>((e+TO)%l+l)%l-l;i.style.transform=`translate3d(${u(e.x)}px, ${u(e.y)}px, 0)`;let d=e.z<.09;n.get().zoomTiny!==d&&n.set(e=>({...e,zoomTiny:d})),t.classList.toggle(`far`,e.z<.15),o??=setTimeout(()=>{o=void 0,p()},90)};h(r.camera),p();let g=r.subscribe(h),_=e.getBoundingClientRect().left,v=new ResizeObserver(()=>{let t=e.getBoundingClientRect().left;if(t!==_){let e=r.camera;r.set({...e,x:e.x-(t-_)}),_=t}p()});return v.observe(e),()=>{g(),v.disconnect(),clearTimeout(a),clearTimeout(o)}},[r,n]),(0,v.useEffect)(()=>{let t=l.current,n=()=>{let{w:n,h:i}={w:t.clientWidth,h:t.clientHeight},o=e.bounds,s=o.w&&n?Math.min((n-160)/o.w,(i-160)/Math.max(o.h,1)):1;r.minZoom=a?.01:Math.min(.25,Math.max(AT,s*.5))};n();let i=new ResizeObserver(n);return i.observe(t),()=>i.disconnect()},[r,e.bounds,a]),(0,v.useEffect)(()=>{let t=l.current,n=()=>({w:t.clientWidth,h:t.clientHeight});o.current={size:n,openView(){let{w:t,h:i}=n(),a=e.bounds;if(!a.w)return;if(Math.min((t-160)/a.w,(i-160)/Math.max(a.h,1))>=xO)return this.fitAll(!1);let o=e.sections[0]??a,s=Math.min(.5,Math.max(.25,(t-160)/Math.max(o.w,1)));r.set({z:s,x:80-a.x*s,y:80-a.y*s})},fitAll(t=!0){let{w:i,h:a}=n();if(!e.bounds.w)return;let o=NT(e.bounds,i,a,80,1,r.minZoom);t?r.animateTo(o):r.set(o)},fitItem(t,i=!0){let a=e.items.find(e=>e.item.id===t);if(!a)return;let{w:o,h:s}=n(),c=NT(a,o,s,64,1,r.minZoom);i?r.animateTo(c):r.set(c)},zoomBy(e){let{w:t,h:i}=n(),a=r.camera,o=a.z*e,s=(t/2-a.x)/a.z,c=(i/2-a.y)/a.z;r.animateTo({z:o,x:t/2-s*o,y:i/2-c*o},180)},zoomTo(e){let{w:t,h:i}=n(),a=r.camera,o=(t/2-a.x)/a.z,s=(i/2-a.y)/a.z;r.animateTo({z:e,x:t/2-o*e,y:i/2-s*e},220)}}},[o,r,e]);let b=(0,v.useRef)([]),x=(0,v.useRef)(new Map),[S,C]=(0,v.useState)(0),w=c_(n,e=>DO(e.frames)),T=(0,v.useMemo)(()=>{let e=new Map;if(a){for(let t of y)e.set(t.item.id,`live`);return e}if(!p)return e;let{x:t,y:n,z:r,w:i,h:o}=p,s={x:-t/r,y:-n/r,w:i/r,h:o/r},c={x:s.x-s.w*.25,y:s.y-s.h*.25,w:s.w*1.5,h:s.h*1.5},l=s.x+s.w/2,u=s.y+s.h/2,d=e=>Math.max(0,Math.min(e.x+e.w,s.x+s.w)-Math.max(e.x,s.x))*Math.max(0,Math.min(e.y+e.h,s.y+s.h)-Math.max(e.y,s.y)),f=e=>Math.hypot(e.x+e.w/2-l,e.y+e.h/2-u),m=y.filter(e=>r>=yO&&PT(e,c)&&e.w*r>=vO).sort((e,t)=>d(t)-d(e)||f(e)-f(t)).slice(0,gO).map(e=>e.item.id),h=[_,g].filter(e=>!!e),v=new Set(y.map(e=>e.item.id)),S=new Set(w.split(`
125
+ `)),C=new Set(b.current),T=performance.now(),E=e=>!S.has(e)&&T-(x.current.get(e)??0)<CO,D=SO-[...C].filter(E).length,O=[];for(let e of new Set([...h,...m]))v.has(e)&&(C.has(e)?O.push(e):(h.includes(e)||!p.moving&&D>0)&&(O.push(e),x.current.set(e,T),D--));let k=[...new Set([...O,...b.current])].filter(e=>v.has(e)).slice(0,_O);b.current=k;for(let e of x.current.keys())k.includes(e)||x.current.delete(e);for(let t of k)e.set(t,O.includes(t)?`live`:`asleep`);return e},[p,y,_,g,a,w,S]);(0,v.useEffect)(()=>{let e=performance.now(),t=new Set(w.split(`
126
+ `)),n=[...x.current].filter(([e])=>!t.has(e)).map(([,t])=>t+CO-e).filter(e=>e>0);if(!n.length)return;let r=setTimeout(()=>C(e=>e+1),Math.min(...n)+20);return()=>clearTimeout(r)},[T,w]);let E=(0,v.useRef)(null),D=(0,v.useRef)(new Map),O=(0,v.useRef)(null),k=(0,v.useRef)(!1),A=e=>{n.get().panning!==e&&n.set(t=>({...t,panning:e}))};(0,v.useEffect)(()=>{let e=e=>{e.code===`Space`&&!OO(e.target)&&(k.current=!0,l.current?.classList.add(`cursor-grab`),e.preventDefault())},t=e=>{e.code===`Space`&&(k.current=!1,l.current?.classList.remove(`cursor-grab`))};return window.addEventListener(`keydown`,e),window.addEventListener(`keyup`,t),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`keyup`,t)}},[]);let j=e=>{let t=e;return(t?.closest(`[data-shield]`))?.dataset.shield??(t?.closest(`[data-label]`))?.dataset.label??(t?.closest(`[data-item]`))?.dataset.item??null},ee=e=>{if(e.target.closest(`[data-ui]`)||e.button!==0&&e.button!==1)return;if(l.current.setPointerCapture(e.pointerId),D.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),r.interrupt(),D.current.size===2){let[e,t]=[...D.current.values()];O.current={dist:Math.hypot(e.x-t.x,e.y-t.y),midX:(e.x+t.x)/2,midY:(e.y+t.y)/2},E.current=null,A(!0);return}let t=e.button===1||k.current;E.current={id:t?null:j(e.target),startX:e.clientX,startY:e.clientY,lastX:e.clientX,lastY:e.clientY,moved:t},t&&A(!0)},te=e=>{if(D.current.has(e.pointerId)&&D.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),O.current&&D.current.size===2){let[e,t]=[...D.current.values()],n=Math.hypot(e.x-t.x,e.y-t.y),i=(e.x+t.x)/2,a=(e.y+t.y)/2,o=l.current.getBoundingClientRect();r.panBy(i-O.current.midX,a-O.current.midY),r.zoomAt(i-o.left,a-o.top,n/Math.max(O.current.dist,1)),O.current={dist:n,midX:i,midY:a};return}let t=E.current;if(!t){if(!n.get().panning){let t=j(e.target);n.get().hovered!==t&&n.set(e=>({...e,hovered:t}))}return}!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>3&&(t.moved=!0,A(!0)),t.moved&&r.panBy(e.clientX-t.lastX,e.clientY-t.lastY),t.lastX=e.clientX,t.lastY=e.clientY},ne=e=>{D.current.delete(e.pointerId),D.current.size<2&&(O.current=null);let t=E.current;E.current=null,t&&!t.moved&&c(t.id,{x:e.clientX,y:e.clientY}),D.current.size||A(!1)};(0,v.useEffect)(()=>{let e=l.current,t=t=>{if(t.target.closest(`[data-ui]`))return;t.preventDefault();let n=e.getBoundingClientRect(),i=t.deltaMode===1?16:t.deltaMode===2?n.height:1;if(t.ctrlKey||t.metaKey){let e=t.deltaY*i,a=Math.abs(e)<40?.012:.0025;r.zoomAt(t.clientX-n.left,t.clientY-n.top,Math.exp(-e*a))}else r.panBy(-t.deltaX*i,-t.deltaY*i)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[r]);let M=e.sections;return(0,L.jsxs)(`div`,{ref:l,className:X(`canvas-root relative h-full w-full touch-none overflow-clip select-none animate-[q-fade-in_160ms_ease-out]`,h&&`canvas-panning cursor-grabbing`),onPointerDown:ee,onPointerMove:te,onPointerUp:ne,onPointerCancel:ne,onPointerLeave:()=>n.get().hovered&&n.set(e=>({...e,hovered:null})),onDoubleClick:t=>{let n=j(t.target),r=n?e.items.find(e=>e.item.id===n):void 0;r&&XT(r.item)&&s(r.item.id)},children:[(0,L.jsx)(`div`,{ref:d,className:`canvas-grid`}),(0,L.jsxs)(`div`,{ref:u,className:`canvas-world`,children:[M.map(e=>(0,L.jsx)(lO,{section:e.section,x:e.x,y:e.y,w:e.w,store:n},`section:${e.section.id}`)),e.items.map(e=>{let{item:r}=e;return r.kind===`screen`||r.kind===`url`?(0,L.jsx)(aO,{placed:e,mode:T.get(r.id)??`off`,thumb:!a&&!!p&&e.w*p.z*devicePixelRatio<=bO,theme:t,store:n,events:i,capture:a},r.id):r.kind===`note`?(0,L.jsx)(sO,{placed:e,store:n},r.id):(0,L.jsx)(cO,{placed:e,store:n},r.id)})]}),(0,L.jsx)(hO,{layout:e,view:p,store:n,overlayRef:f})]})}function DO(e){return Object.keys(e).filter(t=>e[t].ready).sort().join(`
127
+ `)}function OO(e){let t=e;return!!t&&(t.isContentEditable||/^(input|textarea|select)$/i.test(t.tagName))}var kO=new URLSearchParams(window.location.search),AO=kO.has(`capture`),jO=(e,t)=>`foss-design.camera.${e}.${t}`;function MO(e){try{let t=JSON.parse(sessionStorage.getItem(e)??`null`);if(t&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.z))return t}catch{}return null}function NO(e){let t=__(),n=kO.get(`theme`),[r,i]=(0,v.useState)(n===`dark`||n===`light`?n:null);return[r??e?.theme??t,i]}function PO({canvasId:e,pageId:t}){let{data:n,error:r,isLoading:i}=e_(e);if(r)return(0,L.jsx)(kT,{title:`Canvas not found`,text:r.message});if(i||!n)return(0,L.jsx)(`div`,{className:`canvas-dots grow`});let a=t??kO.get(`page`)??void 0,o=n.pages.find(e=>e.id===a)??n.pages[0];return(0,L.jsx)(FO,{canvas:n,page:o},`${n.id}/${o?.id??``}`)}function FO({canvas:e,page:t}){let[,n]=P(),r=(0,v.useMemo)(()=>tE(),[]),i=(0,v.useMemo)(()=>new MT,[]),a=(0,v.useRef)(null),[o,s]=NO(e),[c,l]=(0,v.useState)(()=>!AO&&window.innerWidth>900),[u,d]=(0,v.useState)(!1),f=c_(r,e=>e.sizes),p=(0,v.useMemo)(()=>t?$T(t,f):{items:[],sections:[],bounds:{x:0,y:0,w:0,h:0}},[t,f]),m=zO(c_(r,e=>e.frameEls),p),h=Jw(m),g=u||h;(0,v.useEffect)(()=>{r.set(e=>e.inspecting===g?e:{...e,inspecting:g,active:null})},[g,r]);let _=qw(m,g,{onEscape:()=>d(!1)}),y=!!_.info;(0,v.useEffect)(()=>{y&&d(!0)},[y]),(0,v.useEffect)(()=>{let e=_.frame;if(!e)return;let t=Object.entries(r.get().frameEls).find(([,t])=>t===e)?.[0];t&&r.get().selected!==t&&r.set(e=>({...e,selected:t}))},[_.frame,r]);let b=(0,v.useMemo)(()=>eE(p),[p]),x=jO(e.id,t?.id??``),S=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(S.current||!p.bounds.w)return;S.current=!0;let t=o_(e.id),n=AO?null:MO(x);t?(r.set(e=>({...e,selected:t})),requestAnimationFrame(()=>a.current?.fitItem(t,!1))):n&&n.z>=i.minZoom?i.set(n):requestAnimationFrame(()=>AO?a.current?.fitAll(!1):a.current?.openView())},[p,i,x,e.id,r]),(0,v.useEffect)(()=>{if(AO)return;let e,t=i.subscribe(t=>{clearTimeout(e),e=setTimeout(()=>sessionStorage.setItem(x,JSON.stringify(t)),250)});return()=>{t(),clearTimeout(e)}},[i,x]);let C=(0,v.useCallback)(e=>{let t=e?p.items.find(t=>t.item.id===e)?.item:void 0;r.set(e=>({...e,selected:t?t.id:null,active:t&&XT(t)?t.id:null,hovered:null}))},[p,r]),w=(0,v.useCallback)(e=>{C(e),a.current?.fitItem(e)},[C]),T=(0,v.useCallback)(r=>n(`/c/${encodeURIComponent(e.id)}/play/${encodeURIComponent(r)}${t?`?page=${encodeURIComponent(t.id)}`:``}`),[e.id,t,n]),E=(0,v.useCallback)(()=>{let e=r.get().selected,t=e&&b.find(t=>t.item.id===e)||b[0];t&&T(t.item.id)},[r,b,T]);(0,v.useEffect)(()=>{let t=t=>{let n=t.detail;n.canvas===e.id&&p.items.some(e=>e.item.id===n.item)&&(o_(e.id),w(n.item))};return window.addEventListener(`design:focus`,t),()=>window.removeEventListener(`design:focus`,t)},[e.id,p,w]);let D=(0,v.useMemo)(()=>({onGo(r,i){let[a,o]=i.includes(`/`)?i.split(`/`):[null,i],s=a?e.pages.filter(e=>e.id===a):[t,...e.pages.filter(e=>e!==t)];for(let r of s)if(r&&r.sections.some(e=>e.items.some(e=>e.id===o))){r===t?w(o):(n(BT(e,r)),window.dispatchEvent(new CustomEvent(`design:focus`,{detail:{canvas:e.id,item:o}})));return}console.warn(`[design] go("${i}"): no such screen`)},onLink(t,n){Kw(n,e,e=>this.onGo(t,e),t)},onWheel(e,t){let n=e.closest(`.canvas-root`);if(!n)return;let r=n.getBoundingClientRect(),a=e.getBoundingClientRect(),o=i.camera.z;if(t.zoom){let e=Math.abs(t.deltaY)<40?.012:.0025;i.zoomAt(a.left-r.left+t.x*o,a.top-r.top+t.y*o,Math.exp(-t.deltaY*e))}else i.panBy(-t.deltaX,-t.deltaY)},onEscape(){r.set(e=>({...e,active:null}))}}),[e,t,i,r,w,n]);return(0,v.useEffect)(()=>{if(!AO)return;let e=Date.now(),t=setInterval(()=>{let n=r.get().frames;(b.every(e=>n[e.item.id]?.ready||e.item.kind===`screen`&&e.item.missing)||Date.now()-e>6e4)&&(clearInterval(t),a.current?.fitAll(!1),requestAnimationFrame(()=>requestAnimationFrame(()=>window.__DESIGN_CANVAS_READY__=!0)))},250);return()=>clearInterval(t)},[b,r]),(0,v.useEffect)(()=>{let i=i=>{if(OO(i.target)||document.querySelector(`[role="dialog"]`))return;let o=a.current,s=r.get(),c=i.metaKey||i.ctrlKey;if(i.key===`Escape`)_.info?_.select(null):u?d(!1):s.active?r.set(e=>({...e,active:null})):s.selected&&r.set(e=>({...e,selected:null}));else if(i.key===`i`&&!c&&!i.altKey)d(e=>!e);else if(i.key===`p`&&!c&&!i.altKey)E();else if(i.shiftKey&&i.code===`Digit1`)o?.fitAll();else if(i.shiftKey&&i.code===`Digit2`&&s.selected)o?.fitItem(s.selected);else if(i.shiftKey&&i.code===`Digit0`)o?.zoomTo(1);else if((i.key===`=`||i.key===`+`)&&!i.altKey)i.preventDefault(),o?.zoomBy(1.4);else if(i.key===`-`&&!i.altKey)i.preventDefault(),o?.zoomBy(1/1.4);else if(c&&i.key===`0`)i.preventDefault(),o?.zoomTo(1);else if(c&&i.key===`\\`)i.preventDefault(),l(e=>!e);else if([`ArrowRight`,`ArrowDown`,`ArrowLeft`,`ArrowUp`].includes(i.key)&&b.length){i.preventDefault();let e=b.findIndex(e=>e.item.id===s.selected),t=i.key===`ArrowRight`||i.key===`ArrowDown`?1:-1,n=b[e===-1?0:(e+t+b.length)%b.length];r.set(e=>({...e,selected:n.item.id,active:null})),o?.fitItem(n.item.id)}else if(i.key===`Enter`&&s.selected){let e=p.items.find(e=>e.item.id===s.selected)?.item;e&&XT(e)&&T(e.id)}else if(i.key===`]`||i.key===`[`){let r=t?e.pages.indexOf(t):-1,a=e.pages[r+(i.key===`]`?1:-1)];a&&n(BT(e,a))}};return window.addEventListener(`keydown`,i),()=>window.removeEventListener(`keydown`,i)},[r,b,p,T,E,e,t,n,u,_]),AO?(0,L.jsx)(`div`,{className:`flex h-dvh`,children:(0,L.jsx)(EO,{layout:p,theme:o,store:r,camera:i,events:D,capture:!0,apiRef:a,onPlay:()=>{},onSelect:()=>{}})}):(0,L.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,L.jsx)(HT,{canvas:e,page:t,theme:o,onTheme:s,sidebar:c,onSidebar:l,inspect:u,onInspect:d,onPlay:E,canPlay:b.length>0}),(0,L.jsxs)(`div`,{className:`flex min-h-0 grow basis-0`,children:[(0,L.jsx)(ST,{open:c&&!!t,side:`left`,width:264,children:t?(0,L.jsx)(VT,{canvas:e,page:t,store:r,onPick:w}):null}),(0,L.jsxs)(`div`,{className:`relative min-w-0 grow`,children:[t&&p.items.length?(0,L.jsx)(EO,{layout:p,theme:o,store:r,camera:i,events:D,capture:!1,apiRef:a,onPlay:T,onSelect:C}):(0,L.jsx)(`div`,{className:`canvas-dots flex h-full`,children:(0,L.jsx)(OT,{title:t?`This page is empty`:`This canvas has no pages`,text:(0,L.jsxs)(L.Fragment,{children:[`Add sections and screens to`,` `,(0,L.jsxs)(`code`,{className:`font-mono text-[13px]`,children:[`.design/canvas/`,e.id,`/canvas.json`]}),`.`]})})}),(0,L.jsx)(UT,{canvas:e,store:r,layoutItems:p.items.map(e=>e.item),theme:o,onPlay:T,inspect:g}),(0,L.jsx)(LO,{camera:i,apiRef:a}),e.issues.length?(0,L.jsx)(RO,{canvas:e}):null]}),(0,L.jsx)(ST,{open:u,side:`right`,width:320,children:(0,L.jsx)(iT,{info:_.info,active:!0,onSelect:e=>_.select(e),onClose:()=>{d(!1),_.select(null)}})})]})]})}function IO({camera:e}){let[t,n]=(0,v.useState)(e.camera.z);return(0,v.useEffect)(()=>{let t=0;return e.subscribe(e=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>n(e.z))})},[e]),(0,L.jsxs)(L.Fragment,{children:[Math.round(t*100),`%`]})}function LO({camera:e,apiRef:t}){return(0,L.jsxs)(`div`,{"data-ui":!0,className:`absolute right-4 bottom-5 z-20 flex h-[46px] items-center gap-0.5 rounded-[10px] border border-rule bg-surface px-1.5 shadow-pop`,children:[(0,L.jsx)(ix,{icon:`zoom-out`,label:`Zoom out (−)`,onClick:()=>t.current?.zoomBy(1/1.4)}),(0,L.jsxs)(MC,{side:`top`,align:`end`,width:210,trigger:(0,L.jsx)(`button`,{type:`button`,className:`h-ctrl min-w-[56px] cursor-pointer rounded-[6px] border-0 bg-transparent px-1.5 text-[12.5px] font-medium text-ink2 tabular hover:bg-soft2`,children:(0,L.jsx)(IO,{camera:e})}),children:[(0,L.jsx)(PC,{onSelect:()=>t.current?.fitAll(),hint:`⇧1`,children:`Zoom to fit`}),(0,L.jsx)(PC,{onSelect:()=>t.current?.zoomTo(1),hint:`⇧0`,children:`100%`}),(0,L.jsx)(FC,{}),[.25,.5,2].map(e=>(0,L.jsxs)(PC,{onSelect:()=>t.current?.zoomTo(e),children:[e*100,`%`]},e))]}),(0,L.jsx)(ix,{icon:`zoom-in`,label:`Zoom in (+)`,onClick:()=>t.current?.zoomBy(1.4)}),(0,L.jsx)(`div`,{className:`mx-0.5 h-5 w-px bg-rule`}),(0,L.jsx)(ix,{icon:`fit`,label:`Zoom to fit (⇧1)`,onClick:()=>t.current?.fitAll()})]})}function RO({canvas:e}){let t=e.issues.filter(e=>e.severity===`error`).length;return(0,L.jsxs)(yw,{children:[(0,L.jsx)(bw,{asChild:!0,children:(0,L.jsxs)(`button`,{type:`button`,"data-ui":!0,className:`absolute bottom-5 left-4 z-20 flex h-[46px] cursor-pointer items-center gap-2 rounded-[10px] border border-rule bg-surface px-3.5 text-[13px] font-medium shadow-pop hover:bg-soft`,children:[(0,L.jsx)(Z,{name:`alert`,size:15,className:t?`text-danger-text`:`text-action`}),e.issues.length,` `,e.issues.length===1?`problem`:`problems`,` in canvas.json`]})}),(0,L.jsx)(xw,{children:(0,L.jsx)(Sw,{side:`top`,align:`start`,sideOffset:8,collisionPadding:12,className:`z-50 max-h-[50vh] w-[460px] max-w-[calc(100vw-24px)] overflow-y-auto rounded-[10px] border border-rule bg-surface shadow-pop outline-none data-[state=open]:animate-[q-pop_120ms_ease-out]`,children:(0,L.jsx)(yT,{issues:e.issues})})})]})}function zO(e,t){let n=(0,v.useRef)([]);return(0,v.useMemo)(()=>{let r=new Set(t.items.filter(e=>e.item.kind===`screen`).map(e=>e.item.id)),i=Object.entries(e).filter(e=>!!e[1]&&r.has(e[0])).map(([,e])=>e);return i.length===n.current.length&&i.every((e,t)=>e===n.current[t])||(n.current=i),n.current},[e,t])}function BO({open:e,onOpenChange:t,title:n,children:r}){return(0,L.jsx)(mg,{open:e,onOpenChange:t,children:(0,L.jsx)(ed,{children:e?(0,L.jsxs)(vg,{forceMount:!0,children:[(0,L.jsx)(bg,{asChild:!0,forceMount:!0,children:(0,L.jsx)(Wf.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},className:`fixed inset-0 z-50 bg-overlay`})}),(0,L.jsx)(wg,{asChild:!0,forceMount:!0,"aria-describedby":void 0,children:(0,L.jsxs)(Wf.div,{initial:{y:`100%`},animate:{y:0},exit:{y:`100%`,transition:{duration:.18,ease:`easeIn`}},transition:{type:`spring`,stiffness:420,damping:40},className:`fixed inset-x-0 bottom-0 z-50 flex max-h-[82dvh] flex-col rounded-t-[14px] border-t border-rule bg-surface pb-[env(safe-area-inset-bottom)] shadow-pop outline-none`,children:[(0,L.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,L.jsx)(`span`,{"aria-hidden":!0,className:`h-1 w-9 rounded-full bg-rule-strong`})}),(0,L.jsxs)(`div`,{className:`flex min-h-[48px] items-center justify-between gap-3 pr-2 pl-4`,children:[(0,L.jsx)(kg,{className:`m-0 truncate text-[15px] font-semibold`,children:n}),(0,L.jsx)(jg,{asChild:!0,children:(0,L.jsx)(ix,{icon:`x`,label:`Close`})})]}),(0,L.jsx)(`div`,{className:`min-h-0 overflow-y-auto overscroll-contain border-t border-rule`,children:r})]})})]}):null})})}function VO(e,t){return(t?e.pages.filter(e=>e.id===t):e.pages).flatMap(t=>t.sections.flatMap(n=>n.items.filter(e=>e.kind===`screen`||e.kind===`url`).map(r=>({item:r,pageId:t.id,where:[e.pages.length>1?t.title:null,n.title].filter(Boolean).join(` · `)}))))}var HO=(e,t,n)=>`/c/${encodeURIComponent(e)}/play/${encodeURIComponent(t)}?page=${encodeURIComponent(n)}`;function UO({canvasId:e,itemId:t}){let{data:n,error:r,isLoading:i}=e_(e);return r?(0,L.jsx)(kT,{title:`Canvas not found`,text:r.message}):i||!n?null:(0,L.jsx)(WO,{canvas:n,itemId:t})}function WO({canvas:e,itemId:t}){let[,n]=P(),{frameSandbox:r,slots:i}=Xg(),a=new URLSearchParams(window.location.search).get(`page`)??(window.location.hash.split(`?`)[1]?new URLSearchParams(window.location.hash.split(`?`)[1]).get(`page`):null),o=(0,v.useMemo)(()=>VO(e,null),[e]),s=o.find(e=>e.item.id===t),c=a??s?.pageId??null,l=(0,v.useMemo)(()=>c?VO(e,c):o,[e,c,o]),u=l.findIndex(e=>e.item.id===t),d=__(),[f,p]=(0,v.useState)(e.theme??d),[m,h]=(0,v.useState)(`fit`),g=(0,v.useRef)(null),_=(0,v.useRef)(null),[y,b]=(0,v.useState)(null),x=(0,v.useCallback)(e=>{_.current=e,b(e)},[]),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)({w:0,h:0}),[E,D]=(0,v.useState)([]),O=c?`/c/${encodeURIComponent(e.id)}/p/${encodeURIComponent(c)}`:`/c/${encodeURIComponent(e.id)}`,k=t=>{if(!l.length)return;let r=l[(u+t+l.length)%l.length];n(HO(e.id,r.item.id,r.pageId),{replace:!0})};(0,v.useLayoutEffect)(()=>{let e=g.current;if(!e)return;let t=new ResizeObserver(()=>T({w:e.clientWidth,h:e.clientHeight}));return t.observe(e),()=>t.disconnect()},[]),(0,v.useEffect)(()=>{let e=e=>{OO(e.target)||document.querySelector(`[role="dialog"]`)||(e.key===`ArrowRight`?k(1):e.key===`ArrowLeft`?k(-1):e.key===`i`&&!e.metaKey&&!e.ctrlKey&&!e.altKey?C(e=>!e):e.key===`Escape`&&(N.info?N.select(null):S?C(!1):n(O)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});let A=l[u],j=A?.item,ee=j?.kind===`screen`?j.theme??f:f,te=LT(e.id,j,ee),[ne]=(0,v.useState)(ee),M=j?j.kind===`screen`?Ww(j.url,ne):j.url:``,re=(0,v.useMemo)(()=>y&&j?.kind===`screen`?[y]:[],[y,j?.kind]),ie=Jw(re),N=qw(re,S||ie,{onEscape:()=>C(!1)}),ae=!!N.info;if((0,v.useEffect)(()=>{ae&&C(!0)},[ae]),(0,v.useEffect)(()=>{let t=_.current;if(t&&j?.kind===`screen`)return D([]),Lw(t,t=>{if(t.type===`error`)D(e=>e.includes(t.message)?e:[...e,t.message]);else if(t.type===`updated`)D([]);else if(t.type===`keydown`&&t.code===`Escape`)n(O);else if(t.type===`go`){let[r,i]=t.target.includes(`/`)?t.target.split(`/`):[null,t.target],a=o.find(e=>e.item.id===i&&(!r||e.pageId===r));a&&n(HO(e.id,a.item.id,a.pageId))}else t.type===`link`&&Kw(t,e,t=>{let r=o.find(e=>e.item.id===t);r&&n(HO(e.id,r.item.id,r.pageId))},j?.id)})},[j,M,o,e.id,n,O]),(0,v.useEffect)(()=>{j?.kind===`screen`&&Vw(_.current,ee)},[ee,j]),!j)return(0,L.jsx)(kT,{title:`Screen not found`,text:`No screen "${t}" on this canvas.`});let oe=j.frame.width,se=j.frame.height===`auto`?Math.max(w.h-48,400):j.frame.height,ce=m===`fit`?Math.min(1,(w.w-48)/oe,(w.h-48)/se):1,le=oe<=w.w-48&&se<=w.h-48;return(0,L.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,L.jsxs)(VC,{children:[i.barStart,(0,L.jsx)(Yb,{content:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Back to canvas `,(0,L.jsx)(y_,{children:`esc`})]}),children:(0,L.jsx)(be,{href:O,className:`inline-flex h-ctrl w-ctrl items-center justify-center rounded-[6px] text-muted hover:bg-soft2 hover:text-ink2`,"aria-label":`Back to canvas`,children:(0,L.jsx)(Z,{name:`arrow-left`,size:16})})}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col leading-tight`,children:[(0,L.jsx)(`span`,{className:`truncate text-[14px] font-semibold`,children:j.title}),(0,L.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:[e.title,A.where].filter(Boolean).join(` · `)})]}),(0,L.jsxs)(`div`,{className:`mx-auto flex items-center gap-1`,children:[(0,L.jsx)(ix,{icon:`chevron-left`,label:`Previous screen (←)`,onClick:()=>k(-1),disabled:l.length<2}),(0,L.jsxs)(`span`,{className:`min-w-[52px] text-center text-[12.5px] text-muted tabular`,children:[u+1,` / `,l.length]}),(0,L.jsx)(ix,{icon:`chevron-right`,label:`Next screen (→)`,onClick:()=>k(1),disabled:l.length<2})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[le?null:(0,L.jsx)(FT,{label:`Scale`,value:m,onChange:h,items:[{value:`fit`,label:`Fit`},{value:`actual`,label:`100%`}]}),j.kind===`screen`&&!j.theme?(0,L.jsx)(FT,{label:`Screen theme`,value:f,onChange:p,items:[{value:`light`,label:(0,L.jsx)(Z,{name:`sun`,size:15}),title:`Light`},{value:`dark`,label:(0,L.jsx)(Z,{name:`moon`,size:15}),title:`Dark`}]}):null,j.kind===`screen`?(0,L.jsx)(WT,{on:S,onChange:C}):null,(0,L.jsx)(ix,{icon:`refresh`,label:`Reload`,onClick:()=>Hw(_.current)}),te?(0,L.jsx)(`a`,{href:te,target:`_blank`,rel:`noreferrer`,title:`Open in a new tab`,className:`inline-flex h-ctrl w-ctrl items-center justify-center rounded-[6px] text-muted hover:bg-soft2 hover:text-ink2`,children:(0,L.jsx)(Z,{name:`external`,size:16})}):null,(0,L.jsx)(RC,{}),i.barEnd]})]}),i.belowBar?(0,L.jsx)(`div`,{className:`shrink-0`,children:i.belowBar}):null,(0,L.jsxs)(`div`,{className:`flex min-h-0 grow basis-0`,children:[(0,L.jsxs)(`div`,{ref:g,className:`canvas-dots relative min-w-0 grow overscroll-none ${m===`actual`?`overflow-auto`:`overflow-hidden`}`,children:[E.length?(0,L.jsxs)(`div`,{className:`absolute inset-x-0 top-0 z-10 flex items-start gap-2 border-b border-rule bg-danger-soft px-4 py-2 font-mono text-[12px] whitespace-pre-wrap text-danger-text`,children:[(0,L.jsx)(Z,{name:`alert`,size:14,className:`mt-px`}),E.join(`
128
+ `)]}):null,(0,L.jsx)(`div`,{className:`flex min-h-full min-w-full items-center justify-center p-6`,style:{width:m===`actual`?oe+48:void 0},children:(0,L.jsx)(`div`,{className:`shrink-0 animate-[q-fade-in_160ms_ease-out] overflow-clip bg-surface`,style:{width:oe*ce,height:se*ce,boxShadow:`var(--shadow-frame), 0 0 0 1px var(--rule)`},children:(0,L.jsx)(`iframe`,{ref:x,src:M,title:j.title,allow:`clipboard-read; clipboard-write; fullscreen`,sandbox:r,className:`block border-0`,style:{width:oe,height:se,transform:`scale(${ce})`,transformOrigin:`0 0`,colorScheme:ee},onLoad:()=>j.kind===`screen`&&Vw(_.current,ee)},`${j.id}:${j.kind===`screen`?j.rev:j.url}`)},j.id)})]}),(0,L.jsx)(ST,{open:S,side:`right`,width:320,children:(0,L.jsx)(iT,{info:N.info,active:!0,onSelect:e=>N.select(e),onClose:()=>{C(!1),N.select(null)}})})]})]})}var GO=12;function KO({canvasId:e,pageId:t,itemId:n}){let{data:r,error:i,isLoading:a}=e_(e);return i?(0,L.jsx)(kT,{title:`Canvas not found`,text:i.message}):a||!r?(0,L.jsx)(`div`,{className:`canvas-dots h-dvh`}):(0,L.jsx)(qO,{canvas:r,pageId:t,itemId:n})}function qO({canvas:e,pageId:t,itemId:n}){let[,r]=P(),{frameSandbox:i,slots:a,scope:o}=Xg(),s=__(),c=(0,v.useMemo)(()=>VO(e,null),[e]),l=Math.max(0,n?c.findIndex(e=>e.item.id===n):t?c.findIndex(e=>e.pageId===t):0),u=c[l],d=u?.item,[f,p]=(0,v.useState)(e.theme??s),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)([]),[y,b]=(0,v.useState)(0),[x,S]=(0,v.useState)(null),[C,w]=(0,v.useState)(0),[T,E]=(0,v.useState)(!1),D=(0,v.useRef)(null),O=(0,v.useRef)(null),[k,A]=(0,v.useState)(null),j=(0,v.useCallback)(e=>{e&&(O.current=e,A(e))},[]),ee=(0,v.useCallback)((t,n=0)=>{w(n),r(HO(e.id,t.item.id,t.pageId),{replace:!0})},[e.id,r]),te=e=>{c.length<2||ee(c[(l+e+c.length)%c.length],e)},ne=e=>{let t=c.find(t=>t.item.id===e);t&&ee(t,c.indexOf(t)>l?1:-1)};(0,v.useLayoutEffect)(()=>{let e=D.current;if(!e)return;let t=new ResizeObserver(()=>b(e.clientWidth));return t.observe(e),()=>t.disconnect()},[]);let M=d?.kind===`screen`?d.theme??f:f,[re]=(0,v.useState)(M),ie=d?d.kind===`screen`?Ww(d.url,re):d.url:``,N=LT(e.id,d,M);(0,v.useEffect)(()=>{_([]),S(d?.kind===`screen`?d.measuredHeight??null:null),D.current?.scrollTo({top:0});let t=O.current;if(t&&d?.kind===`screen`)return Lw(t,t=>{t.type===`size`?S(t.height):t.type===`error`?_(e=>e.includes(t.message)?e:[...e,t.message]):t.type===`updated`?_([]):t.type===`go`?ne(t.target.includes(`/`)?t.target.split(`/`)[1]:t.target):t.type===`link`&&Kw(t,e,ne,d.id)})},[k,ie]),(0,v.useEffect)(()=>{d?.kind===`screen`&&Vw(O.current,M)},[M,d]),(0,v.useEffect)(()=>{let e=e=>{document.querySelector(`[role="dialog"]`)||(e.key===`ArrowRight`?te(1):e.key===`ArrowLeft`&&te(-1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});let ae=(0,v.useRef)(null),oe=e=>{let t=e.touches[0];ae.current=t?{x:t.clientX,y:t.clientY}:null},se=e=>{let t=ae.current,n=e.changedTouches[0];if(ae.current=null,!t||!n)return;let r=n.clientX-t.x,i=n.clientY-t.y;Math.abs(r)>56&&Math.abs(r)>Math.abs(i)*1.5&&te(r<0?1:-1)};if(!d||!u)return(0,L.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,L.jsx)(YO,{canvas:e,title:e.title,sub:null}),(0,L.jsx)(kT,{title:`No screens here`,text:`This canvas has no screens to show yet.`})]});let ce=d.frame.width,le=y?Math.min(1,(y-24)/ce):0,ue=le>0&&le<.8,de=ue&&T?1:le,fe=d.frame.height===`auto`?Math.max(x??0,480):d.frame.height,pe=d.kind===`screen`&&!d.theme;return(0,L.jsxs)(`div`,{className:`flex h-dvh flex-col`,children:[(0,L.jsx)(YO,{canvas:e,title:d.title||d.id,sub:[e.title,u.where].filter(Boolean).join(` · `),back:o?void 0:`/`,end:(0,L.jsxs)(L.Fragment,{children:[ue?(0,L.jsx)(ix,{icon:T?`zoom-out`:`zoom-in`,label:T?`Fit to width`:`Actual size`,onClick:()=>E(e=>!e)}):null,(0,L.jsxs)(MC,{align:`end`,width:220,trigger:(0,L.jsx)(ix,{icon:`more`,label:`Screen options`}),children:[pe?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(IC,{children:`Screen theme`}),(0,L.jsx)(JO,{value:`light`,current:f,onPick:p}),(0,L.jsx)(JO,{value:`dark`,current:f,onPick:p}),(0,L.jsx)(FC,{})]}):null,(0,L.jsxs)(PC,{onSelect:()=>Hw(O.current),children:[(0,L.jsx)(Z,{name:`refresh`,size:15,className:`text-ink2`}),`Reload screen`]}),N?(0,L.jsxs)(PC,{onSelect:()=>window.open(N,`_blank`,`noopener`),children:[(0,L.jsx)(Z,{name:`external`,size:15,className:`text-ink2`}),`Open in a new tab`]}):null,(0,L.jsxs)(PC,{onSelect:()=>h_(s===`dark`?`light`:`dark`),children:[(0,L.jsx)(Z,{name:s===`dark`?`sun`:`moon`,size:15,className:`text-ink2`}),s===`dark`?`Light appearance`:`Dark appearance`]})]}),a.barEnd]})}),a.belowBar?(0,L.jsx)(`div`,{className:`shrink-0`,children:a.belowBar}):null,(0,L.jsxs)(`div`,{ref:D,onTouchStart:oe,onTouchEnd:se,className:X(`canvas-dots relative min-h-0 grow overflow-y-auto overscroll-contain`,ue&&T?`overflow-x-auto`:`overflow-x-hidden`),children:[g.length?(0,L.jsxs)(`div`,{className:`sticky top-0 z-10 flex items-start gap-2 border-b border-rule bg-danger-soft px-4 py-2 font-mono text-[12px] whitespace-pre-wrap text-danger-text`,children:[(0,L.jsx)(Z,{name:`alert`,size:14,className:`mt-px shrink-0`}),(0,L.jsx)(`span`,{className:`min-w-0 break-words`,children:g.join(`
129
+ `)})]}):null,(0,L.jsx)(ed,{initial:!1,mode:`popLayout`,custom:C,children:(0,L.jsx)(Wf.div,{custom:C,initial:{opacity:0,x:C*40},animate:{opacity:1,x:0},exit:{opacity:0,x:C*-40,transition:{duration:.12}},transition:{type:`spring`,stiffness:420,damping:38},className:X(`flex`,ue&&T?`w-max`:`justify-center`),style:{padding:GO},children:de?(0,L.jsx)(`div`,{className:`shrink-0 overflow-hidden rounded-[6px] bg-surface`,style:{width:ce*de,height:fe*de,boxShadow:`var(--shadow-frame), 0 0 0 1px var(--rule)`},children:(0,L.jsx)(`iframe`,{ref:j,src:ie,title:d.title,allow:`clipboard-read; clipboard-write; fullscreen`,sandbox:i,className:`block border-0`,style:{width:ce,height:fe,transform:`scale(${de})`,transformOrigin:`0 0`,colorScheme:M},onLoad:()=>d.kind===`screen`&&Vw(O.current,M)},`${d.id}:${d.kind===`screen`?d.rev:d.url}`)}):null},d.id)})]}),(0,L.jsxs)(`nav`,{"aria-label":`Screens`,className:`flex shrink-0 items-center gap-1 border-t border-rule bg-surface px-2 pt-1.5 pb-[max(6px,env(safe-area-inset-bottom))]`,children:[(0,L.jsx)(ix,{icon:`chevron-left`,label:`Previous screen`,onClick:()=>te(-1),disabled:c.length<2}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>h(!0),className:`flex h-10 min-w-0 grow cursor-pointer items-center justify-center gap-2 rounded-[8px] border-0 bg-transparent px-3 text-[13.5px] text-ink active:bg-soft2`,children:[(0,L.jsx)(Z,{name:`list`,size:15,className:`shrink-0 text-muted`}),(0,L.jsxs)(`span`,{className:`tabular shrink-0 text-muted`,children:[l+1,` / `,c.length]}),(0,L.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:d.title||d.id})]}),(0,L.jsx)(ix,{icon:`chevron-right`,label:`Next screen`,onClick:()=>te(1),disabled:c.length<2})]}),(0,L.jsx)(BO,{open:m,onOpenChange:h,title:e.title,children:(0,L.jsx)(ZO,{canvas:e,current:d.id,onPick:e=>{h(!1),ne(e)}})})]})}function JO({value:e,current:t,onPick:n}){return(0,L.jsxs)(PC,{active:t===e,onSelect:()=>n(e),children:[(0,L.jsx)(Z,{name:e===`dark`?`moon`:`sun`,size:15,className:`text-ink2`}),e===`dark`?`Dark`:`Light`,t===e?(0,L.jsx)(Z,{name:`check`,size:15,className:`ml-auto text-ink2`}):null]})}function YO({canvas:e,title:t,sub:n,back:r,end:i}){let{slots:a}=Xg();return(0,L.jsxs)(`header`,{className:`flex h-[52px] shrink-0 items-center gap-2 border-b border-rule bg-surface pr-2 pl-2 pt-[env(safe-area-inset-top)]`,children:[a.barStart,r?(0,L.jsx)(be,{href:r,"aria-label":`All canvases, leaving ${e.title}`,className:`inline-flex size-10 shrink-0 items-center justify-center rounded-[8px] text-ink2 active:bg-soft2`,children:(0,L.jsx)(Z,{name:`arrow-left`,size:18})}):(0,L.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center`,children:(0,L.jsx)(zC,{})}),(0,L.jsxs)(`div`,{className:`flex min-w-0 grow flex-col leading-tight`,children:[(0,L.jsx)(`span`,{className:`truncate text-[14.5px] font-semibold`,children:t}),n?(0,L.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:n}):null]}),(0,L.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:i})]})}var XO=e=>e.item.kind===`url`?`globe`:e.item.frame.device===`phone`?`smartphone`:e.item.frame.device===`tablet`?`tablet`:`monitor`;function ZO({canvas:e,current:t,onPick:n}){let r=(0,v.useRef)(null);(0,v.useEffect)(()=>{r.current?.scrollIntoView({block:`center`})},[]);let i=e.pages.length>1;return(0,L.jsx)(`div`,{className:`flex flex-col pb-2`,children:e.pages.map(a=>{let o=VO(e,a.id);return o.length?(0,L.jsxs)(`section`,{className:`flex flex-col`,children:[i?(0,L.jsx)(`h3`,{className:`sticky top-0 z-[1] m-0 border-b border-rule bg-soft px-4 py-2 text-[12px] font-semibold text-ink2`,children:a.title}):null,a.sections.map(e=>{let i=o.filter(t=>e.items.includes(t.item));return i.length?(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[e.title?(0,L.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:e.title}):null,i.map(e=>{let i=e.item.id===t;return(0,L.jsxs)(`button`,{ref:i?r:void 0,type:`button`,"aria-current":i?`true`:void 0,onClick:()=>n(e.item.id),className:X(`flex min-h-[48px] cursor-pointer items-center gap-3 border-0 bg-transparent px-4 text-left text-[14px] active:bg-soft2`,i?`font-medium text-ink`:`text-ink2`),children:[(0,L.jsx)(`span`,{className:X(`flex size-8 shrink-0 items-center justify-center rounded-[8px]`,i?`bg-action-soft text-action`:`bg-soft2 text-muted`),children:(0,L.jsx)(Z,{name:XO(e),size:15})}),(0,L.jsx)(`span`,{className:`min-w-0 grow truncate`,children:e.item.title||e.item.id}),i?(0,L.jsx)(Z,{name:`check`,size:16,className:`shrink-0 text-action`}):null]},e.item.id)})]},e.id):null})]},a.id):null})})}var QO=[[`year`,31536e3],[`month`,2592e3],[`week`,604800],[`day`,86400],[`hour`,3600],[`minute`,60]],$O=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`});function ek(e){if(!e)return``;let t=(e-Date.now())/1e3;for(let[e,n]of QO)if(Math.abs(t)>=n)return $O.format(Math.round(t/n),e);return`just now`}function tk(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(+(e<10240))} KB`:`${(e/1024/1024).toFixed(1)} MB`}function nk(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function rk({className:e,style:t}){return(0,L.jsx)(`span`,{"aria-hidden":`true`,className:X(`block animate-pulse rounded-[6px] bg-soft2`,e),style:t})}function ik({rows:e=3,lead:t=28,minH:n=56}){return(0,L.jsx)(`div`,{role:`status`,"aria-label":`Loading`,children:Array.from({length:e},(e,r)=>(0,L.jsxs)(`div`,{className:`flex items-center gap-3 border-t border-rule px-4`,style:{minHeight:n,opacity:1-r*.18},children:[t?(0,L.jsx)(rk,{style:{width:t,height:Math.min(t,n-20)}}):null,(0,L.jsxs)(`span`,{className:`flex min-w-0 grow flex-col gap-1.5`,children:[(0,L.jsx)(rk,{className:`h-3 w-[38%]`}),(0,L.jsx)(rk,{className:`h-2.5 w-[62%]`})]}),(0,L.jsx)(rk,{className:`h-3 w-14`})]},r))})}function ak({canvas:e}){return(0,L.jsx)(`div`,{className:`flex h-[54px] w-[86px] shrink-0 items-center justify-center overflow-hidden rounded-[6px] border border-rule bg-soft`,children:e.cover?(0,L.jsx)(`img`,{src:e.cover,alt:``,className:`h-full w-full object-cover object-top`}):(0,L.jsx)(Z,{name:`canvas`,size:18,className:`text-muted`})})}function ok({src:e}){return(0,L.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-[6px] border border-rule bg-soft`,children:(0,L.jsx)(`img`,{src:e,alt:``,className:`size-full object-contain`})})}function sk({project:e}){let{source:t,keys:n}=Xg(),r=Ne(),i=(0,v.useRef)(null);if(!t.setIcon||e.static)return null;let a=async e=>{try{await t.setIcon(e),await r.invalidateQueries({queryKey:n.project}),Tw(e?`Icon set`:`Icon removed`,e?`Saved as .design/icon; a linked project takes it to the cloud on its next push or pull.`:void 0)}catch(e){Tw(`Could not change the icon`,e.message,`error`)}};return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`input`,{ref:i,type:`file`,accept:`.svg,.png,.webp,image/svg+xml,image/png,image/webp`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&a(t)}}),(0,L.jsxs)(MC,{trigger:(0,L.jsx)(tx,{children:`Icon`}),align:`end`,width:240,children:[(0,L.jsxs)(PC,{onSelect:()=>i.current?.click(),hint:`≤ 256 KB`,children:[(0,L.jsx)(Z,{name:`upload`,size:15}),e.icon?`Replace icon`:`Upload icon`]}),e.icon?(0,L.jsxs)(PC,{danger:!0,onSelect:()=>void a(null),children:[(0,L.jsx)(Z,{name:`trash`,size:15}),`Remove icon`]}):null]})]})}function ck({actions:e,children:t}){return e?(0,L.jsxs)(`div`,{className:`grid items-center border-t border-rule transition-colors hover:bg-soft`,style:{gridTemplateColumns:`minmax(0,1fr) auto`},children:[t,(0,L.jsx)(`div`,{className:`flex items-center gap-2 pr-4`,children:e})]}):t}function lk({children:e}){return e?(0,L.jsx)(`div`,{className:`flex items-center gap-2.5 border-t border-rule bg-soft px-4 py-3 text-[12.5px] text-muted`,children:e}):null}function uk({project:e}){let{canvasRowActions:t,canvasesFoot:n}=Xg().slots,r=XC();return e.canvases.length?(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Canvases`,count:e.canvases.length}),e.canvases.map(e=>{let n=t?.(e.id);return(0,L.jsx)(ck,{actions:n,children:r?(0,L.jsxs)(gT,{to:`/c/${encodeURIComponent(e.id)}`,cols:`86px minmax(0,1fr)`,align:`ll`,pad:`10px 16px`,minH:74,first:!!n,children:[(0,L.jsx)(ak,{canvas:e}),(0,L.jsx)(b_,{top:e.title,bottom:(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[e.issues?(0,L.jsx)(oT,{tone:`danger`,children:nk(e.issues,`problem`)}):null,(0,L.jsxs)(`span`,{className:`truncate`,children:[nk(e.screens,`screen`),` · `,ek(e.updatedAt)]})]})})]}):(0,L.jsxs)(gT,{to:`/c/${encodeURIComponent(e.id)}`,cols:`86px minmax(0,1fr) auto auto`,align:`llrr`,pad:`10px 16px`,minH:74,first:!!n,children:[(0,L.jsx)(ak,{canvas:e}),(0,L.jsx)(b_,{top:e.title,bottom:(0,L.jsx)(`span`,{className:`truncate`,children:e.description??e.id})}),(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-[12.5px] whitespace-nowrap text-muted`,children:[e.issues?(0,L.jsx)(oT,{tone:`danger`,children:nk(e.issues,`problem`)}):null,nk(e.screens,`screen`),` · `,nk(e.pages,`page`)]}),(0,L.jsx)(`span`,{className:`w-[92px] text-[12.5px] whitespace-nowrap text-muted`,children:ek(e.updatedAt)})]})},e.id)}),(0,L.jsx)(lk,{children:n})]}):(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Canvases`,count:0}),(0,L.jsx)(vT,{children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 py-6 text-center`,children:[(0,L.jsx)(`span`,{className:`text-[14px] text-ink2`,children:`No canvases yet.`}),(0,L.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`Ask your agent to design something, or run `,(0,L.jsx)(Q,{children:`design new <name>`}),` in the project.`]})]})}),(0,L.jsx)(lk,{children:n})]})}function dk({project:e}){let t=e.system;return t?(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Design system`,right:(0,L.jsx)(ax,{to:`/system`,children:`Open`})}),(0,L.jsxs)(vT,{gap:6,children:[(0,L.jsx)(`span`,{className:`text-[15px] font-semibold`,children:t.name}),t.description?(0,L.jsx)(`span`,{className:`text-[13px] text-ink2`,children:t.description}):null]}),(0,L.jsx)(_T,{label:`Tokens`,labelWidth:120,end:!0,children:(0,L.jsx)(sT,{value:t.tokens})}),(0,L.jsx)(_T,{label:`Components`,labelWidth:120,end:!0,children:(0,L.jsx)(sT,{value:t.components})}),(0,L.jsx)(_T,{label:`Guidelines`,labelWidth:120,end:!0,children:(0,L.jsx)(sT,{value:t.guidelines})}),t.issues?(0,L.jsx)(_T,{label:`Problems`,labelWidth:120,end:!0,children:(0,L.jsx)(oT,{tone:`danger`,children:t.issues})}):null]}):(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Design system`}),(0,L.jsx)(vT,{children:(0,L.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`No design system yet. Ask your agent to build one from the codebase, or run `,(0,L.jsx)(Q,{children:`design system init`}),`.`]})})]})}function fk(){return(0,L.jsxs)(CT,{children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-2.5 pt-1 pb-1`,children:[(0,L.jsx)(rk,{className:`h-6 w-[220px]`}),(0,L.jsx)(rk,{className:`h-3.5 w-[300px]`})]}),(0,L.jsxs)(`div`,{className:`grid items-start gap-5 max-lg:grid-cols-1!`,style:{gridTemplateColumns:`minmax(0,1fr) 340px`},children:[(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Canvases`}),(0,L.jsx)(ik,{rows:3,lead:86,minH:74})]}),(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Design system`}),(0,L.jsx)(ik,{rows:3,lead:0,minH:40})]})]})]})}function pk(){let{data:e,error:t,isLoading:n}=$g(),{slots:r}=Xg(),i=XC();return t?(0,L.jsx)(OT,{title:`Could not load the project`,text:t.message}):n||!e?(0,L.jsx)(fk,{}):(0,L.jsxs)(CT,{children:[(0,L.jsx)(wT,{title:e.icon?(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,L.jsx)(ok,{src:e.icon}),e.name]}):e.name,right:i?void 0:r.homeActions??(0,L.jsx)(sk,{project:e}),badge:i&&r.homeActions?(0,L.jsx)(`span`,{className:`ml-auto flex`,children:r.homeActions}):void 0,sub:r.homeSub?r.homeSub:e.static?`Snapshot built with foss-design ${e.version}`:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Q,{size:12.5,wrap:!0,children:[e.root,`/.design`]}),` `,`· foss-design `,e.version]})}),(0,L.jsx)(bT,{issues:e.issues,title:`Problems in design.json`}),(0,L.jsxs)(`div`,{className:`grid items-start gap-5 max-lg:grid-cols-1!`,style:{gridTemplateColumns:`minmax(0,1fr) 340px`},children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5`,children:[(0,L.jsx)(uk,{project:e}),r.canvasesAfter]}),(0,L.jsx)(dk,{project:e})]}),r.homeAfter]})}function mk(e){let t=e.utility;if(t===void 0)return[];let n=t?`-${t}`:``;switch(e.kind){case`color`:return[`bg${n}`,`text${n}`,`border${n}`];case`font`:return[`font${n}`];case`text`:return[`text${n}`];case`weight`:return[`font${n}`];case`leading`:return[`leading${n}`];case`tracking`:return[`tracking${n}`];case`spacing`:return t?[`p${n}`,`gap${n}`]:[`p-1`,`gap-4`,`m-2`];case`radius`:return[`rounded${n}`];case`shadow`:return e.name.startsWith(`--inset-shadow-`)?[`inset-shadow${n}`]:e.name.startsWith(`--drop-shadow-`)?[`drop-shadow${n}`]:e.name.startsWith(`--text-shadow-`)?[`text-shadow${n}`]:[`shadow${n}`];case`blur`:return[`blur${n}`,`backdrop-blur${n}`];case`ease`:return[`ease${n}`];case`animation`:return[`animate${n}`];case`breakpoint`:return e.name.startsWith(`--container-`)?[`@${t}:`,`max-w${n}`]:[`${t}:`];default:return[]}}function hk(e,...t){return e.filter(e=>t.includes(e.kind))}function gk(e){let t=new Map;for(let n of e){let e=t.get(n.group)??[];e.push(n),t.set(n.group,e)}return[...t].map(([e,t])=>({group:e,tokens:t}))}function _k(e){let t=/^(-?[\d.]+)(px|rem|em)?$/.exec(e.trim());if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?t[2]===`rem`||t[2]===`em`?n*16:n:null}function vk(e,t){return(t===`dark`?e.dark?.value:void 0)??e.light?.value}function yk(){let e=__(),[t,n]=(0,v.useState)(null);return[t??e,n]}function bk({value:e,onChange:t}){return(0,L.jsx)(FT,{label:`Theme`,size:`sm`,value:e,onChange:t,items:[{value:`light`,label:(0,L.jsx)(Z,{name:`sun`,size:14}),title:`Light`},{value:`dark`,label:(0,L.jsx)(Z,{name:`moon`,size:14}),title:`Dark`}]})}function xk({items:e}){return e.length?(0,L.jsx)(`span`,{className:`flex min-w-0 flex-wrap gap-x-2 gap-y-0.5`,children:e.map(e=>(0,L.jsx)(Q,{size:12,className:`text-muted`,children:e},e))}):null}function Sk({title:e,children:t}){return(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:e}),(0,L.jsx)(vT,{children:(0,L.jsx)(`div`,{className:`py-4 text-[13px] text-muted`,children:t})})]})}var Ck=`.design/system/tokens.css`;function wk({children:e,className:t}){return(0,L.jsx)(`span`,{className:`font-mono text-[12px] text-muted [overflow-wrap:anywhere] ${t??``}`,children:e})}function Tk({asset:e,index:t}){if(e.kind===`image`)return(0,L.jsx)(`span`,{className:`checker flex h-[132px] items-center justify-center overflow-hidden border-b border-rule`,children:(0,L.jsx)(`img`,{src:e.url,alt:``,className:`max-h-[96px] max-w-[80%] object-contain`})});if(e.kind===`font`){let n=`design-asset-font-${t}`;return(0,L.jsxs)(`span`,{className:`flex h-[132px] items-center justify-center border-b border-rule bg-soft`,children:[(0,L.jsx)(`style`,{children:`@font-face{font-family:"${n}";src:url("${e.url.replace(/"/g,`%22`)}")}`}),(0,L.jsx)(`span`,{className:`text-[52px] leading-none text-ink`,style:{fontFamily:`"${n}", var(--font-sans)`},children:`Aa`})]})}return(0,L.jsx)(`span`,{className:`flex h-[132px] items-center justify-center border-b border-rule bg-soft text-muted`,children:(0,L.jsx)(Z,{name:`file`,size:28})})}function Ek({system:e}){return e.assets.length?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(wT,{title:`Assets`,sub:`Click an asset to copy its import path.`}),(0,L.jsx)(`div`,{className:`grid gap-4`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(210px, 1fr))`},children:e.assets.map((e,t)=>(0,L.jsx)(`button`,{type:`button`,title:`Copy the import path`,onClick:()=>kw(`@system/${e.path}`),className:`block cursor-pointer border-0 bg-transparent p-0 text-left`,children:(0,L.jsxs)(cT,{className:`transition-colors hover:border-rule-strong`,children:[(0,L.jsx)(Tk,{asset:e,index:t}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 px-3.5 py-2.5`,children:[(0,L.jsx)(`span`,{className:`truncate text-[13.5px] font-medium text-ink`,children:e.name}),(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-[12.5px] text-muted`,children:[(0,L.jsx)(`span`,{className:`shrink-0`,children:tk(e.size)}),(0,L.jsx)(Q,{size:12,className:`truncate`,children:e.path})]})]})]})},e.path))})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(wT,{title:`Assets`}),(0,L.jsxs)(Sk,{title:`No assets`,children:[`Put logos, icons, images and font files in `,(0,L.jsx)(Q,{children:`.design/system/assets`}),`; screens import them as`,` `,(0,L.jsx)(Q,{children:`@system/assets/…`}),`.`]})]})}function Dk({color:e,label:t,className:n}){return e?(0,L.jsx)(`span`,{title:`${t}: ${e}`,className:X(`checker relative h-[30px] w-[44px] shrink-0 overflow-hidden rounded-[6px]`,n),children:(0,L.jsx)(`span`,{className:`absolute inset-0 rounded-[6px] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] dark:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.12)]`,style:{background:e}})}):(0,L.jsx)(`span`,{className:X(`h-[30px] w-[44px] shrink-0`,n)})}function Ok({tokens:e}){let t=e.some(e=>e.dark),n=t=>(0,L.jsxs)(`div`,{className:`relative flex h-9 min-w-0 grow overflow-hidden rounded-[6px]`,children:[(0,L.jsx)(`span`,{className:`pointer-events-none absolute inset-0 z-10 rounded-[6px] shadow-[inset_0_0_0_1px_var(--rule-strong)] opacity-60`}),e.map(e=>{let n=t===`dark`?e.dark?.value??e.light?.value:e.light?.value;return(0,L.jsx)(`button`,{type:`button`,title:`${e.name}: ${n}`,onClick:()=>kw(`var(${e.name})`),className:`h-full min-w-0 flex-1 cursor-pointer border-0 p-0 transition-[flex-grow] duration-150 hover:grow-[1.6]`,style:{background:n}},e.name)})]});return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-rule px-4 py-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[t?(0,L.jsx)(`span`,{className:`w-9 shrink-0 text-[12px] text-muted`,children:`Light`}):null,n(`light`)]}),t?(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`span`,{className:`w-9 shrink-0 text-[12px] text-muted`,children:`Dark`}),n(`dark`)]}):null]})}function kk({token:e}){return(0,L.jsxs)(hT,{cols:`100px minmax(170px, 0.9fr) minmax(0, 1.4fr)`,minH:56,title:`Copy the variable`,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(Dk,{color:e.light?.value,label:`Light`}),e.dark?(0,L.jsx)(Dk,{color:e.dark.value,label:`Dark`}):null]}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,L.jsx)(xk,{items:mk(e).slice(0,2)})]}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-wrap gap-x-3`,children:[(0,L.jsx)(Q,{size:12,className:`text-muted`,children:e.light?.value}),e.dark?(0,L.jsxs)(Q,{size:12,className:`text-muted`,children:[`dark `,e.dark.value]}):null]}),e.description?(0,L.jsx)(`span`,{className:`text-[13px] text-ink2`,children:e.description}):null]})]})}function Ak({system:e}){let t=hk(e.tokens,`color`),n=gk(t);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(wT,{title:`Colors`,sub:t.length?`${t.length} tokens · click a color to copy its variable`:void 0}),n.length?n.map(({group:e,tokens:t})=>(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:e,count:t.length}),(0,L.jsx)(Ok,{tokens:t}),t.map(e=>(0,L.jsx)(kk,{token:e},e.name))]},e)):(0,L.jsxs)(Sk,{title:`No color tokens`,children:[`Add them to `,(0,L.jsx)(Q,{children:Ck}),`: light values in `,(0,L.jsx)(Q,{children:`:root`}),`, dark ones in`,` `,(0,L.jsx)(Q,{children:`:root[data-theme="dark"]`}),`, and map them to Tailwind with `,(0,L.jsx)(Q,{children:`--color-*`}),` in`,` `,(0,L.jsx)(Q,{children:`@theme inline`}),`.`]})]})}function jk({src:e,theme:t,title:n,minHeight:r=120,width:i,className:a}){let o=(0,v.useRef)(null),{frameSandbox:s}=Xg(),[c]=(0,v.useState)(()=>({src:e,theme:t})),l=Ww(e,c.src===e?c.theme:t),[u,d]=(0,v.useState)(r),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)([]);return(0,v.useEffect)(()=>{let e=o.current;if(e)return p(!1),h([]),Lw(e,t=>{t.type===`size`?d(Math.max(r,t.height)):t.type===`ready`?p(!0):t.type===`error`?h(e=>e.includes(t.message)?e:[...e,t.message]):t.type===`updated`?h([]):t.type===`wheel`&&!t.zoom&&Bw(e,t)})},[r,l]),(0,v.useEffect)(()=>{Vw(o.current,t)},[t]),(0,L.jsxs)(`div`,{className:X(`relative`,a),style:{width:i},children:[m.length?(0,L.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-rule bg-danger-soft px-4 py-2.5 text-[12.5px] text-danger-text`,children:[(0,L.jsx)(Z,{name:`alert`,size:15,className:`mt-px`}),(0,L.jsx)(`div`,{className:`min-w-0 font-mono break-words`,children:m.join(`
130
+ `)})]}):null,(0,L.jsx)(`iframe`,{ref:o,src:l,title:n,sandbox:s,className:X(`block w-full border-0 transition-opacity duration-150`,f?`opacity-100`:`opacity-0`),style:{height:u,colorScheme:t},onLoad:()=>Vw(o.current,t)},l),f?null:(0,L.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-muted`,children:(0,L.jsx)(Z,{name:`loader`,size:18})})]})}var Mk=`identifier keyword string class property entity jsxliterals sign comment break space`.split(` `),[Nk,Pk,Fk,Ik,Lk,Rk,zk,Bk,Vk,Hk,Uk]=Mk.map((e,t)=>t);new Map(Mk.map((e,t)=>[e,t]));function Wk(e,t){let n=[],r=0,i=[],a=!1;function o(e){n.push({index:r++,value:e.map(([,e])=>e).join(``),tokens:e.map(([e,t])=>({type:Mk[e],value:t})),annotations:[]})}for(let e=0;e<t.length;e++){let n=t[e],[r,s]=n;if(r!==Hk){if(s.includes(`
131
131
  `)){let e=s.split(`
132
- `);for(let t=0;t<e.length;t++)i.push([r,e[t]]),t<e.length-1&&(o(i),i.length=0)}else i.push(n);a=!1}else a?o([]):(o(i),i.length=0),e===t.length-1&&o([]),a=!0}return i.length&&o(i),{value:e,lines:n}}function Wk(e,t){let n={index:e.index,value:e.value,tokens:e.tokens,annotations:e.annotations,className:`sh__line${e.annotations.map(e=>` sh__line--${e}`).join(``)}`,style:{},properties:{}};return t?.(n),n}function Gk({type:e,value:t},n,r){let i=n?.[e],a={type:e,value:t,className:`sh__token--${e}${i?` ${i}`:``}`,style:{color:`var(--sh-${e})`},properties:{}};return r?.(a),a}function Kk(e,t){let n=t?.cx,r=t?.mark,i=t?.markLine;return!n&&!r&&!i?e.lines.map(e=>{let t=`sh__line${e.annotations.map(e=>` sh__line--${e}`).join(``)}`,n=e.tokens.map(({type:e,value:t})=>`<span class="sh__token--${e}" style="color:var(--sh-${e})">${Jk(t)}</span>`).join(``);return`<span class="${Jk(t)}">${n}</span>`}).join(`
133
- `):e.lines.map(e=>{let t=Wk(e,i),a=e.tokens.map(e=>{let t=Gk(e,n,r);return`<span ${Yk({...t.properties,className:t.className,style:t.style})}>${Jk(t.value)}</span>`}).join(``);return`<span ${Yk({...t.properties,className:t.className,style:t.style})}>${a}</span>`}).join(`
134
- `)}var qk={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#039;`},Jk=e=>e.replace(/[&<>"']/g,e=>qk[e]);function Yk(e){let t=Object.entries(e.style||{}).map(([e,t])=>`${e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${t}`).join(`;`),n=Object.entries(e).filter(([e,t])=>/^[\w:-]+$/.test(e)&&e!==`className`&&e!==`style`&&t!==!1&&t!=null).map(([e,t])=>t===!0?e:`${e}="${Jk(String(t))}"`).join(` `);return`class="${Jk(e.className||``)}"${t?` style="${Jk(t)}"`:``}${n?` ${n}`:``}`}var Xk=new Set(`+-*/%=!&|^~?:.,;()[]{}<>#@\\`.split(``)),Zk=()=>0,Qk=e=>e===`_`||e===`$`||/[\p{L}\p{N}]/u.test(e);function $k(e,t){for(;t<e.length&&/\s/.test(e[t]);)t++;return e[t]===`:`}function eA(e,t){if(typeof t?.tokenize==`function`)return t.tokenize(e,t);let n=t?.keywords||new Set,r=t?.typeKeywords||new Set,i=t?.onCommentStart||Zk,a=t?.onCommentEnd||Zk,o=t?.caseInsensitive?e=>e.toLowerCase():e=>e,s=[],c=``;function l(e,t){t&&(s.push([e,t]),e!==Hk&&e!==Vk&&(c=t))}for(let s=0;s<e.length;){let u=e[s],d=e[s+1],f=i(u,d,s,e);if(f){let t=s++;for(;s<e.length;){if(a(e[s-1],e[s],s,e,t)==f){s++;break}s++}l(Bk,e.slice(t,s));continue}let p=t?.onLiteral?.(u,s,e);if(p){l(Pk,e.slice(s,s+p)),s+=p;continue}if(typeof t?.onQuote==`function`&&u===`'`){let n=t.onQuote(u,s,e);if(typeof n==`number`&&n>=1){l(Mk,e.slice(s,s+n)),s+=n;continue}}if(u===`"`||u===`'`||t?.templateStrings&&u==="`"){let n=u,r=s++;for(;s<e.length;){if(e[s]===`\\`)s++;else if(e[s]===n){s++;break}s++}let i=e.slice(r,s);l(t?.quotedKeys&&$k(e,s)?Ik:Pk,i);continue}if(u===`
135
- `){l(Vk,u),s++;continue}if(/[^\S\r\n]/.test(u)){let t=s++;for(;s<e.length&&/[^\S\r\n]/.test(e[s]);)s++;l(Hk,e.slice(t,s));continue}if(Qk(u)){let t=s++;for(;s<e.length&&Qk(e[s]);)s++;if(/^\d/.test(u)&&e[s]===`.`&&/\d/.test(e[s+1]||``))for(s++;s<e.length&&Qk(e[s]);)s++;let i=e.slice(t,s),a=o(i);l(r.has(a)?Fk:n.has(a)?Nk:c===`.`?Ik:/^\d/.test(i)||i===`null`||/^\p{Lu}/u.test(i)?Fk:Mk,i);continue}if(Xk.has(u)){l(zk,u),s++;continue}l(Pk,u),s++}return s}function tA(e,t){let n=Uk(e,eA(e,t));if(t?.annotateLine)for(let e of n.lines)t.annotateLine(e);return n}var nA=(e,t)=>{let n=e+t;return n===`//`?1:n===`/*`?2:0},rA=(e,t)=>t===`
136
- `?1:e+t===`*/`?2:0,iA=s({keywords:()=>oA,onCommentEnd:()=>rA,onCommentStart:()=>nA,typeKeywords:()=>aA}),aA=new Set([`void`,`char`,`short`,`int`,`long`,`float`,`double`,`signed`,`unsigned`,`_Bool`,`_Complex`,`_Imaginary`]),oA=new Set(`auto.break.case.const.continue.default.do.else.enum.extern.for.goto.if.inline.register.restrict.return.sizeof.static.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local`.split(`.`)),sA=s({keywords:()=>cA,onCommentEnd:()=>rA,onCommentStart:()=>nA,typeKeywords:()=>lA}),cA=new Set(`alignas.alignof.and.and_eq.asm.auto.bitand.bitor.break.case.catch.class.compl.concept.const.consteval.constexpr.constinit.const_cast.continue.co_await.co_return.co_yield.decltype.default.delete.do.dynamic_cast.else.enum.explicit.export.extern.false.for.friend.goto.if.inline.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.private.protected.public.register.reinterpret_cast.requires.return.sizeof.static.static_assert.static_cast.struct.switch.template.this.thread_local.throw.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`)),lA=new Set([`bool`,`char`,`char8_t`,`char16_t`,`char32_t`,`double`,`float`,`int`,`long`,`short`,`signed`,`unsigned`,`void`,`wchar_t`]),uA=s({keywords:()=>dA,onCommentEnd:()=>rA,onCommentStart:()=>nA,typeKeywords:()=>fA}),dA=new Set(`abstract.as.async.await.base.break.case.catch.checked.class.const.continue.default.delegate.do.else.enum.event.explicit.extern.false.finally.fixed.for.foreach.from.get.global.goto.if.implicit.in.init.interface.internal.into.is.join.let.lock.namespace.new.null.on.operator.orderby.out.override.params.partial.private.protected.public.readonly.record.ref.remove.required.return.sealed.select.set.sizeof.stackalloc.static.struct.switch.this.throw.true.try.typeof.unchecked.unsafe.using.value.virtual.volatile.when.where.while.with.yield`.split(`.`)),fA=new Set([`bool`,`byte`,`char`,`decimal`,`double`,`dynamic`,`float`,`int`,`long`,`nint`,`nuint`,`object`,`sbyte`,`short`,`string`,`uint`,`ulong`,`ushort`,`void`]),pA=s({keywords:()=>mA,onCommentEnd:()=>gA,onCommentStart:()=>hA,onLiteral:()=>_A,tokenize:()=>TA}),mA=new Set([`@media`,`@import`,`@keyframes`,`@font-face`,`@supports`,`@page`,`@counter-style`,`@font-feature-values`,`@viewport`,`@counter-style`,`@font-feature-values`,`@document`]),hA=(e,t)=>+(e+t===`/*`),gA=(e,t)=>+(e+t===`*/`),_A=(e,t,n)=>e===`#`&&n.slice(t).match(/^#(?:[\da-f]{8}|[\da-f]{6}|[\da-f]{4}|[\da-f]{3})(?![\w-])/i)?.[0].length||0,vA=e=>e===Hk||e===Vk||e===Bk,yA=([e,t])=>e===Mk||e===Fk||e===zk&&t===`-`,bA=([e])=>e===Mk||e===Fk||e===Ik,xA=e=>bA(e)&&!/^\d/.test(e[1]),SA=([e,t])=>e===zk&&t===`-`,CA=e=>{for(let t=0;t<e.length;t++){let n=t,r=t;if(SA(e[r])){for(;e[r]&&SA(e[r]);)r++;if(!e[r]||!xA(e[r]))continue;n=r++}else if(xA(e[r]))r++;else continue;let i=n>t;for(;e[r]&&SA(e[r]);){let t=r;for(;e[r]&&SA(e[r]);)r++;if(!e[r]||!bA(e[r])){r=t;break}i=!0,r++}if(!i)continue;let a=e.slice(t,r).map(([,e])=>e).join(``);e.splice(t,r-t,[e[n][0],a])}},wA=(e,t)=>{let n=0,r=0;for(let i=t;i<e.length;i++){let[t,a]=e[i];if(t===zk){if(a===`(`)n++;else if(a===`)`)n--;else if(a===`[`)r++;else if(a===`]`)r--;else if(!n&&!r&&a===`{`)return!0;else if(!n&&!r&&(a===`;`||a===`}`))return!1}}return!1},TA=(e,t)=>{let n=eA(e,{...t,tokenize:void 0});CA(n);let r=0,i=!1;for(let e=0;e<n.length;e++){let[t,a]=n[e];if(t===zk&&a===`{`){r++,i=!0;continue}if(t===zk&&a===`}`){r--,i=!1;continue}if(t===zk&&a===`;`){i=r>0;continue}if(!i||vA(t))continue;let o=e,s=e;for(;s<n.length&&yA(n[s]);)s++;let c=s;for(;c<n.length&&vA(n[c][0]);)c++;if(s>o&&n[c]?.[0]===zk&&n[c][1]===`:`&&!wA(n,c+1)){let e=n.slice(o,s).map(([,e])=>e).join(``);n.splice(o,s-o,[Ik,e])}i=!1}return n},EA=s({annotateLine:()=>OA,keywords:()=>DA}),DA=new Set([]),OA=e=>{let t=``;if(e.value.startsWith(`+`)&&!e.value.startsWith(`+++`))t=`diff-add`;else if(e.value.startsWith(`-`)&&!e.value.startsWith(`---`))t=`diff-remove`;else if(e.value.startsWith(`@@`))t=`diff-hunk`;else if(/^(diff --git|index |--- |\+\+\+ )/.test(e.value)){t=`diff-meta`;for(let t of e.tokens)t.type===`property`&&(t.type=`identifier`)}t&&e.annotations.push(t)},kA=e=>+(e===`#`),AA=(e,t)=>+(t===`
137
- `),jA=s({caseInsensitive:()=>!0,keywords:()=>MA,onCommentEnd:()=>AA,onCommentStart:()=>kA}),MA=new Set([`add`,`arg`,`cmd`,`copy`,`entrypoint`,`env`,`expose`,`from`,`healthcheck`,`label`,`maintainer`,`onbuild`,`run`,`shell`,`stopsignal`,`user`,`volume`,`workdir`]),NA=s({keywords:()=>FA,onCommentEnd:()=>rA,onCommentStart:()=>nA,typeKeywords:()=>PA}),PA=new Set([`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int`,`int8`,`int16`,`int32`,`int64`,`rune`,`string`,`uint`,`uint8`,`uint16`,`uint32`,`uint64`,`uintptr`]),FA=new Set([`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`]),IA=s({keywords:()=>LA,onCommentEnd:()=>AA,onCommentStart:()=>kA,typeKeywords:()=>RA}),LA=new Set([`directive`,`enum`,`extend`,`fragment`,`implements`,`input`,`interface`,`mutation`,`on`,`query`,`repeatable`,`scalar`,`schema`,`subscription`,`type`,`union`]),RA=new Set([`Boolean`,`Float`,`ID`,`Int`,`String`]),zA=s({keywords:()=>BA,onCommentEnd:()=>HA,onCommentStart:()=>VA}),BA=new Set([`false`,`for`,`if`,`in`,`null`,`true`]),VA=(e,t)=>e===`#`||e+t===`//`?1:e+t===`/*`?2:0,HA=(e,t)=>t===`
138
- `?1:e+t===`*/`?2:0,UA=new Set([`<`,`>`,`{`,`}`,`[`,`]`]),WA=new Set(`for.do.while.if.else.return.function.var.let.const.true.false.undefined.this.new.delete.typeof.in.instanceof.void.break.continue.switch.case.default.throw.try.catch.finally.debugger.with.yield.async.await.class.extends.super.import.export.from.static`.split(`.`)),GA=new Set([...WA,`type`,`interface`,`enum`,`implements`,`readonly`,`abstract`,`declare`,`namespace`,`module`,`private`,`protected`,`public`,`override`,`keyof`,`infer`,`is`,`asserts`,`satisfies`,`as`,`unknown`,`never`,`any`,`number`,`string`,`boolean`,`bigint`,`symbol`,`object`]),KA=new Set([`+`,`-`,`*`,`/`,`%`,`=`,`!`,`&`,`|`,`^`,`~`,`!`,`?`,`:`,`.`,`,`,`;`,`'`,`"`,`.`,`(`,`)`,`[`,`]`,`#`,`@`,`\\`,...UA]),qA={keywords:WA,onCommentStart:oj,onCommentEnd:sj,jsx:!0,regex:!0,templateStrings:!0};function JA(e){return{...qA,...e}}function YA(e){let t=0;return/\binterface\s+[A-Za-z_$][\w$]*/.test(e)&&(t+=2),/\btype\s+[A-Za-z_$][\w$]*\s*=/.test(e)&&(t+=2),/\benum\s+[A-Za-z_$][\w$]*/.test(e)&&(t+=2),/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test(e)&&(t+=2),/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test(e)&&(t+=1),/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test(e)&&(t+=1),/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test(e)&&(t+=1),t>=2}function XA(e,t){if(e[t]!==`<`)return!1;let n=0,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t===`<`){n++;continue}if(t===`>`){if(n--,n===0){let t=i+1;for(;t<e.length&&/\s/.test(e[t]);)t++;if(!(r&&e[t]===`(`))return!1;let n=e.slice(t,t+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(n)}continue}if(n!==0){if(/[$A-Za-z_]/.test(t)){r=!0;continue}if(!/[\s,\.\=\?\:\|\&\[\]]/.test(t))return!1}}return!1}function ZA(e){return/^[^\S\r\n]+$/g.test(e)}function QA(e){return KA.has(e)}function $A(e){return/^[\w$\u0080-\uffff]+$/.test(e||``)}function ej(e){return/^[0-9A-Z\p{Lu}]/u.test(e)||e===`null`}function tj(e){return/^[a-zA-Z]$/.test(e)}function nj(e){return/^[$_A-Za-z\u0080-\uffff]$/.test(e||``)}function rj(e){return nj(e[0])&&$A(e)}function ij(e){return e==="`"}function aj(e){return e===`"`||e===`'`}function oj(e,t){let n=e+t;return n===`/*`?2:+(n===`//`)}function sj(e,t){return e+t===`*/`?2:+(t===`
139
- `)}function cj(e){return e[0]===`/`&&!oj(e[0],e[1])}function lj(e,t){let n=t+1;for(;n<e.length&&/\s/.test(e[n]);)n++;return e[n]===`:`}function uj(e,t){let n=JA(t),r=n.keywords!==qA.keywords,i=typeof n.typescript==`boolean`?n.typescript:YA(e),a=r?n.keywords:i?GA:WA,{onCommentStart:o,onCommentEnd:s}=n,c=n.typeKeywords instanceof Set?n.typeKeywords:null,l=n.jsx!==!1,u=n.regex!==!1,d=n.templateStrings!==!1,f=n.caseInsensitive?e=>e.toLowerCase():e=>e,p=e=>d&&ij(e),m=``,h=-1,g=[-1,``],_=[-2,``],v=[],y=!1,b=0,x=0,S=0,C=0,w=()=>y&&!x&&!b,T=()=>b,E=()=>w()&&C,D=null,O=0,k=!1,A=0,j=0,ee=()=>D!==null,te=()=>k,ne=()=>j>A,M=()=>j>0&&j===A,re=()=>ee()||ne();function ie(e){let t=e===`
140
- `;if(T()){if(ee())return Pk;let[,t]=g;if(rj(e)){if(t===`<`||t===`</`)return Lk;if(!S&&/^\s+$/.test(v[v.length-1]?.[1]||``))return Ik}}if(E())return Rk;if(ee()||ne())return Pk;if(c&&c.has(f(e)))return g[1]===`.`?Mk:Fk;if(a.has(f(e)))return g[1]===`.`?Mk:Nk;if(t)return Vk;if(ZA(e))return Hk;if(e.split(``).every(QA))return zk;if(ej(e))return T()&&!S?Mk:Fk;if(rj(e)){let e=g[1]===`.`&&rj(_[1]);if(!re()&&!e)return Mk;if(e)return Ik}return Pk}let N=(e,t)=>{if(t&&(m=t),m){h=typeof e==`number`?e:ie(m);let t=[h,m];h!==Hk&&h!==Vk&&(_=g,g=t),T()&&h===zk&&(m===`{`&&S++,m===`}`&&S--),v.push(t)}m=``};for(let t=0;t<e.length;t++){let r=e[t],i=e[t-1],c=e[t+1],d=i+r,f=r+c;if(typeof n.onQuote==`function`&&r===`'`&&!ee()&&!E()&&!ne()){let i=n.onQuote(r,t,e);if(typeof i==`number`&&i>=1&&!Number.isNaN(i)){let n=Math.min(i,e.length-t),r=t+n;N(),m=e.slice(t,r),N(Mk),t=r-1;continue}}if(aj(r)&&!E()&&!ne()){N();let i=!1;if(D&&r===D?(D=null,i=!0):D||(D=r,O=v.length),N(Pk,r),n.quotedKeys&&i&&lj(e,t))for(let e=O;e<v.length;e++)v[e][0]=Ik;continue}if(p(r)){N(),j+=ne()?-1:1,N(Pk,r);continue}if(ne()&&f==="${"){A++,N(Pk),N(zk,f),t++;continue}if(M()&&r===`}`){N(),A--,N(zk,r);continue}if(w()&&r===`{`){N(),N(zk,r),x=1;continue}if(y){if(!b&&r===`<`){N(),c===`/`?(b=2,m=f,t++):(b=1,m=r),N(zk);continue}if(b){if(r===`>`&&!`/=`.includes(i)){N(),b===1?(b=0,C++):(b=0,y=!1),N(zk,r);continue}if(f===`/>`||f===`</`){m!==`<`&&m!==`/`&&N(),f===`/>`?b=0:C--,C||(y=!1),m=f,t++,N(zk);continue}if(r===`<`){N(),m=r,N(zk);continue}if(r===`-`&&m&&!re()&&!E()){let n=t+1;for(;n<e.length&&/[$\w-]/.test(e[n]);)n++;N(Ik,m+e.slice(t,n)),t=n-1;continue}if(c===`=`&&!re()&&!ZA(r)){ZA(m)&&N();let e=m+r;if(rj(e)){N(Ik,e);continue}}}}if(l&&!b&&(r===`<`&&nj(c)||f===`</`)){let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n--;let i=n>=0?e[n]:``,[o,s]=g,l=!1,u=!1;if(m&&!ZA(m)){let e=m;ej(e)||e===`true`||e===`false`?l=!0:a.has(e)&&rj(e)?u=!0:rj(e)&&(l=!0)}let d=r===`<`&&/[$\w\]\)]/.test(i)&&(l||!u&&(o===Mk||o===Fk||o===zk&&(s===`)`||s===`]`))),f=r===`<`&&XA(e,t);!d&&!f&&(b=c===`/`?2:1),r===`<`&&(c===`/`||tj(c))&&!d&&!f&&!re()&&!E()&&!te()&&(y=!0)}let h=aj(r)||p(r),_=ne(),S=u&&!y&&cj(f),T=E();if(h||_||aj(D))m+=r,r===`\\`&&(m+=e[++t]||``);else if(S){N();let[n,i]=g;if(S&&n!==-1&&!(n===zk&&i!==`)`||n===Bk)){m=r,N();continue}k=!0;let a=t++,o=!1,s=!1;for(;t<e.length&&e[t]!==`
132
+ `);for(let t=0;t<e.length;t++)i.push([r,e[t]]),t<e.length-1&&(o(i),i.length=0)}else i.push(n);a=!1}else a?o([]):(o(i),i.length=0),e===t.length-1&&o([]),a=!0}return i.length&&o(i),{value:e,lines:n}}function Gk(e,t){let n={index:e.index,value:e.value,tokens:e.tokens,annotations:e.annotations,className:`sh__line${e.annotations.map(e=>` sh__line--${e}`).join(``)}`,style:{},properties:{}};return t?.(n),n}function Kk({type:e,value:t},n,r){let i=n?.[e],a={type:e,value:t,className:`sh__token--${e}${i?` ${i}`:``}`,style:{color:`var(--sh-${e})`},properties:{}};return r?.(a),a}function qk(e,t){let n=t?.cx,r=t?.mark,i=t?.markLine;return!n&&!r&&!i?e.lines.map(e=>{let t=`sh__line${e.annotations.map(e=>` sh__line--${e}`).join(``)}`,n=e.tokens.map(({type:e,value:t})=>`<span class="sh__token--${e}" style="color:var(--sh-${e})">${Yk(t)}</span>`).join(``);return`<span class="${Yk(t)}">${n}</span>`}).join(`
133
+ `):e.lines.map(e=>{let t=Gk(e,i),a=e.tokens.map(e=>{let t=Kk(e,n,r);return`<span ${Xk({...t.properties,className:t.className,style:t.style})}>${Yk(t.value)}</span>`}).join(``);return`<span ${Xk({...t.properties,className:t.className,style:t.style})}>${a}</span>`}).join(`
134
+ `)}var Jk={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#039;`},Yk=e=>e.replace(/[&<>"']/g,e=>Jk[e]);function Xk(e){let t=Object.entries(e.style||{}).map(([e,t])=>`${e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${t}`).join(`;`),n=Object.entries(e).filter(([e,t])=>/^[\w:-]+$/.test(e)&&e!==`className`&&e!==`style`&&t!==!1&&t!=null).map(([e,t])=>t===!0?e:`${e}="${Yk(String(t))}"`).join(` `);return`class="${Yk(e.className||``)}"${t?` style="${Yk(t)}"`:``}${n?` ${n}`:``}`}var Zk=new Set(`+-*/%=!&|^~?:.,;()[]{}<>#@\\`.split(``)),Qk=()=>0,$k=e=>e===`_`||e===`$`||/[\p{L}\p{N}]/u.test(e);function eA(e,t){for(;t<e.length&&/\s/.test(e[t]);)t++;return e[t]===`:`}function tA(e,t){if(typeof t?.tokenize==`function`)return t.tokenize(e,t);let n=t?.keywords||new Set,r=t?.typeKeywords||new Set,i=t?.onCommentStart||Qk,a=t?.onCommentEnd||Qk,o=t?.caseInsensitive?e=>e.toLowerCase():e=>e,s=[],c=``;function l(e,t){t&&(s.push([e,t]),e!==Uk&&e!==Hk&&(c=t))}for(let s=0;s<e.length;){let u=e[s],d=e[s+1],f=i(u,d,s,e);if(f){let t=s++;for(;s<e.length;){if(a(e[s-1],e[s],s,e,t)==f){s++;break}s++}l(Vk,e.slice(t,s));continue}let p=t?.onLiteral?.(u,s,e);if(p){l(Fk,e.slice(s,s+p)),s+=p;continue}if(typeof t?.onQuote==`function`&&u===`'`){let n=t.onQuote(u,s,e);if(typeof n==`number`&&n>=1){l(Nk,e.slice(s,s+n)),s+=n;continue}}if(u===`"`||u===`'`||t?.templateStrings&&u==="`"){let n=u,r=s++;for(;s<e.length;){if(e[s]===`\\`)s++;else if(e[s]===n){s++;break}s++}let i=e.slice(r,s);l(t?.quotedKeys&&eA(e,s)?Lk:Fk,i);continue}if(u===`
135
+ `){l(Hk,u),s++;continue}if(/[^\S\r\n]/.test(u)){let t=s++;for(;s<e.length&&/[^\S\r\n]/.test(e[s]);)s++;l(Uk,e.slice(t,s));continue}if($k(u)){let t=s++;for(;s<e.length&&$k(e[s]);)s++;if(/^\d/.test(u)&&e[s]===`.`&&/\d/.test(e[s+1]||``))for(s++;s<e.length&&$k(e[s]);)s++;let i=e.slice(t,s),a=o(i);l(r.has(a)?Ik:n.has(a)?Pk:c===`.`?Lk:/^\d/.test(i)||i===`null`||/^\p{Lu}/u.test(i)?Ik:Nk,i);continue}if(Zk.has(u)){l(Bk,u),s++;continue}l(Fk,u),s++}return s}function nA(e,t){let n=Wk(e,tA(e,t));if(t?.annotateLine)for(let e of n.lines)t.annotateLine(e);return n}var rA=(e,t)=>{let n=e+t;return n===`//`?1:n===`/*`?2:0},iA=(e,t)=>t===`
136
+ `?1:e+t===`*/`?2:0,aA=s({keywords:()=>sA,onCommentEnd:()=>iA,onCommentStart:()=>rA,typeKeywords:()=>oA}),oA=new Set([`void`,`char`,`short`,`int`,`long`,`float`,`double`,`signed`,`unsigned`,`_Bool`,`_Complex`,`_Imaginary`]),sA=new Set(`auto.break.case.const.continue.default.do.else.enum.extern.for.goto.if.inline.register.restrict.return.sizeof.static.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local`.split(`.`)),cA=s({keywords:()=>lA,onCommentEnd:()=>iA,onCommentStart:()=>rA,typeKeywords:()=>uA}),lA=new Set(`alignas.alignof.and.and_eq.asm.auto.bitand.bitor.break.case.catch.class.compl.concept.const.consteval.constexpr.constinit.const_cast.continue.co_await.co_return.co_yield.decltype.default.delete.do.dynamic_cast.else.enum.explicit.export.extern.false.for.friend.goto.if.inline.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.private.protected.public.register.reinterpret_cast.requires.return.sizeof.static.static_assert.static_cast.struct.switch.template.this.thread_local.throw.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`)),uA=new Set([`bool`,`char`,`char8_t`,`char16_t`,`char32_t`,`double`,`float`,`int`,`long`,`short`,`signed`,`unsigned`,`void`,`wchar_t`]),dA=s({keywords:()=>fA,onCommentEnd:()=>iA,onCommentStart:()=>rA,typeKeywords:()=>pA}),fA=new Set(`abstract.as.async.await.base.break.case.catch.checked.class.const.continue.default.delegate.do.else.enum.event.explicit.extern.false.finally.fixed.for.foreach.from.get.global.goto.if.implicit.in.init.interface.internal.into.is.join.let.lock.namespace.new.null.on.operator.orderby.out.override.params.partial.private.protected.public.readonly.record.ref.remove.required.return.sealed.select.set.sizeof.stackalloc.static.struct.switch.this.throw.true.try.typeof.unchecked.unsafe.using.value.virtual.volatile.when.where.while.with.yield`.split(`.`)),pA=new Set([`bool`,`byte`,`char`,`decimal`,`double`,`dynamic`,`float`,`int`,`long`,`nint`,`nuint`,`object`,`sbyte`,`short`,`string`,`uint`,`ulong`,`ushort`,`void`]),mA=s({keywords:()=>hA,onCommentEnd:()=>_A,onCommentStart:()=>gA,onLiteral:()=>vA,tokenize:()=>EA}),hA=new Set([`@media`,`@import`,`@keyframes`,`@font-face`,`@supports`,`@page`,`@counter-style`,`@font-feature-values`,`@viewport`,`@counter-style`,`@font-feature-values`,`@document`]),gA=(e,t)=>+(e+t===`/*`),_A=(e,t)=>+(e+t===`*/`),vA=(e,t,n)=>e===`#`&&n.slice(t).match(/^#(?:[\da-f]{8}|[\da-f]{6}|[\da-f]{4}|[\da-f]{3})(?![\w-])/i)?.[0].length||0,yA=e=>e===Uk||e===Hk||e===Vk,bA=([e,t])=>e===Nk||e===Ik||e===Bk&&t===`-`,xA=([e])=>e===Nk||e===Ik||e===Lk,SA=e=>xA(e)&&!/^\d/.test(e[1]),CA=([e,t])=>e===Bk&&t===`-`,wA=e=>{for(let t=0;t<e.length;t++){let n=t,r=t;if(CA(e[r])){for(;e[r]&&CA(e[r]);)r++;if(!e[r]||!SA(e[r]))continue;n=r++}else if(SA(e[r]))r++;else continue;let i=n>t;for(;e[r]&&CA(e[r]);){let t=r;for(;e[r]&&CA(e[r]);)r++;if(!e[r]||!xA(e[r])){r=t;break}i=!0,r++}if(!i)continue;let a=e.slice(t,r).map(([,e])=>e).join(``);e.splice(t,r-t,[e[n][0],a])}},TA=(e,t)=>{let n=0,r=0;for(let i=t;i<e.length;i++){let[t,a]=e[i];if(t===Bk){if(a===`(`)n++;else if(a===`)`)n--;else if(a===`[`)r++;else if(a===`]`)r--;else if(!n&&!r&&a===`{`)return!0;else if(!n&&!r&&(a===`;`||a===`}`))return!1}}return!1},EA=(e,t)=>{let n=tA(e,{...t,tokenize:void 0});wA(n);let r=0,i=!1;for(let e=0;e<n.length;e++){let[t,a]=n[e];if(t===Bk&&a===`{`){r++,i=!0;continue}if(t===Bk&&a===`}`){r--,i=!1;continue}if(t===Bk&&a===`;`){i=r>0;continue}if(!i||yA(t))continue;let o=e,s=e;for(;s<n.length&&bA(n[s]);)s++;let c=s;for(;c<n.length&&yA(n[c][0]);)c++;if(s>o&&n[c]?.[0]===Bk&&n[c][1]===`:`&&!TA(n,c+1)){let e=n.slice(o,s).map(([,e])=>e).join(``);n.splice(o,s-o,[Lk,e])}i=!1}return n},DA=s({annotateLine:()=>kA,keywords:()=>OA}),OA=new Set([]),kA=e=>{let t=``;if(e.value.startsWith(`+`)&&!e.value.startsWith(`+++`))t=`diff-add`;else if(e.value.startsWith(`-`)&&!e.value.startsWith(`---`))t=`diff-remove`;else if(e.value.startsWith(`@@`))t=`diff-hunk`;else if(/^(diff --git|index |--- |\+\+\+ )/.test(e.value)){t=`diff-meta`;for(let t of e.tokens)t.type===`property`&&(t.type=`identifier`)}t&&e.annotations.push(t)},AA=e=>+(e===`#`),jA=(e,t)=>+(t===`
137
+ `),MA=s({caseInsensitive:()=>!0,keywords:()=>NA,onCommentEnd:()=>jA,onCommentStart:()=>AA}),NA=new Set([`add`,`arg`,`cmd`,`copy`,`entrypoint`,`env`,`expose`,`from`,`healthcheck`,`label`,`maintainer`,`onbuild`,`run`,`shell`,`stopsignal`,`user`,`volume`,`workdir`]),PA=s({keywords:()=>IA,onCommentEnd:()=>iA,onCommentStart:()=>rA,typeKeywords:()=>FA}),FA=new Set([`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int`,`int8`,`int16`,`int32`,`int64`,`rune`,`string`,`uint`,`uint8`,`uint16`,`uint32`,`uint64`,`uintptr`]),IA=new Set([`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`]),LA=s({keywords:()=>RA,onCommentEnd:()=>jA,onCommentStart:()=>AA,typeKeywords:()=>zA}),RA=new Set([`directive`,`enum`,`extend`,`fragment`,`implements`,`input`,`interface`,`mutation`,`on`,`query`,`repeatable`,`scalar`,`schema`,`subscription`,`type`,`union`]),zA=new Set([`Boolean`,`Float`,`ID`,`Int`,`String`]),BA=s({keywords:()=>VA,onCommentEnd:()=>UA,onCommentStart:()=>HA}),VA=new Set([`false`,`for`,`if`,`in`,`null`,`true`]),HA=(e,t)=>e===`#`||e+t===`//`?1:e+t===`/*`?2:0,UA=(e,t)=>t===`
138
+ `?1:e+t===`*/`?2:0,WA=new Set([`<`,`>`,`{`,`}`,`[`,`]`]),GA=new Set(`for.do.while.if.else.return.function.var.let.const.true.false.undefined.this.new.delete.typeof.in.instanceof.void.break.continue.switch.case.default.throw.try.catch.finally.debugger.with.yield.async.await.class.extends.super.import.export.from.static`.split(`.`)),KA=new Set([...GA,`type`,`interface`,`enum`,`implements`,`readonly`,`abstract`,`declare`,`namespace`,`module`,`private`,`protected`,`public`,`override`,`keyof`,`infer`,`is`,`asserts`,`satisfies`,`as`,`unknown`,`never`,`any`,`number`,`string`,`boolean`,`bigint`,`symbol`,`object`]),qA=new Set([`+`,`-`,`*`,`/`,`%`,`=`,`!`,`&`,`|`,`^`,`~`,`!`,`?`,`:`,`.`,`,`,`;`,`'`,`"`,`.`,`(`,`)`,`[`,`]`,`#`,`@`,`\\`,...WA]),JA={keywords:GA,onCommentStart:sj,onCommentEnd:cj,jsx:!0,regex:!0,templateStrings:!0};function YA(e){return{...JA,...e}}function XA(e){let t=0;return/\binterface\s+[A-Za-z_$][\w$]*/.test(e)&&(t+=2),/\btype\s+[A-Za-z_$][\w$]*\s*=/.test(e)&&(t+=2),/\benum\s+[A-Za-z_$][\w$]*/.test(e)&&(t+=2),/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test(e)&&(t+=2),/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test(e)&&(t+=1),/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test(e)&&(t+=1),/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test(e)&&(t+=1),t>=2}function ZA(e,t){if(e[t]!==`<`)return!1;let n=0,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t===`<`){n++;continue}if(t===`>`){if(n--,n===0){let t=i+1;for(;t<e.length&&/\s/.test(e[t]);)t++;if(!(r&&e[t]===`(`))return!1;let n=e.slice(t,t+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(n)}continue}if(n!==0){if(/[$A-Za-z_]/.test(t)){r=!0;continue}if(!/[\s,\.\=\?\:\|\&\[\]]/.test(t))return!1}}return!1}function QA(e){return/^[^\S\r\n]+$/g.test(e)}function $A(e){return qA.has(e)}function ej(e){return/^[\w$\u0080-\uffff]+$/.test(e||``)}function tj(e){return/^[0-9A-Z\p{Lu}]/u.test(e)||e===`null`}function nj(e){return/^[a-zA-Z]$/.test(e)}function rj(e){return/^[$_A-Za-z\u0080-\uffff]$/.test(e||``)}function ij(e){return rj(e[0])&&ej(e)}function aj(e){return e==="`"}function oj(e){return e===`"`||e===`'`}function sj(e,t){let n=e+t;return n===`/*`?2:+(n===`//`)}function cj(e,t){return e+t===`*/`?2:+(t===`
139
+ `)}function lj(e){return e[0]===`/`&&!sj(e[0],e[1])}function uj(e,t){let n=t+1;for(;n<e.length&&/\s/.test(e[n]);)n++;return e[n]===`:`}function dj(e,t){let n=YA(t),r=n.keywords!==JA.keywords,i=typeof n.typescript==`boolean`?n.typescript:XA(e),a=r?n.keywords:i?KA:GA,{onCommentStart:o,onCommentEnd:s}=n,c=n.typeKeywords instanceof Set?n.typeKeywords:null,l=n.jsx!==!1,u=n.regex!==!1,d=n.templateStrings!==!1,f=n.caseInsensitive?e=>e.toLowerCase():e=>e,p=e=>d&&aj(e),m=``,h=-1,g=[-1,``],_=[-2,``],v=[],y=!1,b=0,x=0,S=0,C=0,w=()=>y&&!x&&!b,T=()=>b,E=()=>w()&&C,D=null,O=0,k=!1,A=0,j=0,ee=()=>D!==null,te=()=>k,ne=()=>j>A,M=()=>j>0&&j===A,re=()=>ee()||ne();function ie(e){let t=e===`
140
+ `;if(T()){if(ee())return Fk;let[,t]=g;if(ij(e)){if(t===`<`||t===`</`)return Rk;if(!S&&/^\s+$/.test(v[v.length-1]?.[1]||``))return Lk}}if(E())return zk;if(ee()||ne())return Fk;if(c&&c.has(f(e)))return g[1]===`.`?Nk:Ik;if(a.has(f(e)))return g[1]===`.`?Nk:Pk;if(t)return Hk;if(QA(e))return Uk;if(e.split(``).every($A))return Bk;if(tj(e))return T()&&!S?Nk:Ik;if(ij(e)){let e=g[1]===`.`&&ij(_[1]);if(!re()&&!e)return Nk;if(e)return Lk}return Fk}let N=(e,t)=>{if(t&&(m=t),m){h=typeof e==`number`?e:ie(m);let t=[h,m];h!==Uk&&h!==Hk&&(_=g,g=t),T()&&h===Bk&&(m===`{`&&S++,m===`}`&&S--),v.push(t)}m=``};for(let t=0;t<e.length;t++){let r=e[t],i=e[t-1],c=e[t+1],d=i+r,f=r+c;if(typeof n.onQuote==`function`&&r===`'`&&!ee()&&!E()&&!ne()){let i=n.onQuote(r,t,e);if(typeof i==`number`&&i>=1&&!Number.isNaN(i)){let n=Math.min(i,e.length-t),r=t+n;N(),m=e.slice(t,r),N(Nk),t=r-1;continue}}if(oj(r)&&!E()&&!ne()){N();let i=!1;if(D&&r===D?(D=null,i=!0):D||(D=r,O=v.length),N(Fk,r),n.quotedKeys&&i&&uj(e,t))for(let e=O;e<v.length;e++)v[e][0]=Lk;continue}if(p(r)){N(),j+=ne()?-1:1,N(Fk,r);continue}if(ne()&&f==="${"){A++,N(Fk),N(Bk,f),t++;continue}if(M()&&r===`}`){N(),A--,N(Bk,r);continue}if(w()&&r===`{`){N(),N(Bk,r),x=1;continue}if(y){if(!b&&r===`<`){N(),c===`/`?(b=2,m=f,t++):(b=1,m=r),N(Bk);continue}if(b){if(r===`>`&&!`/=`.includes(i)){N(),b===1?(b=0,C++):(b=0,y=!1),N(Bk,r);continue}if(f===`/>`||f===`</`){m!==`<`&&m!==`/`&&N(),f===`/>`?b=0:C--,C||(y=!1),m=f,t++,N(Bk);continue}if(r===`<`){N(),m=r,N(Bk);continue}if(r===`-`&&m&&!re()&&!E()){let n=t+1;for(;n<e.length&&/[$\w-]/.test(e[n]);)n++;N(Lk,m+e.slice(t,n)),t=n-1;continue}if(c===`=`&&!re()&&!QA(r)){QA(m)&&N();let e=m+r;if(ij(e)){N(Lk,e);continue}}}}if(l&&!b&&(r===`<`&&rj(c)||f===`</`)){let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n--;let i=n>=0?e[n]:``,[o,s]=g,l=!1,u=!1;if(m&&!QA(m)){let e=m;tj(e)||e===`true`||e===`false`?l=!0:a.has(e)&&ij(e)?u=!0:ij(e)&&(l=!0)}let d=r===`<`&&/[$\w\]\)]/.test(i)&&(l||!u&&(o===Nk||o===Ik||o===Bk&&(s===`)`||s===`]`))),f=r===`<`&&ZA(e,t);!d&&!f&&(b=c===`/`?2:1),r===`<`&&(c===`/`||nj(c))&&!d&&!f&&!re()&&!E()&&!te()&&(y=!0)}let h=oj(r)||p(r),_=ne(),S=u&&!y&&lj(f),T=E();if(h||_||oj(D))m+=r,r===`\\`&&(m+=e[++t]||``);else if(S){N();let[n,i]=g;if(S&&n!==-1&&!(n===Bk&&i!==`)`||n===Vk)){m=r,N();continue}k=!0;let a=t++,o=!1,s=!1;for(;t<e.length&&e[t]!==`
141
141
  `;t++){let n=e[t];if(n===`\\`){if(e[t+1]===`
142
- `)break;t++;continue}if(n===`[`&&(s=!0),n===`]`&&(s=!1),n===`/`&&!s){for(o=!0;/^[a-z]$/.test(e[t+1]);)t++;break}}k=!1,a!==t&&o?(m=e.slice(a,t+1),N(Pk)):(m=r,N(),t=a)}else if(o(r,c,t,e)){N();let n=t,i=o(r,c,t,e);if(i)for(;t<e.length&&s(e[t-1],e[t],t,e)!=i;t++);m=e.slice(n,t+1),N(Bk)}else if(r===` `||r===`
143
- `){if(r===` `&&(ZA(m)||!m||T)){let n=t+1;for(;e[n]===` `;)n++;m+=e.slice(t,n),t=n-1,e[n]===`<`&&N()}else N(),m=r,N()}else x&&r===`}`?(N(),m=r,N(),x--):T&&!UA.has(r)||ne()||($A(r)===$A(m[m.length-1])||w())&&!KA.has(r)?m+=r:(d===`</`&&(m=d),N(),d!==`</`&&(m=r),f===`</`||f===`/>`?(m=f,N(),t++):UA.has(r)&&N()),x&&r===`{`&&x++}return N(),v}var dj=s({tokenize:()=>fj}),fj=uj,pj={keywords:new Set,jsx:!0,regex:!1,templateStrings:!1,onCommentStart:(e,t,n,r)=>r.startsWith(`<!--`,n)?2:0,onCommentEnd:(e,t,n,r)=>r.slice(n-2,n+1)===`-->`?2:0},mj=e=>fj(e,pj),hj=/^<\s*(script|style)\b/i,gj=e=>RegExp(`</\\s*${e}\\s*>`,`ig`);function _j(e,t){let n=``;for(let r=t;r<e.length;r++){let t=e[r];if(n)t===n&&(n=``);else if(t===`"`||t===`'`)n=t;else if(t===`>`)return r+1}return-1}function vj(e){let t=[],n=0;for(;n<e.length;){if(e.startsWith(`<!--`,n)){let t=e.indexOf(`-->`,n+4);n=t===-1?e.length:t+3;continue}if(e[n]!==`<`){n++;continue}let r=_j(e,n);if(r===-1)break;let i=e.slice(n,r).match(hj);if(!i){n=r;continue}let a=i[1].toLowerCase(),o=gj(a);o.lastIndex=r;let s=o.exec(e);if(!s){n=r;continue}t.push({start:n,openEnd:r,closeStart:s.index,end:o.lastIndex,tag:a}),n=o.lastIndex}return t}function yj(e){let t=[],n=0;for(let r of vj(e)){let{start:i,openEnd:a,closeStart:o,end:s,tag:c}=r;t.push(...mj(e.slice(n,i))),t.push(...mj(e.slice(i,a))),t.push(...c===`style`?TA(e.slice(a,o)):fj(e.slice(a,o),{jsx:!1})),t.push(...mj(e.slice(o,s))),n=s}return t.push(...mj(e.slice(n))),t}var bj=s({jsx:()=>!0,keywords:()=>xj,onCommentEnd:()=>wj,onCommentStart:()=>Cj,regex:()=>!1,templateStrings:()=>!1,tokenize:()=>Sj}),xj=new Set([]),Sj=yj,Cj=(e,t,n,r)=>r.startsWith(`<!--`,n)?2:0,wj=(e,t,n,r)=>r.slice(n-2,n+1)===`-->`?2:0,Tj=s({keywords:()=>Dj,onCommentEnd:()=>rA,onCommentStart:()=>nA,typeKeywords:()=>Ej}),Ej=new Set([`boolean`,`byte`,`char`,`double`,`float`,`int`,`long`,`short`,`void`]),Dj=new Set(`abstract.assert.break.case.catch.class.const.continue.default.do.else.enum.extends.final.finally.for.goto.if.implements.import.instanceof.interface.native.new.package.private.protected.public.return.static.strictfp.super.switch.synchronized.this.throw.throws.transient.try.volatile.while`.split(`.`)),Oj=s({keywords:()=>kj,onCommentEnd:()=>rA,onCommentStart:()=>nA,quotedKeys:()=>!0}),kj=new Set([`true`,`false`,`null`]),Aj=s({keywords:()=>jj,onCommentEnd:()=>rA,onCommentStart:()=>nA,typeKeywords:()=>Mj}),jj=new Set(`as.break.by.catch.class.companion.const.constructor.continue.data.do.else.enum.false.finally.for.fun.get.if.import.in.infix.init.interface.internal.is.lateinit.noinline.null.object.open.operator.out.override.package.private.protected.public.reified.return.sealed.set.suspend.tailrec.this.throw.true.try.typealias.val.var.vararg.when.where.while`.split(`.`)),Mj=new Set([`Any`,`Boolean`,`Byte`,`Char`,`Double`,`Float`,`Int`,`Long`,`Nothing`,`Short`,`String`,`Unit`]),Nj=s({keywords:()=>Pj,onCommentEnd:()=>Ij,onCommentStart:()=>Fj,onLiteral:()=>Lj}),Pj=new Set([`and`,`break`,`do`,`else`,`elseif`,`end`,`false`,`for`,`function`,`goto`,`if`,`in`,`local`,`nil`,`not`,`or`,`repeat`,`return`,`then`,`true`,`until`,`while`]);function Fj(e,t,n,r){return e===`#`&&n===0&&t===`!`?1:e+t===`--`?/^--\[=*\[/.test(r.slice(n))?2:1:0}function Ij(e,t,n,r,i){if(t===`
144
- `)return 1;if(t!==`]`)return 0;let a=r.slice(i).match(/^--\[(=*)\[/);if(!a)return 0;let o=`]${a[1]}]`;return r.slice(n-o.length+1,n+1)===o?2:0}function Lj(e,t,n){if(e!==`[`)return 0;let r=n.slice(t).match(/^\[(=*)\[/);if(!r)return 0;let i=`]${r[1]}]`,a=n.indexOf(i,t+r[0].length);return a===-1?n.length-t:a+i.length-t}var Rj=()=>0,zj=()=>0,Bj=s({annotateLine:()=>Uj,keywords:()=>Vj,onCommentEnd:()=>zj,onCommentStart:()=>Rj,tokenize:()=>Hj}),Vj=new Set([]),Hj=e=>{let t=[],n=``,r=!1,i=(e,n)=>{if(!n)return;let r=t[t.length-1];r?.[0]===e?r[1]+=n:t.push([e,n])};for(let t of e.match(/[^\n]*(?:\n|$)/g)||[]){if(!t)continue;let e=t.endsWith(`
142
+ `)break;t++;continue}if(n===`[`&&(s=!0),n===`]`&&(s=!1),n===`/`&&!s){for(o=!0;/^[a-z]$/.test(e[t+1]);)t++;break}}k=!1,a!==t&&o?(m=e.slice(a,t+1),N(Fk)):(m=r,N(),t=a)}else if(o(r,c,t,e)){N();let n=t,i=o(r,c,t,e);if(i)for(;t<e.length&&s(e[t-1],e[t],t,e)!=i;t++);m=e.slice(n,t+1),N(Vk)}else if(r===` `||r===`
143
+ `){if(r===` `&&(QA(m)||!m||T)){let n=t+1;for(;e[n]===` `;)n++;m+=e.slice(t,n),t=n-1,e[n]===`<`&&N()}else N(),m=r,N()}else x&&r===`}`?(N(),m=r,N(),x--):T&&!WA.has(r)||ne()||(ej(r)===ej(m[m.length-1])||w())&&!qA.has(r)?m+=r:(d===`</`&&(m=d),N(),d!==`</`&&(m=r),f===`</`||f===`/>`?(m=f,N(),t++):WA.has(r)&&N()),x&&r===`{`&&x++}return N(),v}var fj=s({tokenize:()=>pj}),pj=dj,mj={keywords:new Set,jsx:!0,regex:!1,templateStrings:!1,onCommentStart:(e,t,n,r)=>r.startsWith(`<!--`,n)?2:0,onCommentEnd:(e,t,n,r)=>r.slice(n-2,n+1)===`-->`?2:0},hj=e=>pj(e,mj),gj=/^<\s*(script|style)\b/i,_j=e=>RegExp(`</\\s*${e}\\s*>`,`ig`);function vj(e,t){let n=``;for(let r=t;r<e.length;r++){let t=e[r];if(n)t===n&&(n=``);else if(t===`"`||t===`'`)n=t;else if(t===`>`)return r+1}return-1}function yj(e){let t=[],n=0;for(;n<e.length;){if(e.startsWith(`<!--`,n)){let t=e.indexOf(`-->`,n+4);n=t===-1?e.length:t+3;continue}if(e[n]!==`<`){n++;continue}let r=vj(e,n);if(r===-1)break;let i=e.slice(n,r).match(gj);if(!i){n=r;continue}let a=i[1].toLowerCase(),o=_j(a);o.lastIndex=r;let s=o.exec(e);if(!s){n=r;continue}t.push({start:n,openEnd:r,closeStart:s.index,end:o.lastIndex,tag:a}),n=o.lastIndex}return t}function bj(e){let t=[],n=0;for(let r of yj(e)){let{start:i,openEnd:a,closeStart:o,end:s,tag:c}=r;t.push(...hj(e.slice(n,i))),t.push(...hj(e.slice(i,a))),t.push(...c===`style`?EA(e.slice(a,o)):pj(e.slice(a,o),{jsx:!1})),t.push(...hj(e.slice(o,s))),n=s}return t.push(...hj(e.slice(n))),t}var xj=s({jsx:()=>!0,keywords:()=>Sj,onCommentEnd:()=>Tj,onCommentStart:()=>wj,regex:()=>!1,templateStrings:()=>!1,tokenize:()=>Cj}),Sj=new Set([]),Cj=bj,wj=(e,t,n,r)=>r.startsWith(`<!--`,n)?2:0,Tj=(e,t,n,r)=>r.slice(n-2,n+1)===`-->`?2:0,Ej=s({keywords:()=>Oj,onCommentEnd:()=>iA,onCommentStart:()=>rA,typeKeywords:()=>Dj}),Dj=new Set([`boolean`,`byte`,`char`,`double`,`float`,`int`,`long`,`short`,`void`]),Oj=new Set(`abstract.assert.break.case.catch.class.const.continue.default.do.else.enum.extends.final.finally.for.goto.if.implements.import.instanceof.interface.native.new.package.private.protected.public.return.static.strictfp.super.switch.synchronized.this.throw.throws.transient.try.volatile.while`.split(`.`)),kj=s({keywords:()=>Aj,onCommentEnd:()=>iA,onCommentStart:()=>rA,quotedKeys:()=>!0}),Aj=new Set([`true`,`false`,`null`]),jj=s({keywords:()=>Mj,onCommentEnd:()=>iA,onCommentStart:()=>rA,typeKeywords:()=>Nj}),Mj=new Set(`as.break.by.catch.class.companion.const.constructor.continue.data.do.else.enum.false.finally.for.fun.get.if.import.in.infix.init.interface.internal.is.lateinit.noinline.null.object.open.operator.out.override.package.private.protected.public.reified.return.sealed.set.suspend.tailrec.this.throw.true.try.typealias.val.var.vararg.when.where.while`.split(`.`)),Nj=new Set([`Any`,`Boolean`,`Byte`,`Char`,`Double`,`Float`,`Int`,`Long`,`Nothing`,`Short`,`String`,`Unit`]),Pj=s({keywords:()=>Fj,onCommentEnd:()=>Lj,onCommentStart:()=>Ij,onLiteral:()=>Rj}),Fj=new Set([`and`,`break`,`do`,`else`,`elseif`,`end`,`false`,`for`,`function`,`goto`,`if`,`in`,`local`,`nil`,`not`,`or`,`repeat`,`return`,`then`,`true`,`until`,`while`]);function Ij(e,t,n,r){return e===`#`&&n===0&&t===`!`?1:e+t===`--`?/^--\[=*\[/.test(r.slice(n))?2:1:0}function Lj(e,t,n,r,i){if(t===`
144
+ `)return 1;if(t!==`]`)return 0;let a=r.slice(i).match(/^--\[(=*)\[/);if(!a)return 0;let o=`]${a[1]}]`;return r.slice(n-o.length+1,n+1)===o?2:0}function Rj(e,t,n){if(e!==`[`)return 0;let r=n.slice(t).match(/^\[(=*)\[/);if(!r)return 0;let i=`]${r[1]}]`,a=n.indexOf(i,t+r[0].length);return a===-1?n.length-t:a+i.length-t}var zj=()=>0,Bj=()=>0,Vj=s({annotateLine:()=>Wj,keywords:()=>Hj,onCommentEnd:()=>Bj,onCommentStart:()=>zj,tokenize:()=>Uj}),Hj=new Set([]),Uj=e=>{let t=[],n=``,r=!1,i=(e,n)=>{if(!n)return;let r=t[t.length-1];r?.[0]===e?r[1]+=n:t.push([e,n])};for(let t of e.match(/[^\n]*(?:\n|$)/g)||[]){if(!t)continue;let e=t.endsWith(`
145
145
  `)?`
146
- `:``,a=e?t.slice(0,-1):t,o=[],s=a.match(/^(?: {0,3}>[ \t]?)*/)?.[0]||``;if(!n||r)for(let e of s.matchAll(/>/g))o.push([e.index,e.index+1]);let c=s.length,l=0;for(;l<3&&a[c]===` `;)c++,l++;let u=a.slice(c).match(/^(`{3,}|~{3,})/)?.[1];if(n)u?.[0]===n[0]&&u.length>=n.length&&/^\s*$/.test(a.slice(c+u.length))&&(o.push([c,c+u.length]),n=``,r=!1);else if(u)o.push([c,c+u.length]),n=u,r=s.includes(`>`);else{let e=a.slice(c).match(/^(#{1,6}(?=\s)|(?:[-+*]|\d+[.)])(?=\s)|(?:(?:\*\s*){3,}|(?:-\s*){3,}|(?:_\s*){3,})$)/)?.[1];e&&o.push([c,c+e.length]);for(let e of a.matchAll(/(`+)(.*?)\1|(\*{1,3}|_{1,3}|~{2})(?=\S)(.*?\S)\3/g)){let t=e[1]||e[3];a[e.index-1]===`\\`||t[0]===`_`&&/\w/.test(a[e.index-1]||``)||o.push([e.index,e.index+t.length],[e.index+e[0].length-t.length,e.index+e[0].length])}}let d=0;for(let[e,t]of o.sort((e,t)=>e[0]-t[0]))e<d||(i(Mk,a.slice(d,e)),i(zk,a.slice(e,t)),d=t);i(Mk,a.slice(d)+e)}return t},Uj=e=>{let t=``;/^#{1,6}\s/.test(e.value)?t=`markdown-heading`:/^\s*>/.test(e.value)?t=`markdown-quote`:/^\s*(?:[-*+] |\d+[.)] )/.test(e.value)?t=`markdown-list`:/^\s*```/.test(e.value)&&(t=`markdown-fence`),t&&e.annotations.push(t)},Wj=s({keywords:()=>Gj,onCommentEnd:()=>Jj,onCommentStart:()=>qj,typeKeywords:()=>Kj}),Gj=new Set(`abstract.and.array.as.break.callable.case.catch.class.clone.const.continue.declare.default.do.echo.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.exit.extends.false.final.finally.fn.for.foreach.from.function.global.goto.if.implements.include.include_once.instanceof.insteadof.interface.isset.list.match.namespace.new.null.or.print.private.protected.public.readonly.require.require_once.return.static.switch.throw.trait.true.try.unset.use.var.while.xor.yield`.split(`.`)),Kj=new Set([`bool`,`float`,`int`,`iterable`,`mixed`,`never`,`object`,`string`,`void`]),qj=(e,t)=>e===`#`||e+t===`//`?1:e+t===`/*`?2:0,Jj=(e,t)=>t===`
147
- `?1:e+t===`*/`?2:0,Yj=s({tokenize:()=>Xj}),Xj=e=>[[Mk,e]],Zj=s({caseInsensitive:()=>!0,keywords:()=>Qj,onCommentEnd:()=>eM,onCommentStart:()=>$j}),Qj=new Set(`begin.break.catch.class.continue.data.define.do.dynamicparam.else.elseif.end.enum.exit.filter.finally.for.foreach.from.function.if.in.param.process.return.switch.throw.trap.try.until.using.while`.split(`.`)),$j=(e,t)=>e===`#`?1:e+t===`<#`?2:0,eM=(e,t)=>t===`
148
- `?1:e+t===`#>`?2:0,tM=s({keywords:()=>nM,onCommentEnd:()=>iM,onCommentStart:()=>rM}),nM=new Set(`and.as.assert.async.await.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.nonlocal.not.or.pass.raise.return.try.while.with.yield`.split(`.`)),rM=(e,t)=>+(e===`#`),iM=(e,t)=>+(t===`
149
- `),aM=s({keywords:()=>oM,onCommentEnd:()=>lM,onCommentStart:()=>cM}),oM=new Set(`BEGIN.END.__ENCODING__.__FILE__.__LINE__.alias.and.begin.break.case.class.def.defined.do.else.elsif.end.ensure.false.for.if.in.module.next.nil.not.or.redo.rescue.retry.return.self.super.then.true.undef.unless.until.when.while.yield`.split(`.`));function sM(e,t){return e>0&&t[e-1]!==`
150
- `?!1:/^=begin(?:\s|$)/.test(t.slice(e))}function cM(e,t,n,r){return e===`#`?1:e===`=`&&sM(n,r)?2:0}function lM(e,t,n,r){if(t!==`
146
+ `:``,a=e?t.slice(0,-1):t,o=[],s=a.match(/^(?: {0,3}>[ \t]?)*/)?.[0]||``;if(!n||r)for(let e of s.matchAll(/>/g))o.push([e.index,e.index+1]);let c=s.length,l=0;for(;l<3&&a[c]===` `;)c++,l++;let u=a.slice(c).match(/^(`{3,}|~{3,})/)?.[1];if(n)u?.[0]===n[0]&&u.length>=n.length&&/^\s*$/.test(a.slice(c+u.length))&&(o.push([c,c+u.length]),n=``,r=!1);else if(u)o.push([c,c+u.length]),n=u,r=s.includes(`>`);else{let e=a.slice(c).match(/^(#{1,6}(?=\s)|(?:[-+*]|\d+[.)])(?=\s)|(?:(?:\*\s*){3,}|(?:-\s*){3,}|(?:_\s*){3,})$)/)?.[1];e&&o.push([c,c+e.length]);for(let e of a.matchAll(/(`+)(.*?)\1|(\*{1,3}|_{1,3}|~{2})(?=\S)(.*?\S)\3/g)){let t=e[1]||e[3];a[e.index-1]===`\\`||t[0]===`_`&&/\w/.test(a[e.index-1]||``)||o.push([e.index,e.index+t.length],[e.index+e[0].length-t.length,e.index+e[0].length])}}let d=0;for(let[e,t]of o.sort((e,t)=>e[0]-t[0]))e<d||(i(Nk,a.slice(d,e)),i(Bk,a.slice(e,t)),d=t);i(Nk,a.slice(d)+e)}return t},Wj=e=>{let t=``;/^#{1,6}\s/.test(e.value)?t=`markdown-heading`:/^\s*>/.test(e.value)?t=`markdown-quote`:/^\s*(?:[-*+] |\d+[.)] )/.test(e.value)?t=`markdown-list`:/^\s*```/.test(e.value)&&(t=`markdown-fence`),t&&e.annotations.push(t)},Gj=s({keywords:()=>Kj,onCommentEnd:()=>Yj,onCommentStart:()=>Jj,typeKeywords:()=>qj}),Kj=new Set(`abstract.and.array.as.break.callable.case.catch.class.clone.const.continue.declare.default.do.echo.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.exit.extends.false.final.finally.fn.for.foreach.from.function.global.goto.if.implements.include.include_once.instanceof.insteadof.interface.isset.list.match.namespace.new.null.or.print.private.protected.public.readonly.require.require_once.return.static.switch.throw.trait.true.try.unset.use.var.while.xor.yield`.split(`.`)),qj=new Set([`bool`,`float`,`int`,`iterable`,`mixed`,`never`,`object`,`string`,`void`]),Jj=(e,t)=>e===`#`||e+t===`//`?1:e+t===`/*`?2:0,Yj=(e,t)=>t===`
147
+ `?1:e+t===`*/`?2:0,Xj=s({tokenize:()=>Zj}),Zj=e=>[[Nk,e]],Qj=s({caseInsensitive:()=>!0,keywords:()=>$j,onCommentEnd:()=>tM,onCommentStart:()=>eM}),$j=new Set(`begin.break.catch.class.continue.data.define.do.dynamicparam.else.elseif.end.enum.exit.filter.finally.for.foreach.from.function.if.in.param.process.return.switch.throw.trap.try.until.using.while`.split(`.`)),eM=(e,t)=>e===`#`?1:e+t===`<#`?2:0,tM=(e,t)=>t===`
148
+ `?1:e+t===`#>`?2:0,nM=s({keywords:()=>rM,onCommentEnd:()=>aM,onCommentStart:()=>iM}),rM=new Set(`and.as.assert.async.await.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.nonlocal.not.or.pass.raise.return.try.while.with.yield`.split(`.`)),iM=(e,t)=>+(e===`#`),aM=(e,t)=>+(t===`
149
+ `),oM=s({keywords:()=>sM,onCommentEnd:()=>uM,onCommentStart:()=>lM}),sM=new Set(`BEGIN.END.__ENCODING__.__FILE__.__LINE__.alias.and.begin.break.case.class.def.defined.do.else.elsif.end.ensure.false.for.if.in.module.next.nil.not.or.redo.rescue.retry.return.self.super.then.true.undef.unless.until.when.while.yield`.split(`.`));function cM(e,t){return e>0&&t[e-1]!==`
150
+ `?!1:/^=begin(?:\s|$)/.test(t.slice(e))}function lM(e,t,n,r){return e===`#`?1:e===`=`&&cM(n,r)?2:0}function uM(e,t,n,r){if(t!==`
151
151
  `)return 0;let i=r.lastIndexOf(`
152
- `,n-1)+1,a=r.slice(i,n);return/^=end(?:\s|$)/.test(a)?2:1}var uM=s({keywords:()=>dM,onQuote:()=>fM}),dM=new Set(`as.break.const.continue.crate.else.enum.extern.false.fn.for.if.impl.in.let.loop.match.mod.move.mut.pub.ref.return.self.Self.static.struct.super.trait.true.type.unsafe.use.where.while.async.await.dyn.abstract.become.box.do.final.macro.override.priv.typeof.unsized.virtual.yield.try`.split(`.`));function fM(e,t,n){if(e!==`'`||t+1>=n.length)return 1;let r=n[t+1];if(r===`\\`){let e=t+2;for(;e<n.length;){if(n[e]===`\\`){e+=2;continue}if(n[e]===`'`)return e-t+1;e++}return n.length-t}if(r===`_`)return 2;if(/[a-zA-Z]/.test(r)){let e=t+2;for(;e<n.length&&/[a-zA-Z0-9_]/.test(n[e]);)e++;return e<n.length&&n[e]===`'`?e-t+1:e-t}return 1}var pM=s({keywords:()=>mM,onCommentEnd:()=>AA,onCommentStart:()=>kA}),mM=new Set([`case`,`coproc`,`do`,`done`,`elif`,`else`,`esac`,`export`,`fi`,`for`,`function`,`if`,`in`,`local`,`readonly`,`return`,`select`,`then`,`time`,`until`,`while`]),hM=s({caseInsensitive:()=>!0,keywords:()=>gM,onCommentEnd:()=>yM,onCommentStart:()=>vM,typeKeywords:()=>_M}),gM=new Set(`add.all.alter.and.as.asc.between.by.case.check.column.constraint.create.cross.database.default.delete.desc.distinct.drop.else.end.exists.foreign.from.full.group.having.in.index.inner.insert.into.is.join.key.left.like.limit.not.null.offset.on.or.order.outer.primary.references.right.select.set.table.then.union.unique.update.values.view.when.where.with`.split(`.`)),_M=new Set([`bigint`,`binary`,`bit`,`blob`,`boolean`,`char`,`date`,`datetime`,`decimal`,`double`,`float`,`int`,`integer`,`interval`,`json`,`numeric`,`real`,`smallint`,`text`,`time`,`timestamp`,`uuid`,`varchar`]),vM=(e,t)=>{let n=e+t;return n===`--`?1:n===`/*`?2:0},yM=(e,t)=>t===`
153
- `?1:e+t===`*/`?2:0,bM=s({keywords:()=>xM,onCommentEnd:()=>rA,onCommentStart:()=>nA,typeKeywords:()=>SM}),xM=new Set(`as.associatedtype.break.case.catch.class.continue.convenience.default.defer.deinit.didSet.do.dynamic.else.enum.extension.fallthrough.false.fileprivate.final.for.func.get.guard.if.import.in.indirect.infix.init.inout.internal.is.lazy.let.mutating.nil.nonmutating.open.operator.override.precedencegroup.private.protocol.public.repeat.required.rethrows.return.self.set.some.static.struct.subscript.super.switch.throw.throws.true.try.typealias.unowned.var.weak.where.while.willSet`.split(`.`)),SM=new Set([`Any`,`Bool`,`Character`,`Double`,`Float`,`Int`,`Never`,`String`,`UInt`,`Void`]),CM=s({keywords:()=>wM,onCommentEnd:()=>AA,onCommentStart:()=>kA,quotedKeys:()=>!0}),wM=new Set([`false`,`true`]),TM=s({tokenize:()=>EM}),EM=(e,t)=>uj(e,{...t,typescript:!0}),DM=s({jsx:()=>!0,keywords:()=>xj,onCommentEnd:()=>wj,onCommentStart:()=>Cj,regex:()=>!1,templateStrings:()=>!1,tokenize:()=>yj}),OM=s({jsx:()=>!0,keywords:()=>xj,onCommentEnd:()=>wj,onCommentStart:()=>Cj,regex:()=>!1,templateStrings:()=>!1,tokenize:()=>yj}),kM=s({keywords:()=>AM,onCommentEnd:()=>AA,onCommentStart:()=>kA,quotedKeys:()=>!0}),AM=new Set([`false`,`False`,`FALSE`,`no`,`No`,`NO`,`null`,`Null`,`NULL`,`off`,`Off`,`OFF`,`on`,`On`,`ON`,`true`,`True`,`TRUE`,`yes`,`Yes`,`YES`]),jM=s({keywords:()=>MM,onCommentEnd:()=>FM,onCommentStart:()=>PM,onLiteral:()=>IM,typeKeywords:()=>NM}),MM=new Set(`addrspace.align.allowzero.and.anyframe.anytype.asm.async.await.break.callconv.catch.comptime.const.continue.defer.else.enum.errdefer.error.export.extern.false.fn.for.if.inline.linksection.noalias.noinline.nosuspend.null.opaque.or.orelse.packed.pub.resume.return.struct.suspend.switch.test.threadlocal.true.try.undefined.union.unreachable.usingnamespace.var.volatile.while`.split(`.`)),NM=new Set(`anyerror.anyopaque.bool.c_char.c_int.c_long.c_longdouble.c_longlong.c_short.c_uint.c_ulong.c_ulonglong.c_ushort.comptime_float.comptime_int.f16.f32.f64.f80.f128.i8.i16.i32.i64.i128.isize.noreturn.type.u8.u16.u32.u64.u128.usize.void`.split(`.`)),PM=(e,t)=>+(e+t===`//`),FM=(e,t)=>+(t===`
154
- `);function IM(e,t,n){if(e!==`\\`||n[t+1]!==`\\`)return 0;let r=n.lastIndexOf(`
152
+ `,n-1)+1,a=r.slice(i,n);return/^=end(?:\s|$)/.test(a)?2:1}var dM=s({keywords:()=>fM,onQuote:()=>pM}),fM=new Set(`as.break.const.continue.crate.else.enum.extern.false.fn.for.if.impl.in.let.loop.match.mod.move.mut.pub.ref.return.self.Self.static.struct.super.trait.true.type.unsafe.use.where.while.async.await.dyn.abstract.become.box.do.final.macro.override.priv.typeof.unsized.virtual.yield.try`.split(`.`));function pM(e,t,n){if(e!==`'`||t+1>=n.length)return 1;let r=n[t+1];if(r===`\\`){let e=t+2;for(;e<n.length;){if(n[e]===`\\`){e+=2;continue}if(n[e]===`'`)return e-t+1;e++}return n.length-t}if(r===`_`)return 2;if(/[a-zA-Z]/.test(r)){let e=t+2;for(;e<n.length&&/[a-zA-Z0-9_]/.test(n[e]);)e++;return e<n.length&&n[e]===`'`?e-t+1:e-t}return 1}var mM=s({keywords:()=>hM,onCommentEnd:()=>jA,onCommentStart:()=>AA}),hM=new Set([`case`,`coproc`,`do`,`done`,`elif`,`else`,`esac`,`export`,`fi`,`for`,`function`,`if`,`in`,`local`,`readonly`,`return`,`select`,`then`,`time`,`until`,`while`]),gM=s({caseInsensitive:()=>!0,keywords:()=>_M,onCommentEnd:()=>bM,onCommentStart:()=>yM,typeKeywords:()=>vM}),_M=new Set(`add.all.alter.and.as.asc.between.by.case.check.column.constraint.create.cross.database.default.delete.desc.distinct.drop.else.end.exists.foreign.from.full.group.having.in.index.inner.insert.into.is.join.key.left.like.limit.not.null.offset.on.or.order.outer.primary.references.right.select.set.table.then.union.unique.update.values.view.when.where.with`.split(`.`)),vM=new Set([`bigint`,`binary`,`bit`,`blob`,`boolean`,`char`,`date`,`datetime`,`decimal`,`double`,`float`,`int`,`integer`,`interval`,`json`,`numeric`,`real`,`smallint`,`text`,`time`,`timestamp`,`uuid`,`varchar`]),yM=(e,t)=>{let n=e+t;return n===`--`?1:n===`/*`?2:0},bM=(e,t)=>t===`
153
+ `?1:e+t===`*/`?2:0,xM=s({keywords:()=>SM,onCommentEnd:()=>iA,onCommentStart:()=>rA,typeKeywords:()=>CM}),SM=new Set(`as.associatedtype.break.case.catch.class.continue.convenience.default.defer.deinit.didSet.do.dynamic.else.enum.extension.fallthrough.false.fileprivate.final.for.func.get.guard.if.import.in.indirect.infix.init.inout.internal.is.lazy.let.mutating.nil.nonmutating.open.operator.override.precedencegroup.private.protocol.public.repeat.required.rethrows.return.self.set.some.static.struct.subscript.super.switch.throw.throws.true.try.typealias.unowned.var.weak.where.while.willSet`.split(`.`)),CM=new Set([`Any`,`Bool`,`Character`,`Double`,`Float`,`Int`,`Never`,`String`,`UInt`,`Void`]),wM=s({keywords:()=>TM,onCommentEnd:()=>jA,onCommentStart:()=>AA,quotedKeys:()=>!0}),TM=new Set([`false`,`true`]),EM=s({tokenize:()=>DM}),DM=(e,t)=>dj(e,{...t,typescript:!0}),OM=s({jsx:()=>!0,keywords:()=>Sj,onCommentEnd:()=>Tj,onCommentStart:()=>wj,regex:()=>!1,templateStrings:()=>!1,tokenize:()=>bj}),kM=s({jsx:()=>!0,keywords:()=>Sj,onCommentEnd:()=>Tj,onCommentStart:()=>wj,regex:()=>!1,templateStrings:()=>!1,tokenize:()=>bj}),AM=s({keywords:()=>jM,onCommentEnd:()=>jA,onCommentStart:()=>AA,quotedKeys:()=>!0}),jM=new Set([`false`,`False`,`FALSE`,`no`,`No`,`NO`,`null`,`Null`,`NULL`,`off`,`Off`,`OFF`,`on`,`On`,`ON`,`true`,`True`,`TRUE`,`yes`,`Yes`,`YES`]),MM=s({keywords:()=>NM,onCommentEnd:()=>IM,onCommentStart:()=>FM,onLiteral:()=>LM,typeKeywords:()=>PM}),NM=new Set(`addrspace.align.allowzero.and.anyframe.anytype.asm.async.await.break.callconv.catch.comptime.const.continue.defer.else.enum.errdefer.error.export.extern.false.fn.for.if.inline.linksection.noalias.noinline.nosuspend.null.opaque.or.orelse.packed.pub.resume.return.struct.suspend.switch.test.threadlocal.true.try.undefined.union.unreachable.usingnamespace.var.volatile.while`.split(`.`)),PM=new Set(`anyerror.anyopaque.bool.c_char.c_int.c_long.c_longdouble.c_longlong.c_short.c_uint.c_ulong.c_ulonglong.c_ushort.comptime_float.comptime_int.f16.f32.f64.f80.f128.i8.i16.i32.i64.i128.isize.noreturn.type.u8.u16.u32.u64.u128.usize.void`.split(`.`)),FM=(e,t)=>+(e+t===`//`),IM=(e,t)=>+(t===`
154
+ `);function LM(e,t,n){if(e!==`\\`||n[t+1]!==`\\`)return 0;let r=n.lastIndexOf(`
155
155
  `,t-1)+1;if(n.slice(r,t).trim())return 0;let i=n.indexOf(`
156
- `,t+2);return(i===-1?n.length:i)-t}function LM(e){return{...e,jsx:!1,regex:!1,templateStrings:!1}}function RM(){return{javascript:dj,typescript:TM,css:LM(pA),python:LM(tM),c:LM(iA),go:LM(NA),java:LM(Tj),rust:LM(uM),json:LM(Oj),diff:LM(EA),shell:LM(pM),cpp:LM(sA),csharp:LM(uA),sql:LM(hM),html:bj,vue:OM,svelte:DM,yaml:LM(kM),markdown:LM(Bj),plaintext:LM(Yj),ruby:LM(aM),kotlin:LM(Aj),swift:LM(bM),php:LM(Wj),toml:LM(CM),powershell:LM(Zj),dockerfile:LM(jA),graphql:LM(IA),hcl:LM(zA),zig:LM(jM),lua:LM(Nj)}}var zM=RM();function BM(e){return zM[e||`javascript`]}function VM(e,t){let{lang:n,cx:r,mark:i,markLine:a}=t||{};return Kk(tA(e,BM(n)),{cx:r,mark:i,markLine:a})}function HM({code:e,path:t,className:n}){let r=e.replace(/\n$/,``),i=(0,v.useMemo)(()=>VM(r),[r]),a=r.split(`
156
+ `,t+2);return(i===-1?n.length:i)-t}function RM(e){return{...e,jsx:!1,regex:!1,templateStrings:!1}}function zM(){return{javascript:fj,typescript:EM,css:RM(mA),python:RM(nM),c:RM(aA),go:RM(PA),java:RM(Ej),rust:RM(dM),json:RM(kj),diff:RM(DA),shell:RM(mM),cpp:RM(cA),csharp:RM(dA),sql:RM(gM),html:xj,vue:kM,svelte:OM,yaml:RM(AM),markdown:RM(Vj),plaintext:RM(Xj),ruby:RM(oM),kotlin:RM(jj),swift:RM(xM),php:RM(Gj),toml:RM(wM),powershell:RM(Qj),dockerfile:RM(MA),graphql:RM(LA),hcl:RM(BA),zig:RM(MM),lua:RM(Pj)}}var BM=zM();function VM(e){return BM[e||`javascript`]}function HM(e,t){let{lang:n,cx:r,mark:i,markLine:a}=t||{};return qk(nA(e,VM(n)),{cx:r,mark:i,markLine:a})}function UM({code:e,path:t,className:n}){let r=e.replace(/\n$/,``),i=(0,v.useMemo)(()=>HM(r),[r]),a=r.split(`
157
157
  `).length;return(0,L.jsxs)(`div`,{className:X(`flex min-w-0 flex-col`,n),children:[t?(0,L.jsxs)(`div`,{className:`flex h-10 items-center justify-between gap-3 border-b border-rule bg-soft pr-1.5 pl-4`,children:[(0,L.jsx)(Q,{size:12,className:`truncate text-muted`,title:t,children:t}),(0,L.jsx)(ix,{icon:`copy`,label:`Copy file`,size:15,onClick:()=>kw(e,`Copied the file`)})]}):null,(0,L.jsxs)(`div`,{className:`flex max-h-[640px] min-w-0 overflow-auto font-mono text-[12.5px] leading-[1.6]`,children:[(0,L.jsx)(`pre`,{"aria-hidden":`true`,className:`sticky left-0 m-0 shrink-0 select-none border-r border-rule bg-surface py-3 pr-3 pl-4 text-right text-muted`,children:Array.from({length:a},(e,t)=>t+1).join(`
158
- `)}),(0,L.jsx)(`pre`,{className:`m-0 min-w-0 grow py-3 pr-6 pl-4 text-ink`,children:(0,L.jsx)(`code`,{dangerouslySetInnerHTML:{__html:i}})})]})]})}var UM={beta:`action`,experimental:`action`,draft:`action`,deprecated:`danger`,stable:`ok`},WM=`.design/system/components/`;function GM(e){return e.startsWith(WM)?`@system/components/${e.slice(26).replace(/\.(tsx|jsx|ts|js)$/,``).replace(/\/index$/,``)}`:null}function KM(e){let t=new Set;for(let n of e.matchAll(/export\s+(?:async\s+)?(?:function|const|class|let)\s+([A-Za-z_$][\w$]*)/g))t.add(n[1]);for(let n of e.matchAll(/export\s*\{([^}]+)\}/g))for(let e of n[1].split(`,`)){let n=e.trim().split(/\s+as\s+/).pop()?.trim();n&&n!=="default"&&t.add(n)}return[...t].filter(e=>/^[A-Z]/.test(e))}function qM({path:e}){let t=GM(e),n=n_(t?e:null).data;if(!t)return null;let r=n?KM(n):[],i=`import { ${r.length?r.join(`, `):`…`} } from '${t}'`;return(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-rule py-1.5 pr-1.5 pl-4`,children:[(0,L.jsx)(Q,{size:12.5,className:`min-w-0 truncate text-ink2`,title:i,children:i}),(0,L.jsx)(ix,{icon:`copy`,label:`Copy the import`,size:14,className:`ml-auto`,onClick:()=>kw(i)})]})}function JM({component:e,theme:t,width:n}){return n===`fill`?(0,L.jsx)(Ak,{src:e.url,theme:t,title:e.title,minHeight:160}):(0,L.jsx)(`div`,{className:`flex justify-center overflow-x-auto bg-soft p-6`,children:(0,L.jsx)(`div`,{className:`shrink-0 overflow-hidden rounded-[8px] border border-rule bg-surface shadow-frame`,children:(0,L.jsx)(Ak,{src:e.url,theme:t,title:e.title,minHeight:160,width:Number(n)})})})}function YM({component:e}){let t=[...e.sources,e.specimen],[n,r]=(0,v.useState)(t[0]),i=t.includes(n)?n:t[0],{data:a,error:o,isLoading:s}=n_(i);return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[t.length>1?(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-rule px-4 py-2.5`,children:(0,L.jsx)(PT,{label:`File`,size:`sm`,value:i,onChange:r,items:t.map(t=>({value:t,label:t===e.specimen?`${XM(t)} · specimen`:XM(t),title:t}))})}):null,GM(i)?(0,L.jsx)(qM,{path:i}):null,o?(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-6 text-[13px] text-danger-text`,children:[(0,L.jsx)(Z,{name:`alert`,size:15}),o.message]}):s||a===void 0?(0,L.jsx)(`div`,{className:`flex items-center justify-center py-10 text-muted`,children:(0,L.jsx)(Z,{name:`loader`,size:18})}):(0,L.jsx)(HM,{code:a,path:i})]})}function XM(e){return e.split(`/`).pop()??e}function ZM({system:e,id:t}){let n=e.components.find(e=>e.id===t),[r,i]=(0,v.useState)(`preview`),[a,o]=vk(),[s,c]=(0,v.useState)(`fill`),l=!Xg().frameSandbox;if(!n)return(0,L.jsx)(OT,{title:`No such component`,text:`There is no specimen "${t}" in .design/system/specimens.`});let u=n.status?.toLowerCase();return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(CT,{title:n.title,badge:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(aT,{children:n.group}),u?(0,L.jsx)(aT,{tone:UM[u]??`neutral`,children:n.status}):null]}),sub:n.description}),(0,L.jsxs)(sT,{children:[(0,L.jsx)(lT,{value:r,onChange:i,items:[{value:`preview`,label:`Preview`},{value:`code`,label:`Code`,count:n.sources.length+1}],right:r===`preview`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(PT,{label:`Width`,size:`sm`,value:s,onChange:c,items:[{value:`fill`,label:`Fill`},{value:`768`,label:`768`},{value:`390`,label:`390`}]}),(0,L.jsx)(yk,{value:a,onChange:o}),l?(0,L.jsx)(ox,{icon:`external`,href:Ww(Uw(n.url,a)),target:`_blank`,rel:`noreferrer`,children:`Open`}):null]}):null}),(0,L.jsx)(`div`,{className:`border-t border-rule`,children:r===`preview`?(0,L.jsx)(JM,{component:n,theme:a,width:s}):(0,L.jsx)(YM,{component:n})})]})]})}function QM(e,t){let n=/^\s*#\s+(.+)\r?\n/.exec(e);return n&&n[1].trim()===t?e.slice(n[0].length):e}function $M({system:e,slug:t}){let n=e.guidelines.find(e=>e.slug===t);if(!n)return(0,L.jsx)(OT,{title:`No such guideline`,text:`There is no guideline "${t}" in .design/system/guidelines.`});let r=QM(n.markdown,n.title).trim();return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(CT,{title:n.title,sub:`Guideline`}),(0,L.jsx)(sT,{children:(0,L.jsx)(`div`,{className:`px-6 py-5`,children:r?(0,L.jsx)(tO,{text:r,className:`max-w-[760px]`}):(0,L.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`This guideline is empty. Write it in `,(0,L.jsx)(Q,{children:`.design/system/guidelines`}),`.`]})})})]})}var eN={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]};function tN(e){let t=e.trim();if(eN[t])return eN[t];let n=/^cubic-bezier\(\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\)$/.exec(t);if(!n)return null;let r=n.slice(1).map(Number);return r.every(Number.isFinite)?r:null}function nN(e){let t=/^(-?[\d.]+)(ms|s)$/.exec(e.trim());return t?Number(t[1])*(t[2]===`s`?1e3:1):null}var rN=132,iN=22;function aN({bezier:e}){let[t,n,r,i]=e,a=Math.min(0,n,i),o=Math.max(1,n,i),s=88/(o-a),c=e=>iN+e*88,l=e=>iN+(o-e)*s;return(0,L.jsxs)(`svg`,{width:rN,height:rN,viewBox:`0 0 ${rN} ${rN}`,"aria-hidden":`true`,className:`shrink-0`,children:[(0,L.jsx)(`rect`,{x:c(0),y:l(1),width:88,height:l(0)-l(1),className:`fill-none stroke-rule`}),(0,L.jsx)(`line`,{x1:c(0),y1:l(0),x2:c(t),y2:l(n),className:`stroke-rule-strong`,strokeDasharray:`3 3`}),(0,L.jsx)(`line`,{x1:c(1),y1:l(1),x2:c(r),y2:l(i),className:`stroke-rule-strong`,strokeDasharray:`3 3`}),(0,L.jsx)(`path`,{d:`M ${c(0)} ${l(0)} C ${c(t)} ${l(n)}, ${c(r)} ${l(i)}, ${c(1)} ${l(1)}`,className:`fill-none stroke-ink`,strokeWidth:2,strokeLinecap:`round`}),(0,L.jsx)(`circle`,{cx:c(t),cy:l(n),r:3,className:`fill-action`}),(0,L.jsx)(`circle`,{cx:c(r),cy:l(i),r:3,className:`fill-action`})]})}function oN({token:e,duration:t}){let[n,r]=(0,v.useState)(!1),i=e.light?.value??``,a=tN(i);return(0,L.jsxs)(`button`,{type:`button`,title:`Hover to play; click to copy the variable`,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onFocus:()=>r(!0),onBlur:()=>r(!1),onClick:()=>kw(`var(${e.name})`),className:`flex min-w-0 cursor-pointer flex-col gap-3 rounded-[8px] border border-transparent bg-transparent p-3 text-left transition-colors hover:border-rule hover:bg-soft`,children:[(0,L.jsx)(`span`,{className:`flex h-[132px] items-center justify-center rounded-[6px] bg-soft`,children:a?(0,L.jsx)(aN,{bezier:a}):(0,L.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`No curve to draw`})}),(0,L.jsx)(`span`,{className:`relative mx-1 h-2 rounded-full bg-soft2`,children:(0,L.jsx)(`span`,{className:`absolute top-1/2 size-3.5 -translate-y-1/2 rounded-full bg-ink`,style:{left:n?`calc(100% - 14px)`:`0px`,transition:`left ${t}ms ${i||`ease`}`}})}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 px-1`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,L.jsx)(bk,{items:pk(e)}),(0,L.jsx)(Ck,{children:i}),e.description?(0,L.jsx)(`span`,{className:`text-[12.5px] text-ink2`,children:e.description}):null]})]})}function sN({system:e}){let t=mk(e.tokens,`ease`),n=mk(e.tokens,`duration`),r=mk(e.tokens,`animation`),i=`minmax(170px,1fr) 100px minmax(0,2fr)`,a=`minmax(170px,1fr) minmax(140px,0.7fr) minmax(0,2fr)`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(CT,{title:`Motion`,sub:`Hover an easing to see it move.`}),!t.length&&!n.length&&!r.length?(0,L.jsxs)(xk,{title:`No motion tokens`,children:[`Add `,(0,L.jsx)(Q,{children:`--ease-*`}),` and `,(0,L.jsx)(Q,{children:`--animate-*`}),` to the `,(0,L.jsx)(Q,{children:`@theme`}),` block, and durations as`,` `,(0,L.jsx)(Q,{children:`--duration-*`}),`, in `,(0,L.jsx)(Q,{children:Sk}),`.`]}):null,t.length?(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Easing`,count:t.length}),(0,L.jsx)(`div`,{className:`grid gap-2 border-t border-rule p-3`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(190px, 1fr))`},children:t.map(e=>(0,L.jsx)(oN,{token:e,duration:900},e.name))})]}):null,n.length?(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Durations`,count:n.length}),(0,L.jsx)(fT,{cols:i,labels:[`Token`,`Value`,``]}),n.map(e=>{let t=e.light?nN(e.light.value):null;return(0,L.jsxs)(mT,{cols:i,minH:40,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,L.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,L.jsx)(Q,{size:12,className:`text-muted`,children:e.light?.value}),t===null?(0,L.jsx)(`span`,{}):(0,L.jsx)(`span`,{className:`h-3 rounded-[3px] bg-action/70`,style:{width:Math.max(2,Math.min(t/2,480))}})]},e.name)})]}):null,r.length?(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Animations`,count:r.length,sub:`keyframes live in the system stylesheet`}),(0,L.jsx)(fT,{cols:a,labels:[`Token`,`Class`,`Value`]}),r.map(e=>(0,L.jsxs)(mT,{cols:a,minH:40,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,L.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,L.jsx)(bk,{items:pk(e)}),(0,L.jsx)(Ck,{children:e.light?.value})]},e.name))]}):null]})}function cN({system:e}){let t=XC(),n=new Set(e.tokens.map(e=>e.kind)),r=[{to:`/system/colors`,label:`Colors`,hint:lN(e,`color`)},{to:`/system/typography`,label:`Typography`},{to:`/system/shape`,label:`Spacing & shape`}];(n.has(`ease`)||n.has(`duration`)||n.has(`animation`))&&r.push({to:`/system/motion`,label:`Motion`}),n.has(`other`)&&r.push({to:`/system/tokens`,label:`Other tokens`,hint:lN(e,`other`)}),e.assets.length&&r.push({to:`/system/assets`,label:`Assets`,hint:e.assets.length});let i=new Map;for(let t of e.components){let e=i.get(t.group)??[];e.push({to:`/system/components/${encodeURIComponent(t.id)}`,label:t.title,hint:t.status}),i.set(t.group,e)}let a=e.guidelines.filter(e=>e.slug!==`overview`);if(t){let e=[{label:``,items:[{to:`/system`,label:`Overview`}]},{label:`Foundations`,items:r},{label:`Guidelines`,items:a.map(e=>({to:`/system/guidelines/${encodeURIComponent(e.slug)}`,label:e.title}))},...[...i].map(([e,t])=>({label:e,items:t}))];return(0,L.jsx)(uN,{sections:e.filter(e=>e.items.length)})}return(0,L.jsxs)(`div`,{className:`flex flex-col max-lg:gap-1 max-lg:[&_nav]:flex-row max-lg:[&_nav]:flex-wrap`,children:[(0,L.jsx)(wT,{label:`Overview`,items:[{to:`/system`,label:`Overview`}]}),(0,L.jsx)(TT,{children:`Foundations`}),(0,L.jsx)(wT,{label:`Foundations`,items:r}),a.length?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(TT,{children:`Guidelines`}),(0,L.jsx)(wT,{label:`Guidelines`,items:a.map(e=>({to:`/system/guidelines/${encodeURIComponent(e.slug)}`,label:e.title}))})]}):null,[...i].map(([e,t])=>(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[(0,L.jsx)(TT,{children:e}),(0,L.jsx)(wT,{label:e,items:t})]},e))]})}function lN(e,t){return e.tokens.filter(e=>e.kind===t).length||void 0}function uN({sections:e}){let[t]=P(),[n,r]=(0,v.useState)(!1),i=e.flatMap(e=>e.items).find(e=>e.to===t);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r(!0),className:`flex h-11 w-full cursor-pointer items-center gap-2 rounded-[8px] border border-rule bg-surface px-3.5 text-left text-[14px] text-ink`,children:[(0,L.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`Section`}),(0,L.jsx)(`span`,{className:`min-w-0 grow truncate font-medium`,children:i?.label??`Overview`}),(0,L.jsx)(Z,{name:`chevron-down`,size:16,className:`shrink-0 text-muted`})]}),(0,L.jsx)(zO,{open:n,onOpenChange:r,title:`Design system`,children:(0,L.jsx)(`nav`,{"aria-label":`Design system`,className:`flex flex-col pb-2`,children:e.map(e=>(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[e.label?(0,L.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:e.label}):null,e.items.map(e=>{let n=e.to===t;return(0,L.jsxs)(be,{href:e.to,onClick:()=>r(!1),"aria-current":n?`page`:void 0,className:X(`flex min-h-[46px] items-center gap-2 px-4 text-[14px] no-underline active:bg-soft2`,n?`font-medium text-ink`:`text-ink2`),children:[(0,L.jsx)(`span`,{className:`min-w-0 grow truncate`,children:e.label}),e.hint?(0,L.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:e.hint}):null,n?(0,L.jsx)(Z,{name:`check`,size:16,className:`shrink-0 text-action`}):null]},e.to)})]},e.label||`overview`))})})]})}function dN({system:e}){let t=mk(e.tokens,`other`),n=`minmax(170px,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.3fr)`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(CT,{title:`Other tokens`,sub:`Variables that are not colors, type, spacing, shape or motion.`}),t.length?hk(t).map(({group:e,tokens:t})=>(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:e,count:t.length}),(0,L.jsx)(fT,{cols:n,labels:[`Token`,`Light`,`Dark`,`Description`]}),t.map(e=>(0,L.jsxs)(mT,{cols:n,minH:40,title:`Copy the variable`,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,L.jsx)(Ck,{children:e.light?.value}),(0,L.jsx)(Ck,{children:e.dark?.value??`—`}),(0,L.jsx)(`span`,{className:`text-[13px] text-ink2`,children:e.description})]},e.name))]},e)):(0,L.jsxs)(xk,{title:`No other tokens`,children:[`Variables in `,(0,L.jsx)(Q,{children:`:root`}),` of `,(0,L.jsx)(Q,{children:Sk}),` that are not colors or lengths show here.`]})]})}function fN(e,...t){return e.tokens.filter(e=>t.includes(e.kind)).length}function pN(e){let t=[{to:`/system/colors`,icon:`palette`,title:`Colors`,text:tk(fN(e,`color`),`token`)},{to:`/system/typography`,icon:`type`,title:`Typography`,text:`${tk(fN(e,`font`),`family`,`families`)} · ${tk(fN(e,`text`),`size`)}`},{to:`/system/shape`,icon:`shape`,title:`Spacing & shape`,text:tk(fN(e,`spacing`,`radius`,`shadow`,`blur`,`breakpoint`),`token`)}],n=fN(e,`ease`,`duration`,`animation`);n&&t.push({to:`/system/motion`,icon:`motion`,title:`Motion`,text:tk(n,`token`)}),e.assets.length&&t.push({to:`/system/assets`,icon:`image`,title:`Assets`,text:tk(e.assets.length,`file`)});let r=e.components[0];return r&&t.push({to:`/system/components/${encodeURIComponent(r.id)}`,icon:`component`,title:`Components`,text:tk(e.components.length,`component`)}),t}function mN({system:e}){return(0,L.jsx)(`div`,{className:`grid gap-4`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`},children:pN(e).map(e=>(0,L.jsxs)(be,{href:e.to,className:`flex items-center gap-3 rounded-[10px] border border-rule bg-surface px-4 py-3.5 text-inherit no-underline transition-colors hover:border-rule-strong hover:bg-soft`,children:[(0,L.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-[8px] bg-soft2 text-ink2`,children:(0,L.jsx)(Z,{name:e.icon,size:17})}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,L.jsx)(`span`,{className:`text-[14px] font-medium text-ink`,children:e.title}),(0,L.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.text})]})]},e.to))})}function hN({system:e}){let[,t]=P(),n=[{label:`Color tokens`,value:fN(e,`color`),to:`/system/colors`},{label:`Type tokens`,value:fN(e,`font`,`text`,`weight`,`leading`,`tracking`),to:`/system/typography`},{label:`Spacing & shape tokens`,value:fN(e,`spacing`,`radius`,`shadow`,`blur`,`breakpoint`),to:`/system/shape`},{label:`Motion tokens`,value:fN(e,`ease`,`duration`,`animation`),to:`/system/motion`},{label:`Other tokens`,value:fN(e,`other`),to:`/system/tokens`},{label:`Components`,value:e.components.length},{label:`Guidelines`,value:e.guidelines.length}];return(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`At a glance`}),n.filter(e=>e.value||!e.to||e.to===`/system/colors`).map(e=>(0,L.jsxs)(mT,{cols:`minmax(0,1fr) auto`,align:`lr`,minH:40,pad:`8px 16px`,onClick:e.to&&e.value?()=>t(e.to):void 0,children:[(0,L.jsx)(`span`,{className:`text-[13.5px] text-ink2`,children:e.label}),(0,L.jsx)(oT,{value:e.value})]},e.label)),e.fonts.length?(0,L.jsxs)(mT,{cols:`minmax(0,1fr) auto`,align:`lr`,minH:40,pad:`8px 16px`,children:[(0,L.jsx)(`span`,{className:`text-[13.5px] text-ink2`,children:`Web fonts`}),(0,L.jsx)(`span`,{className:`flex min-w-0 flex-col items-end gap-0.5`,children:e.fonts.map(e=>(0,L.jsx)(Q,{size:12,className:`max-w-[260px] truncate text-muted`,title:e,children:gN(e)},e))})]}):null]})}function gN(e){try{let t=new URL(e),n=t.searchParams.getAll(`family`).map(e=>e.split(`:`)[0].replace(/\+/g,` `));return n.length?n.join(`, `):t.host}catch{return e}}function _N({system:e}){let t=e.guidelines.find(e=>e.slug===`overview`);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(CT,{title:e.name,sub:e.description}),(0,L.jsx)(yT,{issues:e.issues,title:`Problems in the design system`}),(0,L.jsx)(mN,{system:e}),(0,L.jsxs)(`div`,{className:`grid items-start gap-5 max-xl:grid-cols-1!`,style:{gridTemplateColumns:`minmax(0,1fr) 320px`},children:[t?(0,L.jsx)(sT,{children:(0,L.jsx)(`div`,{className:`px-6 py-5`,children:(0,L.jsx)(tO,{text:t.markdown})})}):(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Overview`}),(0,L.jsxs)(`div`,{className:`border-t border-rule px-4 py-5 text-[13px] text-muted`,children:[`Write the principles every screen follows in `,(0,L.jsx)(Q,{children:`.design/system/guidelines/01-overview.md`}),`; it shows here.`]})]}),(0,L.jsx)(hN,{system:e})]})]})}var vN=[1,2,3,4,6,8,12,16],yN=480;function bN({px:e}){return e===null?(0,L.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`not a plain length`}):(0,L.jsxs)(`span`,{className:`flex h-3 items-center`,children:[(0,L.jsx)(`span`,{className:`h-3 rounded-[3px] bg-action/70`,style:{width:Math.max(2,Math.min(e,yN))},title:`${e}px`}),e>yN?(0,L.jsx)(`span`,{className:`ml-1.5 text-[12px] text-muted`,children:`…`}):null]})}function xN({tokens:e}){let t=e.find(e=>e.name===`--spacing`),n=e.filter(e=>e!==t),r=t?.light?gk(t.light.value):null,i=`minmax(150px,0.8fr) 110px minmax(0,2fr)`;return(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Spacing`,count:e.length,sub:t?`base ${t.light?.value}`:void 0}),(0,L.jsx)(fT,{cols:i,labels:[`Class or token`,`Value`,``]}),t&&r!==null?vN.map(e=>(0,L.jsxs)(mT,{cols:i,minH:36,pad:`6px 16px`,children:[(0,L.jsxs)(Q,{size:12.5,className:`text-ink`,children:[`p-`,e,` · gap-`,e]}),(0,L.jsxs)(Q,{size:12,className:`text-muted`,children:[r*e,`px`]}),(0,L.jsx)(bN,{px:r*e})]},e)):null,n.map(e=>(0,L.jsxs)(mT,{cols:i,minH:40,pad:`6px 16px`,title:`Copy the variable`,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,L.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,L.jsx)(Q,{size:12,className:`text-muted`,children:e.light?.value}),(0,L.jsx)(bN,{px:e.light?gk(e.light.value):null})]},e.name))]})}function SN({token:e,children:t}){return(0,L.jsxs)(`button`,{type:`button`,title:`Copy the variable`,onClick:()=>kw(`var(${e.name})`),className:`flex min-w-0 cursor-pointer flex-col items-stretch gap-2.5 rounded-[8px] border border-transparent bg-transparent p-2 text-left transition-colors hover:border-rule hover:bg-soft`,children:[t,(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 px-1`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,L.jsx)(bk,{items:pk(e)}),(0,L.jsx)(Ck,{children:e.light?.value}),e.description?(0,L.jsx)(`span`,{className:`text-[12.5px] text-ink2`,children:e.description}):null]})]})}function CN({title:e,tokens:t,min:n=170,children:r}){return(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:e,count:t.length}),(0,L.jsx)(`div`,{className:`grid gap-2 border-t border-rule p-3`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr))`},children:t.map(e=>(0,L.jsx)(SN,{token:e,children:r(e)},e.name))})]})}function wN({tokens:e}){let t=`minmax(170px,1fr) minmax(90px,0.6fr) 110px 90px`;return(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Breakpoints`,count:e.length}),(0,L.jsx)(fT,{cols:t,labels:[`Token`,`Variant`,`Value`,`Pixels`],align:`lllr`}),e.map(e=>{let n=e.light?gk(e.light.value):null;return(0,L.jsxs)(mT,{cols:t,align:`lllr`,minH:40,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,L.jsx)(bk,{items:pk(e)}),(0,L.jsx)(Q,{size:12,className:`text-muted`,children:e.light?.value}),(0,L.jsx)(Q,{size:12,className:`text-muted`,children:n===null?``:`${n}px`})]},e.name)})]})}function TN({system:e}){let t=__(),n=mk(e.tokens,`spacing`),r=mk(e.tokens,`radius`),i=mk(e.tokens,`shadow`),a=mk(e.tokens,`blur`),o=mk(e.tokens,`breakpoint`),s=!n.length&&!r.length&&!i.length&&!a.length&&!o.length;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(CT,{title:`Spacing & shape`,sub:`Click a token to copy its variable.`}),s?(0,L.jsxs)(xk,{title:`No spacing or shape tokens`,children:[`Add `,(0,L.jsx)(Q,{children:`--spacing`}),` (the base step), `,(0,L.jsx)(Q,{children:`--spacing-*`}),`, `,(0,L.jsx)(Q,{children:`--radius-*`}),`,`,` `,(0,L.jsx)(Q,{children:`--shadow-*`}),` and `,(0,L.jsx)(Q,{children:`--breakpoint-*`}),` to the `,(0,L.jsx)(Q,{children:`@theme`}),` block in`,` `,(0,L.jsx)(Q,{children:Sk}),`.`]}):null,n.length?(0,L.jsx)(xN,{tokens:n}):null,r.length?(0,L.jsx)(CN,{title:`Radii`,tokens:r,children:e=>(0,L.jsx)(`span`,{className:`flex h-[88px] items-center justify-center rounded-[6px] bg-soft`,children:(0,L.jsx)(`span`,{className:`size-14 border border-rule-strong bg-surface`,style:{borderRadius:e.light?.value}})})}):null,i.length?(0,L.jsx)(CN,{title:`Shadows`,tokens:i,min:200,children:e=>(0,L.jsx)(`span`,{className:`flex h-[112px] items-center justify-center rounded-[6px] bg-soft`,children:(0,L.jsx)(`span`,{className:`h-[60px] w-[108px] rounded-[8px] bg-surface`,style:{boxShadow:_k(e,t)}})})}):null,a.length?(0,L.jsx)(CN,{title:`Blur`,tokens:a,children:e=>(0,L.jsxs)(`span`,{className:`relative flex h-[88px] items-center justify-center overflow-hidden rounded-[6px] bg-soft`,children:[(0,L.jsx)(`span`,{className:`absolute left-5 top-4 size-10 rounded-full bg-action`}),(0,L.jsx)(`span`,{className:`absolute right-6 bottom-3 size-12 rounded-[6px] bg-ink2`}),(0,L.jsx)(`span`,{className:`absolute inset-x-6 inset-y-5 rounded-[6px] bg-surface/40`,style:{backdropFilter:`blur(${e.light?.value})`}})]})}):null,o.length?(0,L.jsx)(wN,{tokens:o}):null]})}var EN={font:`Family`,text:`Size`,weight:`Weight`,leading:`Line height`,tracking:`Letter spacing`};function DN(e){return e.kind===`text`?[e.light?.value,e.lineHeight].filter(Boolean).join(` / `):e.light?.value??``}function ON({system:e}){let[t,n]=vk(),r=mk(e.tokens,`font`,`text`,`weight`,`leading`,`tracking`);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(CT,{title:`Typography`,sub:`Set in the design system's own stylesheet, with its fonts.`}),e.typographyUrl?(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Specimen`,right:(0,L.jsx)(yk,{value:t,onChange:n})}),(0,L.jsx)(`div`,{className:`border-t border-rule`,children:(0,L.jsx)(Ak,{src:e.typographyUrl,theme:t,title:`Typography specimen`,minHeight:200})})]}):null,r.length?(0,L.jsxs)(sT,{children:[(0,L.jsx)(cT,{title:`Tokens`,count:r.length}),(0,L.jsx)(fT,{cols:`minmax(160px,1fr) 110px minmax(120px,0.8fr) minmax(0,1.4fr)`,labels:[`Token`,`Kind`,`Class`,`Value`]}),r.map(e=>(0,L.jsxs)(mT,{cols:`minmax(160px,1fr) 110px minmax(120px,0.8fr) minmax(0,1.4fr)`,minH:42,title:`Copy the variable`,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,L.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,L.jsx)(`span`,{className:`text-[13px] text-ink2`,children:EN[e.kind]}),(0,L.jsx)(bk,{items:pk(e)}),(0,L.jsx)(Ck,{children:DN(e)})]},e.name))]}):(0,L.jsxs)(xk,{title:`No type tokens`,children:[`Add font families (`,(0,L.jsx)(Q,{children:`--font-*`}),`), sizes (`,(0,L.jsx)(Q,{children:`--text-*`}),` with`,` `,(0,L.jsx)(Q,{children:`--text-*--line-height`}),`) and weights (`,(0,L.jsx)(Q,{children:`--font-weight-*`}),`) to the `,(0,L.jsx)(Q,{children:`@theme`}),` `,`block in `,(0,L.jsx)(Q,{children:Sk}),`. Web fonts go in `,(0,L.jsx)(Q,{children:`system.json`}),` `,(0,L.jsx)(Q,{children:`fonts`}),`.`]})]})}function kN({system:e}){return(0,L.jsx)(`main`,{className:`mx-auto flex w-full max-w-[1440px] grow animate-[q-fade-in_160ms_ease-out] px-8 max-md:px-4`,children:(0,L.jsxs)(`div`,{className:`grid w-full items-start gap-6 max-lg:grid-cols-1! max-lg:gap-0`,style:{gridTemplateColumns:`232px minmax(0, 1fr)`},children:[(0,L.jsx)(`aside`,{className:`sticky top-[52px] flex max-h-[calc(100dvh-52px)] flex-col overflow-y-auto pt-6 pb-4 max-lg:static max-lg:max-h-none max-lg:overflow-visible max-lg:pb-0 max-md:pt-4`,children:(0,L.jsx)(cN,{system:e})}),(0,L.jsx)(`div`,{className:`flex min-w-0 flex-col gap-5 pt-6 pb-7`,children:(0,L.jsxs)(Se,{children:[(0,L.jsx)(I,{path:`/system`,children:(0,L.jsx)(_N,{system:e})}),(0,L.jsx)(I,{path:`/system/colors`,children:(0,L.jsx)(kk,{system:e})}),(0,L.jsx)(I,{path:`/system/typography`,children:(0,L.jsx)(ON,{system:e})}),(0,L.jsx)(I,{path:`/system/shape`,children:(0,L.jsx)(TN,{system:e})}),(0,L.jsx)(I,{path:`/system/motion`,children:(0,L.jsx)(sN,{system:e})}),(0,L.jsx)(I,{path:`/system/tokens`,children:(0,L.jsx)(dN,{system:e})}),(0,L.jsx)(I,{path:`/system/assets`,children:(0,L.jsx)(Tk,{system:e})}),(0,L.jsx)(I,{path:`/system/guidelines/:slug`,children:t=>(0,L.jsx)($M,{system:e,slug:decodeURIComponent(t.slug)})}),(0,L.jsx)(I,{path:`/system/components/:id`,children:t=>(0,L.jsx)(ZM,{system:e,id:decodeURIComponent(t.id)})}),(0,L.jsx)(I,{children:(0,L.jsx)(OT,{title:`No such page`,text:`This page is not part of the design system.`})})]})})]})})}function AN(){return(0,L.jsx)(DT,{title:`No design system yet`,text:(0,L.jsxs)(L.Fragment,{children:[`Ask your agent to build one from the codebase, or run `,(0,L.jsx)(Q,{children:`design system init`}),` to start from a template in `,(0,L.jsx)(Q,{children:`.design/system`}),`.`]})})}function jN(){let e=$g().data,t=e?e.system!==null:void 0,{data:n,error:r,isLoading:i}=t_(t===!0);return t===!1||n===null||r instanceof Pg&&r.status===404?(0,L.jsx)(AN,{}):r?(0,L.jsx)(DT,{title:`Could not load the design system`,text:r.message}):i||!n?null:(0,L.jsx)(kN,{system:n})}function MN(){let{name:e,icon:t}=$g().data??{};return(0,v.useEffect)(()=>{e&&(document.title=`${e} · Design`)},[e]),(0,v.useEffect)(()=>{let e=document.querySelector(`link[rel="icon"]`);e&&(e.dataset.fallback??=e.getAttribute(`href`)??``,e.removeAttribute(`type`),e.href=t||e.dataset.fallback)},[t]),null}var NN=new URLSearchParams(window.location.search).has(`capture`);function PN(){let e=XC()&&!NN;return{play:(t,n)=>e?(0,L.jsx)(GO,{canvasId:t,itemId:n}):(0,L.jsx)(HO,{canvasId:t,itemId:n}),canvas:(t,n)=>e?(0,L.jsx)(GO,{canvasId:t,pageId:n}):(0,L.jsx)(NO,{canvasId:t,pageId:n})}}function FN(){let e=PN();return(0,L.jsxs)(Se,{children:[(0,L.jsx)(I,{path:`/c/:canvas/full/:item`,children:e=>(0,L.jsx)(LT,{canvasId:e.canvas,itemId:e.item})}),(0,L.jsx)(I,{path:`/c/:canvas/play/:item`,children:t=>e.play(t.canvas,t.item)}),(0,L.jsx)(I,{path:`/c/:canvas/p/:page`,children:t=>e.canvas(t.canvas,t.page)}),(0,L.jsx)(I,{path:`/c/:canvas`,children:t=>e.canvas(t.canvas)}),(0,L.jsxs)(I,{path:`/system/*?`,children:[(0,L.jsx)(KC,{}),(0,L.jsx)(jN,{})]}),(0,L.jsxs)(I,{path:`/`,children:[(0,L.jsx)(KC,{}),(0,L.jsx)(fk,{})]}),(0,L.jsxs)(I,{children:[(0,L.jsx)(KC,{}),(0,L.jsx)(OT,{})]})]})}function IN({canvas:e}){let t=`/c/${encodeURIComponent(e)}`,n=(n,r)=>Zg(n,e)?r:(0,L.jsx)(Ce,{to:t,replace:!0}),r=PN();return(0,L.jsxs)(Se,{children:[(0,L.jsx)(I,{path:`/c/:canvas/full/:item`,children:t=>n(t.canvas,(0,L.jsx)(LT,{canvasId:e,itemId:t.item}))}),(0,L.jsx)(I,{path:`/c/:canvas/play/:item`,children:t=>n(t.canvas,r.play(e,t.item))}),(0,L.jsx)(I,{path:`/c/:canvas/p/:page`,children:t=>n(t.canvas,r.canvas(e,t.page))}),(0,L.jsx)(I,{path:`/c/:canvas`,children:t=>n(t.canvas,r.canvas(e))}),(0,L.jsx)(I,{children:(0,L.jsx)(Ce,{to:t,replace:!0})})]})}function LN({source:e,base:t=``,frameSandbox:n,slots:r,scope:i,queryClient:a}){let[o]=(0,v.useState)(()=>a??Qg(e.live)),s=a??o,c=(0,v.useMemo)(()=>Gg(Jg(e)),[e]),l=i?.canvas,u=(0,v.useMemo)(()=>({source:e,keys:c,frameSandbox:n,slots:r??{},scope:l===void 0?null:{canvas:l}}),[e,c,n,r,l]);return(0,v.useEffect)(()=>e.live?r_(s,c):void 0,[e,s,c]),(0,L.jsx)(Pe,{client:s,children:(0,L.jsx)(Yg.Provider,{value:u,children:(0,L.jsx)(rd,{reducedMotion:`user`,children:(0,L.jsxs)(qb,{children:[(0,L.jsx)(MN,{}),(0,L.jsxs)(_e,{base:t,children:[u.scope?(0,L.jsx)(IN,{canvas:u.scope.canvas}):(0,L.jsx)(FN,{}),(0,L.jsx)(w_,{})]}),(0,L.jsx)(Ow,{})]})})})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(v.StrictMode,{children:Ng?(0,L.jsx)(_e,{hook:Ae,hrefs:e=>`#${e}`,children:(0,L.jsx)(LN,{source:Vg})}):(0,L.jsx)(LN,{source:zg})}));
158
+ `)}),(0,L.jsx)(`pre`,{className:`m-0 min-w-0 grow py-3 pr-6 pl-4 text-ink`,children:(0,L.jsx)(`code`,{dangerouslySetInnerHTML:{__html:i}})})]})]})}var WM={beta:`action`,experimental:`action`,draft:`action`,deprecated:`danger`,stable:`ok`},GM=`.design/system/components/`;function KM(e){return e.startsWith(GM)?`@system/components/${e.slice(26).replace(/\.(tsx|jsx|ts|js)$/,``).replace(/\/index$/,``)}`:null}function qM(e){let t=new Set;for(let n of e.matchAll(/export\s+(?:async\s+)?(?:function|const|class|let)\s+([A-Za-z_$][\w$]*)/g))t.add(n[1]);for(let n of e.matchAll(/export\s*\{([^}]+)\}/g))for(let e of n[1].split(`,`)){let n=e.trim().split(/\s+as\s+/).pop()?.trim();n&&n!=="default"&&t.add(n)}return[...t].filter(e=>/^[A-Z]/.test(e))}function JM({path:e}){let t=KM(e),n=n_(t?e:null).data;if(!t)return null;let r=n?qM(n):[],i=`import { ${r.length?r.join(`, `):`…`} } from '${t}'`;return(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-rule py-1.5 pr-1.5 pl-4`,children:[(0,L.jsx)(Q,{size:12.5,className:`min-w-0 truncate text-ink2`,title:i,children:i}),(0,L.jsx)(ix,{icon:`copy`,label:`Copy the import`,size:14,className:`ml-auto`,onClick:()=>kw(i)})]})}function YM({component:e,theme:t,width:n}){return n===`fill`?(0,L.jsx)(jk,{src:e.url,theme:t,title:e.title,minHeight:160}):(0,L.jsx)(`div`,{className:`flex justify-center overflow-x-auto bg-soft p-6`,children:(0,L.jsx)(`div`,{className:`shrink-0 overflow-hidden rounded-[8px] border border-rule bg-surface shadow-frame`,children:(0,L.jsx)(jk,{src:e.url,theme:t,title:e.title,minHeight:160,width:Number(n)})})})}function XM({component:e}){let t=[...e.sources,e.specimen],[n,r]=(0,v.useState)(t[0]),i=t.includes(n)?n:t[0],{data:a,error:o,isLoading:s}=n_(i);return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[t.length>1?(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-rule px-4 py-2.5`,children:(0,L.jsx)(FT,{label:`File`,size:`sm`,value:i,onChange:r,items:t.map(t=>({value:t,label:t===e.specimen?`${ZM(t)} · specimen`:ZM(t),title:t}))})}):null,KM(i)?(0,L.jsx)(JM,{path:i}):null,o?(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-6 text-[13px] text-danger-text`,children:[(0,L.jsx)(Z,{name:`alert`,size:15}),o.message]}):s||a===void 0?(0,L.jsx)(`div`,{className:`flex items-center justify-center py-10 text-muted`,children:(0,L.jsx)(Z,{name:`loader`,size:18})}):(0,L.jsx)(UM,{code:a,path:i})]})}function ZM(e){return e.split(`/`).pop()??e}function QM({system:e,id:t}){let n=e.components.find(e=>e.id===t),[r,i]=(0,v.useState)(`preview`),[a,o]=yk(),[s,c]=(0,v.useState)(`fill`),l=!Xg().frameSandbox;if(!n)return(0,L.jsx)(kT,{title:`No such component`,text:`There is no specimen "${t}" in .design/system/specimens.`});let u=n.status?.toLowerCase();return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(wT,{title:n.title,badge:(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(oT,{children:n.group}),u?(0,L.jsx)(oT,{tone:WM[u]??`neutral`,children:n.status}):null]}),sub:n.description}),(0,L.jsxs)(cT,{children:[(0,L.jsx)(uT,{value:r,onChange:i,items:[{value:`preview`,label:`Preview`},{value:`code`,label:`Code`,count:n.sources.length+1}],right:r===`preview`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(FT,{label:`Width`,size:`sm`,value:s,onChange:c,items:[{value:`fill`,label:`Fill`},{value:`768`,label:`768`},{value:`390`,label:`390`}]}),(0,L.jsx)(bk,{value:a,onChange:o}),l?(0,L.jsx)(ox,{icon:`external`,href:Gw(Ww(n.url,a)),target:`_blank`,rel:`noreferrer`,children:`Open`}):null]}):null}),(0,L.jsx)(`div`,{className:`border-t border-rule`,children:r===`preview`?(0,L.jsx)(YM,{component:n,theme:a,width:s}):(0,L.jsx)(XM,{component:n})})]})]})}function $M(e,t){let n=/^\s*#\s+(.+)\r?\n/.exec(e);return n&&n[1].trim()===t?e.slice(n[0].length):e}function eN({system:e,slug:t}){let n=e.guidelines.find(e=>e.slug===t);if(!n)return(0,L.jsx)(kT,{title:`No such guideline`,text:`There is no guideline "${t}" in .design/system/guidelines.`});let r=$M(n.markdown,n.title).trim();return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(wT,{title:n.title,sub:`Guideline`}),(0,L.jsx)(cT,{children:(0,L.jsx)(`div`,{className:`px-6 py-5`,children:r?(0,L.jsx)(nO,{text:r,className:`max-w-[760px]`}):(0,L.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`This guideline is empty. Write it in `,(0,L.jsx)(Q,{children:`.design/system/guidelines`}),`.`]})})})]})}var tN={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]};function nN(e){let t=e.trim();if(tN[t])return tN[t];let n=/^cubic-bezier\(\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)\s*\)$/.exec(t);if(!n)return null;let r=n.slice(1).map(Number);return r.every(Number.isFinite)?r:null}function rN(e){let t=/^(-?[\d.]+)(ms|s)$/.exec(e.trim());return t?Number(t[1])*(t[2]===`s`?1e3:1):null}var iN=132,aN=22;function oN({bezier:e}){let[t,n,r,i]=e,a=Math.min(0,n,i),o=Math.max(1,n,i),s=88/(o-a),c=e=>aN+e*88,l=e=>aN+(o-e)*s;return(0,L.jsxs)(`svg`,{width:iN,height:iN,viewBox:`0 0 ${iN} ${iN}`,"aria-hidden":`true`,className:`shrink-0`,children:[(0,L.jsx)(`rect`,{x:c(0),y:l(1),width:88,height:l(0)-l(1),className:`fill-none stroke-rule`}),(0,L.jsx)(`line`,{x1:c(0),y1:l(0),x2:c(t),y2:l(n),className:`stroke-rule-strong`,strokeDasharray:`3 3`}),(0,L.jsx)(`line`,{x1:c(1),y1:l(1),x2:c(r),y2:l(i),className:`stroke-rule-strong`,strokeDasharray:`3 3`}),(0,L.jsx)(`path`,{d:`M ${c(0)} ${l(0)} C ${c(t)} ${l(n)}, ${c(r)} ${l(i)}, ${c(1)} ${l(1)}`,className:`fill-none stroke-ink`,strokeWidth:2,strokeLinecap:`round`}),(0,L.jsx)(`circle`,{cx:c(t),cy:l(n),r:3,className:`fill-action`}),(0,L.jsx)(`circle`,{cx:c(r),cy:l(i),r:3,className:`fill-action`})]})}function sN({token:e,duration:t}){let[n,r]=(0,v.useState)(!1),i=e.light?.value??``,a=nN(i);return(0,L.jsxs)(`button`,{type:`button`,title:`Hover to play; click to copy the variable`,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onFocus:()=>r(!0),onBlur:()=>r(!1),onClick:()=>kw(`var(${e.name})`),className:`flex min-w-0 cursor-pointer flex-col gap-3 rounded-[8px] border border-transparent bg-transparent p-3 text-left transition-colors hover:border-rule hover:bg-soft`,children:[(0,L.jsx)(`span`,{className:`flex h-[132px] items-center justify-center rounded-[6px] bg-soft`,children:a?(0,L.jsx)(oN,{bezier:a}):(0,L.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`No curve to draw`})}),(0,L.jsx)(`span`,{className:`relative mx-1 h-2 rounded-full bg-soft2`,children:(0,L.jsx)(`span`,{className:`absolute top-1/2 size-3.5 -translate-y-1/2 rounded-full bg-ink`,style:{left:n?`calc(100% - 14px)`:`0px`,transition:`left ${t}ms ${i||`ease`}`}})}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 px-1`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,L.jsx)(xk,{items:mk(e)}),(0,L.jsx)(wk,{children:i}),e.description?(0,L.jsx)(`span`,{className:`text-[12.5px] text-ink2`,children:e.description}):null]})]})}function cN({system:e}){let t=hk(e.tokens,`ease`),n=hk(e.tokens,`duration`),r=hk(e.tokens,`animation`),i=`minmax(170px,1fr) 100px minmax(0,2fr)`,a=`minmax(170px,1fr) minmax(140px,0.7fr) minmax(0,2fr)`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(wT,{title:`Motion`,sub:`Hover an easing to see it move.`}),!t.length&&!n.length&&!r.length?(0,L.jsxs)(Sk,{title:`No motion tokens`,children:[`Add `,(0,L.jsx)(Q,{children:`--ease-*`}),` and `,(0,L.jsx)(Q,{children:`--animate-*`}),` to the `,(0,L.jsx)(Q,{children:`@theme`}),` block, and durations as`,` `,(0,L.jsx)(Q,{children:`--duration-*`}),`, in `,(0,L.jsx)(Q,{children:Ck}),`.`]}):null,t.length?(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Easing`,count:t.length}),(0,L.jsx)(`div`,{className:`grid gap-2 border-t border-rule p-3`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(190px, 1fr))`},children:t.map(e=>(0,L.jsx)(sN,{token:e,duration:900},e.name))})]}):null,n.length?(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Durations`,count:n.length}),(0,L.jsx)(pT,{cols:i,labels:[`Token`,`Value`,``]}),n.map(e=>{let t=e.light?rN(e.light.value):null;return(0,L.jsxs)(hT,{cols:i,minH:40,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,L.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,L.jsx)(Q,{size:12,className:`text-muted`,children:e.light?.value}),t===null?(0,L.jsx)(`span`,{}):(0,L.jsx)(`span`,{className:`h-3 rounded-[3px] bg-action/70`,style:{width:Math.max(2,Math.min(t/2,480))}})]},e.name)})]}):null,r.length?(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Animations`,count:r.length,sub:`keyframes live in the system stylesheet`}),(0,L.jsx)(pT,{cols:a,labels:[`Token`,`Class`,`Value`]}),r.map(e=>(0,L.jsxs)(hT,{cols:a,minH:40,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,L.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,L.jsx)(xk,{items:mk(e)}),(0,L.jsx)(wk,{children:e.light?.value})]},e.name))]}):null]})}function lN({system:e}){let t=XC(),n=new Set(e.tokens.map(e=>e.kind)),r=[{to:`/system/colors`,label:`Colors`,hint:uN(e,`color`)},{to:`/system/typography`,label:`Typography`},{to:`/system/shape`,label:`Spacing & shape`}];(n.has(`ease`)||n.has(`duration`)||n.has(`animation`))&&r.push({to:`/system/motion`,label:`Motion`}),n.has(`other`)&&r.push({to:`/system/tokens`,label:`Other tokens`,hint:uN(e,`other`)}),e.assets.length&&r.push({to:`/system/assets`,label:`Assets`,hint:e.assets.length});let i=new Map;for(let t of e.components){let e=i.get(t.group)??[];e.push({to:`/system/components/${encodeURIComponent(t.id)}`,label:t.title,hint:t.status}),i.set(t.group,e)}let a=e.guidelines.filter(e=>e.slug!==`overview`);if(t){let e=[{label:``,items:[{to:`/system`,label:`Overview`}]},{label:`Foundations`,items:r},{label:`Guidelines`,items:a.map(e=>({to:`/system/guidelines/${encodeURIComponent(e.slug)}`,label:e.title}))},...[...i].map(([e,t])=>({label:e,items:t}))];return(0,L.jsx)(dN,{sections:e.filter(e=>e.items.length)})}return(0,L.jsxs)(`div`,{className:`flex flex-col max-lg:gap-1 max-lg:[&_nav]:flex-row max-lg:[&_nav]:flex-wrap`,children:[(0,L.jsx)(TT,{label:`Overview`,items:[{to:`/system`,label:`Overview`}]}),(0,L.jsx)(ET,{children:`Foundations`}),(0,L.jsx)(TT,{label:`Foundations`,items:r}),a.length?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(ET,{children:`Guidelines`}),(0,L.jsx)(TT,{label:`Guidelines`,items:a.map(e=>({to:`/system/guidelines/${encodeURIComponent(e.slug)}`,label:e.title}))})]}):null,[...i].map(([e,t])=>(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[(0,L.jsx)(ET,{children:e}),(0,L.jsx)(TT,{label:e,items:t})]},e))]})}function uN(e,t){return e.tokens.filter(e=>e.kind===t).length||void 0}function dN({sections:e}){let[t]=P(),[n,r]=(0,v.useState)(!1),i=e.flatMap(e=>e.items).find(e=>e.to===t);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r(!0),className:`flex h-11 w-full cursor-pointer items-center gap-2 rounded-[8px] border border-rule bg-surface px-3.5 text-left text-[14px] text-ink`,children:[(0,L.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`Section`}),(0,L.jsx)(`span`,{className:`min-w-0 grow truncate font-medium`,children:i?.label??`Overview`}),(0,L.jsx)(Z,{name:`chevron-down`,size:16,className:`shrink-0 text-muted`})]}),(0,L.jsx)(BO,{open:n,onOpenChange:r,title:`Design system`,children:(0,L.jsx)(`nav`,{"aria-label":`Design system`,className:`flex flex-col pb-2`,children:e.map(e=>(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[e.label?(0,L.jsx)(`div`,{className:`px-4 pt-3 pb-1 text-[12px] text-muted`,children:e.label}):null,e.items.map(e=>{let n=e.to===t;return(0,L.jsxs)(be,{href:e.to,onClick:()=>r(!1),"aria-current":n?`page`:void 0,className:X(`flex min-h-[46px] items-center gap-2 px-4 text-[14px] no-underline active:bg-soft2`,n?`font-medium text-ink`:`text-ink2`),children:[(0,L.jsx)(`span`,{className:`min-w-0 grow truncate`,children:e.label}),e.hint?(0,L.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:e.hint}):null,n?(0,L.jsx)(Z,{name:`check`,size:16,className:`shrink-0 text-action`}):null]},e.to)})]},e.label||`overview`))})})]})}function fN({system:e}){let t=hk(e.tokens,`other`),n=`minmax(170px,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.3fr)`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(wT,{title:`Other tokens`,sub:`Variables that are not colors, type, spacing, shape or motion.`}),t.length?gk(t).map(({group:e,tokens:t})=>(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:e,count:t.length}),(0,L.jsx)(pT,{cols:n,labels:[`Token`,`Light`,`Dark`,`Description`]}),t.map(e=>(0,L.jsxs)(hT,{cols:n,minH:40,title:`Copy the variable`,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,L.jsx)(wk,{children:e.light?.value}),(0,L.jsx)(wk,{children:e.dark?.value??`—`}),(0,L.jsx)(`span`,{className:`text-[13px] text-ink2`,children:e.description})]},e.name))]},e)):(0,L.jsxs)(Sk,{title:`No other tokens`,children:[`Variables in `,(0,L.jsx)(Q,{children:`:root`}),` of `,(0,L.jsx)(Q,{children:Ck}),` that are not colors or lengths show here.`]})]})}function pN(e,...t){return e.tokens.filter(e=>t.includes(e.kind)).length}function mN(e){let t=[{to:`/system/colors`,icon:`palette`,title:`Colors`,text:nk(pN(e,`color`),`token`)},{to:`/system/typography`,icon:`type`,title:`Typography`,text:`${nk(pN(e,`font`),`family`,`families`)} · ${nk(pN(e,`text`),`size`)}`},{to:`/system/shape`,icon:`shape`,title:`Spacing & shape`,text:nk(pN(e,`spacing`,`radius`,`shadow`,`blur`,`breakpoint`),`token`)}],n=pN(e,`ease`,`duration`,`animation`);n&&t.push({to:`/system/motion`,icon:`motion`,title:`Motion`,text:nk(n,`token`)}),e.assets.length&&t.push({to:`/system/assets`,icon:`image`,title:`Assets`,text:nk(e.assets.length,`file`)});let r=e.components[0];return r&&t.push({to:`/system/components/${encodeURIComponent(r.id)}`,icon:`component`,title:`Components`,text:nk(e.components.length,`component`)}),t}function hN({system:e}){return(0,L.jsx)(`div`,{className:`grid gap-4`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`},children:mN(e).map(e=>(0,L.jsxs)(be,{href:e.to,className:`flex items-center gap-3 rounded-[10px] border border-rule bg-surface px-4 py-3.5 text-inherit no-underline transition-colors hover:border-rule-strong hover:bg-soft`,children:[(0,L.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-[8px] bg-soft2 text-ink2`,children:(0,L.jsx)(Z,{name:e.icon,size:17})}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,L.jsx)(`span`,{className:`text-[14px] font-medium text-ink`,children:e.title}),(0,L.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.text})]})]},e.to))})}function gN({system:e}){let[,t]=P(),n=[{label:`Color tokens`,value:pN(e,`color`),to:`/system/colors`},{label:`Type tokens`,value:pN(e,`font`,`text`,`weight`,`leading`,`tracking`),to:`/system/typography`},{label:`Spacing & shape tokens`,value:pN(e,`spacing`,`radius`,`shadow`,`blur`,`breakpoint`),to:`/system/shape`},{label:`Motion tokens`,value:pN(e,`ease`,`duration`,`animation`),to:`/system/motion`},{label:`Other tokens`,value:pN(e,`other`),to:`/system/tokens`},{label:`Components`,value:e.components.length},{label:`Guidelines`,value:e.guidelines.length}];return(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`At a glance`}),n.filter(e=>e.value||!e.to||e.to===`/system/colors`).map(e=>(0,L.jsxs)(hT,{cols:`minmax(0,1fr) auto`,align:`lr`,minH:40,pad:`8px 16px`,onClick:e.to&&e.value?()=>t(e.to):void 0,children:[(0,L.jsx)(`span`,{className:`text-[13.5px] text-ink2`,children:e.label}),(0,L.jsx)(sT,{value:e.value})]},e.label)),e.fonts.length?(0,L.jsxs)(hT,{cols:`minmax(0,1fr) auto`,align:`lr`,minH:40,pad:`8px 16px`,children:[(0,L.jsx)(`span`,{className:`text-[13.5px] text-ink2`,children:`Web fonts`}),(0,L.jsx)(`span`,{className:`flex min-w-0 flex-col items-end gap-0.5`,children:e.fonts.map(e=>(0,L.jsx)(Q,{size:12,className:`max-w-[260px] truncate text-muted`,title:e,children:_N(e)},e))})]}):null]})}function _N(e){try{let t=new URL(e),n=t.searchParams.getAll(`family`).map(e=>e.split(`:`)[0].replace(/\+/g,` `));return n.length?n.join(`, `):t.host}catch{return e}}function vN({system:e}){let t=e.guidelines.find(e=>e.slug===`overview`);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(wT,{title:e.name,sub:e.description}),(0,L.jsx)(bT,{issues:e.issues,title:`Problems in the design system`}),(0,L.jsx)(hN,{system:e}),(0,L.jsxs)(`div`,{className:`grid items-start gap-5 max-xl:grid-cols-1!`,style:{gridTemplateColumns:`minmax(0,1fr) 320px`},children:[t?(0,L.jsx)(cT,{children:(0,L.jsx)(`div`,{className:`px-6 py-5`,children:(0,L.jsx)(nO,{text:t.markdown})})}):(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Overview`}),(0,L.jsxs)(`div`,{className:`border-t border-rule px-4 py-5 text-[13px] text-muted`,children:[`Write the principles every screen follows in `,(0,L.jsx)(Q,{children:`.design/system/guidelines/01-overview.md`}),`; it shows here.`]})]}),(0,L.jsx)(gN,{system:e})]})]})}var yN=[1,2,3,4,6,8,12,16],bN=480;function xN({px:e}){return e===null?(0,L.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`not a plain length`}):(0,L.jsxs)(`span`,{className:`flex h-3 items-center`,children:[(0,L.jsx)(`span`,{className:`h-3 rounded-[3px] bg-action/70`,style:{width:Math.max(2,Math.min(e,bN))},title:`${e}px`}),e>bN?(0,L.jsx)(`span`,{className:`ml-1.5 text-[12px] text-muted`,children:`…`}):null]})}function SN({tokens:e}){let t=e.find(e=>e.name===`--spacing`),n=e.filter(e=>e!==t),r=t?.light?_k(t.light.value):null,i=`minmax(150px,0.8fr) 110px minmax(0,2fr)`;return(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Spacing`,count:e.length,sub:t?`base ${t.light?.value}`:void 0}),(0,L.jsx)(pT,{cols:i,labels:[`Class or token`,`Value`,``]}),t&&r!==null?yN.map(e=>(0,L.jsxs)(hT,{cols:i,minH:36,pad:`6px 16px`,children:[(0,L.jsxs)(Q,{size:12.5,className:`text-ink`,children:[`p-`,e,` · gap-`,e]}),(0,L.jsxs)(Q,{size:12,className:`text-muted`,children:[r*e,`px`]}),(0,L.jsx)(xN,{px:r*e})]},e)):null,n.map(e=>(0,L.jsxs)(hT,{cols:i,minH:40,pad:`6px 16px`,title:`Copy the variable`,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,L.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,L.jsx)(Q,{size:12,className:`text-muted`,children:e.light?.value}),(0,L.jsx)(xN,{px:e.light?_k(e.light.value):null})]},e.name))]})}function CN({token:e,children:t}){return(0,L.jsxs)(`button`,{type:`button`,title:`Copy the variable`,onClick:()=>kw(`var(${e.name})`),className:`flex min-w-0 cursor-pointer flex-col items-stretch gap-2.5 rounded-[8px] border border-transparent bg-transparent p-2 text-left transition-colors hover:border-rule hover:bg-soft`,children:[t,(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 px-1`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,L.jsx)(xk,{items:mk(e)}),(0,L.jsx)(wk,{children:e.light?.value}),e.description?(0,L.jsx)(`span`,{className:`text-[12.5px] text-ink2`,children:e.description}):null]})]})}function wN({title:e,tokens:t,min:n=170,children:r}){return(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:e,count:t.length}),(0,L.jsx)(`div`,{className:`grid gap-2 border-t border-rule p-3`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr))`},children:t.map(e=>(0,L.jsx)(CN,{token:e,children:r(e)},e.name))})]})}function TN({tokens:e}){let t=`minmax(170px,1fr) minmax(90px,0.6fr) 110px 90px`;return(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Breakpoints`,count:e.length}),(0,L.jsx)(pT,{cols:t,labels:[`Token`,`Variant`,`Value`,`Pixels`],align:`lllr`}),e.map(e=>{let n=e.light?_k(e.light.value):null;return(0,L.jsxs)(hT,{cols:t,align:`lllr`,minH:40,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),(0,L.jsx)(xk,{items:mk(e)}),(0,L.jsx)(Q,{size:12,className:`text-muted`,children:e.light?.value}),(0,L.jsx)(Q,{size:12,className:`text-muted`,children:n===null?``:`${n}px`})]},e.name)})]})}function EN({system:e}){let t=__(),n=hk(e.tokens,`spacing`),r=hk(e.tokens,`radius`),i=hk(e.tokens,`shadow`),a=hk(e.tokens,`blur`),o=hk(e.tokens,`breakpoint`),s=!n.length&&!r.length&&!i.length&&!a.length&&!o.length;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(wT,{title:`Spacing & shape`,sub:`Click a token to copy its variable.`}),s?(0,L.jsxs)(Sk,{title:`No spacing or shape tokens`,children:[`Add `,(0,L.jsx)(Q,{children:`--spacing`}),` (the base step), `,(0,L.jsx)(Q,{children:`--spacing-*`}),`, `,(0,L.jsx)(Q,{children:`--radius-*`}),`,`,` `,(0,L.jsx)(Q,{children:`--shadow-*`}),` and `,(0,L.jsx)(Q,{children:`--breakpoint-*`}),` to the `,(0,L.jsx)(Q,{children:`@theme`}),` block in`,` `,(0,L.jsx)(Q,{children:Ck}),`.`]}):null,n.length?(0,L.jsx)(SN,{tokens:n}):null,r.length?(0,L.jsx)(wN,{title:`Radii`,tokens:r,children:e=>(0,L.jsx)(`span`,{className:`flex h-[88px] items-center justify-center rounded-[6px] bg-soft`,children:(0,L.jsx)(`span`,{className:`size-14 border border-rule-strong bg-surface`,style:{borderRadius:e.light?.value}})})}):null,i.length?(0,L.jsx)(wN,{title:`Shadows`,tokens:i,min:200,children:e=>(0,L.jsx)(`span`,{className:`flex h-[112px] items-center justify-center rounded-[6px] bg-soft`,children:(0,L.jsx)(`span`,{className:`h-[60px] w-[108px] rounded-[8px] bg-surface`,style:{boxShadow:vk(e,t)}})})}):null,a.length?(0,L.jsx)(wN,{title:`Blur`,tokens:a,children:e=>(0,L.jsxs)(`span`,{className:`relative flex h-[88px] items-center justify-center overflow-hidden rounded-[6px] bg-soft`,children:[(0,L.jsx)(`span`,{className:`absolute left-5 top-4 size-10 rounded-full bg-action`}),(0,L.jsx)(`span`,{className:`absolute right-6 bottom-3 size-12 rounded-[6px] bg-ink2`}),(0,L.jsx)(`span`,{className:`absolute inset-x-6 inset-y-5 rounded-[6px] bg-surface/40`,style:{backdropFilter:`blur(${e.light?.value})`}})]})}):null,o.length?(0,L.jsx)(TN,{tokens:o}):null]})}var DN={font:`Family`,text:`Size`,weight:`Weight`,leading:`Line height`,tracking:`Letter spacing`};function ON(e){return e.kind===`text`?[e.light?.value,e.lineHeight].filter(Boolean).join(` / `):e.light?.value??``}function kN({system:e}){let[t,n]=yk(),r=hk(e.tokens,`font`,`text`,`weight`,`leading`,`tracking`);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(wT,{title:`Typography`,sub:`Set in the design system's own stylesheet, with its fonts.`}),e.typographyUrl?(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Specimen`,right:(0,L.jsx)(bk,{value:t,onChange:n})}),(0,L.jsx)(`div`,{className:`border-t border-rule`,children:(0,L.jsx)(jk,{src:e.typographyUrl,theme:t,title:`Typography specimen`,minHeight:200})})]}):null,r.length?(0,L.jsxs)(cT,{children:[(0,L.jsx)(lT,{title:`Tokens`,count:r.length}),(0,L.jsx)(pT,{cols:`minmax(160px,1fr) 110px minmax(120px,0.8fr) minmax(0,1.4fr)`,labels:[`Token`,`Kind`,`Class`,`Value`]}),r.map(e=>(0,L.jsxs)(hT,{cols:`minmax(160px,1fr) 110px minmax(120px,0.8fr) minmax(0,1.4fr)`,minH:42,title:`Copy the variable`,onClick:()=>kw(`var(${e.name})`),children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(Q,{size:12.5,className:`truncate text-ink`,children:e.name}),e.description?(0,L.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.description}):null]}),(0,L.jsx)(`span`,{className:`text-[13px] text-ink2`,children:DN[e.kind]}),(0,L.jsx)(xk,{items:mk(e)}),(0,L.jsx)(wk,{children:ON(e)})]},e.name))]}):(0,L.jsxs)(Sk,{title:`No type tokens`,children:[`Add font families (`,(0,L.jsx)(Q,{children:`--font-*`}),`), sizes (`,(0,L.jsx)(Q,{children:`--text-*`}),` with`,` `,(0,L.jsx)(Q,{children:`--text-*--line-height`}),`) and weights (`,(0,L.jsx)(Q,{children:`--font-weight-*`}),`) to the `,(0,L.jsx)(Q,{children:`@theme`}),` `,`block in `,(0,L.jsx)(Q,{children:Ck}),`. Web fonts go in `,(0,L.jsx)(Q,{children:`system.json`}),` `,(0,L.jsx)(Q,{children:`fonts`}),`.`]})]})}function AN({system:e}){let[t]=P();return(0,L.jsx)(`main`,{className:`mx-auto flex w-full max-w-[1440px] grow animate-[q-fade-in_160ms_ease-out] px-8 max-md:px-4`,children:(0,L.jsxs)(`div`,{className:`grid w-full items-start gap-6 max-lg:grid-cols-1! max-lg:gap-0`,style:{gridTemplateColumns:`232px minmax(0, 1fr)`},children:[(0,L.jsx)(`aside`,{className:`sticky top-[52px] flex max-h-[calc(100dvh-52px)] flex-col overflow-y-auto pt-6 pb-4 max-lg:static max-lg:max-h-none max-lg:overflow-visible max-lg:pb-0 max-md:pt-4`,children:(0,L.jsx)(lN,{system:e})}),(0,L.jsx)(`div`,{className:`flex min-w-0 animate-[q-fade-in_160ms_ease-out] flex-col gap-5 pt-6 pb-7`,children:(0,L.jsxs)(Se,{children:[(0,L.jsx)(I,{path:`/system`,children:(0,L.jsx)(vN,{system:e})}),(0,L.jsx)(I,{path:`/system/colors`,children:(0,L.jsx)(Ak,{system:e})}),(0,L.jsx)(I,{path:`/system/typography`,children:(0,L.jsx)(kN,{system:e})}),(0,L.jsx)(I,{path:`/system/shape`,children:(0,L.jsx)(EN,{system:e})}),(0,L.jsx)(I,{path:`/system/motion`,children:(0,L.jsx)(cN,{system:e})}),(0,L.jsx)(I,{path:`/system/tokens`,children:(0,L.jsx)(fN,{system:e})}),(0,L.jsx)(I,{path:`/system/assets`,children:(0,L.jsx)(Ek,{system:e})}),(0,L.jsx)(I,{path:`/system/guidelines/:slug`,children:t=>(0,L.jsx)(eN,{system:e,slug:decodeURIComponent(t.slug)})}),(0,L.jsx)(I,{path:`/system/components/:id`,children:t=>(0,L.jsx)(QM,{system:e,id:decodeURIComponent(t.id)})}),(0,L.jsx)(I,{children:(0,L.jsx)(kT,{title:`No such page`,text:`This page is not part of the design system.`})})]})},t)]})})}function jN(){return(0,L.jsx)(OT,{title:`No design system yet`,text:(0,L.jsxs)(L.Fragment,{children:[`Ask your agent to build one from the codebase, or run `,(0,L.jsx)(Q,{children:`design system init`}),` to start from a template in `,(0,L.jsx)(Q,{children:`.design/system`}),`.`]})})}function MN(){let e=$g().data,t=e?e.system!==null:void 0,{data:n,error:r,isLoading:i}=t_(t===!0);return t===!1||n===null||r instanceof Pg&&r.status===404?(0,L.jsx)(jN,{}):r?(0,L.jsx)(OT,{title:`Could not load the design system`,text:r.message}):i||!n?null:(0,L.jsx)(AN,{system:n})}function NN(){let{name:e,icon:t}=$g().data??{};return(0,v.useEffect)(()=>{e&&(document.title=`${e} · Design`)},[e]),(0,v.useEffect)(()=>{let e=document.querySelector(`link[rel="icon"]`);e&&(e.dataset.fallback??=e.getAttribute(`href`)??``,e.removeAttribute(`type`),e.href=t||e.dataset.fallback)},[t]),null}var PN=new URLSearchParams(window.location.search).has(`capture`);function FN(){let e=XC()&&!PN;return{play:(t,n)=>e?(0,L.jsx)(KO,{canvasId:t,itemId:n}):(0,L.jsx)(UO,{canvasId:t,itemId:n}),canvas:(t,n)=>e?(0,L.jsx)(KO,{canvasId:t,pageId:n}):(0,L.jsx)(PO,{canvasId:t,pageId:n})}}function IN(){let e=FN();return(0,L.jsxs)(Se,{children:[(0,L.jsx)(I,{path:`/c/:canvas/full/:item`,children:e=>(0,L.jsx)(RT,{canvasId:e.canvas,itemId:e.item})}),(0,L.jsx)(I,{path:`/c/:canvas/play/:item`,children:t=>e.play(t.canvas,t.item)}),(0,L.jsx)(I,{path:`/c/:canvas/p/:page`,children:t=>e.canvas(t.canvas,t.page)}),(0,L.jsx)(I,{path:`/c/:canvas`,children:t=>e.canvas(t.canvas)}),(0,L.jsxs)(I,{path:`/system/*?`,children:[(0,L.jsx)(KC,{}),(0,L.jsx)(MN,{})]}),(0,L.jsxs)(I,{path:`/`,children:[(0,L.jsx)(KC,{}),(0,L.jsx)(pk,{})]}),(0,L.jsxs)(I,{children:[(0,L.jsx)(KC,{}),(0,L.jsx)(kT,{})]})]})}function LN({canvas:e}){let t=`/c/${encodeURIComponent(e)}`,n=(n,r)=>Zg(n,e)?r:(0,L.jsx)(Ce,{to:t,replace:!0}),r=FN();return(0,L.jsxs)(Se,{children:[(0,L.jsx)(I,{path:`/c/:canvas/full/:item`,children:t=>n(t.canvas,(0,L.jsx)(RT,{canvasId:e,itemId:t.item}))}),(0,L.jsx)(I,{path:`/c/:canvas/play/:item`,children:t=>n(t.canvas,r.play(e,t.item))}),(0,L.jsx)(I,{path:`/c/:canvas/p/:page`,children:t=>n(t.canvas,r.canvas(e,t.page))}),(0,L.jsx)(I,{path:`/c/:canvas`,children:t=>n(t.canvas,r.canvas(e))}),(0,L.jsx)(I,{children:(0,L.jsx)(Ce,{to:t,replace:!0})})]})}function RN({source:e,base:t=``,frameSandbox:n,slots:r,scope:i,queryClient:a}){let[o]=(0,v.useState)(()=>a??Qg(e.live)),s=a??o,c=(0,v.useMemo)(()=>Gg(Jg(e)),[e]),l=i?.canvas,u=(0,v.useMemo)(()=>({source:e,keys:c,frameSandbox:n,slots:r??{},scope:l===void 0?null:{canvas:l}}),[e,c,n,r,l]);return(0,v.useEffect)(()=>e.live?r_(s,c):void 0,[e,s,c]),(0,L.jsx)(Pe,{client:s,children:(0,L.jsx)(Yg.Provider,{value:u,children:(0,L.jsx)(id,{reducedMotion:`user`,children:(0,L.jsxs)(qb,{children:[(0,L.jsx)(NN,{}),(0,L.jsxs)(_e,{base:t,children:[u.scope?(0,L.jsx)(LN,{canvas:u.scope.canvas}):(0,L.jsx)(IN,{}),(0,L.jsx)(w_,{})]}),(0,L.jsx)(Ow,{})]})})})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(v.StrictMode,{children:Ng?(0,L.jsx)(_e,{hook:Ae,hrefs:e=>`#${e}`,children:(0,L.jsx)(RN,{source:Vg})}):(0,L.jsx)(RN,{source:zg})}));