mtranserver 4.0.25 → 4.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -20
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/core/engine.d.ts +3 -1
- package/dist/core/engine.d.ts.map +1 -1
- package/dist/{index-bQLHUB4Q-91y6ny8e.js → index-DAzz1C6Q-238q065m.js} +2 -2
- package/dist/{index-3w67mw5s.html → index-csm26kkw.html} +1 -1
- package/dist/index.js +172 -107
- package/dist/main.js +401 -123
- package/dist/services/detector.d.ts.map +1 -1
- package/dist/utils/lang-alias.d.ts +1 -0
- package/dist/utils/lang-alias.d.ts.map +1 -1
- package/package.json +35 -14
|
@@ -6,7 +6,7 @@ function tw(n,l){for(var r=0;r<l.length;r++){const i=l[r];if(typeof i!="string"&
|
|
|
6
6
|
`+j[o].replace(" at new "," at ");return e.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",e.displayName)),W}while(1<=o&&0<=u);break}}}finally{wn=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?it(a):""}function Qt(e,t){switch(e.tag){case 26:case 27:case 5:return it(e.type);case 16:return it("Lazy");case 13:return e.child!==t&&t!==null?it("Suspense Fallback"):it("Suspense");case 19:return it("SuspenseList");case 0:case 15:return on(e.type,!1);case 11:return on(e.type.render,!1);case 1:return on(e.type,!0);case 31:return it("Activity");default:return""}}function ae(e){try{var t="",a=null;do t+=Qt(e,a),a=e,e=e.return;while(e);return t}catch(o){return`
|
|
7
7
|
Error generating stack: `+o.message+`
|
|
8
8
|
`+o.stack}}var xe=Object.prototype.hasOwnProperty,Ve=n.unstable_scheduleCallback,nt=n.unstable_cancelCallback,Ye=n.unstable_shouldYield,St=n.unstable_requestPaint,at=n.unstable_now,jl=n.unstable_getCurrentPriorityLevel,Fn=n.unstable_ImmediatePriority,ri=n.unstable_UserBlockingPriority,tl=n.unstable_NormalPriority,Ir=n.unstable_LowPriority,Kn=n.unstable_IdlePriority,oi=n.log,va=n.unstable_setDisableYieldValue,nl=null,zt=null;function Cn(e){if(typeof oi=="function"&&va(e),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(nl,e)}catch{}}var Dt=Math.clz32?Math.clz32:_n,xc=Math.log,Yr=Math.LN2;function _n(e){return e>>>=0,e===0?32:31-(xc(e)/Yr|0)|0}var Dl=256,_l=262144,al=4194304;function Mn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ee(e,t,a){var o=e.pendingLanes;if(o===0)return 0;var u=0,f=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var S=o&134217727;return S!==0?(o=S&~f,o!==0?u=Mn(o):(b&=S,b!==0?u=Mn(b):a||(a=S&~e,a!==0&&(u=Mn(a))))):(S=o&~f,S!==0?u=Mn(S):b!==0?u=Mn(b):a||(a=o&~e,a!==0&&(u=Mn(a)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,a=t&-t,f>=a||f===32&&(a&4194048)!==0)?t:u}function Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function yt(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 _t(){var e=al;return al<<=1,(al&62914560)===0&&(al=4194304),e}function ya(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function lt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Bt(e,t,a,o,u,f){var b=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var S=e.entanglements,j=e.expirationTimes,I=e.hiddenUpdates;for(a=b&~a;0<a;){var W=31-Dt(a),te=1<<W;S[W]=0,j[W]=-1;var q=I[W];if(q!==null)for(I[W]=null,W=0;W<q.length;W++){var F=q[W];F!==null&&(F.lane&=-536870913)}a&=~te}o!==0&&ll(e,o,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function ll(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Dt(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|a&261930}function Pt(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var o=31-Dt(a),u=1<<o;u&t|e[o]&t&&(e[o]|=t),a&=~u}}function Vt(e,t){var a=t&-t;return a=(a&42)!==0?1:Ml(a),(a&(e.suspendedLanes|t))!==0?0:a}function Ml(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 En(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Sc(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:Qg(e.type))}function dh(e,t){var a=$.p;try{return $.p=e,t()}finally{$.p=a}}var ba=Math.random().toString(36).slice(2),wt="__reactFiber$"+ba,It="__reactProps$"+ba,zl="__reactContainer$"+ba,wc="__reactEvents$"+ba,qx="__reactListeners$"+ba,Gx="__reactHandles$"+ba,hh="__reactResources$"+ba,qr="__reactMarker$"+ba;function Cc(e){delete e[wt],delete e[It],delete e[wc],delete e[qx],delete e[Gx]}function Ll(e){var t=e[wt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[zl]||a[wt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=zg(e);e!==null;){if(a=e[wt])return a;e=zg(e)}return t}e=a,a=e.parentNode}return null}function kl(e){if(e=e[wt]||e[zl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Gr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ul(e){var t=e[hh];return t||(t=e[hh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function bt(e){e[qr]=!0}var ph=new Set,mh={};function rl(e,t){Hl(e,t),Hl(e+"Capture",t)}function Hl(e,t){for(mh[e]=t,e=0;e<t.length;e++)ph.add(t[e])}var $x=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]*$"),gh={},vh={};function Xx(e){return xe.call(vh,e)?!0:xe.call(gh,e)?!1:$x.test(e)?vh[e]=!0:(gh[e]=!0,!1)}function ii(e,t,a){if(Xx(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function si(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Qn(e,t,a,o){if(o===null)e.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+o)}}function sn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function yh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fx(e,t,a){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,f=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(b){a=""+b,f.call(this,b)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(b){a=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ec(e){if(!e._valueTracker){var t=yh(e)?"checked":"value";e._valueTracker=Fx(e,t,""+e[t])}}function bh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),o="";return e&&(o=yh(e)?e.checked?"true":"false":e.value),e=o,e!==a?(t.setValue(e),!0):!1}function ci(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Kx=/[\n"\\]/g;function cn(e){return e.replace(Kx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Tc(e,t,a,o,u,f,b,S){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+sn(t)):e.value!==""+sn(t)&&(e.value=""+sn(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?Rc(e,b,sn(t)):a!=null?Rc(e,b,sn(a)):o!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+sn(S):e.removeAttribute("name")}function xh(e,t,a,o,u,f,b,S){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Ec(e);return}a=a!=null?""+sn(a):"",t=t!=null?""+sn(t):a,S||t===e.value||(e.value=t),e.defaultValue=t}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=S?e.checked:!!o,e.defaultChecked=!!o,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),Ec(e)}function Rc(e,t,a){t==="number"&&ci(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Bl(e,t,a,o){if(e=e.options,t){t={};for(var u=0;u<a.length;u++)t["$"+a[u]]=!0;for(a=0;a<e.length;a++)u=t.hasOwnProperty("$"+e[a].value),e[a].selected!==u&&(e[a].selected=u),u&&o&&(e[a].defaultSelected=!0)}else{for(a=""+sn(a),t=null,u=0;u<e.length;u++){if(e[u].value===a){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Sh(e,t,a){if(t!=null&&(t=""+sn(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+sn(a):""}function wh(e,t,a,o){if(t==null){if(o!=null){if(a!=null)throw Error(i(92));if(he(o)){if(1<o.length)throw Error(i(93));o=o[0]}a=o}a==null&&(a=""),t=a}a=sn(t),e.defaultValue=a,o=e.textContent,o===a&&o!==""&&o!==null&&(e.value=o),Ec(e)}function Pl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Qx=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 Ch(e,t,a){var o=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,a):typeof a!="number"||a===0||Qx.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Eh(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var u in t)o=t[u],t.hasOwnProperty(u)&&a[u]!==o&&Ch(e,u,o)}else for(var f in t)t.hasOwnProperty(f)&&Ch(e,f,t[f])}function Ac(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 Zx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Wx=/^[\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 ui(e){return Wx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Zn(){}var Nc=null;function Oc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vl=null,Il=null;function Th(e){var t=kl(e);if(t&&(e=t.stateNode)){var a=e[It]||null;e:switch(e=t.stateNode,t.type){case"input":if(Tc(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+cn(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var o=a[t];if(o!==e&&o.form===e.form){var u=o[It]||null;if(!u)throw Error(i(90));Tc(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<a.length;t++)o=a[t],o.form===e.form&&bh(o)}break e;case"textarea":Sh(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Bl(e,!!a.multiple,t,!1)}}}var jc=!1;function Rh(e,t,a){if(jc)return e(t,a);jc=!0;try{var o=e(t);return o}finally{if(jc=!1,(Vl!==null||Il!==null)&&(Zi(),Vl&&(t=Vl,e=Il,Il=Vl=null,Th(t),e)))for(t=0;t<e.length;t++)Th(e[t])}}function $r(e,t){var a=e.stateNode;if(a===null)return null;var o=a[It]||null;if(o===null)return null;a=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var Wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dc=!1;if(Wn)try{var Xr={};Object.defineProperty(Xr,"passive",{get:function(){Dc=!0}}),window.addEventListener("test",Xr,Xr),window.removeEventListener("test",Xr,Xr)}catch{Dc=!1}var xa=null,_c=null,fi=null;function Ah(){if(fi)return fi;var e,t=_c,a=t.length,o,u="value"in xa?xa.value:xa.textContent,f=u.length;for(e=0;e<a&&t[e]===u[e];e++);var b=a-e;for(o=1;o<=b&&t[a-o]===u[f-o];o++);return fi=u.slice(e,1<o?1-o:void 0)}function di(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 hi(){return!0}function Nh(){return!1}function Yt(e){function t(a,o,u,f,b){this._reactName=a,this._targetInst=u,this.type=o,this.nativeEvent=f,this.target=b,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(a=e[S],this[S]=a?a(f):f[S]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?hi:Nh,this.isPropagationStopped=Nh,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=hi)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=hi)},persist:function(){},isPersistent:hi}),t}var ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pi=Yt(ol),Fr=v({},ol,{view:0,detail:0}),Jx=Yt(Fr),Mc,zc,Kr,mi=v({},Fr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kc,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!==Kr&&(Kr&&e.type==="mousemove"?(Mc=e.screenX-Kr.screenX,zc=e.screenY-Kr.screenY):zc=Mc=0,Kr=e),Mc)},movementY:function(e){return"movementY"in e?e.movementY:zc}}),Oh=Yt(mi),eS=v({},mi,{dataTransfer:0}),tS=Yt(eS),nS=v({},Fr,{relatedTarget:0}),Lc=Yt(nS),aS=v({},ol,{animationName:0,elapsedTime:0,pseudoElement:0}),lS=Yt(aS),rS=v({},ol,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),oS=Yt(rS),iS=v({},ol,{data:0}),jh=Yt(iS),sS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cS={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"},uS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=uS[e])?!!t[e]:!1}function kc(){return fS}var dS=v({},Fr,{key:function(e){if(e.key){var t=sS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=di(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kc,charCode:function(e){return e.type==="keypress"?di(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?di(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hS=Yt(dS),pS=v({},mi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dh=Yt(pS),mS=v({},Fr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kc}),gS=Yt(mS),vS=v({},ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),yS=Yt(vS),bS=v({},mi,{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}),xS=Yt(bS),SS=v({},ol,{newState:0,oldState:0}),wS=Yt(SS),CS=[9,13,27,32],Uc=Wn&&"CompositionEvent"in window,Qr=null;Wn&&"documentMode"in document&&(Qr=document.documentMode);var ES=Wn&&"TextEvent"in window&&!Qr,_h=Wn&&(!Uc||Qr&&8<Qr&&11>=Qr),Mh=" ",zh=!1;function Lh(e,t){switch(e){case"keyup":return CS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Yl=!1;function TS(e,t){switch(e){case"compositionend":return kh(t);case"keypress":return t.which!==32?null:(zh=!0,Mh);case"textInput":return e=t.data,e===Mh&&zh?null:e;default:return null}}function RS(e,t){if(Yl)return e==="compositionend"||!Uc&&Lh(e,t)?(e=Ah(),fi=_c=xa=null,Yl=!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 _h&&t.locale!=="ko"?null:t.data;default:return null}}var AS={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 Uh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!AS[e.type]:t==="textarea"}function Hh(e,t,a,o){Vl?Il?Il.push(o):Il=[o]:Vl=o,t=ls(t,"onChange"),0<t.length&&(a=new pi("onChange","change",null,a,o),e.push({event:a,listeners:t}))}var Zr=null,Wr=null;function NS(e){xg(e,0)}function gi(e){var t=Gr(e);if(bh(t))return e}function Bh(e,t){if(e==="change")return t}var Ph=!1;if(Wn){var Hc;if(Wn){var Bc="oninput"in document;if(!Bc){var Vh=document.createElement("div");Vh.setAttribute("oninput","return;"),Bc=typeof Vh.oninput=="function"}Hc=Bc}else Hc=!1;Ph=Hc&&(!document.documentMode||9<document.documentMode)}function Ih(){Zr&&(Zr.detachEvent("onpropertychange",Yh),Wr=Zr=null)}function Yh(e){if(e.propertyName==="value"&&gi(Wr)){var t=[];Hh(t,Wr,e,Oc(e)),Rh(NS,t)}}function OS(e,t,a){e==="focusin"?(Ih(),Zr=t,Wr=a,Zr.attachEvent("onpropertychange",Yh)):e==="focusout"&&Ih()}function jS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return gi(Wr)}function DS(e,t){if(e==="click")return gi(t)}function _S(e,t){if(e==="input"||e==="change")return gi(t)}function MS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zt=typeof Object.is=="function"?Object.is:MS;function Jr(e,t){if(Zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var u=a[o];if(!xe.call(t,u)||!Zt(e[u],t[u]))return!1}return!0}function qh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gh(e,t){var a=qh(e);e=0;for(var o;a;){if(a.nodeType===3){if(o=e+a.textContent.length,e<=t&&o>=t)return{node:a,offset:t-e};e=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=qh(a)}}function $h(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$h(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ci(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ci(e.document)}return t}function Pc(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 zS=Wn&&"documentMode"in document&&11>=document.documentMode,ql=null,Vc=null,eo=null,Ic=!1;function Fh(e,t,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ic||ql==null||ql!==ci(o)||(o=ql,"selectionStart"in o&&Pc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),eo&&Jr(eo,o)||(eo=o,o=ls(Vc,"onSelect"),0<o.length&&(t=new pi("onSelect","select",null,t,a),e.push({event:t,listeners:o}),t.target=ql)))}function il(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Gl={animationend:il("Animation","AnimationEnd"),animationiteration:il("Animation","AnimationIteration"),animationstart:il("Animation","AnimationStart"),transitionrun:il("Transition","TransitionRun"),transitionstart:il("Transition","TransitionStart"),transitioncancel:il("Transition","TransitionCancel"),transitionend:il("Transition","TransitionEnd")},Yc={},Kh={};Wn&&(Kh=document.createElement("div").style,"AnimationEvent"in window||(delete Gl.animationend.animation,delete Gl.animationiteration.animation,delete Gl.animationstart.animation),"TransitionEvent"in window||delete Gl.transitionend.transition);function sl(e){if(Yc[e])return Yc[e];if(!Gl[e])return e;var t=Gl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Kh)return Yc[e]=t[a];return e}var Qh=sl("animationend"),Zh=sl("animationiteration"),Wh=sl("animationstart"),LS=sl("transitionrun"),kS=sl("transitionstart"),US=sl("transitioncancel"),Jh=sl("transitionend"),ep=new Map,qc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");qc.push("scrollEnd");function Tn(e,t){ep.set(e,t),rl(t,[e])}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!==null&&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)},un=[],$l=0,Gc=0;function yi(){for(var e=$l,t=Gc=$l=0;t<e;){var a=un[t];un[t++]=null;var o=un[t];un[t++]=null;var u=un[t];un[t++]=null;var f=un[t];if(un[t++]=null,o!==null&&u!==null){var b=o.pending;b===null?u.next=u:(u.next=b.next,b.next=u),o.pending=u}f!==0&&tp(a,u,f)}}function bi(e,t,a,o){un[$l++]=e,un[$l++]=t,un[$l++]=a,un[$l++]=o,Gc|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function $c(e,t,a,o){return bi(e,t,a,o),xi(e)}function cl(e,t){return bi(e,null,null,t),xi(e)}function tp(e,t,a){e.lanes|=a;var o=e.alternate;o!==null&&(o.lanes|=a);for(var u=!1,f=e.return;f!==null;)f.childLanes|=a,o=f.alternate,o!==null&&(o.childLanes|=a),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-Dt(a),e=f.hiddenUpdates,o=e[u],o===null?e[u]=[t]:o.push(t),t.lane=a|536870912),f):null}function xi(e){if(50<Co)throw Co=0,tf=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Xl={};function HS(e,t,a,o){this.tag=e,this.key=a,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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wt(e,t,a,o){return new HS(e,t,a,o)}function Xc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jn(e,t){var a=e.alternate;return a===null?(a=Wt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function np(e,t){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Si(e,t,a,o,u,f){var b=0;if(o=e,typeof e=="function")Xc(e)&&(b=1);else if(typeof e=="string")b=Y1(e,a,X.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case J:return e=Wt(31,a,t,u),e.elementType=J,e.lanes=f,e;case E:return ul(a.children,u,f,t);case R:b=8,u|=24;break;case N:return e=Wt(12,a,t,u|2),e.elementType=N,e.lanes=f,e;case G:return e=Wt(13,a,t,u),e.elementType=G,e.lanes=f,e;case k:return e=Wt(19,a,t,u),e.elementType=k,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case z:b=10;break e;case M:b=9;break e;case P:b=11;break e;case L:b=14;break e;case Y:b=16,o=null;break e}b=29,a=Error(i(130,e===null?"null":typeof e,"")),o=null}return t=Wt(b,a,t,u),t.elementType=e,t.type=o,t.lanes=f,t}function ul(e,t,a,o){return e=Wt(7,e,o,t),e.lanes=a,e}function Fc(e,t,a){return e=Wt(6,e,null,t),e.lanes=a,e}function ap(e){var t=Wt(18,null,null,0);return t.stateNode=e,t}function Kc(e,t,a){return t=Wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var lp=new WeakMap;function fn(e,t){if(typeof e=="object"&&e!==null){var a=lp.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ae(t)},lp.set(e,t),t)}return{value:e,source:t,stack:ae(t)}}var Fl=[],Kl=0,wi=null,to=0,dn=[],hn=0,Sa=null,zn=1,Ln="";function ea(e,t){Fl[Kl++]=to,Fl[Kl++]=wi,wi=e,to=t}function rp(e,t,a){dn[hn++]=zn,dn[hn++]=Ln,dn[hn++]=Sa,Sa=e;var o=zn;e=Ln;var u=32-Dt(o)-1;o&=~(1<<u),a+=1;var f=32-Dt(t)+u;if(30<f){var b=u-u%5;f=(o&(1<<b)-1).toString(32),o>>=b,u-=b,zn=1<<32-Dt(t)+u|a<<u|o,Ln=f+e}else zn=1<<f|a<<u|o,Ln=e}function Qc(e){e.return!==null&&(ea(e,1),rp(e,1,0))}function Zc(e){for(;e===wi;)wi=Fl[--Kl],Fl[Kl]=null,to=Fl[--Kl],Fl[Kl]=null;for(;e===Sa;)Sa=dn[--hn],dn[hn]=null,Ln=dn[--hn],dn[hn]=null,zn=dn[--hn],dn[hn]=null}function op(e,t){dn[hn++]=zn,dn[hn++]=Ln,dn[hn++]=Sa,zn=t.id,Ln=t.overflow,Sa=e}var Ct=null,Ze=null,Ue=!1,wa=null,pn=!1,Wc=Error(i(519));function Ca(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw no(fn(t,e)),Wc}function ip(e){var t=e.stateNode,a=e.type,o=e.memoizedProps;switch(t[wt]=e,t[It]=o,a){case"dialog":ze("cancel",t),ze("close",t);break;case"iframe":case"object":case"embed":ze("load",t);break;case"video":case"audio":for(a=0;a<To.length;a++)ze(To[a],t);break;case"source":ze("error",t);break;case"img":case"image":case"link":ze("error",t),ze("load",t);break;case"details":ze("toggle",t);break;case"input":ze("invalid",t),xh(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":ze("invalid",t);break;case"textarea":ze("invalid",t),wh(t,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||o.suppressHydrationWarning===!0||Eg(t.textContent,a)?(o.popover!=null&&(ze("beforetoggle",t),ze("toggle",t)),o.onScroll!=null&&ze("scroll",t),o.onScrollEnd!=null&&ze("scrollend",t),o.onClick!=null&&(t.onclick=Zn),t=!0):t=!1,t||Ca(e,!0)}function sp(e){for(Ct=e.return;Ct;)switch(Ct.tag){case 5:case 31:case 13:pn=!1;return;case 27:case 3:pn=!0;return;default:Ct=Ct.return}}function Ql(e){if(e!==Ct)return!1;if(!Ue)return sp(e),Ue=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||vf(e.type,e.memoizedProps)),a=!a),a&&Ze&&Ca(e),sp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ze=Mg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ze=Mg(e)}else t===27?(t=Ze,Ua(e.type)?(e=wf,wf=null,Ze=e):Ze=t):Ze=Ct?gn(e.stateNode.nextSibling):null;return!0}function fl(){Ze=Ct=null,Ue=!1}function Jc(){var e=wa;return e!==null&&(Xt===null?Xt=e:Xt.push.apply(Xt,e),wa=null),e}function no(e){wa===null?wa=[e]:wa.push(e)}var eu=A(null),dl=null,ta=null;function Ea(e,t,a){U(eu,t._currentValue),t._currentValue=a}function na(e){e._currentValue=eu.current,O(eu)}function tu(e,t,a){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===a)break;e=e.return}}function nu(e,t,a,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var b=u.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=u;for(var j=0;j<t.length;j++)if(S.context===t[j]){f.lanes|=a,S=f.alternate,S!==null&&(S.lanes|=a),tu(f.return,a,e),o||(b=null);break e}f=S.next}}else if(u.tag===18){if(b=u.return,b===null)throw Error(i(341));b.lanes|=a,f=b.alternate,f!==null&&(f.lanes|=a),tu(b,a,e),b=null}else b=u.child;if(b!==null)b.return=u;else for(b=u;b!==null;){if(b===e){b=null;break}if(u=b.sibling,u!==null){u.return=b.return,b=u;break}b=b.return}u=b}}function Zl(e,t,a,o){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var b=u.alternate;if(b===null)throw Error(i(387));if(b=b.memoizedProps,b!==null){var S=u.type;Zt(u.pendingProps.value,b.value)||(e!==null?e.push(S):e=[S])}}else if(u===Z.current){if(b=u.alternate,b===null)throw Error(i(387));b.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(jo):e=[jo])}u=u.return}e!==null&&nu(t,e,a,o),t.flags|=262144}function Ci(e){for(e=e.firstContext;e!==null;){if(!Zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function hl(e){dl=e,ta=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Et(e){return cp(dl,e)}function Ei(e,t){return dl===null&&hl(e),cp(e,t)}function cp(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ta===null){if(e===null)throw Error(i(308));ta=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ta=ta.next=t;return a}var BS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},PS=n.unstable_scheduleCallback,VS=n.unstable_NormalPriority,dt={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function au(){return{controller:new BS,data:new Map,refCount:0}}function ao(e){e.refCount--,e.refCount===0&&PS(VS,function(){e.controller.abort()})}var lo=null,lu=0,Wl=0,Jl=null;function IS(e,t){if(lo===null){var a=lo=[];lu=0,Wl=sf(),Jl={status:"pending",value:void 0,then:function(o){a.push(o)}}}return lu++,t.then(up,up),t}function up(){if(--lu===0&&lo!==null){Jl!==null&&(Jl.status="fulfilled");var e=lo;lo=null,Wl=0,Jl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function YS(e,t){var a=[],o={status:"pending",value:null,reason:null,then:function(u){a.push(u)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var u=0;u<a.length;u++)(0,a[u])(t)},function(u){for(o.status="rejected",o.reason=u,u=0;u<a.length;u++)(0,a[u])(void 0)}),o}var fp=D.S;D.S=function(e,t){Fm=at(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&IS(e,t),fp!==null&&fp(e,t)};var pl=A(null);function ru(){var e=pl.current;return e!==null?e:Ke.pooledCache}function Ti(e,t){t===null?U(pl,pl.current):U(pl,t.pool)}function dp(){var e=ru();return e===null?null:{parent:dt._currentValue,pool:e}}var er=Error(i(460)),ou=Error(i(474)),Ri=Error(i(542)),Ai={then:function(){}};function hp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function pp(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Zn,Zn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gp(e),e;default:if(typeof t.status=="string")t.then(Zn,Zn);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=o}},function(o){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gp(e),e}throw gl=t,er}}function ml(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(gl=a,er):a}}var gl=null;function mp(){if(gl===null)throw Error(i(459));var e=gl;return gl=null,e}function gp(e){if(e===er||e===Ri)throw Error(i(483))}var tr=null,ro=0;function Ni(e){var t=ro;return ro+=1,tr===null&&(tr=[]),pp(tr,e,t)}function oo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Oi(e,t){throw t.$$typeof===w?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function vp(e){function t(H,_){if(e){var V=H.deletions;V===null?(H.deletions=[_],H.flags|=16):V.push(_)}}function a(H,_){if(!e)return null;for(;_!==null;)t(H,_),_=_.sibling;return null}function o(H){for(var _=new Map;H!==null;)H.key!==null?_.set(H.key,H):_.set(H.index,H),H=H.sibling;return _}function u(H,_){return H=Jn(H,_),H.index=0,H.sibling=null,H}function f(H,_,V){return H.index=V,e?(V=H.alternate,V!==null?(V=V.index,V<_?(H.flags|=67108866,_):V):(H.flags|=67108866,_)):(H.flags|=1048576,_)}function b(H){return e&&H.alternate===null&&(H.flags|=67108866),H}function S(H,_,V,ee){return _===null||_.tag!==6?(_=Fc(V,H.mode,ee),_.return=H,_):(_=u(_,V),_.return=H,_)}function j(H,_,V,ee){var ye=V.type;return ye===E?W(H,_,V.props.children,ee,V.key):_!==null&&(_.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===Y&&ml(ye)===_.type)?(_=u(_,V.props),oo(_,V),_.return=H,_):(_=Si(V.type,V.key,V.props,null,H.mode,ee),oo(_,V),_.return=H,_)}function I(H,_,V,ee){return _===null||_.tag!==4||_.stateNode.containerInfo!==V.containerInfo||_.stateNode.implementation!==V.implementation?(_=Kc(V,H.mode,ee),_.return=H,_):(_=u(_,V.children||[]),_.return=H,_)}function W(H,_,V,ee,ye){return _===null||_.tag!==7?(_=ul(V,H.mode,ee,ye),_.return=H,_):(_=u(_,V),_.return=H,_)}function te(H,_,V){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=Fc(""+_,H.mode,V),_.return=H,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case C:return V=Si(_.type,_.key,_.props,null,H.mode,V),oo(V,_),V.return=H,V;case T:return _=Kc(_,H.mode,V),_.return=H,_;case Y:return _=ml(_),te(H,_,V)}if(he(_)||K(_))return _=ul(_,H.mode,V,null),_.return=H,_;if(typeof _.then=="function")return te(H,Ni(_),V);if(_.$$typeof===z)return te(H,Ei(H,_),V);Oi(H,_)}return null}function q(H,_,V,ee){var ye=_!==null?_.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return ye!==null?null:S(H,_,""+V,ee);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case C:return V.key===ye?j(H,_,V,ee):null;case T:return V.key===ye?I(H,_,V,ee):null;case Y:return V=ml(V),q(H,_,V,ee)}if(he(V)||K(V))return ye!==null?null:W(H,_,V,ee,null);if(typeof V.then=="function")return q(H,_,Ni(V),ee);if(V.$$typeof===z)return q(H,_,Ei(H,V),ee);Oi(H,V)}return null}function F(H,_,V,ee,ye){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return H=H.get(V)||null,S(_,H,""+ee,ye);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case C:return H=H.get(ee.key===null?V:ee.key)||null,j(_,H,ee,ye);case T:return H=H.get(ee.key===null?V:ee.key)||null,I(_,H,ee,ye);case Y:return ee=ml(ee),F(H,_,V,ee,ye)}if(he(ee)||K(ee))return H=H.get(V)||null,W(_,H,ee,ye,null);if(typeof ee.then=="function")return F(H,_,V,Ni(ee),ye);if(ee.$$typeof===z)return F(H,_,V,Ei(_,ee),ye);Oi(_,ee)}return null}function pe(H,_,V,ee){for(var ye=null,Be=null,ve=_,Oe=_=0,ke=null;ve!==null&&Oe<V.length;Oe++){ve.index>Oe?(ke=ve,ve=null):ke=ve.sibling;var Pe=q(H,ve,V[Oe],ee);if(Pe===null){ve===null&&(ve=ke);break}e&&ve&&Pe.alternate===null&&t(H,ve),_=f(Pe,_,Oe),Be===null?ye=Pe:Be.sibling=Pe,Be=Pe,ve=ke}if(Oe===V.length)return a(H,ve),Ue&&ea(H,Oe),ye;if(ve===null){for(;Oe<V.length;Oe++)ve=te(H,V[Oe],ee),ve!==null&&(_=f(ve,_,Oe),Be===null?ye=ve:Be.sibling=ve,Be=ve);return Ue&&ea(H,Oe),ye}for(ve=o(ve);Oe<V.length;Oe++)ke=F(ve,H,Oe,V[Oe],ee),ke!==null&&(e&&ke.alternate!==null&&ve.delete(ke.key===null?Oe:ke.key),_=f(ke,_,Oe),Be===null?ye=ke:Be.sibling=ke,Be=ke);return e&&ve.forEach(function(Ia){return t(H,Ia)}),Ue&&ea(H,Oe),ye}function Se(H,_,V,ee){if(V==null)throw Error(i(151));for(var ye=null,Be=null,ve=_,Oe=_=0,ke=null,Pe=V.next();ve!==null&&!Pe.done;Oe++,Pe=V.next()){ve.index>Oe?(ke=ve,ve=null):ke=ve.sibling;var Ia=q(H,ve,Pe.value,ee);if(Ia===null){ve===null&&(ve=ke);break}e&&ve&&Ia.alternate===null&&t(H,ve),_=f(Ia,_,Oe),Be===null?ye=Ia:Be.sibling=Ia,Be=Ia,ve=ke}if(Pe.done)return a(H,ve),Ue&&ea(H,Oe),ye;if(ve===null){for(;!Pe.done;Oe++,Pe=V.next())Pe=te(H,Pe.value,ee),Pe!==null&&(_=f(Pe,_,Oe),Be===null?ye=Pe:Be.sibling=Pe,Be=Pe);return Ue&&ea(H,Oe),ye}for(ve=o(ve);!Pe.done;Oe++,Pe=V.next())Pe=F(ve,H,Oe,Pe.value,ee),Pe!==null&&(e&&Pe.alternate!==null&&ve.delete(Pe.key===null?Oe:Pe.key),_=f(Pe,_,Oe),Be===null?ye=Pe:Be.sibling=Pe,Be=Pe);return e&&ve.forEach(function(ew){return t(H,ew)}),Ue&&ea(H,Oe),ye}function Fe(H,_,V,ee){if(typeof V=="object"&&V!==null&&V.type===E&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case C:e:{for(var ye=V.key;_!==null;){if(_.key===ye){if(ye=V.type,ye===E){if(_.tag===7){a(H,_.sibling),ee=u(_,V.props.children),ee.return=H,H=ee;break e}}else if(_.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===Y&&ml(ye)===_.type){a(H,_.sibling),ee=u(_,V.props),oo(ee,V),ee.return=H,H=ee;break e}a(H,_);break}else t(H,_);_=_.sibling}V.type===E?(ee=ul(V.props.children,H.mode,ee,V.key),ee.return=H,H=ee):(ee=Si(V.type,V.key,V.props,null,H.mode,ee),oo(ee,V),ee.return=H,H=ee)}return b(H);case T:e:{for(ye=V.key;_!==null;){if(_.key===ye)if(_.tag===4&&_.stateNode.containerInfo===V.containerInfo&&_.stateNode.implementation===V.implementation){a(H,_.sibling),ee=u(_,V.children||[]),ee.return=H,H=ee;break e}else{a(H,_);break}else t(H,_);_=_.sibling}ee=Kc(V,H.mode,ee),ee.return=H,H=ee}return b(H);case Y:return V=ml(V),Fe(H,_,V,ee)}if(he(V))return pe(H,_,V,ee);if(K(V)){if(ye=K(V),typeof ye!="function")throw Error(i(150));return V=ye.call(V),Se(H,_,V,ee)}if(typeof V.then=="function")return Fe(H,_,Ni(V),ee);if(V.$$typeof===z)return Fe(H,_,Ei(H,V),ee);Oi(H,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,_!==null&&_.tag===6?(a(H,_.sibling),ee=u(_,V),ee.return=H,H=ee):(a(H,_),ee=Fc(V,H.mode,ee),ee.return=H,H=ee),b(H)):a(H,_)}return function(H,_,V,ee){try{ro=0;var ye=Fe(H,_,V,ee);return tr=null,ye}catch(ve){if(ve===er||ve===Ri)throw ve;var Be=Wt(29,ve,null,H.mode);return Be.lanes=ee,Be.return=H,Be}}}var vl=vp(!0),yp=vp(!1),Ta=!1;function iu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function su(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 Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Aa(e,t,a){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Ie&2)!==0){var u=o.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),o.pending=t,t=xi(e),tp(e,null,a),t}return bi(e,o,t,a),xi(e)}function io(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,a|=o,t.lanes=a,Pt(e,a)}}function cu(e,t){var a=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var u=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};f===null?u=f=b:f=f.next=b,a=a.next}while(a!==null);f===null?u=f=t:f=f.next=t}else u=f=t;a={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:o.shared,callbacks:o.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var uu=!1;function so(){if(uu){var e=Jl;if(e!==null)throw e}}function co(e,t,a,o){uu=!1;var u=e.updateQueue;Ta=!1;var f=u.firstBaseUpdate,b=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var j=S,I=j.next;j.next=null,b===null?f=I:b.next=I,b=j;var W=e.alternate;W!==null&&(W=W.updateQueue,S=W.lastBaseUpdate,S!==b&&(S===null?W.firstBaseUpdate=I:S.next=I,W.lastBaseUpdate=j))}if(f!==null){var te=u.baseState;b=0,W=I=j=null,S=f;do{var q=S.lane&-536870913,F=q!==S.lane;if(F?(Le&q)===q:(o&q)===q){q!==0&&q===Wl&&(uu=!0),W!==null&&(W=W.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var pe=e,Se=S;q=t;var Fe=a;switch(Se.tag){case 1:if(pe=Se.payload,typeof pe=="function"){te=pe.call(Fe,te,q);break e}te=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Se.payload,q=typeof pe=="function"?pe.call(Fe,te,q):pe,q==null)break e;te=v({},te,q);break e;case 2:Ta=!0}}q=S.callback,q!==null&&(e.flags|=64,F&&(e.flags|=8192),F=u.callbacks,F===null?u.callbacks=[q]:F.push(q))}else F={lane:q,tag:S.tag,payload:S.payload,callback:S.callback,next:null},W===null?(I=W=F,j=te):W=W.next=F,b|=q;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;F=S,S=F.next,F.next=null,u.lastBaseUpdate=F,u.shared.pending=null}}while(!0);W===null&&(j=te),u.baseState=j,u.firstBaseUpdate=I,u.lastBaseUpdate=W,f===null&&(u.shared.lanes=0),_a|=b,e.lanes=b,e.memoizedState=te}}function bp(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function xp(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)bp(a[e],t)}var nr=A(null),ji=A(0);function Sp(e,t){e=fa,U(ji,e),U(nr,t),fa=e|t.baseLanes}function fu(){U(ji,fa),U(nr,nr.current)}function du(){fa=ji.current,O(nr),O(ji)}var Jt=A(null),mn=null;function Na(e){var t=e.alternate;U(st,st.current&1),U(Jt,e),mn===null&&(t===null||nr.current!==null||t.memoizedState!==null)&&(mn=e)}function hu(e){U(st,st.current),U(Jt,e),mn===null&&(mn=e)}function wp(e){e.tag===22?(U(st,st.current),U(Jt,e),mn===null&&(mn=e)):Oa()}function Oa(){U(st,st.current),U(Jt,Jt.current)}function en(e){O(Jt),mn===e&&(mn=null),O(st)}var st=A(0);function Di(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||xf(a)||Sf(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 aa=0,Ne=null,$e=null,ht=null,_i=!1,ar=!1,yl=!1,Mi=0,uo=0,lr=null,qS=0;function rt(){throw Error(i(321))}function pu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Zt(e[a],t[a]))return!1;return!0}function mu(e,t,a,o,u,f){return aa=f,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?rm:ju,yl=!1,f=a(o,u),yl=!1,ar&&(f=Ep(t,a,o,u)),Cp(e),f}function Cp(e){D.H=po;var t=$e!==null&&$e.next!==null;if(aa=0,ht=$e=Ne=null,_i=!1,uo=0,lr=null,t)throw Error(i(300));e===null||pt||(e=e.dependencies,e!==null&&Ci(e)&&(pt=!0))}function Ep(e,t,a,o){Ne=e;var u=0;do{if(ar&&(lr=null),uo=0,ar=!1,25<=u)throw Error(i(301));if(u+=1,ht=$e=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}D.H=om,f=t(a,o)}while(ar);return f}function GS(){var e=D.H,t=e.useState()[0];return t=typeof t.then=="function"?fo(t):t,e=e.useState()[0],($e!==null?$e.memoizedState:null)!==e&&(Ne.flags|=1024),t}function gu(){var e=Mi!==0;return Mi=0,e}function vu(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function yu(e){if(_i){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_i=!1}aa=0,ht=$e=Ne=null,ar=!1,uo=Mi=0,lr=null}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ht===null?Ne.memoizedState=ht=e:ht=ht.next=e,ht}function ct(){if($e===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=ht===null?Ne.memoizedState:ht.next;if(t!==null)ht=t,$e=e;else{if(e===null)throw Ne.alternate===null?Error(i(467)):Error(i(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},ht===null?Ne.memoizedState=ht=e:ht=ht.next=e}return ht}function zi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fo(e){var t=uo;return uo+=1,lr===null&&(lr=[]),e=pp(lr,e,t),t=Ne,(ht===null?t.memoizedState:ht.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?rm:ju),e}function Li(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fo(e);if(e.$$typeof===z)return Et(e)}throw Error(i(438,String(e)))}function bu(e){var t=null,a=Ne.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var o=Ne.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=zi(),Ne.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),o=0;o<e;o++)a[o]=ne;return t.index++,a}function la(e,t){return typeof t=="function"?t(e):t}function ki(e){var t=ct();return xu(t,$e,e)}function xu(e,t,a){var o=e.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=a;var u=e.baseQueue,f=o.pending;if(f!==null){if(u!==null){var b=u.next;u.next=f.next,f.next=b}t.baseQueue=u=f,o.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var S=b=null,j=null,I=t,W=!1;do{var te=I.lane&-536870913;if(te!==I.lane?(Le&te)===te:(aa&te)===te){var q=I.revertLane;if(q===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),te===Wl&&(W=!0);else if((aa&q)===q){I=I.next,q===Wl&&(W=!0);continue}else te={lane:0,revertLane:I.revertLane,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},j===null?(S=j=te,b=f):j=j.next=te,Ne.lanes|=q,_a|=q;te=I.action,yl&&a(f,te),f=I.hasEagerState?I.eagerState:a(f,te)}else q={lane:te,revertLane:I.revertLane,gesture:I.gesture,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},j===null?(S=j=q,b=f):j=j.next=q,Ne.lanes|=te,_a|=te;I=I.next}while(I!==null&&I!==t);if(j===null?b=f:j.next=S,!Zt(f,e.memoizedState)&&(pt=!0,W&&(a=Jl,a!==null)))throw a;e.memoizedState=f,e.baseState=b,e.baseQueue=j,o.lastRenderedState=f}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Su(e){var t=ct(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var o=a.dispatch,u=a.pending,f=t.memoizedState;if(u!==null){a.pending=null;var b=u=u.next;do f=e(f,b.action),b=b.next;while(b!==u);Zt(f,t.memoizedState)||(pt=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),a.lastRenderedState=f}return[f,o]}function Tp(e,t,a){var o=Ne,u=ct(),f=Ue;if(f){if(a===void 0)throw Error(i(407));a=a()}else a=t();var b=!Zt(($e||u).memoizedState,a);if(b&&(u.memoizedState=a,pt=!0),u=u.queue,Eu(Np.bind(null,o,u,e),[e]),u.getSnapshot!==t||b||ht!==null&&ht.memoizedState.tag&1){if(o.flags|=2048,rr(9,{destroy:void 0},Ap.bind(null,o,u,a,t),null),Ke===null)throw Error(i(349));f||(aa&127)!==0||Rp(o,t,a)}return a}function Rp(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ne.updateQueue,t===null?(t=zi(),Ne.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Ap(e,t,a,o){t.value=a,t.getSnapshot=o,Op(t)&&jp(e)}function Np(e,t,a){return a(function(){Op(t)&&jp(e)})}function Op(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Zt(e,a)}catch{return!0}}function jp(e){var t=cl(e,2);t!==null&&Ft(t,e,2)}function wu(e){var t=Lt();if(typeof e=="function"){var a=e;if(e=a(),yl){Cn(!0);try{a()}finally{Cn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:e},t}function Dp(e,t,a,o){return e.baseState=a,xu(e,$e,typeof o=="function"?o:la)}function $S(e,t,a,o,u){if(Bi(e))throw Error(i(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){f.listeners.push(b)}};D.T!==null?a(!0):f.isTransition=!1,o(f),a=t.pending,a===null?(f.next=t.pending=f,_p(t,f)):(f.next=a.next,t.pending=a.next=f)}}function _p(e,t){var a=t.action,o=t.payload,u=e.state;if(t.isTransition){var f=D.T,b={};D.T=b;try{var S=a(u,o),j=D.S;j!==null&&j(b,S),Mp(e,t,S)}catch(I){Cu(e,t,I)}finally{f!==null&&b.types!==null&&(f.types=b.types),D.T=f}}else try{f=a(u,o),Mp(e,t,f)}catch(I){Cu(e,t,I)}}function Mp(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){zp(e,t,o)},function(o){return Cu(e,t,o)}):zp(e,t,a)}function zp(e,t,a){t.status="fulfilled",t.value=a,Lp(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,_p(e,a)))}function Cu(e,t,a){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=a,Lp(t),t=t.next;while(t!==o)}e.action=null}function Lp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function kp(e,t){return t}function Up(e,t){if(Ue){var a=Ke.formState;if(a!==null){e:{var o=Ne;if(Ue){if(Ze){t:{for(var u=Ze,f=pn;u.nodeType!==8;){if(!f){u=null;break t}if(u=gn(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Ze=gn(u.nextSibling),o=u.data==="F!";break e}}Ca(o)}o=!1}o&&(t=a[0])}}return a=Lt(),a.memoizedState=a.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kp,lastRenderedState:t},a.queue=o,a=nm.bind(null,Ne,o),o.dispatch=a,o=wu(!1),f=Ou.bind(null,Ne,!1,o.queue),o=Lt(),u={state:t,dispatch:null,action:e,pending:null},o.queue=u,a=$S.bind(null,Ne,u,f,a),u.dispatch=a,o.memoizedState=e,[t,a,!1]}function Hp(e){var t=ct();return Bp(t,$e,e)}function Bp(e,t,a){if(t=xu(e,t,kp)[0],e=ki(la)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=fo(t)}catch(b){throw b===er?Ri:b}else o=t;t=ct();var u=t.queue,f=u.dispatch;return a!==t.memoizedState&&(Ne.flags|=2048,rr(9,{destroy:void 0},XS.bind(null,u,a),null)),[o,f,e]}function XS(e,t){e.action=t}function Pp(e){var t=ct(),a=$e;if(a!==null)return Bp(t,a,e);ct(),t=t.memoizedState,a=ct();var o=a.queue.dispatch;return a.memoizedState=e,[t,o,!1]}function rr(e,t,a,o){return e={tag:e,create:a,deps:o,inst:t,next:null},t=Ne.updateQueue,t===null&&(t=zi(),Ne.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(o=a.next,a.next=e,e.next=o,t.lastEffect=e),e}function Vp(){return ct().memoizedState}function Ui(e,t,a,o){var u=Lt();Ne.flags|=e,u.memoizedState=rr(1|t,{destroy:void 0},a,o===void 0?null:o)}function Hi(e,t,a,o){var u=ct();o=o===void 0?null:o;var f=u.memoizedState.inst;$e!==null&&o!==null&&pu(o,$e.memoizedState.deps)?u.memoizedState=rr(t,f,a,o):(Ne.flags|=e,u.memoizedState=rr(1|t,f,a,o))}function Ip(e,t){Ui(8390656,8,e,t)}function Eu(e,t){Hi(2048,8,e,t)}function FS(e){Ne.flags|=4;var t=Ne.updateQueue;if(t===null)t=zi(),Ne.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Yp(e){var t=ct().memoizedState;return FS({ref:t,nextImpl:e}),function(){if((Ie&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function qp(e,t){return Hi(4,2,e,t)}function Gp(e,t){return Hi(4,4,e,t)}function $p(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Xp(e,t,a){a=a!=null?a.concat([e]):null,Hi(4,4,$p.bind(null,t,e),a)}function Tu(){}function Fp(e,t){var a=ct();t=t===void 0?null:t;var o=a.memoizedState;return t!==null&&pu(t,o[1])?o[0]:(a.memoizedState=[e,t],e)}function Kp(e,t){var a=ct();t=t===void 0?null:t;var o=a.memoizedState;if(t!==null&&pu(t,o[1]))return o[0];if(o=e(),yl){Cn(!0);try{e()}finally{Cn(!1)}}return a.memoizedState=[o,t],o}function Ru(e,t,a){return a===void 0||(aa&1073741824)!==0&&(Le&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Qm(),Ne.lanes|=e,_a|=e,a)}function Qp(e,t,a,o){return Zt(a,t)?a:nr.current!==null?(e=Ru(e,a,o),Zt(e,t)||(pt=!0),e):(aa&42)===0||(aa&1073741824)!==0&&(Le&261930)===0?(pt=!0,e.memoizedState=a):(e=Qm(),Ne.lanes|=e,_a|=e,t)}function Zp(e,t,a,o,u){var f=$.p;$.p=f!==0&&8>f?f:8;var b=D.T,S={};D.T=S,Ou(e,!1,t,a);try{var j=u(),I=D.S;if(I!==null&&I(S,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var W=YS(j,o);ho(e,t,W,an(e))}else ho(e,t,o,an(e))}catch(te){ho(e,t,{then:function(){},status:"rejected",reason:te},an())}finally{$.p=f,b!==null&&S.types!==null&&(b.types=S.types),D.T=b}}function KS(){}function Au(e,t,a,o){if(e.tag!==5)throw Error(i(476));var u=Wp(e).queue;Zp(e,u,t,B,a===null?KS:function(){return Jp(e),a(o)})}function Wp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:B},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Jp(e){var t=Wp(e);t.next===null&&(t=e.alternate.memoizedState),ho(e,t.next.queue,{},an())}function Nu(){return Et(jo)}function em(){return ct().memoizedState}function tm(){return ct().memoizedState}function QS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=an();e=Ra(a);var o=Aa(t,e,a);o!==null&&(Ft(o,t,a),io(o,t,a)),t={cache:au()},e.payload=t;return}t=t.return}}function ZS(e,t,a){var o=an();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Bi(e)?am(t,a):(a=$c(e,t,a,o),a!==null&&(Ft(a,e,o),lm(a,t,o)))}function nm(e,t,a){var o=an();ho(e,t,a,o)}function ho(e,t,a,o){var u={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Bi(e))am(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var b=t.lastRenderedState,S=f(b,a);if(u.hasEagerState=!0,u.eagerState=S,Zt(S,b))return bi(e,t,u,0),Ke===null&&yi(),!1}catch{}if(a=$c(e,t,u,o),a!==null)return Ft(a,e,o),lm(a,t,o),!0}return!1}function Ou(e,t,a,o){if(o={lane:2,revertLane:sf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Bi(e)){if(t)throw Error(i(479))}else t=$c(e,a,o,2),t!==null&&Ft(t,e,2)}function Bi(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function am(e,t){ar=_i=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function lm(e,t,a){if((a&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,a|=o,t.lanes=a,Pt(e,a)}}var po={readContext:Et,use:Li,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt,useHostTransitionStatus:rt,useFormState:rt,useActionState:rt,useOptimistic:rt,useMemoCache:rt,useCacheRefresh:rt};po.useEffectEvent=rt;var rm={readContext:Et,use:Li,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Ip,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ui(4194308,4,$p.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ui(4194308,4,e,t)},useInsertionEffect:function(e,t){Ui(4,2,e,t)},useMemo:function(e,t){var a=Lt();t=t===void 0?null:t;var o=e();if(yl){Cn(!0);try{e()}finally{Cn(!1)}}return a.memoizedState=[o,t],o},useReducer:function(e,t,a){var o=Lt();if(a!==void 0){var u=a(t);if(yl){Cn(!0);try{a(t)}finally{Cn(!1)}}}else u=t;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=ZS.bind(null,Ne,e),[o.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:function(e){e=wu(e);var t=e.queue,a=nm.bind(null,Ne,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Tu,useDeferredValue:function(e,t){var a=Lt();return Ru(a,e,t)},useTransition:function(){var e=wu(!1);return e=Zp.bind(null,Ne,e.queue,!0,!1),Lt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var o=Ne,u=Lt();if(Ue){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),Ke===null)throw Error(i(349));(Le&127)!==0||Rp(o,t,a)}u.memoizedState=a;var f={value:a,getSnapshot:t};return u.queue=f,Ip(Np.bind(null,o,f,e),[e]),o.flags|=2048,rr(9,{destroy:void 0},Ap.bind(null,o,f,a,t),null),a},useId:function(){var e=Lt(),t=Ke.identifierPrefix;if(Ue){var a=Ln,o=zn;a=(o&~(1<<32-Dt(o)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Mi++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=qS++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Nu,useFormState:Up,useActionState:Up,useOptimistic:function(e){var t=Lt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Ou.bind(null,Ne,!0,a),a.dispatch=t,[e,t]},useMemoCache:bu,useCacheRefresh:function(){return Lt().memoizedState=QS.bind(null,Ne)},useEffectEvent:function(e){var t=Lt(),a={impl:e};return t.memoizedState=a,function(){if((Ie&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},ju={readContext:Et,use:Li,useCallback:Fp,useContext:Et,useEffect:Eu,useImperativeHandle:Xp,useInsertionEffect:qp,useLayoutEffect:Gp,useMemo:Kp,useReducer:ki,useRef:Vp,useState:function(){return ki(la)},useDebugValue:Tu,useDeferredValue:function(e,t){var a=ct();return Qp(a,$e.memoizedState,e,t)},useTransition:function(){var e=ki(la)[0],t=ct().memoizedState;return[typeof e=="boolean"?e:fo(e),t]},useSyncExternalStore:Tp,useId:em,useHostTransitionStatus:Nu,useFormState:Hp,useActionState:Hp,useOptimistic:function(e,t){var a=ct();return Dp(a,$e,e,t)},useMemoCache:bu,useCacheRefresh:tm};ju.useEffectEvent=Yp;var om={readContext:Et,use:Li,useCallback:Fp,useContext:Et,useEffect:Eu,useImperativeHandle:Xp,useInsertionEffect:qp,useLayoutEffect:Gp,useMemo:Kp,useReducer:Su,useRef:Vp,useState:function(){return Su(la)},useDebugValue:Tu,useDeferredValue:function(e,t){var a=ct();return $e===null?Ru(a,e,t):Qp(a,$e.memoizedState,e,t)},useTransition:function(){var e=Su(la)[0],t=ct().memoizedState;return[typeof e=="boolean"?e:fo(e),t]},useSyncExternalStore:Tp,useId:em,useHostTransitionStatus:Nu,useFormState:Pp,useActionState:Pp,useOptimistic:function(e,t){var a=ct();return $e!==null?Dp(a,$e,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:bu,useCacheRefresh:tm};om.useEffectEvent=Yp;function Du(e,t,a,o){t=e.memoizedState,a=a(o,t),a=a==null?t:v({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var _u={enqueueSetState:function(e,t,a){e=e._reactInternals;var o=an(),u=Ra(o);u.payload=t,a!=null&&(u.callback=a),t=Aa(e,u,o),t!==null&&(Ft(t,e,o),io(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var o=an(),u=Ra(o);u.tag=1,u.payload=t,a!=null&&(u.callback=a),t=Aa(e,u,o),t!==null&&(Ft(t,e,o),io(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=an(),o=Ra(a);o.tag=2,t!=null&&(o.callback=t),t=Aa(e,o,a),t!==null&&(Ft(t,e,a),io(t,e,a))}};function im(e,t,a,o,u,f,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,f,b):t.prototype&&t.prototype.isPureReactComponent?!Jr(a,o)||!Jr(u,f):!0}function sm(e,t,a,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,o),t.state!==e&&_u.enqueueReplaceState(t,t.state,null)}function bl(e,t){var a=t;if("ref"in t){a={};for(var o in t)o!=="ref"&&(a[o]=t[o])}if(e=e.defaultProps){a===t&&(a=v({},a));for(var u in e)a[u]===void 0&&(a[u]=e[u])}return a}function cm(e){vi(e)}function um(e){console.error(e)}function fm(e){vi(e)}function Pi(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function dm(e,t,a){try{var o=e.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Mu(e,t,a){return a=Ra(a),a.tag=3,a.payload={element:null},a.callback=function(){Pi(e,t)},a}function hm(e){return e=Ra(e),e.tag=3,e}function pm(e,t,a,o){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var f=o.value;e.payload=function(){return u(f)},e.callback=function(){dm(t,a,o)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){dm(t,a,o),typeof u!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var S=o.stack;this.componentDidCatch(o.value,{componentStack:S!==null?S:""})})}function WS(e,t,a,o,u){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=a.alternate,t!==null&&Zl(t,a,u,!0),a=Jt.current,a!==null){switch(a.tag){case 31:case 13:return mn===null?Wi():a.alternate===null&&ot===0&&(ot=3),a.flags&=-257,a.flags|=65536,a.lanes=u,o===Ai?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([o]):t.add(o),lf(e,o,u)),!1;case 22:return a.flags|=65536,o===Ai?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([o]):a.add(o)),lf(e,o,u)),!1}throw Error(i(435,a.tag))}return lf(e,o,u),Wi(),!1}if(Ue)return t=Jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,o!==Wc&&(e=Error(i(422),{cause:o}),no(fn(e,a)))):(o!==Wc&&(t=Error(i(423),{cause:o}),no(fn(t,a))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=fn(o,a),u=Mu(e.stateNode,o,u),cu(e,u),ot!==4&&(ot=2)),!1;var f=Error(i(520),{cause:o});if(f=fn(f,a),wo===null?wo=[f]:wo.push(f),ot!==4&&(ot=2),t===null)return!0;o=fn(o,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=u&-u,a.lanes|=e,e=Mu(a.stateNode,o,e),cu(a,e),!1;case 1:if(t=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ma===null||!Ma.has(f))))return a.flags|=65536,u&=-u,a.lanes|=u,u=hm(u),pm(u,e,a,o),cu(a,u),!1}a=a.return}while(a!==null);return!1}var zu=Error(i(461)),pt=!1;function Tt(e,t,a,o){t.child=e===null?yp(t,null,a,o):vl(t,e.child,a,o)}function mm(e,t,a,o,u){a=a.render;var f=t.ref;if("ref"in o){var b={};for(var S in o)S!=="ref"&&(b[S]=o[S])}else b=o;return hl(t),o=mu(e,t,a,b,f,u),S=gu(),e!==null&&!pt?(vu(e,t,u),ra(e,t,u)):(Ue&&S&&Qc(t),t.flags|=1,Tt(e,t,o,u),t.child)}function gm(e,t,a,o,u){if(e===null){var f=a.type;return typeof f=="function"&&!Xc(f)&&f.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=f,vm(e,t,f,o,u)):(e=Si(a.type,null,o,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Iu(e,u)){var b=f.memoizedProps;if(a=a.compare,a=a!==null?a:Jr,a(b,o)&&e.ref===t.ref)return ra(e,t,u)}return t.flags|=1,e=Jn(f,o),e.ref=t.ref,e.return=t,t.child=e}function vm(e,t,a,o,u){if(e!==null){var f=e.memoizedProps;if(Jr(f,o)&&e.ref===t.ref)if(pt=!1,t.pendingProps=o=f,Iu(e,u))(e.flags&131072)!==0&&(pt=!0);else return t.lanes=e.lanes,ra(e,t,u)}return Lu(e,t,a,o,u)}function ym(e,t,a,o){var u=o.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|a:a,e!==null){for(o=t.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~f}else o=0,t.child=null;return bm(e,t,f,a,o)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ti(t,f!==null?f.cachePool:null),f!==null?Sp(t,f):fu(),wp(t);else return o=t.lanes=536870912,bm(e,t,f!==null?f.baseLanes|a:a,a,o)}else f!==null?(Ti(t,f.cachePool),Sp(t,f),Oa(),t.memoizedState=null):(e!==null&&Ti(t,null),fu(),Oa());return Tt(e,t,u,a),t.child}function mo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function bm(e,t,a,o,u){var f=ru();return f=f===null?null:{parent:dt._currentValue,pool:f},t.memoizedState={baseLanes:a,cachePool:f},e!==null&&Ti(t,null),fu(),wp(t),e!==null&&Zl(e,t,o,!0),t.childLanes=u,null}function Vi(e,t){return t=Yi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function xm(e,t,a){return vl(t,e.child,null,a),e=Vi(t,t.pendingProps),e.flags|=2,en(t),t.memoizedState=null,e}function JS(e,t,a){var o=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(o.mode==="hidden")return e=Vi(t,o),t.lanes=536870912,mo(null,e);if(hu(t),(e=Ze)?(e=_g(e,pn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Sa!==null?{id:zn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},a=ap(e),a.return=t,t.child=a,Ct=t,Ze=null)):e=null,e===null)throw Ca(t);return t.lanes=536870912,null}return Vi(t,o)}var f=e.memoizedState;if(f!==null){var b=f.dehydrated;if(hu(t),u)if(t.flags&256)t.flags&=-257,t=xm(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(pt||Zl(e,t,a,!1),u=(a&e.childLanes)!==0,pt||u){if(o=Ke,o!==null&&(b=Vt(o,a),b!==0&&b!==f.retryLane))throw f.retryLane=b,cl(e,b),Ft(o,e,b),zu;Wi(),t=xm(e,t,a)}else e=f.treeContext,Ze=gn(b.nextSibling),Ct=t,Ue=!0,wa=null,pn=!1,e!==null&&op(t,e),t=Vi(t,o),t.flags|=4096;return t}return e=Jn(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ii(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Lu(e,t,a,o,u){return hl(t),a=mu(e,t,a,o,void 0,u),o=gu(),e!==null&&!pt?(vu(e,t,u),ra(e,t,u)):(Ue&&o&&Qc(t),t.flags|=1,Tt(e,t,a,u),t.child)}function Sm(e,t,a,o,u,f){return hl(t),t.updateQueue=null,a=Ep(t,o,a,u),Cp(e),o=gu(),e!==null&&!pt?(vu(e,t,f),ra(e,t,f)):(Ue&&o&&Qc(t),t.flags|=1,Tt(e,t,a,f),t.child)}function wm(e,t,a,o,u){if(hl(t),t.stateNode===null){var f=Xl,b=a.contextType;typeof b=="object"&&b!==null&&(f=Et(b)),f=new a(o,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=_u,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=o,f.state=t.memoizedState,f.refs={},iu(t),b=a.contextType,f.context=typeof b=="object"&&b!==null?Et(b):Xl,f.state=t.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(Du(t,a,b,o),f.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(b=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),b!==f.state&&_u.enqueueReplaceState(f,f.state,null),co(t,o,f,u),so(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,j=bl(a,S);f.props=j;var I=f.context,W=a.contextType;b=Xl,typeof W=="object"&&W!==null&&(b=Et(W));var te=a.getDerivedStateFromProps;W=typeof te=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,W||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||I!==b)&&sm(t,f,o,b),Ta=!1;var q=t.memoizedState;f.state=q,co(t,o,f,u),so(),I=t.memoizedState,S||q!==I||Ta?(typeof te=="function"&&(Du(t,a,te,o),I=t.memoizedState),(j=Ta||im(t,a,j,o,q,I,b))?(W||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=I),f.props=o,f.state=I,f.context=b,o=j):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{f=t.stateNode,su(e,t),b=t.memoizedProps,W=bl(a,b),f.props=W,te=t.pendingProps,q=f.context,I=a.contextType,j=Xl,typeof I=="object"&&I!==null&&(j=Et(I)),S=a.getDerivedStateFromProps,(I=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==te||q!==j)&&sm(t,f,o,j),Ta=!1,q=t.memoizedState,f.state=q,co(t,o,f,u),so();var F=t.memoizedState;b!==te||q!==F||Ta||e!==null&&e.dependencies!==null&&Ci(e.dependencies)?(typeof S=="function"&&(Du(t,a,S,o),F=t.memoizedState),(W=Ta||im(t,a,W,o,q,F,j)||e!==null&&e.dependencies!==null&&Ci(e.dependencies))?(I||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(o,F,j),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(o,F,j)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=F),f.props=o,f.state=F,f.context=j,o=W):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),o=!1)}return f=o,Ii(e,t),o=(t.flags&128)!==0,f||o?(f=t.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&o?(t.child=vl(t,e.child,null,u),t.child=vl(t,null,a,u)):Tt(e,t,a,u),t.memoizedState=f.state,e=t.child):e=ra(e,t,u),e}function Cm(e,t,a,o){return fl(),t.flags|=256,Tt(e,t,a,o),t.child}var ku={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Uu(e){return{baseLanes:e,cachePool:dp()}}function Hu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=nn),e}function Em(e,t,a){var o=t.pendingProps,u=!1,f=(t.flags&128)!==0,b;if((b=f)||(b=e!==null&&e.memoizedState===null?!1:(st.current&2)!==0),b&&(u=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(u?Na(t):Oa(),(e=Ze)?(e=_g(e,pn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Sa!==null?{id:zn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},a=ap(e),a.return=t,t.child=a,Ct=t,Ze=null)):e=null,e===null)throw Ca(t);return Sf(e)?t.lanes=32:t.lanes=536870912,null}var S=o.children;return o=o.fallback,u?(Oa(),u=t.mode,S=Yi({mode:"hidden",children:S},u),o=ul(o,u,a,null),S.return=t,o.return=t,S.sibling=o,t.child=S,o=t.child,o.memoizedState=Uu(a),o.childLanes=Hu(e,b,a),t.memoizedState=ku,mo(null,o)):(Na(t),Bu(t,S))}var j=e.memoizedState;if(j!==null&&(S=j.dehydrated,S!==null)){if(f)t.flags&256?(Na(t),t.flags&=-257,t=Pu(e,t,a)):t.memoizedState!==null?(Oa(),t.child=e.child,t.flags|=128,t=null):(Oa(),S=o.fallback,u=t.mode,o=Yi({mode:"visible",children:o.children},u),S=ul(S,u,a,null),S.flags|=2,o.return=t,S.return=t,o.sibling=S,t.child=o,vl(t,e.child,null,a),o=t.child,o.memoizedState=Uu(a),o.childLanes=Hu(e,b,a),t.memoizedState=ku,t=mo(null,o));else if(Na(t),Sf(S)){if(b=S.nextSibling&&S.nextSibling.dataset,b)var I=b.dgst;b=I,o=Error(i(419)),o.stack="",o.digest=b,no({value:o,source:null,stack:null}),t=Pu(e,t,a)}else if(pt||Zl(e,t,a,!1),b=(a&e.childLanes)!==0,pt||b){if(b=Ke,b!==null&&(o=Vt(b,a),o!==0&&o!==j.retryLane))throw j.retryLane=o,cl(e,o),Ft(b,e,o),zu;xf(S)||Wi(),t=Pu(e,t,a)}else xf(S)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,Ze=gn(S.nextSibling),Ct=t,Ue=!0,wa=null,pn=!1,e!==null&&op(t,e),t=Bu(t,o.children),t.flags|=4096);return t}return u?(Oa(),S=o.fallback,u=t.mode,j=e.child,I=j.sibling,o=Jn(j,{mode:"hidden",children:o.children}),o.subtreeFlags=j.subtreeFlags&65011712,I!==null?S=Jn(I,S):(S=ul(S,u,a,null),S.flags|=2),S.return=t,o.return=t,o.sibling=S,t.child=o,mo(null,o),o=t.child,S=e.child.memoizedState,S===null?S=Uu(a):(u=S.cachePool,u!==null?(j=dt._currentValue,u=u.parent!==j?{parent:j,pool:j}:u):u=dp(),S={baseLanes:S.baseLanes|a,cachePool:u}),o.memoizedState=S,o.childLanes=Hu(e,b,a),t.memoizedState=ku,mo(e.child,o)):(Na(t),a=e.child,e=a.sibling,a=Jn(a,{mode:"visible",children:o.children}),a.return=t,a.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=a,t.memoizedState=null,a)}function Bu(e,t){return t=Yi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Yi(e,t){return e=Wt(22,e,null,t),e.lanes=0,e}function Pu(e,t,a){return vl(t,e.child,null,a),e=Bu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tm(e,t,a){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),tu(e.return,t,a)}function Vu(e,t,a,o,u,f){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:u,treeForkCount:f}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=o,b.tail=a,b.tailMode=u,b.treeForkCount=f)}function Rm(e,t,a){var o=t.pendingProps,u=o.revealOrder,f=o.tail;o=o.children;var b=st.current,S=(b&2)!==0;if(S?(b=b&1|2,t.flags|=128):b&=1,U(st,b),Tt(e,t,o,a),o=Ue?to:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tm(e,a,t);else if(e.tag===19)Tm(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(a=t.child,u=null;a!==null;)e=a.alternate,e!==null&&Di(e)===null&&(u=a),a=a.sibling;a=u,a===null?(u=t.child,t.child=null):(u=a.sibling,a.sibling=null),Vu(t,!1,u,a,f,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Di(e)===null){t.child=u;break}e=u.sibling,u.sibling=a,a=u,u=e}Vu(t,!0,a,null,f,o);break;case"together":Vu(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function ra(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),_a|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Zl(e,t,a,!1),(a&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,a=Jn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Jn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Iu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ci(e)))}function e1(e,t,a){switch(t.tag){case 3:se(t,t.stateNode.containerInfo),Ea(t,dt,e.memoizedState.cache),fl();break;case 27:case 5:be(t);break;case 4:se(t,t.stateNode.containerInfo);break;case 10:Ea(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,hu(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Na(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Em(e,t,a):(Na(t),e=ra(e,t,a),e!==null?e.sibling:null);Na(t);break;case 19:var u=(e.flags&128)!==0;if(o=(a&t.childLanes)!==0,o||(Zl(e,t,a,!1),o=(a&t.childLanes)!==0),u){if(o)return Rm(e,t,a);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),U(st,st.current),o)break;return null;case 22:return t.lanes=0,ym(e,t,a,t.pendingProps);case 24:Ea(t,dt,e.memoizedState.cache)}return ra(e,t,a)}function Am(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)pt=!0;else{if(!Iu(e,a)&&(t.flags&128)===0)return pt=!1,e1(e,t,a);pt=(e.flags&131072)!==0}else pt=!1,Ue&&(t.flags&1048576)!==0&&rp(t,to,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=ml(t.elementType),t.type=e,typeof e=="function")Xc(e)?(o=bl(e,o),t.tag=1,t=wm(null,t,e,o,a)):(t.tag=0,t=Lu(null,t,e,o,a));else{if(e!=null){var u=e.$$typeof;if(u===P){t.tag=11,t=mm(null,t,e,o,a);break e}else if(u===L){t.tag=14,t=gm(null,t,e,o,a);break e}}throw t=ce(e)||e,Error(i(306,t,""))}}return t;case 0:return Lu(e,t,t.type,t.pendingProps,a);case 1:return o=t.type,u=bl(o,t.pendingProps),wm(e,t,o,u,a);case 3:e:{if(se(t,t.stateNode.containerInfo),e===null)throw Error(i(387));o=t.pendingProps;var f=t.memoizedState;u=f.element,su(e,t),co(t,o,null,a);var b=t.memoizedState;if(o=b.cache,Ea(t,dt,o),o!==f.cache&&nu(t,[dt],a,!0),so(),o=b.element,f.isDehydrated)if(f={element:o,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Cm(e,t,o,a);break e}else if(o!==u){u=fn(Error(i(424)),t),no(u),t=Cm(e,t,o,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ze=gn(e.firstChild),Ct=t,Ue=!0,wa=null,pn=!0,a=yp(t,null,o,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(fl(),o===u){t=ra(e,t,a);break e}Tt(e,t,o,a)}t=t.child}return t;case 26:return Ii(e,t),e===null?(a=Hg(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ue||(a=t.type,e=t.pendingProps,o=rs(oe.current).createElement(a),o[wt]=t,o[It]=e,Rt(o,a,e),bt(o),t.stateNode=o):t.memoizedState=Hg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return be(t),e===null&&Ue&&(o=t.stateNode=Lg(t.type,t.pendingProps,oe.current),Ct=t,pn=!0,u=Ze,Ua(t.type)?(wf=u,Ze=gn(o.firstChild)):Ze=u),Tt(e,t,t.pendingProps.children,a),Ii(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((u=o=Ze)&&(o=j1(o,t.type,t.pendingProps,pn),o!==null?(t.stateNode=o,Ct=t,Ze=gn(o.firstChild),pn=!1,u=!0):u=!1),u||Ca(t)),be(t),u=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,o=f.children,vf(u,f)?o=null:b!==null&&vf(u,b)&&(t.flags|=32),t.memoizedState!==null&&(u=mu(e,t,GS,null,null,a),jo._currentValue=u),Ii(e,t),Tt(e,t,o,a),t.child;case 6:return e===null&&Ue&&((e=a=Ze)&&(a=D1(a,t.pendingProps,pn),a!==null?(t.stateNode=a,Ct=t,Ze=null,e=!0):e=!1),e||Ca(t)),null;case 13:return Em(e,t,a);case 4:return se(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=vl(t,null,o,a):Tt(e,t,o,a),t.child;case 11:return mm(e,t,t.type,t.pendingProps,a);case 7:return Tt(e,t,t.pendingProps,a),t.child;case 8:return Tt(e,t,t.pendingProps.children,a),t.child;case 12:return Tt(e,t,t.pendingProps.children,a),t.child;case 10:return o=t.pendingProps,Ea(t,t.type,o.value),Tt(e,t,o.children,a),t.child;case 9:return u=t.type._context,o=t.pendingProps.children,hl(t),u=Et(u),o=o(u),t.flags|=1,Tt(e,t,o,a),t.child;case 14:return gm(e,t,t.type,t.pendingProps,a);case 15:return vm(e,t,t.type,t.pendingProps,a);case 19:return Rm(e,t,a);case 31:return JS(e,t,a);case 22:return ym(e,t,a,t.pendingProps);case 24:return hl(t),o=Et(dt),e===null?(u=ru(),u===null&&(u=Ke,f=au(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=a),u=f),t.memoizedState={parent:o,cache:u},iu(t),Ea(t,dt,u)):((e.lanes&a)!==0&&(su(e,t),co(t,null,null,a),so()),u=e.memoizedState,f=t.memoizedState,u.parent!==o?(u={parent:o,cache:o},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Ea(t,dt,o)):(o=f.cache,Ea(t,dt,o),o!==u.cache&&nu(t,[dt],a,!0))),Tt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function oa(e){e.flags|=4}function Yu(e,t,a,o,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(eg())e.flags|=8192;else throw gl=Ai,ou}else e.flags&=-16777217}function Nm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Yg(t))if(eg())e.flags|=8192;else throw gl=Ai,ou}function qi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?_t():536870912,e.lanes|=t,cr|=t)}function go(e,t){if(!Ue)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function We(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,o=0;if(t)for(var u=e.child;u!==null;)a|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)a|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=a,t}function t1(e,t,a){var o=t.pendingProps;switch(Zc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return We(t),null;case 3:return a=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),na(dt),fe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ql(t)?oa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Jc())),We(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(oa(t),f!==null?(We(t),Nm(t,f)):(We(t),Yu(t,u,null,o,a))):f?f!==e.memoizedState?(oa(t),We(t),Nm(t,f)):(We(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&oa(t),We(t),Yu(t,u,e,o,a)),null;case 27:if(Ae(t),a=oe.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&oa(t);else{if(!o){if(t.stateNode===null)throw Error(i(166));return We(t),null}e=X.current,Ql(t)?ip(t):(e=Lg(u,o,a),t.stateNode=e,oa(t))}return We(t),null;case 5:if(Ae(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&oa(t);else{if(!o){if(t.stateNode===null)throw Error(i(166));return We(t),null}if(f=X.current,Ql(t))ip(t);else{var b=rs(oe.current);switch(f){case 1:f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=b.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof o.is=="string"?b.createElement("select",{is:o.is}):b.createElement("select"),o.multiple?f.multiple=!0:o.size&&(f.size=o.size);break;default:f=typeof o.is=="string"?b.createElement(u,{is:o.is}):b.createElement(u)}}f[wt]=t,f[It]=o;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)f.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=f;e:switch(Rt(f,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&oa(t)}}return We(t),Yu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&oa(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(i(166));if(e=oe.current,Ql(t)){if(e=t.stateNode,a=t.memoizedProps,o=null,u=Ct,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[wt]=t,e=!!(e.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||Eg(e.nodeValue,a)),e||Ca(t,!0)}else e=rs(e).createTextNode(o),e[wt]=t,t.stateNode=e}return We(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(o=Ql(t),a!==null){if(e===null){if(!o)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[wt]=t}else fl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),e=!1}else a=Jc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(en(t),t):(en(t),null);if((t.flags&128)!==0)throw Error(i(558))}return We(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Ql(t),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(i(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(i(317));u[wt]=t}else fl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),u=!1}else u=Jc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(en(t),t):(en(t),null)}return en(t),(t.flags&128)!==0?(t.lanes=a,t):(a=o!==null,e=e!==null&&e.memoizedState!==null,a&&(o=t.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==u&&(o.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),qi(t,t.updateQueue),We(t),null);case 4:return fe(),e===null&&df(t.stateNode.containerInfo),We(t),null;case 10:return na(t.type),We(t),null;case 19:if(O(st),o=t.memoizedState,o===null)return We(t),null;if(u=(t.flags&128)!==0,f=o.rendering,f===null)if(u)go(o,!1);else{if(ot!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Di(e),f!==null){for(t.flags|=128,go(o,!1),e=f.updateQueue,t.updateQueue=e,qi(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)np(a,e),a=a.sibling;return U(st,st.current&1|2),Ue&&ea(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&at()>Ki&&(t.flags|=128,u=!0,go(o,!1),t.lanes=4194304)}else{if(!u)if(e=Di(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,qi(t,e),go(o,!0),o.tail===null&&o.tailMode==="hidden"&&!f.alternate&&!Ue)return We(t),null}else 2*at()-o.renderingStartTime>Ki&&a!==536870912&&(t.flags|=128,u=!0,go(o,!1),t.lanes=4194304);o.isBackwards?(f.sibling=t.child,t.child=f):(e=o.last,e!==null?e.sibling=f:t.child=f,o.last=f)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=at(),e.sibling=null,a=st.current,U(st,u?a&1|2:a&1),Ue&&ea(t,o.treeForkCount),e):(We(t),null);case 22:case 23:return en(t),du(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(a&536870912)!==0&&(t.flags&128)===0&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),a=t.updateQueue,a!==null&&qi(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==a&&(t.flags|=2048),e!==null&&O(pl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),na(dt),We(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function n1(e,t){switch(Zc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return na(dt),fe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(en(t),t.alternate===null)throw Error(i(340));fl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(en(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));fl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(st),null;case 4:return fe(),null;case 10:return na(t.type),null;case 22:case 23:return en(t),du(),e!==null&&O(pl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return na(dt),null;case 25:return null;default:return null}}function Om(e,t){switch(Zc(t),t.tag){case 3:na(dt),fe();break;case 26:case 27:case 5:Ae(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&en(t);break;case 13:en(t);break;case 19:O(st);break;case 10:na(t.type);break;case 22:case 23:en(t),du(),e!==null&&O(pl);break;case 24:na(dt)}}function vo(e,t){try{var a=t.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var u=o.next;a=u;do{if((a.tag&e)===e){o=void 0;var f=a.create,b=a.inst;o=f(),b.destroy=o}a=a.next}while(a!==u)}}catch(S){Ge(t,t.return,S)}}function ja(e,t,a){try{var o=t.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var f=u.next;o=f;do{if((o.tag&e)===e){var b=o.inst,S=b.destroy;if(S!==void 0){b.destroy=void 0,u=t;var j=a,I=S;try{I()}catch(W){Ge(u,j,W)}}}o=o.next}while(o!==f)}}catch(W){Ge(t,t.return,W)}}function jm(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{xp(t,a)}catch(o){Ge(e,e.return,o)}}}function Dm(e,t,a){a.props=bl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(o){Ge(e,t,o)}}function yo(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof a=="function"?e.refCleanup=a(o):a.current=o}}catch(u){Ge(e,t,u)}}function kn(e,t){var a=e.ref,o=e.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(u){Ge(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){Ge(e,t,u)}else a.current=null}function _m(e){var t=e.type,a=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break e;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(u){Ge(e,e.return,u)}}function qu(e,t,a){try{var o=e.stateNode;E1(o,e.type,a,t),o[It]=t}catch(u){Ge(e,e.return,u)}}function Mm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ua(e.type)||e.tag===4}function Gu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Mm(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&&Ua(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $u(e,t,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Zn));else if(o!==4&&(o===27&&Ua(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for($u(e,t,a),e=e.sibling;e!==null;)$u(e,t,a),e=e.sibling}function Gi(e,t,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(o!==4&&(o===27&&Ua(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Gi(e,t,a),e=e.sibling;e!==null;)Gi(e,t,a),e=e.sibling}function zm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var o=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Rt(t,o,a),t[wt]=e,t[It]=a}catch(f){Ge(e,e.return,f)}}var ia=!1,mt=!1,Xu=!1,Lm=typeof WeakSet=="function"?WeakSet:Set,xt=null;function a1(e,t){if(e=e.containerInfo,mf=ds,e=Xh(e),Pc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var u=o.anchorOffset,f=o.focusNode;o=o.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break e}var b=0,S=-1,j=-1,I=0,W=0,te=e,q=null;t:for(;;){for(var F;te!==a||u!==0&&te.nodeType!==3||(S=b+u),te!==f||o!==0&&te.nodeType!==3||(j=b+o),te.nodeType===3&&(b+=te.nodeValue.length),(F=te.firstChild)!==null;)q=te,te=F;for(;;){if(te===e)break t;if(q===a&&++I===u&&(S=b),q===f&&++W===o&&(j=b),(F=te.nextSibling)!==null)break;te=q,q=te.parentNode}te=F}a=S===-1||j===-1?null:{start:S,end:j}}else a=null}a=a||{start:0,end:0}}else a=null;for(gf={focusedElem:e,selectionRange:a},ds=!1,xt=t;xt!==null;)if(t=xt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xt=e;else for(;xt!==null;){switch(t=xt,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)u=e[a],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,a=t,u=f.memoizedProps,f=f.memoizedState,o=a.stateNode;try{var pe=bl(a.type,u);e=o.getSnapshotBeforeUpdate(pe,f),o.__reactInternalSnapshotBeforeUpdate=e}catch(Se){Ge(a,a.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)bf(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":bf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,xt=e;break}xt=t.return}}function km(e,t,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:ca(e,a),o&4&&vo(5,a);break;case 1:if(ca(e,a),o&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(b){Ge(a,a.return,b)}else{var u=bl(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Ge(a,a.return,b)}}o&64&&jm(a),o&512&&yo(a,a.return);break;case 3:if(ca(e,a),o&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{xp(e,t)}catch(b){Ge(a,a.return,b)}}break;case 27:t===null&&o&4&&zm(a);case 26:case 5:ca(e,a),t===null&&o&4&&_m(a),o&512&&yo(a,a.return);break;case 12:ca(e,a);break;case 31:ca(e,a),o&4&&Bm(e,a);break;case 13:ca(e,a),o&4&&Pm(e,a),o&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=d1.bind(null,a),_1(e,a))));break;case 22:if(o=a.memoizedState!==null||ia,!o){t=t!==null&&t.memoizedState!==null||mt,u=ia;var f=mt;ia=o,(mt=t)&&!f?ua(e,a,(a.subtreeFlags&8772)!==0):ca(e,a),ia=u,mt=f}break;case 30:break;default:ca(e,a)}}function Um(e){var t=e.alternate;t!==null&&(e.alternate=null,Um(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Cc(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 et=null,qt=!1;function sa(e,t,a){for(a=a.child;a!==null;)Hm(e,t,a),a=a.sibling}function Hm(e,t,a){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(nl,a)}catch{}switch(a.tag){case 26:mt||kn(a,t),sa(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:mt||kn(a,t);var o=et,u=qt;Ua(a.type)&&(et=a.stateNode,qt=!1),sa(e,t,a),Ao(a.stateNode),et=o,qt=u;break;case 5:mt||kn(a,t);case 6:if(o=et,u=qt,et=null,sa(e,t,a),et=o,qt=u,et!==null)if(qt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(a.stateNode)}catch(f){Ge(a,t,f)}else try{et.removeChild(a.stateNode)}catch(f){Ge(a,t,f)}break;case 18:et!==null&&(qt?(e=et,jg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),vr(e)):jg(et,a.stateNode));break;case 4:o=et,u=qt,et=a.stateNode.containerInfo,qt=!0,sa(e,t,a),et=o,qt=u;break;case 0:case 11:case 14:case 15:ja(2,a,t),mt||ja(4,a,t),sa(e,t,a);break;case 1:mt||(kn(a,t),o=a.stateNode,typeof o.componentWillUnmount=="function"&&Dm(a,t,o)),sa(e,t,a);break;case 21:sa(e,t,a);break;case 22:mt=(o=mt)||a.memoizedState!==null,sa(e,t,a),mt=o;break;default:sa(e,t,a)}}function Bm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{vr(e)}catch(a){Ge(t,t.return,a)}}}function Pm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{vr(e)}catch(a){Ge(t,t.return,a)}}function l1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Lm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Lm),t;default:throw Error(i(435,e.tag))}}function $i(e,t){var a=l1(e);t.forEach(function(o){if(!a.has(o)){a.add(o);var u=h1.bind(null,e,o);o.then(u,u)}})}function Gt(e,t){var a=t.deletions;if(a!==null)for(var o=0;o<a.length;o++){var u=a[o],f=e,b=t,S=b;e:for(;S!==null;){switch(S.tag){case 27:if(Ua(S.type)){et=S.stateNode,qt=!1;break e}break;case 5:et=S.stateNode,qt=!1;break e;case 3:case 4:et=S.stateNode.containerInfo,qt=!0;break e}S=S.return}if(et===null)throw Error(i(160));Hm(f,b,u),et=null,qt=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Vm(t,e),t=t.sibling}var Rn=null;function Vm(e,t){var a=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(t,e),$t(e),o&4&&(ja(3,e,e.return),vo(3,e),ja(5,e,e.return));break;case 1:Gt(t,e),$t(e),o&512&&(mt||a===null||kn(a,a.return)),o&64&&ia&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var u=Rn;if(Gt(t,e),$t(e),o&512&&(mt||a===null||kn(a,a.return)),o&4){var f=a!==null?a.memoizedState:null;if(o=e.memoizedState,a===null)if(o===null)if(e.stateNode===null){e:{o=e.type,a=e.memoizedProps,u=u.ownerDocument||u;t:switch(o){case"title":f=u.getElementsByTagName("title")[0],(!f||f[qr]||f[wt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(o),u.head.insertBefore(f,u.querySelector("head > title"))),Rt(f,o,a),f[wt]=e,bt(f),o=f;break e;case"link":var b=Vg("link","href",u).get(o+(a.href||""));if(b){for(var S=0;S<b.length;S++)if(f=b[S],f.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&f.getAttribute("rel")===(a.rel==null?null:a.rel)&&f.getAttribute("title")===(a.title==null?null:a.title)&&f.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){b.splice(S,1);break t}}f=u.createElement(o),Rt(f,o,a),u.head.appendChild(f);break;case"meta":if(b=Vg("meta","content",u).get(o+(a.content||""))){for(S=0;S<b.length;S++)if(f=b[S],f.getAttribute("content")===(a.content==null?null:""+a.content)&&f.getAttribute("name")===(a.name==null?null:a.name)&&f.getAttribute("property")===(a.property==null?null:a.property)&&f.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&f.getAttribute("charset")===(a.charSet==null?null:a.charSet)){b.splice(S,1);break t}}f=u.createElement(o),Rt(f,o,a),u.head.appendChild(f);break;default:throw Error(i(468,o))}f[wt]=e,bt(f),o=f}e.stateNode=o}else Ig(u,e.type,e.stateNode);else e.stateNode=Pg(u,o,e.memoizedProps);else f!==o?(f===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):f.count--,o===null?Ig(u,e.type,e.stateNode):Pg(u,o,e.memoizedProps)):o===null&&e.stateNode!==null&&qu(e,e.memoizedProps,a.memoizedProps)}break;case 27:Gt(t,e),$t(e),o&512&&(mt||a===null||kn(a,a.return)),a!==null&&o&4&&qu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Gt(t,e),$t(e),o&512&&(mt||a===null||kn(a,a.return)),e.flags&32){u=e.stateNode;try{Pl(u,"")}catch(pe){Ge(e,e.return,pe)}}o&4&&e.stateNode!=null&&(u=e.memoizedProps,qu(e,u,a!==null?a.memoizedProps:u)),o&1024&&(Xu=!0);break;case 6:if(Gt(t,e),$t(e),o&4){if(e.stateNode===null)throw Error(i(162));o=e.memoizedProps,a=e.stateNode;try{a.nodeValue=o}catch(pe){Ge(e,e.return,pe)}}break;case 3:if(ss=null,u=Rn,Rn=os(t.containerInfo),Gt(t,e),Rn=u,$t(e),o&4&&a!==null&&a.memoizedState.isDehydrated)try{vr(t.containerInfo)}catch(pe){Ge(e,e.return,pe)}Xu&&(Xu=!1,Im(e));break;case 4:o=Rn,Rn=os(e.stateNode.containerInfo),Gt(t,e),$t(e),Rn=o;break;case 12:Gt(t,e),$t(e);break;case 31:Gt(t,e),$t(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,$i(e,o)));break;case 13:Gt(t,e),$t(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Fi=at()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,$i(e,o)));break;case 22:u=e.memoizedState!==null;var j=a!==null&&a.memoizedState!==null,I=ia,W=mt;if(ia=I||u,mt=W||j,Gt(t,e),mt=W,ia=I,$t(e),o&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(a===null||j||ia||mt||xl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){j=a=t;try{if(f=j.stateNode,u)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{S=j.stateNode;var te=j.memoizedProps.style,q=te!=null&&te.hasOwnProperty("display")?te.display:null;S.style.display=q==null||typeof q=="boolean"?"":(""+q).trim()}}catch(pe){Ge(j,j.return,pe)}}}else if(t.tag===6){if(a===null){j=t;try{j.stateNode.nodeValue=u?"":j.memoizedProps}catch(pe){Ge(j,j.return,pe)}}}else if(t.tag===18){if(a===null){j=t;try{var F=j.stateNode;u?Dg(F,!0):Dg(j.stateNode,!1)}catch(pe){Ge(j,j.return,pe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}o&4&&(o=e.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,$i(e,a))));break;case 19:Gt(t,e),$t(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,$i(e,o)));break;case 30:break;case 21:break;default:Gt(t,e),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{for(var a,o=e.return;o!==null;){if(Mm(o)){a=o;break}o=o.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var u=a.stateNode,f=Gu(e);Gi(e,f,u);break;case 5:var b=a.stateNode;a.flags&32&&(Pl(b,""),a.flags&=-33);var S=Gu(e);Gi(e,S,b);break;case 3:case 4:var j=a.stateNode.containerInfo,I=Gu(e);$u(e,I,j);break;default:throw Error(i(161))}}catch(W){Ge(e,e.return,W)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Im(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Im(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ca(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)km(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ja(4,t,t.return),xl(t);break;case 1:kn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Dm(t,t.return,a),xl(t);break;case 27:Ao(t.stateNode);case 26:case 5:kn(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function ua(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,u=e,f=t,b=f.flags;switch(f.tag){case 0:case 11:case 15:ua(u,f,a),vo(4,f);break;case 1:if(ua(u,f,a),o=f,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(I){Ge(o,o.return,I)}if(o=f,u=o.updateQueue,u!==null){var S=o.stateNode;try{var j=u.shared.hiddenCallbacks;if(j!==null)for(u.shared.hiddenCallbacks=null,u=0;u<j.length;u++)bp(j[u],S)}catch(I){Ge(o,o.return,I)}}a&&b&64&&jm(f),yo(f,f.return);break;case 27:zm(f);case 26:case 5:ua(u,f,a),a&&o===null&&b&4&&_m(f),yo(f,f.return);break;case 12:ua(u,f,a);break;case 31:ua(u,f,a),a&&b&4&&Bm(u,f);break;case 13:ua(u,f,a),a&&b&4&&Pm(u,f);break;case 22:f.memoizedState===null&&ua(u,f,a),yo(f,f.return);break;case 30:break;default:ua(u,f,a)}t=t.sibling}}function Fu(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&ao(a))}function Ku(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ao(e))}function An(e,t,a,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ym(e,t,a,o),t=t.sibling}function Ym(e,t,a,o){var u=t.flags;switch(t.tag){case 0:case 11:case 15:An(e,t,a,o),u&2048&&vo(9,t);break;case 1:An(e,t,a,o);break;case 3:An(e,t,a,o),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ao(e)));break;case 12:if(u&2048){An(e,t,a,o),e=t.stateNode;try{var f=t.memoizedProps,b=f.id,S=f.onPostCommit;typeof S=="function"&&S(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){Ge(t,t.return,j)}}else An(e,t,a,o);break;case 31:An(e,t,a,o);break;case 13:An(e,t,a,o);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?An(e,t,a,o):bo(e,t):f._visibility&2?An(e,t,a,o):(f._visibility|=2,or(e,t,a,o,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Fu(b,t);break;case 24:An(e,t,a,o),u&2048&&Ku(t.alternate,t);break;default:An(e,t,a,o)}}function or(e,t,a,o,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,b=t,S=a,j=o,I=b.flags;switch(b.tag){case 0:case 11:case 15:or(f,b,S,j,u),vo(8,b);break;case 23:break;case 22:var W=b.stateNode;b.memoizedState!==null?W._visibility&2?or(f,b,S,j,u):bo(f,b):(W._visibility|=2,or(f,b,S,j,u)),u&&I&2048&&Fu(b.alternate,b);break;case 24:or(f,b,S,j,u),u&&I&2048&&Ku(b.alternate,b);break;default:or(f,b,S,j,u)}t=t.sibling}}function bo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,o=t,u=o.flags;switch(o.tag){case 22:bo(a,o),u&2048&&Fu(o.alternate,o);break;case 24:bo(a,o),u&2048&&Ku(o.alternate,o);break;default:bo(a,o)}t=t.sibling}}var xo=8192;function ir(e,t,a){if(e.subtreeFlags&xo)for(e=e.child;e!==null;)qm(e,t,a),e=e.sibling}function qm(e,t,a){switch(e.tag){case 26:ir(e,t,a),e.flags&xo&&e.memoizedState!==null&&q1(a,Rn,e.memoizedState,e.memoizedProps);break;case 5:ir(e,t,a);break;case 3:case 4:var o=Rn;Rn=os(e.stateNode.containerInfo),ir(e,t,a),Rn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=xo,xo=16777216,ir(e,t,a),xo=o):ir(e,t,a));break;default:ir(e,t,a)}}function Gm(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 So(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var o=t[a];xt=o,Xm(o,e)}Gm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$m(e),e=e.sibling}function $m(e){switch(e.tag){case 0:case 11:case 15:So(e),e.flags&2048&&ja(9,e,e.return);break;case 3:So(e);break;case 12:So(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xi(e)):So(e);break;default:So(e)}}function Xi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var o=t[a];xt=o,Xm(o,e)}Gm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ja(8,t,t.return),Xi(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Xi(t));break;default:Xi(t)}e=e.sibling}}function Xm(e,t){for(;xt!==null;){var a=xt;switch(a.tag){case 0:case 11:case 15:ja(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:ao(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,xt=o;else e:for(a=e;xt!==null;){o=xt;var u=o.sibling,f=o.return;if(Um(o),o===a){xt=null;break e}if(u!==null){u.return=f,xt=u;break e}xt=f}}}var r1={getCacheForType:function(e){var t=Et(dt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Et(dt).controller.signal}},o1=typeof WeakMap=="function"?WeakMap:Map,Ie=0,Ke=null,Me=null,Le=0,qe=0,tn=null,Da=!1,sr=!1,Qu=!1,fa=0,ot=0,_a=0,Sl=0,Zu=0,nn=0,cr=0,wo=null,Xt=null,Wu=!1,Fi=0,Fm=0,Ki=1/0,Qi=null,Ma=null,gt=0,za=null,ur=null,da=0,Ju=0,ef=null,Km=null,Co=0,tf=null;function an(){return(Ie&2)!==0&&Le!==0?Le&-Le:D.T!==null?sf():Sc()}function Qm(){if(nn===0)if((Le&536870912)===0||Ue){var e=_l;_l<<=1,(_l&3932160)===0&&(_l=262144),nn=e}else nn=536870912;return e=Jt.current,e!==null&&(e.flags|=32),nn}function Ft(e,t,a){(e===Ke&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(fr(e,0),La(e,Le,nn,!1)),lt(e,a),((Ie&2)===0||e!==Ke)&&(e===Ke&&((Ie&2)===0&&(Sl|=a),ot===4&&La(e,Le,nn,!1)),Un(e))}function Zm(e,t,a){if((Ie&6)!==0)throw Error(i(327));var o=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Je(e,t),u=o?c1(e,t):af(e,t,!0),f=o;do{if(u===0){sr&&!o&&La(e,t,0,!1);break}else{if(a=e.current.alternate,f&&!i1(a)){u=af(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var S=e;u=wo;var j=S.current.memoizedState.isDehydrated;if(j&&(fr(S,b).flags|=256),b=af(S,b,!1),b!==2){if(Qu&&!j){S.errorRecoveryDisabledLanes|=f,Sl|=f,u=4;break e}f=Xt,Xt=u,f!==null&&(Xt===null?Xt=f:Xt.push.apply(Xt,f))}u=b}if(f=!1,u!==2)continue}}if(u===1){fr(e,0),La(e,t,0,!0);break}e:{switch(o=e,f=u,f){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:La(o,t,nn,!Da);break e;case 2:Xt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(u=Fi+300-at(),10<u)){if(La(o,t,nn,!Da),Ee(o,0,!0)!==0)break e;da=t,o.timeoutHandle=Ng(Wm.bind(null,o,a,Xt,Qi,Wu,t,nn,Sl,cr,Da,f,"Throttled",-0,0),u);break e}Wm(o,a,Xt,Qi,Wu,t,nn,Sl,cr,Da,f,null,-0,0)}}break}while(!0);Un(e)}function Wm(e,t,a,o,u,f,b,S,j,I,W,te,q,F){if(e.timeoutHandle=-1,te=t.subtreeFlags,te&8192||(te&16785408)===16785408){te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Zn},qm(t,f,te);var pe=(f&62914560)===f?Fi-at():(f&4194048)===f?Fm-at():0;if(pe=G1(te,pe),pe!==null){da=f,e.cancelPendingCommit=pe(og.bind(null,e,t,f,a,o,u,b,S,j,W,te,null,q,F)),La(e,f,b,!I);return}}og(e,t,f,a,o,u,b,S,j)}function i1(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var u=a[o],f=u.getSnapshot;u=u.value;try{if(!Zt(f(),u))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 La(e,t,a,o){t&=~Zu,t&=~Sl,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var u=t;0<u;){var f=31-Dt(u),b=1<<f;o[f]=-1,u&=~b}a!==0&&ll(e,a,t)}function Zi(){return(Ie&6)===0?(Eo(0),!1):!0}function nf(){if(Me!==null){if(qe===0)var e=Me.return;else e=Me,ta=dl=null,yu(e),tr=null,ro=0,e=Me;for(;e!==null;)Om(e.alternate,e),e=e.return;Me=null}}function fr(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,A1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),da=0,nf(),Ke=e,Me=a=Jn(e.current,null),Le=t,qe=0,tn=null,Da=!1,sr=Je(e,t),Qu=!1,cr=nn=Zu=Sl=_a=ot=0,Xt=wo=null,Wu=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var u=31-Dt(o),f=1<<u;t|=e[u],o&=~f}return fa=t,yi(),a}function Jm(e,t){Ne=null,D.H=po,t===er||t===Ri?(t=mp(),qe=3):t===ou?(t=mp(),qe=4):qe=t===zu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,tn=t,Me===null&&(ot=1,Pi(e,fn(t,e.current)))}function eg(){var e=Jt.current;return e===null?!0:(Le&4194048)===Le?mn===null:(Le&62914560)===Le||(Le&536870912)!==0?e===mn:!1}function tg(){var e=D.H;return D.H=po,e===null?po:e}function ng(){var e=D.A;return D.A=r1,e}function Wi(){ot=4,Da||(Le&4194048)!==Le&&Jt.current!==null||(sr=!0),(_a&134217727)===0&&(Sl&134217727)===0||Ke===null||La(Ke,Le,nn,!1)}function af(e,t,a){var o=Ie;Ie|=2;var u=tg(),f=ng();(Ke!==e||Le!==t)&&(Qi=null,fr(e,t)),t=!1;var b=ot;e:do try{if(qe!==0&&Me!==null){var S=Me,j=tn;switch(qe){case 8:nf(),b=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(t=!0);var I=qe;if(qe=0,tn=null,dr(e,S,j,I),a&&sr){b=0;break e}break;default:I=qe,qe=0,tn=null,dr(e,S,j,I)}}s1(),b=ot;break}catch(W){Jm(e,W)}while(!0);return t&&e.shellSuspendCounter++,ta=dl=null,Ie=o,D.H=u,D.A=f,Me===null&&(Ke=null,Le=0,yi()),b}function s1(){for(;Me!==null;)ag(Me)}function c1(e,t){var a=Ie;Ie|=2;var o=tg(),u=ng();Ke!==e||Le!==t?(Qi=null,Ki=at()+500,fr(e,t)):sr=Je(e,t);e:do try{if(qe!==0&&Me!==null){t=Me;var f=tn;t:switch(qe){case 1:qe=0,tn=null,dr(e,t,f,1);break;case 2:case 9:if(hp(f)){qe=0,tn=null,lg(t);break}t=function(){qe!==2&&qe!==9||Ke!==e||(qe=7),Un(e)},f.then(t,t);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:hp(f)?(qe=0,tn=null,lg(t)):(qe=0,tn=null,dr(e,t,f,7));break;case 5:var b=null;switch(Me.tag){case 26:b=Me.memoizedState;case 5:case 27:var S=Me;if(b?Yg(b):S.stateNode.complete){qe=0,tn=null;var j=S.sibling;if(j!==null)Me=j;else{var I=S.return;I!==null?(Me=I,Ji(I)):Me=null}break t}}qe=0,tn=null,dr(e,t,f,5);break;case 6:qe=0,tn=null,dr(e,t,f,6);break;case 8:nf(),ot=6;break e;default:throw Error(i(462))}}u1();break}catch(W){Jm(e,W)}while(!0);return ta=dl=null,D.H=o,D.A=u,Ie=a,Me!==null?0:(Ke=null,Le=0,yi(),ot)}function u1(){for(;Me!==null&&!Ye();)ag(Me)}function ag(e){var t=Am(e.alternate,e,fa);e.memoizedProps=e.pendingProps,t===null?Ji(e):Me=t}function lg(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Sm(a,t,t.pendingProps,t.type,void 0,Le);break;case 11:t=Sm(a,t,t.pendingProps,t.type.render,t.ref,Le);break;case 5:yu(t);default:Om(a,t),t=Me=np(t,fa),t=Am(a,t,fa)}e.memoizedProps=e.pendingProps,t===null?Ji(e):Me=t}function dr(e,t,a,o){ta=dl=null,yu(t),tr=null,ro=0;var u=t.return;try{if(WS(e,u,t,a,Le)){ot=1,Pi(e,fn(a,e.current)),Me=null;return}}catch(f){if(u!==null)throw Me=u,f;ot=1,Pi(e,fn(a,e.current)),Me=null;return}t.flags&32768?(Ue||o===1?e=!0:sr||(Le&536870912)!==0?e=!1:(Da=e=!0,(o===2||o===9||o===3||o===6)&&(o=Jt.current,o!==null&&o.tag===13&&(o.flags|=16384))),rg(t,e)):Ji(t)}function Ji(e){var t=e;do{if((t.flags&32768)!==0){rg(t,Da);return}e=t.return;var a=t1(t.alternate,t,fa);if(a!==null){Me=a;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);ot===0&&(ot=5)}function rg(e,t){do{var a=n1(e.alternate,e);if(a!==null){a.flags&=32767,Me=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Me=e;return}Me=e=a}while(e!==null);ot=6,Me=null}function og(e,t,a,o,u,f,b,S,j){e.cancelPendingCommit=null;do es();while(gt!==0);if((Ie&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(f=t.lanes|t.childLanes,f|=Gc,Bt(e,a,f,b,S,j),e===Ke&&(Me=Ke=null,Le=0),ur=t,za=e,da=a,Ju=f,ef=u,Km=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,p1(tl,function(){return fg(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=D.T,D.T=null,u=$.p,$.p=2,b=Ie,Ie|=4;try{a1(e,t,a)}finally{Ie=b,$.p=u,D.T=o}}gt=1,ig(),sg(),cg()}}function ig(){if(gt===1){gt=0;var e=za,t=ur,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=D.T,D.T=null;var o=$.p;$.p=2;var u=Ie;Ie|=4;try{Vm(t,e);var f=gf,b=Xh(e.containerInfo),S=f.focusedElem,j=f.selectionRange;if(b!==S&&S&&S.ownerDocument&&$h(S.ownerDocument.documentElement,S)){if(j!==null&&Pc(S)){var I=j.start,W=j.end;if(W===void 0&&(W=I),"selectionStart"in S)S.selectionStart=I,S.selectionEnd=Math.min(W,S.value.length);else{var te=S.ownerDocument||document,q=te&&te.defaultView||window;if(q.getSelection){var F=q.getSelection(),pe=S.textContent.length,Se=Math.min(j.start,pe),Fe=j.end===void 0?Se:Math.min(j.end,pe);!F.extend&&Se>Fe&&(b=Fe,Fe=Se,Se=b);var H=Gh(S,Se),_=Gh(S,Fe);if(H&&_&&(F.rangeCount!==1||F.anchorNode!==H.node||F.anchorOffset!==H.offset||F.focusNode!==_.node||F.focusOffset!==_.offset)){var V=te.createRange();V.setStart(H.node,H.offset),F.removeAllRanges(),Se>Fe?(F.addRange(V),F.extend(_.node,_.offset)):(V.setEnd(_.node,_.offset),F.addRange(V))}}}}for(te=[],F=S;F=F.parentNode;)F.nodeType===1&&te.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<te.length;S++){var ee=te[S];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}ds=!!mf,gf=mf=null}finally{Ie=u,$.p=o,D.T=a}}e.current=t,gt=2}}function sg(){if(gt===2){gt=0;var e=za,t=ur,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=D.T,D.T=null;var o=$.p;$.p=2;var u=Ie;Ie|=4;try{km(e,t.alternate,t)}finally{Ie=u,$.p=o,D.T=a}}gt=3}}function cg(){if(gt===4||gt===3){gt=0,St();var e=za,t=ur,a=da,o=Km;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?gt=5:(gt=0,ur=za=null,ug(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Ma=null),En(a),t=t.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(nl,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=D.T,u=$.p,$.p=2,D.T=null;try{for(var f=e.onRecoverableError,b=0;b<o.length;b++){var S=o[b];f(S.value,{componentStack:S.stack})}}finally{D.T=t,$.p=u}}(da&3)!==0&&es(),Un(e),u=e.pendingLanes,(a&261930)!==0&&(u&42)!==0?e===tf?Co++:(Co=0,tf=e):Co=0,Eo(0)}}function ug(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ao(t)))}function es(){return ig(),sg(),cg(),fg()}function fg(){if(gt!==5)return!1;var e=za,t=Ju;Ju=0;var a=En(da),o=D.T,u=$.p;try{$.p=32>a?32:a,D.T=null,a=ef,ef=null;var f=za,b=da;if(gt=0,ur=za=null,da=0,(Ie&6)!==0)throw Error(i(331));var S=Ie;if(Ie|=4,$m(f.current),Ym(f,f.current,b,a),Ie=S,Eo(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(nl,f)}catch{}return!0}finally{$.p=u,D.T=o,ug(e,t)}}function dg(e,t,a){t=fn(a,t),t=Mu(e.stateNode,t,2),e=Aa(e,t,2),e!==null&&(lt(e,2),Un(e))}function Ge(e,t,a){if(e.tag===3)dg(e,e,a);else for(;t!==null;){if(t.tag===3){dg(t,e,a);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ma===null||!Ma.has(o))){e=fn(a,e),a=hm(2),o=Aa(t,a,2),o!==null&&(pm(a,o,t,e),lt(o,2),Un(o));break}}t=t.return}}function lf(e,t,a){var o=e.pingCache;if(o===null){o=e.pingCache=new o1;var u=new Set;o.set(t,u)}else u=o.get(t),u===void 0&&(u=new Set,o.set(t,u));u.has(a)||(Qu=!0,u.add(a),e=f1.bind(null,e,t,a),t.then(e,e))}function f1(e,t,a){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ke===e&&(Le&a)===a&&(ot===4||ot===3&&(Le&62914560)===Le&&300>at()-Fi?(Ie&2)===0&&fr(e,0):Zu|=a,cr===Le&&(cr=0)),Un(e)}function hg(e,t){t===0&&(t=_t()),e=cl(e,t),e!==null&&(lt(e,t),Un(e))}function d1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),hg(e,a)}function h1(e,t){var a=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(a=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(i(314))}o!==null&&o.delete(t),hg(e,a)}function p1(e,t){return Ve(e,t)}var ts=null,hr=null,rf=!1,ns=!1,of=!1,ka=0;function Un(e){e!==hr&&e.next===null&&(hr===null?ts=hr=e:hr=hr.next=e),ns=!0,rf||(rf=!0,g1())}function Eo(e,t){if(!of&&ns){of=!0;do for(var a=!1,o=ts;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var f=0;else{var b=o.suspendedLanes,S=o.pingedLanes;f=(1<<31-Dt(42|e)+1)-1,f&=u&~(b&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(a=!0,vg(o,f))}else f=Le,f=Ee(o,o===Ke?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(f&3)===0||Je(o,f)||(a=!0,vg(o,f));o=o.next}while(a);of=!1}}function m1(){pg()}function pg(){ns=rf=!1;var e=0;ka!==0&&R1()&&(e=ka);for(var t=at(),a=null,o=ts;o!==null;){var u=o.next,f=mg(o,t);f===0?(o.next=null,a===null?ts=u:a.next=u,u===null&&(hr=a)):(a=o,(e!==0||(f&3)!==0)&&(ns=!0)),o=u}gt!==0&>!==5||Eo(e),ka!==0&&(ka=0)}function mg(e,t){for(var a=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var b=31-Dt(f),S=1<<b,j=u[b];j===-1?((S&a)===0||(S&o)!==0)&&(u[b]=yt(S,t)):j<=t&&(e.expiredLanes|=S),f&=~S}if(t=Ke,a=Le,a=Ee(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,a===0||e===t&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&nt(o),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Je(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(o!==null&&nt(o),En(a)){case 2:case 8:a=ri;break;case 32:a=tl;break;case 268435456:a=Kn;break;default:a=tl}return o=gg.bind(null,e),a=Ve(a,o),e.callbackPriority=t,e.callbackNode=a,t}return o!==null&&o!==null&&nt(o),e.callbackPriority=2,e.callbackNode=null,2}function gg(e,t){if(gt!==0&>!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(es()&&e.callbackNode!==a)return null;var o=Le;return o=Ee(e,e===Ke?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Zm(e,o,t),mg(e,at()),e.callbackNode!=null&&e.callbackNode===a?gg.bind(null,e):null)}function vg(e,t){if(es())return null;Zm(e,t,!0)}function g1(){N1(function(){(Ie&6)!==0?Ve(Fn,m1):pg()})}function sf(){if(ka===0){var e=Wl;e===0&&(e=Dl,Dl<<=1,(Dl&261888)===0&&(Dl=256)),ka=e}return ka}function yg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ui(""+e)}function bg(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function v1(e,t,a,o,u){if(t==="submit"&&a&&a.stateNode===u){var f=yg((u[It]||null).action),b=o.submitter;b&&(t=(t=b[It]||null)?yg(t.formAction):b.getAttribute("formAction"),t!==null&&(f=t,b=null));var S=new pi("action","action",null,o,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(ka!==0){var j=b?bg(u,b):new FormData(u);Au(a,{pending:!0,data:j,method:u.method,action:f},null,j)}}else typeof f=="function"&&(S.preventDefault(),j=b?bg(u,b):new FormData(u),Au(a,{pending:!0,data:j,method:u.method,action:f},f,j))},currentTarget:u}]})}}for(var cf=0;cf<qc.length;cf++){var uf=qc[cf],y1=uf.toLowerCase(),b1=uf[0].toUpperCase()+uf.slice(1);Tn(y1,"on"+b1)}Tn(Qh,"onAnimationEnd"),Tn(Zh,"onAnimationIteration"),Tn(Wh,"onAnimationStart"),Tn("dblclick","onDoubleClick"),Tn("focusin","onFocus"),Tn("focusout","onBlur"),Tn(LS,"onTransitionRun"),Tn(kS,"onTransitionStart"),Tn(US,"onTransitionCancel"),Tn(Jh,"onTransitionEnd"),Hl("onMouseEnter",["mouseout","mouseover"]),Hl("onMouseLeave",["mouseout","mouseover"]),Hl("onPointerEnter",["pointerout","pointerover"]),Hl("onPointerLeave",["pointerout","pointerover"]),rl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),rl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),rl("onBeforeInput",["compositionend","keypress","textInput","paste"]),rl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),rl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),rl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var To="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(" "),x1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(To));function xg(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var o=e[a],u=o.event;o=o.listeners;e:{var f=void 0;if(t)for(var b=o.length-1;0<=b;b--){var S=o[b],j=S.instance,I=S.currentTarget;if(S=S.listener,j!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=I;try{f(u)}catch(W){vi(W)}u.currentTarget=null,f=j}else for(b=0;b<o.length;b++){if(S=o[b],j=S.instance,I=S.currentTarget,S=S.listener,j!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=I;try{f(u)}catch(W){vi(W)}u.currentTarget=null,f=j}}}}function ze(e,t){var a=t[wc];a===void 0&&(a=t[wc]=new Set);var o=e+"__bubble";a.has(o)||(Sg(t,e,2,!1),a.add(o))}function ff(e,t,a){var o=0;t&&(o|=4),Sg(a,e,o,t)}var as="_reactListening"+Math.random().toString(36).slice(2);function df(e){if(!e[as]){e[as]=!0,ph.forEach(function(a){a!=="selectionchange"&&(x1.has(a)||ff(a,!1,e),ff(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[as]||(t[as]=!0,ff("selectionchange",!1,t))}}function Sg(e,t,a,o){switch(Qg(t)){case 2:var u=F1;break;case 8:u=K1;break;default:u=Af}a=u.bind(null,t,a,e),u=void 0,!Dc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(t,a,{capture:!0,passive:u}):e.addEventListener(t,a,!0):u!==void 0?e.addEventListener(t,a,{passive:u}):e.addEventListener(t,a,!1)}function hf(e,t,a,o,u){var f=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var b=o.tag;if(b===3||b===4){var S=o.stateNode.containerInfo;if(S===u)break;if(b===4)for(b=o.return;b!==null;){var j=b.tag;if((j===3||j===4)&&b.stateNode.containerInfo===u)return;b=b.return}for(;S!==null;){if(b=Ll(S),b===null)return;if(j=b.tag,j===5||j===6||j===26||j===27){o=f=b;continue e}S=S.parentNode}}o=o.return}Rh(function(){var I=f,W=Oc(a),te=[];e:{var q=ep.get(e);if(q!==void 0){var F=pi,pe=e;switch(e){case"keypress":if(di(a)===0)break e;case"keydown":case"keyup":F=hS;break;case"focusin":pe="focus",F=Lc;break;case"focusout":pe="blur",F=Lc;break;case"beforeblur":case"afterblur":F=Lc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=Oh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=tS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=gS;break;case Qh:case Zh:case Wh:F=lS;break;case Jh:F=yS;break;case"scroll":case"scrollend":F=Jx;break;case"wheel":F=xS;break;case"copy":case"cut":case"paste":F=oS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=Dh;break;case"toggle":case"beforetoggle":F=wS}var Se=(t&4)!==0,Fe=!Se&&(e==="scroll"||e==="scrollend"),H=Se?q!==null?q+"Capture":null:q;Se=[];for(var _=I,V;_!==null;){var ee=_;if(V=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||V===null||H===null||(ee=$r(_,H),ee!=null&&Se.push(Ro(_,ee,V))),Fe)break;_=_.return}0<Se.length&&(q=new F(q,pe,null,a,W),te.push({event:q,listeners:Se}))}}if((t&7)===0){e:{if(q=e==="mouseover"||e==="pointerover",F=e==="mouseout"||e==="pointerout",q&&a!==Nc&&(pe=a.relatedTarget||a.fromElement)&&(Ll(pe)||pe[zl]))break e;if((F||q)&&(q=W.window===W?W:(q=W.ownerDocument)?q.defaultView||q.parentWindow:window,F?(pe=a.relatedTarget||a.toElement,F=I,pe=pe?Ll(pe):null,pe!==null&&(Fe=c(pe),Se=pe.tag,pe!==Fe||Se!==5&&Se!==27&&Se!==6)&&(pe=null)):(F=null,pe=I),F!==pe)){if(Se=Oh,ee="onMouseLeave",H="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Dh,ee="onPointerLeave",H="onPointerEnter",_="pointer"),Fe=F==null?q:Gr(F),V=pe==null?q:Gr(pe),q=new Se(ee,_+"leave",F,a,W),q.target=Fe,q.relatedTarget=V,ee=null,Ll(W)===I&&(Se=new Se(H,_+"enter",pe,a,W),Se.target=V,Se.relatedTarget=Fe,ee=Se),Fe=ee,F&&pe)t:{for(Se=S1,H=F,_=pe,V=0,ee=H;ee;ee=Se(ee))V++;ee=0;for(var ye=_;ye;ye=Se(ye))ee++;for(;0<V-ee;)H=Se(H),V--;for(;0<ee-V;)_=Se(_),ee--;for(;V--;){if(H===_||_!==null&&H===_.alternate){Se=H;break t}H=Se(H),_=Se(_)}Se=null}else Se=null;F!==null&&wg(te,q,F,Se,!1),pe!==null&&Fe!==null&&wg(te,Fe,pe,Se,!0)}}e:{if(q=I?Gr(I):window,F=q.nodeName&&q.nodeName.toLowerCase(),F==="select"||F==="input"&&q.type==="file")var Be=Bh;else if(Uh(q))if(Ph)Be=_S;else{Be=jS;var ve=OS}else F=q.nodeName,!F||F.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?I&&Ac(I.elementType)&&(Be=Bh):Be=DS;if(Be&&(Be=Be(e,I))){Hh(te,Be,a,W);break e}ve&&ve(e,q,I),e==="focusout"&&I&&q.type==="number"&&I.memoizedProps.value!=null&&Rc(q,"number",q.value)}switch(ve=I?Gr(I):window,e){case"focusin":(Uh(ve)||ve.contentEditable==="true")&&(ql=ve,Vc=I,eo=null);break;case"focusout":eo=Vc=ql=null;break;case"mousedown":Ic=!0;break;case"contextmenu":case"mouseup":case"dragend":Ic=!1,Fh(te,a,W);break;case"selectionchange":if(zS)break;case"keydown":case"keyup":Fh(te,a,W)}var Oe;if(Uc)e:{switch(e){case"compositionstart":var ke="onCompositionStart";break e;case"compositionend":ke="onCompositionEnd";break e;case"compositionupdate":ke="onCompositionUpdate";break e}ke=void 0}else Yl?Lh(e,a)&&(ke="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ke="onCompositionStart");ke&&(_h&&a.locale!=="ko"&&(Yl||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&Yl&&(Oe=Ah()):(xa=W,_c="value"in xa?xa.value:xa.textContent,Yl=!0)),ve=ls(I,ke),0<ve.length&&(ke=new jh(ke,e,null,a,W),te.push({event:ke,listeners:ve}),Oe?ke.data=Oe:(Oe=kh(a),Oe!==null&&(ke.data=Oe)))),(Oe=ES?TS(e,a):RS(e,a))&&(ke=ls(I,"onBeforeInput"),0<ke.length&&(ve=new jh("onBeforeInput","beforeinput",null,a,W),te.push({event:ve,listeners:ke}),ve.data=Oe)),v1(te,e,I,a,W)}xg(te,t)})}function Ro(e,t,a){return{instance:e,listener:t,currentTarget:a}}function ls(e,t){for(var a=t+"Capture",o=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=$r(e,a),u!=null&&o.unshift(Ro(e,u,f)),u=$r(e,t),u!=null&&o.push(Ro(e,u,f))),e.tag===3)return o;e=e.return}return[]}function S1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function wg(e,t,a,o,u){for(var f=t._reactName,b=[];a!==null&&a!==o;){var S=a,j=S.alternate,I=S.stateNode;if(S=S.tag,j!==null&&j===o)break;S!==5&&S!==26&&S!==27||I===null||(j=I,u?(I=$r(a,f),I!=null&&b.unshift(Ro(a,I,j))):u||(I=$r(a,f),I!=null&&b.push(Ro(a,I,j)))),a=a.return}b.length!==0&&e.push({event:t,listeners:b})}var w1=/\r\n?/g,C1=/\u0000|\uFFFD/g;function Cg(e){return(typeof e=="string"?e:""+e).replace(w1,`
|
|
9
|
-
`).replace(C1,"")}function Eg(e,t){return t=Cg(t),Cg(e)===t}function Xe(e,t,a,o,u,f){switch(a){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||Pl(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&Pl(e,""+o);break;case"className":si(e,"class",o);break;case"tabIndex":si(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":si(e,a,o);break;case"style":Eh(e,o,f);break;case"data":if(t!=="object"){si(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=ui(""+o),e.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(a==="formAction"?(t!=="input"&&Xe(e,t,"name",u.name,u,null),Xe(e,t,"formEncType",u.formEncType,u,null),Xe(e,t,"formMethod",u.formMethod,u,null),Xe(e,t,"formTarget",u.formTarget,u,null)):(Xe(e,t,"encType",u.encType,u,null),Xe(e,t,"method",u.method,u,null),Xe(e,t,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=ui(""+o),e.setAttribute(a,o);break;case"onClick":o!=null&&(e.onclick=Zn);break;case"onScroll":o!=null&&ze("scroll",e);break;case"onScrollEnd":o!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(a=o.__html,a!=null){if(u.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}a=ui(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""+o):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":o===!0?e.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,o):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(a,o):e.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(a):e.setAttribute(a,o);break;case"popover":ze("beforetoggle",e),ze("toggle",e),ii(e,"popover",o);break;case"xlinkActuate":Qn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Qn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Qn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Qn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Qn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Qn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":ii(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Zx.get(a)||a,ii(e,a,o))}}function pf(e,t,a,o,u,f){switch(a){case"style":Eh(e,o,f);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(a=o.__html,a!=null){if(u.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof o=="string"?Pl(e,o):(typeof o=="number"||typeof o=="bigint")&&Pl(e,""+o);break;case"onScroll":o!=null&&ze("scroll",e);break;case"onScrollEnd":o!=null&&ze("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Zn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!mh.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),t=a.slice(2,u?a.length-7:void 0),f=e[It]||null,f=f!=null?f[a]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof o=="function")){typeof f!="function"&&f!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,o,u);break e}a in e?e[a]=o:o===!0?e.setAttribute(a,""):ii(e,a,o)}}}function Rt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var o=!1,u=!1,f;for(f in a)if(a.hasOwnProperty(f)){var b=a[f];if(b!=null)switch(f){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Xe(e,t,f,b,a,null)}}u&&Xe(e,t,"srcSet",a.srcSet,a,null),o&&Xe(e,t,"src",a.src,a,null);return;case"input":ze("invalid",e);var S=f=b=u=null,j=null,I=null;for(o in a)if(a.hasOwnProperty(o)){var W=a[o];if(W!=null)switch(o){case"name":u=W;break;case"type":b=W;break;case"checked":j=W;break;case"defaultChecked":I=W;break;case"value":f=W;break;case"defaultValue":S=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(i(137,t));break;default:Xe(e,t,o,W,a,null)}}xh(e,f,S,j,I,b,u,!1);return;case"select":ze("invalid",e),o=b=f=null;for(u in a)if(a.hasOwnProperty(u)&&(S=a[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":b=S;break;case"multiple":o=S;default:Xe(e,t,u,S,a,null)}t=f,a=b,e.multiple=!!o,t!=null?Bl(e,!!o,t,!1):a!=null&&Bl(e,!!o,a,!0);return;case"textarea":ze("invalid",e),f=u=o=null;for(b in a)if(a.hasOwnProperty(b)&&(S=a[b],S!=null))switch(b){case"value":o=S;break;case"defaultValue":u=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:Xe(e,t,b,S,a,null)}wh(e,o,u,f);return;case"option":for(j in a)a.hasOwnProperty(j)&&(o=a[j],o!=null)&&(j==="selected"?e.selected=o&&typeof o!="function"&&typeof o!="symbol":Xe(e,t,j,o,a,null));return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(o=0;o<To.length;o++)ze(To[o],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("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(I in a)if(a.hasOwnProperty(I)&&(o=a[I],o!=null))switch(I){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Xe(e,t,I,o,a,null)}return;default:if(Ac(t)){for(W in a)a.hasOwnProperty(W)&&(o=a[W],o!==void 0&&pf(e,t,W,o,a,void 0));return}}for(S in a)a.hasOwnProperty(S)&&(o=a[S],o!=null&&Xe(e,t,S,o,a,null))}function E1(e,t,a,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,b=null,S=null,j=null,I=null,W=null;for(F in a){var te=a[F];if(a.hasOwnProperty(F)&&te!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":j=te;default:o.hasOwnProperty(F)||Xe(e,t,F,null,o,te)}}for(var q in o){var F=o[q];if(te=a[q],o.hasOwnProperty(q)&&(F!=null||te!=null))switch(q){case"type":f=F;break;case"name":u=F;break;case"checked":I=F;break;case"defaultChecked":W=F;break;case"value":b=F;break;case"defaultValue":S=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(i(137,t));break;default:F!==te&&Xe(e,t,q,F,o,te)}}Tc(e,b,S,j,I,W,f,u);return;case"select":F=b=S=q=null;for(f in a)if(j=a[f],a.hasOwnProperty(f)&&j!=null)switch(f){case"value":break;case"multiple":F=j;default:o.hasOwnProperty(f)||Xe(e,t,f,null,o,j)}for(u in o)if(f=o[u],j=a[u],o.hasOwnProperty(u)&&(f!=null||j!=null))switch(u){case"value":q=f;break;case"defaultValue":S=f;break;case"multiple":b=f;default:f!==j&&Xe(e,t,u,f,o,j)}t=S,a=b,o=F,q!=null?Bl(e,!!a,q,!1):!!o!=!!a&&(t!=null?Bl(e,!!a,t,!0):Bl(e,!!a,a?[]:"",!1));return;case"textarea":F=q=null;for(S in a)if(u=a[S],a.hasOwnProperty(S)&&u!=null&&!o.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Xe(e,t,S,null,o,u)}for(b in o)if(u=o[b],f=a[b],o.hasOwnProperty(b)&&(u!=null||f!=null))switch(b){case"value":q=u;break;case"defaultValue":F=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(i(91));break;default:u!==f&&Xe(e,t,b,u,o,f)}Sh(e,q,F);return;case"option":for(var pe in a)q=a[pe],a.hasOwnProperty(pe)&&q!=null&&!o.hasOwnProperty(pe)&&(pe==="selected"?e.selected=!1:Xe(e,t,pe,null,o,q));for(j in o)q=o[j],F=a[j],o.hasOwnProperty(j)&&q!==F&&(q!=null||F!=null)&&(j==="selected"?e.selected=q&&typeof q!="function"&&typeof q!="symbol":Xe(e,t,j,q,o,F));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 Se in a)q=a[Se],a.hasOwnProperty(Se)&&q!=null&&!o.hasOwnProperty(Se)&&Xe(e,t,Se,null,o,q);for(I in o)if(q=o[I],F=a[I],o.hasOwnProperty(I)&&q!==F&&(q!=null||F!=null))switch(I){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(137,t));break;default:Xe(e,t,I,q,o,F)}return;default:if(Ac(t)){for(var Fe in a)q=a[Fe],a.hasOwnProperty(Fe)&&q!==void 0&&!o.hasOwnProperty(Fe)&&pf(e,t,Fe,void 0,o,q);for(W in o)q=o[W],F=a[W],!o.hasOwnProperty(W)||q===F||q===void 0&&F===void 0||pf(e,t,W,q,o,F);return}}for(var H in a)q=a[H],a.hasOwnProperty(H)&&q!=null&&!o.hasOwnProperty(H)&&Xe(e,t,H,null,o,q);for(te in o)q=o[te],F=a[te],!o.hasOwnProperty(te)||q===F||q==null&&F==null||Xe(e,t,te,q,o,F)}function Tg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function T1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var u=a[o],f=u.transferSize,b=u.initiatorType,S=u.duration;if(f&&S&&Tg(b)){for(b=0,S=u.responseEnd,o+=1;o<a.length;o++){var j=a[o],I=j.startTime;if(I>S)break;var W=j.transferSize,te=j.initiatorType;W&&Tg(te)&&(j=j.responseEnd,b+=W*(j<S?1:(S-I)/(j-I)))}if(--o,t+=8*(f+b)/(u.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 mf=null,gf=null;function rs(e){return e.nodeType===9?e:e.ownerDocument}function Rg(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 Ag(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 vf(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 yf=null;function R1(){var e=window.event;return e&&e.type==="popstate"?e===yf?!1:(yf=e,!0):(yf=null,!1)}var Ng=typeof setTimeout=="function"?setTimeout:void 0,A1=typeof clearTimeout=="function"?clearTimeout:void 0,Og=typeof Promise=="function"?Promise:void 0,N1=typeof queueMicrotask=="function"?queueMicrotask:typeof Og<"u"?function(e){return Og.resolve(null).then(e).catch(O1)}:Ng;function O1(e){setTimeout(function(){throw e})}function Ua(e){return e==="head"}function jg(e,t){var a=t,o=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(o===0){e.removeChild(u),vr(t);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")Ao(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ao(a);for(var f=a.firstChild;f;){var b=f.nextSibling,S=f.nodeName;f[qr]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||a.removeChild(f),f=b}}else a==="body"&&Ao(e.ownerDocument.body);a=u}while(a);vr(t)}function Dg(e,t){var a=e;e=0;do{var o=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=o}while(a)}function bf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":bf(a),Cc(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function j1(e,t,a,o){for(;e.nodeType===1;){var u=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[qr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=gn(e.nextSibling),e===null)break}return null}function D1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=gn(e.nextSibling),e===null))return null;return e}function _g(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=gn(e.nextSibling),e===null))return null;return e}function xf(e){return e.data==="$?"||e.data==="$~"}function Sf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function _1(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var o=function(){t(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function gn(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 wf=null;function Mg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return gn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function zg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Lg(e,t,a){switch(t=rs(a),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 Ao(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Cc(e)}var vn=new Map,kg=new Set;function os(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ha=$.d;$.d={f:M1,r:z1,D:L1,C:k1,L:U1,m:H1,X:P1,S:B1,M:V1};function M1(){var e=ha.f(),t=Zi();return e||t}function z1(e){var t=kl(e);t!==null&&t.tag===5&&t.type==="form"?Jp(t):ha.r(e)}var pr=typeof document>"u"?null:document;function Ug(e,t,a){var o=pr;if(o&&typeof t=="string"&&t){var u=cn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),kg.has(u)||(kg.add(u),e={rel:e,crossOrigin:a,href:t},o.querySelector(u)===null&&(t=o.createElement("link"),Rt(t,"link",e),bt(t),o.head.appendChild(t)))}}function L1(e){ha.D(e),Ug("dns-prefetch",e,null)}function k1(e,t){ha.C(e,t),Ug("preconnect",e,t)}function U1(e,t,a){ha.L(e,t,a);var o=pr;if(o&&e&&t){var u='link[rel="preload"][as="'+cn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+cn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+cn(a.imageSizes)+'"]')):u+='[href="'+cn(e)+'"]';var f=u;switch(t){case"style":f=mr(e);break;case"script":f=gr(e)}vn.has(f)||(e=v({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),vn.set(f,e),o.querySelector(u)!==null||t==="style"&&o.querySelector(No(f))||t==="script"&&o.querySelector(Oo(f))||(t=o.createElement("link"),Rt(t,"link",e),bt(t),o.head.appendChild(t)))}}function H1(e,t){ha.m(e,t);var a=pr;if(a&&e){var o=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+cn(o)+'"][href="'+cn(e)+'"]',f=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=gr(e)}if(!vn.has(f)&&(e=v({rel:"modulepreload",href:e},t),vn.set(f,e),a.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Oo(f)))return}o=a.createElement("link"),Rt(o,"link",e),bt(o),a.head.appendChild(o)}}}function B1(e,t,a){ha.S(e,t,a);var o=pr;if(o&&e){var u=Ul(o).hoistableStyles,f=mr(e);t=t||"default";var b=u.get(f);if(!b){var S={loading:0,preload:null};if(b=o.querySelector(No(f)))S.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},a),(a=vn.get(f))&&Cf(e,a);var j=b=o.createElement("link");bt(j),Rt(j,"link",e),j._p=new Promise(function(I,W){j.onload=I,j.onerror=W}),j.addEventListener("load",function(){S.loading|=1}),j.addEventListener("error",function(){S.loading|=2}),S.loading|=4,is(b,t,o)}b={type:"stylesheet",instance:b,count:1,state:S},u.set(f,b)}}}function P1(e,t){ha.X(e,t);var a=pr;if(a&&e){var o=Ul(a).hoistableScripts,u=gr(e),f=o.get(u);f||(f=a.querySelector(Oo(u)),f||(e=v({src:e,async:!0},t),(t=vn.get(u))&&Ef(e,t),f=a.createElement("script"),bt(f),Rt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(u,f))}}function V1(e,t){ha.M(e,t);var a=pr;if(a&&e){var o=Ul(a).hoistableScripts,u=gr(e),f=o.get(u);f||(f=a.querySelector(Oo(u)),f||(e=v({src:e,async:!0,type:"module"},t),(t=vn.get(u))&&Ef(e,t),f=a.createElement("script"),bt(f),Rt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(u,f))}}function Hg(e,t,a,o){var u=(u=oe.current)?os(u):null;if(!u)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=mr(a.href),a=Ul(u).hoistableStyles,o=a.get(t),o||(o={type:"style",instance:null,count:0,state:null},a.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=mr(a.href);var f=Ul(u).hoistableStyles,b=f.get(e);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,b),(f=u.querySelector(No(e)))&&!f._p&&(b.instance=f,b.state.loading=5),vn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},vn.set(e,a),f||I1(u,e,a,b.state))),t&&o===null)throw Error(i(528,""));return b}if(t&&o!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=gr(a),a=Ul(u).hoistableScripts,o=a.get(t),o||(o={type:"script",instance:null,count:0,state:null},a.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function mr(e){return'href="'+cn(e)+'"'}function No(e){return'link[rel="stylesheet"]['+e+"]"}function Bg(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function I1(e,t,a,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),Rt(t,"link",a),bt(t),e.head.appendChild(t))}function gr(e){return'[src="'+cn(e)+'"]'}function Oo(e){return"script[async]"+e}function Pg(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+cn(a.href)+'"]');if(o)return t.instance=o,bt(o),o;var u=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),bt(o),Rt(o,"style",u),is(o,a.precedence,e),t.instance=o;case"stylesheet":u=mr(a.href);var f=e.querySelector(No(u));if(f)return t.state.loading|=4,t.instance=f,bt(f),f;o=Bg(a),(u=vn.get(u))&&Cf(o,u),f=(e.ownerDocument||e).createElement("link"),bt(f);var b=f;return b._p=new Promise(function(S,j){b.onload=S,b.onerror=j}),Rt(f,"link",o),t.state.loading|=4,is(f,a.precedence,e),t.instance=f;case"script":return f=gr(a.src),(u=e.querySelector(Oo(f)))?(t.instance=u,bt(u),u):(o=a,(u=vn.get(f))&&(o=v({},a),Ef(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),bt(u),Rt(u,"link",o),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,is(o,a.precedence,e));return t.instance}function is(e,t,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,f=u,b=0;b<o.length;b++){var S=o[b];if(S.dataset.precedence===t)f=S;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Cf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ef(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ss=null;function Vg(e,t,a){if(ss===null){var o=new Map,u=ss=new Map;u.set(a,o)}else u=ss,o=u.get(a),o||(o=new Map,u.set(a,o));if(o.has(e))return o;for(o.set(e,null),a=a.getElementsByTagName(e),u=0;u<a.length;u++){var f=a[u];if(!(f[qr]||f[wt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var S=o.get(b);S?S.push(f):o.set(b,[f])}}return o}function Ig(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Y1(e,t,a){if(a===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 Yg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function q1(e,t,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=mr(o.href),f=t.querySelector(No(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=cs.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=f,bt(f);return}f=t.ownerDocument||t,o=Bg(o),(u=vn.get(u))&&Cf(o,u),f=f.createElement("link"),bt(f);var b=f;b._p=new Promise(function(S,j){b.onload=S,b.onerror=j}),Rt(f,"link",o),a.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=cs.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Tf=0;function G1(e,t){return e.stylesheets&&e.count===0&&fs(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var o=setTimeout(function(){if(e.stylesheets&&fs(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Tf===0&&(Tf=62500*T1());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fs(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Tf?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function cs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var us=null;function fs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,us=new Map,t.forEach($1,e),us=null,cs.call(e))}function $1(e,t){if(!(t.state.loading&4)){var a=us.get(e);if(a)var o=a.get(null);else{a=new Map,us.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var b=u[f];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(a.set(b.dataset.precedence,b),o=b)}o&&a.set(null,o)}u=t.instance,b=u.getAttribute("data-precedence"),f=a.get(b)||o,f===o&&a.set(null,u),a.set(b,u),this.count++,o=cs.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var jo={$$typeof:z,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function X1(e,t,a,o,u,f,b,S,j){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=ya(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ya(0),this.hiddenUpdates=ya(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function qg(e,t,a,o,u,f,b,S,j,I,W,te){return e=new X1(e,t,a,b,j,I,W,te,S),t=1,f===!0&&(t|=24),f=Wt(3,null,null,t),e.current=f,f.stateNode=e,t=au(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:o,isDehydrated:a,cache:t},iu(f),e}function Gg(e){return e?(e=Xl,e):Xl}function $g(e,t,a,o,u,f){u=Gg(u),o.context===null?o.context=u:o.pendingContext=u,o=Ra(t),o.payload={element:a},f=f===void 0?null:f,f!==null&&(o.callback=f),a=Aa(e,o,t),a!==null&&(Ft(a,e,t),io(a,e,t))}function Xg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Rf(e,t){Xg(e,t),(e=e.alternate)&&Xg(e,t)}function Fg(e){if(e.tag===13||e.tag===31){var t=cl(e,67108864);t!==null&&Ft(t,e,67108864),Rf(e,67108864)}}function Kg(e){if(e.tag===13||e.tag===31){var t=an();t=Ml(t);var a=cl(e,t);a!==null&&Ft(a,e,t),Rf(e,t)}}var ds=!0;function F1(e,t,a,o){var u=D.T;D.T=null;var f=$.p;try{$.p=2,Af(e,t,a,o)}finally{$.p=f,D.T=u}}function K1(e,t,a,o){var u=D.T;D.T=null;var f=$.p;try{$.p=8,Af(e,t,a,o)}finally{$.p=f,D.T=u}}function Af(e,t,a,o){if(ds){var u=Nf(o);if(u===null)hf(e,t,o,hs,a),Zg(e,o);else if(Z1(u,e,t,a,o))o.stopPropagation();else if(Zg(e,o),t&4&&-1<Q1.indexOf(e)){for(;u!==null;){var f=kl(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=Mn(f.pendingLanes);if(b!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;b;){var j=1<<31-Dt(b);S.entanglements[1]|=j,b&=~j}Un(f),(Ie&6)===0&&(Ki=at()+500,Eo(0))}}break;case 31:case 13:S=cl(f,2),S!==null&&Ft(S,f,2),Zi(),Rf(f,2)}if(f=Nf(o),f===null&&hf(e,t,o,hs,a),f===u)break;u=f}u!==null&&o.stopPropagation()}else hf(e,t,o,null,a)}}function Nf(e){return e=Oc(e),Of(e)}var hs=null;function Of(e){if(hs=null,e=Ll(e),e!==null){var t=c(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=d(t),e!==null)return e;e=null}else if(a===31){if(e=h(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return hs=e,null}function Qg(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(jl()){case Fn:return 2;case ri:return 8;case tl:case Ir:return 32;case Kn:return 268435456;default:return 32}default:return 32}}var jf=!1,Ha=null,Ba=null,Pa=null,Do=new Map,_o=new Map,Va=[],Q1="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 Zg(e,t){switch(e){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":Ba=null;break;case"mouseover":case"mouseout":Pa=null;break;case"pointerover":case"pointerout":Do.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_o.delete(t.pointerId)}}function Mo(e,t,a,o,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:a,eventSystemFlags:o,nativeEvent:f,targetContainers:[u]},t!==null&&(t=kl(t),t!==null&&Fg(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function Z1(e,t,a,o,u){switch(t){case"focusin":return Ha=Mo(Ha,e,t,a,o,u),!0;case"dragenter":return Ba=Mo(Ba,e,t,a,o,u),!0;case"mouseover":return Pa=Mo(Pa,e,t,a,o,u),!0;case"pointerover":var f=u.pointerId;return Do.set(f,Mo(Do.get(f)||null,e,t,a,o,u)),!0;case"gotpointercapture":return f=u.pointerId,_o.set(f,Mo(_o.get(f)||null,e,t,a,o,u)),!0}return!1}function Wg(e){var t=Ll(e.target);if(t!==null){var a=c(t);if(a!==null){if(t=a.tag,t===13){if(t=d(a),t!==null){e.blockedOn=t,dh(e.priority,function(){Kg(a)});return}}else if(t===31){if(t=h(a),t!==null){e.blockedOn=t,dh(e.priority,function(){Kg(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ps(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Nf(e.nativeEvent);if(a===null){a=e.nativeEvent;var o=new a.constructor(a.type,a);Nc=o,a.target.dispatchEvent(o),Nc=null}else return t=kl(a),t!==null&&Fg(t),e.blockedOn=a,!1;t.shift()}return!0}function Jg(e,t,a){ps(e)&&a.delete(t)}function W1(){jf=!1,Ha!==null&&ps(Ha)&&(Ha=null),Ba!==null&&ps(Ba)&&(Ba=null),Pa!==null&&ps(Pa)&&(Pa=null),Do.forEach(Jg),_o.forEach(Jg)}function ms(e,t){e.blockedOn===t&&(e.blockedOn=null,jf||(jf=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,W1)))}var gs=null;function ev(e){gs!==e&&(gs=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){gs===e&&(gs=null);for(var t=0;t<e.length;t+=3){var a=e[t],o=e[t+1],u=e[t+2];if(typeof o!="function"){if(Of(o||a)===null)continue;break}var f=kl(a);f!==null&&(e.splice(t,3),t-=3,Au(f,{pending:!0,data:u,method:a.method,action:o},o,u))}}))}function vr(e){function t(j){return ms(j,e)}Ha!==null&&ms(Ha,e),Ba!==null&&ms(Ba,e),Pa!==null&&ms(Pa,e),Do.forEach(t),_o.forEach(t);for(var a=0;a<Va.length;a++){var o=Va[a];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Va.length&&(a=Va[0],a.blockedOn===null);)Wg(a),a.blockedOn===null&&Va.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var u=a[o],f=a[o+1],b=u[It]||null;if(typeof f=="function")b||ev(a);else if(b){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,b=f[It]||null)S=b.formAction;else if(Of(u)!==null)continue}else S=b.action;typeof S=="function"?a[o+1]=S:(a.splice(o,3),o-=3),ev(a)}}}function tv(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(b){return u=b})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Df(e){this._internalRoot=e}vs.prototype.render=Df.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,o=an();$g(a,o,e,t,null,null)},vs.prototype.unmount=Df.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$g(e.current,2,null,e,null,null),Zi(),t[zl]=null}};function vs(e){this._internalRoot=e}vs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Sc();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Va.length&&t!==0&&t<Va[a].priority;a++);Va.splice(a,0,e),a===0&&Wg(e)}};var nv=l.version;if(nv!=="19.2.3")throw Error(i(527,nv,"19.2.3"));$.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=m(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var J1={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ys=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ys.isDisabled&&ys.supportsFiber)try{nl=ys.inject(J1),zt=ys}catch{}}return Lo.createRoot=function(e,t){if(!s(e))throw Error(i(299));var a=!1,o="",u=cm,f=um,b=fm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=qg(e,1,!1,null,null,a,o,null,u,f,b,tv),e[zl]=t.current,df(e),new Df(t)},Lo.hydrateRoot=function(e,t,a){if(!s(e))throw Error(i(299));var o=!1,u="",f=cm,b=um,S=fm,j=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(S=a.onRecoverableError),a.formState!==void 0&&(j=a.formState)),t=qg(e,1,!0,t,a??null,o,u,j,f,b,S,tv),t.context=Gg(null),a=t.current,o=an(),o=Ml(o),u=Ra(o),u.callback=null,Aa(a,u,o),a=o,t.current.lanes=a,lt(t,a),Un(t),e[zl]=t.current,df(e),new vs(t)},Lo.version="19.2.3",Lo}var dv;function cw(){if(dv)return zf.exports;dv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),zf.exports=sw(),zf.exports}var uw=cw();const Te=n=>typeof n=="string",ko=()=>{let n,l;const r=new Promise((i,s)=>{n=i,l=s});return r.resolve=n,r.reject=l,r},hv=n=>n==null?"":""+n,fw=(n,l,r)=>{n.forEach(i=>{l[i]&&(r[i]=l[i])})},dw=/###/g,pv=n=>n&&n.indexOf("###")>-1?n.replace(dw,"."):n,mv=n=>!n||Te(n),Yo=(n,l,r)=>{const i=Te(l)?l.split("."):l;let s=0;for(;s<i.length-1;){if(mv(n))return{};const c=pv(i[s]);!n[c]&&r&&(n[c]=new r),Object.prototype.hasOwnProperty.call(n,c)?n=n[c]:n={},++s}return mv(n)?{}:{obj:n,k:pv(i[s])}},gv=(n,l,r)=>{const{obj:i,k:s}=Yo(n,l,Object);if(i!==void 0||l.length===1){i[s]=r;return}let c=l[l.length-1],d=l.slice(0,l.length-1),h=Yo(n,d,Object);for(;h.obj===void 0&&d.length;)c=`${d[d.length-1]}.${c}`,d=d.slice(0,d.length-1),h=Yo(n,d,Object),h?.obj&&typeof h.obj[`${h.k}.${c}`]<"u"&&(h.obj=void 0);h.obj[`${h.k}.${c}`]=r},hw=(n,l,r,i)=>{const{obj:s,k:c}=Yo(n,l,Object);s[c]=s[c]||[],s[c].push(r)},Ls=(n,l)=>{const{obj:r,k:i}=Yo(n,l);if(r&&Object.prototype.hasOwnProperty.call(r,i))return r[i]},pw=(n,l,r)=>{const i=Ls(n,r);return i!==void 0?i:Ls(l,r)},_y=(n,l,r)=>{for(const i in l)i!=="__proto__"&&i!=="constructor"&&(i in n?Te(n[i])||n[i]instanceof String||Te(l[i])||l[i]instanceof String?r&&(n[i]=l[i]):_y(n[i],l[i],r):n[i]=l[i]);return n},yr=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var mw={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const gw=n=>Te(n)?n.replace(/[&<>"'\/]/g,l=>mw[l]):n;class vw{constructor(l){this.capacity=l,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(l){const r=this.regExpMap.get(l);if(r!==void 0)return r;const i=new RegExp(l);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(l,i),this.regExpQueue.push(l),i}}const yw=[" ",",","?","!",";"],bw=new vw(20),xw=(n,l,r)=>{l=l||"",r=r||"";const i=yw.filter(d=>l.indexOf(d)<0&&r.indexOf(d)<0);if(i.length===0)return!0;const s=bw.getRegExp(`(${i.map(d=>d==="?"?"\\?":d).join("|")})`);let c=!s.test(n);if(!c){const d=n.indexOf(r);d>0&&!s.test(n.substring(0,d))&&(c=!0)}return c},ld=(n,l,r=".")=>{if(!n)return;if(n[l])return Object.prototype.hasOwnProperty.call(n,l)?n[l]:void 0;const i=l.split(r);let s=n;for(let c=0;c<i.length;){if(!s||typeof s!="object")return;let d,h="";for(let p=c;p<i.length;++p)if(p!==c&&(h+=r),h+=i[p],d=s[h],d!==void 0){if(["string","number","boolean"].indexOf(typeof d)>-1&&p<i.length-1)continue;c+=p-c+1;break}s=d}return s},$o=n=>n?.replace("_","-"),Sw={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,l){console?.[n]?.apply?.(console,l)}};class ks{constructor(l,r={}){this.init(l,r)}init(l,r={}){this.prefix=r.prefix||"i18next:",this.logger=l||Sw,this.options=r,this.debug=r.debug}log(...l){return this.forward(l,"log","",!0)}warn(...l){return this.forward(l,"warn","",!0)}error(...l){return this.forward(l,"error","")}deprecate(...l){return this.forward(l,"warn","WARNING DEPRECATED: ",!0)}forward(l,r,i,s){return s&&!this.debug?null:(Te(l[0])&&(l[0]=`${i}${this.prefix} ${l[0]}`),this.logger[r](l))}create(l){return new ks(this.logger,{prefix:`${this.prefix}:${l}:`,...this.options})}clone(l){return l=l||this.options,l.prefix=l.prefix||this.prefix,new ks(this.logger,l)}}var Pn=new ks;class Ws{constructor(){this.observers={}}on(l,r){return l.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const s=this.observers[i].get(r)||0;this.observers[i].set(r,s+1)}),this}off(l,r){if(this.observers[l]){if(!r){delete this.observers[l];return}this.observers[l].delete(r)}}emit(l,...r){this.observers[l]&&Array.from(this.observers[l].entries()).forEach(([s,c])=>{for(let d=0;d<c;d++)s(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,c])=>{for(let d=0;d<c;d++)s.apply(s,[l,...r])})}}class vv extends Ws{constructor(l,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=l||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(l){this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}removeNamespaces(l){const r=this.options.ns.indexOf(l);r>-1&&this.options.ns.splice(r,1)}getResource(l,r,i,s={}){const c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,d=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let h;l.indexOf(".")>-1?h=l.split("."):(h=[l,r],i&&(Array.isArray(i)?h.push(...i):Te(i)&&c?h.push(...i.split(c)):h.push(i)));const p=Ls(this.data,h);return!p&&!r&&!i&&l.indexOf(".")>-1&&(l=h[0],r=h[1],i=h.slice(2).join(".")),p||!d||!Te(i)?p:ld(this.data?.[l]?.[r],i,c)}addResource(l,r,i,s,c={silent:!1}){const d=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator;let h=[l,r];i&&(h=h.concat(d?i.split(d):i)),l.indexOf(".")>-1&&(h=l.split("."),s=r,r=h[1]),this.addNamespaces(r),gv(this.data,h,s),c.silent||this.emit("added",l,r,i,s)}addResources(l,r,i,s={silent:!1}){for(const c in i)(Te(i[c])||Array.isArray(i[c]))&&this.addResource(l,r,c,i[c],{silent:!0});s.silent||this.emit("added",l,r,i)}addResourceBundle(l,r,i,s,c,d={silent:!1,skipCopy:!1}){let h=[l,r];l.indexOf(".")>-1&&(h=l.split("."),s=i,i=r,r=h[1]),this.addNamespaces(r);let p=Ls(this.data,h)||{};d.skipCopy||(i=JSON.parse(JSON.stringify(i))),s?_y(p,i,c):p={...p,...i},gv(this.data,h,p),d.silent||this.emit("added",l,r,i)}removeResourceBundle(l,r){this.hasResourceBundle(l,r)&&delete this.data[l][r],this.removeNamespaces(r),this.emit("removed",l,r)}hasResourceBundle(l,r){return this.getResource(l,r)!==void 0}getResourceBundle(l,r){return r||(r=this.options.defaultNS),this.getResource(l,r)}getDataByLanguage(l){return this.data[l]}hasLanguageSomeTranslations(l){const r=this.getDataByLanguage(l);return!!(r&&Object.keys(r)||[]).find(s=>r[s]&&Object.keys(r[s]).length>0)}toJSON(){return this.data}}var My={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,l,r,i,s){return n.forEach(c=>{l=this.processors[c]?.process(l,r,i,s)??l}),l}};const zy=Symbol("i18next/PATH_KEY");function ww(){const n=[],l=Object.create(null);let r;return l.get=(i,s)=>(r?.revoke?.(),s===zy?n:(n.push(s),r=Proxy.revocable(i,l),r.proxy)),Proxy.revocable(Object.create(null),l).proxy}function rd(n,l){const{[zy]:r}=n(ww());return r.join(l?.keySeparator??".")}const yv={},Hf=n=>!Te(n)&&typeof n!="boolean"&&typeof n!="number";class Us extends Ws{constructor(l,r={}){super(),fw(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],l,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Pn.create("translator")}changeLanguage(l){l&&(this.language=l)}exists(l,r={interpolation:{}}){const i={...r};if(l==null)return!1;const s=this.resolve(l,i);if(s?.res===void 0)return!1;const c=Hf(s.res);return!(i.returnObjects===!1&&c)}extractFromKey(l,r){let i=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let c=r.ns||this.options.defaultNS||[];const d=i&&l.indexOf(i)>-1,h=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!xw(l,i,s);if(d&&!h){const p=l.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:l,namespaces:Te(c)?[c]:c};const m=l.split(i);(i!==s||i===s&&this.options.ns.indexOf(m[0])>-1)&&(c=m.shift()),l=m.join(s)}return{key:l,namespaces:Te(c)?[c]:c}}translate(l,r,i){let s=typeof r=="object"?{...r}:r;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),l==null)return"";typeof l=="function"&&(l=rd(l,{...this.options,...s})),Array.isArray(l)||(l=[String(l)]);const c=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,d=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:h,namespaces:p}=this.extractFromKey(l[l.length-1],s),m=p[p.length-1];let x=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;x===void 0&&(x=":");const v=s.lng||this.language,w=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(v?.toLowerCase()==="cimode")return w?c?{res:`${m}${x}${h}`,usedKey:h,exactUsedKey:h,usedLng:v,usedNS:m,usedParams:this.getUsedParamsDetails(s)}:`${m}${x}${h}`:c?{res:h,usedKey:h,exactUsedKey:h,usedLng:v,usedNS:m,usedParams:this.getUsedParamsDetails(s)}:h;const C=this.resolve(l,s);let T=C?.res;const E=C?.usedKey||h,R=C?.exactUsedKey||h,N=["[object Number]","[object Function]","[object RegExp]"],M=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,z=!this.i18nFormat||this.i18nFormat.handleAsObject,P=s.count!==void 0&&!Te(s.count),G=Us.hasDefaultValue(s),k=P?this.pluralResolver.getSuffix(v,s.count,s):"",L=s.ordinal&&P?this.pluralResolver.getSuffix(v,s.count,{ordinal:!1}):"",Y=P&&!s.ordinal&&s.count===0,J=Y&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${k}`]||s[`defaultValue${L}`]||s.defaultValue;let ne=T;z&&!T&&G&&(ne=J);const re=Hf(ne),K=Object.prototype.toString.apply(ne);if(z&&ne&&re&&N.indexOf(K)<0&&!(Te(M)&&Array.isArray(ne))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ie=this.options.returnedObjectHandler?this.options.returnedObjectHandler(E,ne,{...s,ns:p}):`key '${h} (${this.language})' returned an object instead of string.`;return c?(C.res=ie,C.usedParams=this.getUsedParamsDetails(s),C):ie}if(d){const ie=Array.isArray(ne),ce=ie?[]:{},he=ie?R:E;for(const D in ne)if(Object.prototype.hasOwnProperty.call(ne,D)){const $=`${he}${d}${D}`;G&&!T?ce[D]=this.translate($,{...s,defaultValue:Hf(J)?J[D]:void 0,joinArrays:!1,ns:p}):ce[D]=this.translate($,{...s,joinArrays:!1,ns:p}),ce[D]===$&&(ce[D]=ne[D])}T=ce}}else if(z&&Te(M)&&Array.isArray(T))T=T.join(M),T&&(T=this.extendTranslation(T,l,s,i));else{let ie=!1,ce=!1;!this.isValidLookup(T)&&G&&(ie=!0,T=J),this.isValidLookup(T)||(ce=!0,T=h);const D=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ce?void 0:T,$=G&&J!==T&&this.options.updateMissing;if(ce||ie||$){if(this.logger.log($?"updateKey":"missingKey",v,m,h,$?J:T),d){const A=this.resolve(h,{...s,keySeparator:!1});A&&A.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let B=[];const ue=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ue&&ue[0])for(let A=0;A<ue.length;A++)B.push(ue[A]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(s.lng||this.language):B.push(s.lng||this.language);const de=(A,O,U)=>{const X=G&&U!==T?U:D;this.options.missingKeyHandler?this.options.missingKeyHandler(A,m,O,X,$,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(A,m,O,X,$,s),this.emit("missingKey",A,m,O,T)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?B.forEach(A=>{const O=this.pluralResolver.getSuffixes(A,s);Y&&s[`defaultValue${this.options.pluralSeparator}zero`]&&O.indexOf(`${this.options.pluralSeparator}zero`)<0&&O.push(`${this.options.pluralSeparator}zero`),O.forEach(U=>{de([A],h+U,s[`defaultValue${U}`]||J)})}):de(B,h,J))}T=this.extendTranslation(T,l,s,C,i),ce&&T===h&&this.options.appendNamespaceToMissingKey&&(T=`${m}${x}${h}`),(ce||ie)&&this.options.parseMissingKeyHandler&&(T=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${m}${x}${h}`:h,ie?T:void 0,s))}return c?(C.res=T,C.usedParams=this.getUsedParamsDetails(s),C):T}extendTranslation(l,r,i,s,c){if(this.i18nFormat?.parse)l=this.i18nFormat.parse(l,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const p=Te(l)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(p){const v=l.match(this.interpolator.nestingRegexp);m=v&&v.length}let x=i.replace&&!Te(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(x={...this.options.interpolation.defaultVariables,...x}),l=this.interpolator.interpolate(l,x,i.lng||this.language||s.usedLng,i),p){const v=l.match(this.interpolator.nestingRegexp),w=v&&v.length;m<w&&(i.nest=!1)}!i.lng&&s&&s.res&&(i.lng=this.language||s.usedLng),i.nest!==!1&&(l=this.interpolator.nest(l,(...v)=>c?.[0]===v[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${r[0]}`),null):this.translate(...v,r),i)),i.interpolation&&this.interpolator.reset()}const d=i.postProcess||this.options.postProcess,h=Te(d)?[d]:d;return l!=null&&h?.length&&i.applyPostProcessor!==!1&&(l=My.handle(h,l,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),l}resolve(l,r={}){let i,s,c,d,h;return Te(l)&&(l=[l]),l.forEach(p=>{if(this.isValidLookup(i))return;const m=this.extractFromKey(p,r),x=m.key;s=x;let v=m.namespaces;this.options.fallbackNS&&(v=v.concat(this.options.fallbackNS));const w=r.count!==void 0&&!Te(r.count),C=w&&!r.ordinal&&r.count===0,T=r.context!==void 0&&(Te(r.context)||typeof r.context=="number")&&r.context!=="",E=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);v.forEach(R=>{this.isValidLookup(i)||(h=R,!yv[`${E[0]}-${R}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(h)&&(yv[`${E[0]}-${R}`]=!0,this.logger.warn(`key "${s}" for languages "${E.join(", ")}" won't get resolved as namespace "${h}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach(N=>{if(this.isValidLookup(i))return;d=N;const M=[x];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(M,x,N,R,r);else{let P;w&&(P=this.pluralResolver.getSuffix(N,r.count,r));const G=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(w&&(r.ordinal&&P.indexOf(k)===0&&M.push(x+P.replace(k,this.options.pluralSeparator)),M.push(x+P),C&&M.push(x+G)),T){const L=`${x}${this.options.contextSeparator||"_"}${r.context}`;M.push(L),w&&(r.ordinal&&P.indexOf(k)===0&&M.push(L+P.replace(k,this.options.pluralSeparator)),M.push(L+P),C&&M.push(L+G))}}let z;for(;z=M.pop();)this.isValidLookup(i)||(c=z,i=this.getResource(N,R,z,r))}))})}),{res:i,usedKey:s,exactUsedKey:c,usedLng:d,usedNS:h}}isValidLookup(l){return l!==void 0&&!(!this.options.returnNull&&l===null)&&!(!this.options.returnEmptyString&&l==="")}getResource(l,r,i,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(l,r,i,s):this.resourceStore.getResource(l,r,i,s)}getUsedParamsDetails(l={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=l.replace&&!Te(l.replace);let s=i?l.replace:l;if(i&&typeof l.count<"u"&&(s.count=l.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!i){s={...s};for(const c of r)delete s[c]}return s}static hasDefaultValue(l){const r="defaultValue";for(const i in l)if(Object.prototype.hasOwnProperty.call(l,i)&&r===i.substring(0,r.length)&&l[i]!==void 0)return!0;return!1}}class bv{constructor(l){this.options=l,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Pn.create("languageUtils")}getScriptPartFromCode(l){if(l=$o(l),!l||l.indexOf("-")<0)return null;const r=l.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(l){if(l=$o(l),!l||l.indexOf("-")<0)return l;const r=l.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(l){if(Te(l)&&l.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(l)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?l.toLowerCase():l)}return this.options.cleanCode||this.options.lowerCaseLng?l.toLowerCase():l}isSupportedCode(l){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(l=this.getLanguagePartFromCode(l)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(l)>-1}getBestMatchFromCodes(l){if(!l)return null;let r;return l.forEach(i=>{if(r)return;const s=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(s))&&(r=s)}),!r&&this.options.supportedLngs&&l.forEach(i=>{if(r)return;const s=this.getScriptPartFromCode(i);if(this.isSupportedCode(s))return r=s;const c=this.getLanguagePartFromCode(i);if(this.isSupportedCode(c))return r=c;r=this.options.supportedLngs.find(d=>{if(d===c)return d;if(!(d.indexOf("-")<0&&c.indexOf("-")<0)&&(d.indexOf("-")>0&&c.indexOf("-")<0&&d.substring(0,d.indexOf("-"))===c||d.indexOf(c)===0&&c.length>1))return d})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(l,r){if(!l)return[];if(typeof l=="function"&&(l=l(r)),Te(l)&&(l=[l]),Array.isArray(l))return l;if(!r)return l.default||[];let i=l[r];return i||(i=l[this.getScriptPartFromCode(r)]),i||(i=l[this.formatLanguageCode(r)]),i||(i=l[this.getLanguagePartFromCode(r)]),i||(i=l.default),i||[]}toResolveHierarchy(l,r){const i=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],l),s=[],c=d=>{d&&(this.isSupportedCode(d)?s.push(d):this.logger.warn(`rejecting language code not found in supportedLngs: ${d}`))};return Te(l)&&(l.indexOf("-")>-1||l.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&c(this.formatLanguageCode(l)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&c(this.getScriptPartFromCode(l)),this.options.load!=="currentOnly"&&c(this.getLanguagePartFromCode(l))):Te(l)&&c(this.formatLanguageCode(l)),i.forEach(d=>{s.indexOf(d)<0&&c(this.formatLanguageCode(d))}),s}}const xv={zero:0,one:1,two:2,few:3,many:4,other:5},Sv={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Cw{constructor(l,r={}){this.languageUtils=l,this.options=r,this.logger=Pn.create("pluralResolver"),this.pluralRulesCache={}}addRule(l,r){this.rules[l]=r}clearCache(){this.pluralRulesCache={}}getRule(l,r={}){const i=$o(l==="dev"?"en":l),s=r.ordinal?"ordinal":"cardinal",c=JSON.stringify({cleanedCode:i,type:s});if(c in this.pluralRulesCache)return this.pluralRulesCache[c];let d;try{d=new Intl.PluralRules(i,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Sv;if(!l.match(/-|_/))return Sv;const p=this.languageUtils.getLanguagePartFromCode(l);d=this.getRule(p,r)}return this.pluralRulesCache[c]=d,d}needsPlural(l,r={}){let i=this.getRule(l,r);return i||(i=this.getRule("dev",r)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(l,r,i={}){return this.getSuffixes(l,i).map(s=>`${r}${s}`)}getSuffixes(l,r={}){let i=this.getRule(l,r);return i||(i=this.getRule("dev",r)),i?i.resolvedOptions().pluralCategories.sort((s,c)=>xv[s]-xv[c]).map(s=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(l,r,i={}){const s=this.getRule(l,i);return s?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${s.select(r)}`:(this.logger.warn(`no plural rule found for: ${l}`),this.getSuffix("dev",r,i))}}const wv=(n,l,r,i=".",s=!0)=>{let c=pw(n,l,r);return!c&&s&&Te(r)&&(c=ld(n,r,i),c===void 0&&(c=ld(l,r,i))),c},Bf=n=>n.replace(/\$/g,"$$$$");class Cv{constructor(l={}){this.logger=Pn.create("interpolator"),this.options=l,this.format=l?.interpolation?.format||(r=>r),this.init(l)}init(l={}){l.interpolation||(l.interpolation={escapeValue:!0});const{escape:r,escapeValue:i,useRawValueToEscape:s,prefix:c,prefixEscaped:d,suffix:h,suffixEscaped:p,formatSeparator:m,unescapeSuffix:x,unescapePrefix:v,nestingPrefix:w,nestingPrefixEscaped:C,nestingSuffix:T,nestingSuffixEscaped:E,nestingOptionsSeparator:R,maxReplaces:N,alwaysFormat:M}=l.interpolation;this.escape=r!==void 0?r:gw,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=c?yr(c):d||"{{",this.suffix=h?yr(h):p||"}}",this.formatSeparator=m||",",this.unescapePrefix=x?"":v||"-",this.unescapeSuffix=this.unescapePrefix?"":x||"",this.nestingPrefix=w?yr(w):C||yr("$t("),this.nestingSuffix=T?yr(T):E||yr(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=N||1e3,this.alwaysFormat=M!==void 0?M:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const l=(r,i)=>r?.source===i?(r.lastIndex=0,r):new RegExp(i,"g");this.regexp=l(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=l(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=l(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(l,r,i,s){let c,d,h;const p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},m=C=>{if(C.indexOf(this.formatSeparator)<0){const N=wv(r,p,C,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(N,void 0,i,{...s,...r,interpolationkey:C}):N}const T=C.split(this.formatSeparator),E=T.shift().trim(),R=T.join(this.formatSeparator).trim();return this.format(wv(r,p,E,this.options.keySeparator,this.options.ignoreJSONStructure),R,i,{...s,...r,interpolationkey:E})};this.resetRegExp();const x=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,v=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:C=>Bf(C)},{regex:this.regexp,safeValue:C=>this.escapeValue?Bf(this.escape(C)):Bf(C)}].forEach(C=>{for(h=0;c=C.regex.exec(l);){const T=c[1].trim();if(d=m(T),d===void 0)if(typeof x=="function"){const R=x(l,c,s);d=Te(R)?R:""}else if(s&&Object.prototype.hasOwnProperty.call(s,T))d="";else if(v){d=c[0];continue}else this.logger.warn(`missed to pass in variable ${T} for interpolating ${l}`),d="";else!Te(d)&&!this.useRawValueToEscape&&(d=hv(d));const E=C.safeValue(d);if(l=l.replace(c[0],E),v?(C.regex.lastIndex+=d.length,C.regex.lastIndex-=c[0].length):C.regex.lastIndex=0,h++,h>=this.maxReplaces)break}}),l}nest(l,r,i={}){let s,c,d;const h=(p,m)=>{const x=this.nestingOptionsSeparator;if(p.indexOf(x)<0)return p;const v=p.split(new RegExp(`${x}[ ]*{`));let w=`{${v[1]}`;p=v[0],w=this.interpolate(w,d);const C=w.match(/'/g),T=w.match(/"/g);((C?.length??0)%2===0&&!T||T.length%2!==0)&&(w=w.replace(/'/g,'"'));try{d=JSON.parse(w),m&&(d={...m,...d})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,E),`${p}${x}${w}`}return d.defaultValue&&d.defaultValue.indexOf(this.prefix)>-1&&delete d.defaultValue,p};for(;s=this.nestingRegexp.exec(l);){let p=[];d={...i},d=d.replace&&!Te(d.replace)?d.replace:d,d.applyPostProcessor=!1,delete d.defaultValue;const m=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(m!==-1&&(p=s[1].slice(m).split(this.formatSeparator).map(x=>x.trim()).filter(Boolean),s[1]=s[1].slice(0,m)),c=r(h.call(this,s[1].trim(),d),d),c&&s[0]===l&&!Te(c))return c;Te(c)||(c=hv(c)),c||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${l}`),c=""),p.length&&(c=p.reduce((x,v)=>this.format(x,v,i.lng,{...i,interpolationkey:s[1].trim()}),c.trim())),l=l.replace(s[0],c),this.regexp.lastIndex=0}return l}}const Ew=n=>{let l=n.toLowerCase().trim();const r={};if(n.indexOf("(")>-1){const i=n.split("(");l=i[0].toLowerCase().trim();const s=i[1].substring(0,i[1].length-1);l==="currency"&&s.indexOf(":")<0?r.currency||(r.currency=s.trim()):l==="relativetime"&&s.indexOf(":")<0?r.range||(r.range=s.trim()):s.split(";").forEach(d=>{if(d){const[h,...p]=d.split(":"),m=p.join(":").trim().replace(/^'+|'+$/g,""),x=h.trim();r[x]||(r[x]=m),m==="false"&&(r[x]=!1),m==="true"&&(r[x]=!0),isNaN(m)||(r[x]=parseInt(m,10))}})}return{formatName:l,formatOptions:r}},Ev=n=>{const l={};return(r,i,s)=>{let c=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(c={...c,[s.interpolationkey]:void 0});const d=i+JSON.stringify(c);let h=l[d];return h||(h=n($o(i),s),l[d]=h),h(r)}},Tw=n=>(l,r,i)=>n($o(r),i)(l);class Rw{constructor(l={}){this.logger=Pn.create("formatter"),this.options=l,this.init(l)}init(l,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const i=r.cacheInBuiltFormats?Ev:Tw;this.formats={number:i((s,c)=>{const d=new Intl.NumberFormat(s,{...c});return h=>d.format(h)}),currency:i((s,c)=>{const d=new Intl.NumberFormat(s,{...c,style:"currency"});return h=>d.format(h)}),datetime:i((s,c)=>{const d=new Intl.DateTimeFormat(s,{...c});return h=>d.format(h)}),relativetime:i((s,c)=>{const d=new Intl.RelativeTimeFormat(s,{...c});return h=>d.format(h,c.range||"day")}),list:i((s,c)=>{const d=new Intl.ListFormat(s,{...c});return h=>d.format(h)})}}add(l,r){this.formats[l.toLowerCase().trim()]=r}addCached(l,r){this.formats[l.toLowerCase().trim()]=Ev(r)}format(l,r,i,s={}){const c=r.split(this.formatSeparator);if(c.length>1&&c[0].indexOf("(")>1&&c[0].indexOf(")")<0&&c.find(h=>h.indexOf(")")>-1)){const h=c.findIndex(p=>p.indexOf(")")>-1);c[0]=[c[0],...c.splice(1,h)].join(this.formatSeparator)}return c.reduce((h,p)=>{const{formatName:m,formatOptions:x}=Ew(p);if(this.formats[m]){let v=h;try{const w=s?.formatParams?.[s.interpolationkey]||{},C=w.locale||w.lng||s.locale||s.lng||i;v=this.formats[m](h,C,{...x,...s,...w})}catch(w){this.logger.warn(w)}return v}else this.logger.warn(`there was no format function for ${m}`);return h},l)}}const Aw=(n,l)=>{n.pending[l]!==void 0&&(delete n.pending[l],n.pendingCount--)};class Nw extends Ws{constructor(l,r,i,s={}){super(),this.backend=l,this.store=r,this.services=i,this.languageUtils=i.languageUtils,this.options=s,this.logger=Pn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,s.backend,s)}queueLoad(l,r,i,s){const c={},d={},h={},p={};return l.forEach(m=>{let x=!0;r.forEach(v=>{const w=`${m}|${v}`;!i.reload&&this.store.hasResourceBundle(m,v)?this.state[w]=2:this.state[w]<0||(this.state[w]===1?d[w]===void 0&&(d[w]=!0):(this.state[w]=1,x=!1,d[w]===void 0&&(d[w]=!0),c[w]===void 0&&(c[w]=!0),p[v]===void 0&&(p[v]=!0)))}),x||(h[m]=!0)}),(Object.keys(c).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(c),pending:Object.keys(d),toLoadLanguages:Object.keys(h),toLoadNamespaces:Object.keys(p)}}loaded(l,r,i){const s=l.split("|"),c=s[0],d=s[1];r&&this.emit("failedLoading",c,d,r),!r&&i&&this.store.addResourceBundle(c,d,i,void 0,void 0,{skipCopy:!0}),this.state[l]=r?-1:2,r&&i&&(this.state[l]=0);const h={};this.queue.forEach(p=>{hw(p.loaded,[c],d),Aw(p,l),r&&p.errors.push(r),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(m=>{h[m]||(h[m]={});const x=p.loaded[m];x.length&&x.forEach(v=>{h[m][v]===void 0&&(h[m][v]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",h),this.queue=this.queue.filter(p=>!p.done)}read(l,r,i,s=0,c=this.retryTimeout,d){if(!l.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:l,ns:r,fcName:i,tried:s,wait:c,callback:d});return}this.readingCalls++;const h=(m,x)=>{if(this.readingCalls--,this.waitingReads.length>0){const v=this.waitingReads.shift();this.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(m&&x&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,l,r,i,s+1,c*2,d)},c);return}d(m,x)},p=this.backend[i].bind(this.backend);if(p.length===2){try{const m=p(l,r);m&&typeof m.then=="function"?m.then(x=>h(null,x)).catch(h):h(null,m)}catch(m){h(m)}return}return p(l,r,h)}prepareLoading(l,r,i={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Te(l)&&(l=this.languageUtils.toResolveHierarchy(l)),Te(r)&&(r=[r]);const c=this.queueLoad(l,r,i,s);if(!c.toLoad.length)return c.pending.length||s(),null;c.toLoad.forEach(d=>{this.loadOne(d)})}load(l,r,i){this.prepareLoading(l,r,{},i)}reload(l,r,i){this.prepareLoading(l,r,{reload:!0},i)}loadOne(l,r=""){const i=l.split("|"),s=i[0],c=i[1];this.read(s,c,"read",void 0,void 0,(d,h)=>{d&&this.logger.warn(`${r}loading namespace ${c} for language ${s} failed`,d),!d&&h&&this.logger.log(`${r}loaded namespace ${c} for language ${s}`,h),this.loaded(l,d,h)})}saveMissing(l,r,i,s,c,d={},h=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${i}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend?.create){const p={...d,isUpdate:c},m=this.backend.create.bind(this.backend);if(m.length<6)try{let x;m.length===5?x=m(l,r,i,s,p):x=m(l,r,i,s),x&&typeof x.then=="function"?x.then(v=>h(null,v)).catch(h):h(null,x)}catch(x){h(x)}else m(l,r,i,s,h,p)}!l||!l[0]||this.store.addResource(l[0],r,i,s)}}}const Tv=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let l={};if(typeof n[1]=="object"&&(l=n[1]),Te(n[1])&&(l.defaultValue=n[1]),Te(n[2])&&(l.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const r=n[3]||n[2];Object.keys(r).forEach(i=>{l[i]=r[i]})}return l},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Rv=n=>(Te(n.ns)&&(n.ns=[n.ns]),Te(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),Te(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),bs=()=>{},Ow=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(r=>{typeof n[r]=="function"&&(n[r]=n[r].bind(n))})};class qo extends Ws{constructor(l={},r){if(super(),this.options=Rv(l),this.services={},this.logger=Pn,this.modules={external:[]},Ow(this),r&&!this.isInitialized&&!l.isClone){if(!this.options.initAsync)return this.init(l,r),this;setTimeout(()=>{this.init(l,r)},0)}}init(l={},r){this.isInitializing=!0,typeof l=="function"&&(r=l,l={}),l.defaultNS==null&&l.ns&&(Te(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const i=Tv();this.options={...i,...this.options,...Rv(l)},this.options.interpolation={...i.interpolation,...this.options.interpolation},l.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=l.keySeparator),l.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=l.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const s=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?Pn.init(s(this.modules.logger),this.options):Pn.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:m=Rw;const x=new bv(this.options);this.store=new vv(this.options.resources,this.options);const v=this.services;v.logger=Pn,v.resourceStore=this.store,v.languageUtils=x,v.pluralResolver=new Cw(x,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),m&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(v.formatter=s(m),v.formatter.init&&v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new Cv(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new Nw(s(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",(C,...T)=>{this.emit(C,...T)}),this.modules.languageDetector&&(v.languageDetector=s(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=s(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new Us(this.services,this.options),this.translator.on("*",(C,...T)=>{this.emit(C,...T)}),this.modules.external.forEach(C=>{C.init&&C.init(this)})}if(this.format=this.options.interpolation.format,r||(r=bs),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(m=>{this[m]=(...x)=>this.store[m](...x)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=(...x)=>(this.store[m](...x),this)});const h=ko(),p=()=>{const m=(x,v)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),h.resolve(v),r(x,v)};if(this.languages&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),h}loadResources(l,r=bs){let i=r;const s=Te(l)?l:this.language;if(typeof l=="function"&&(i=l),!this.options.resources||this.options.partialBundledLanguages){if(s?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const c=[],d=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(m=>{m!=="cimode"&&c.indexOf(m)<0&&c.push(m)})};s?d(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>d(p)),this.options.preload?.forEach?.(h=>d(h)),this.services.backendConnector.load(c,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(h)})}else i(null)}reloadResources(l,r,i){const s=ko();return typeof l=="function"&&(i=l,l=void 0),typeof r=="function"&&(i=r,r=void 0),l||(l=this.languages),r||(r=this.options.ns),i||(i=bs),this.services.backendConnector.reload(l,r,c=>{s.resolve(),i(c)}),s}use(l){if(!l)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!l.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return l.type==="backend"&&(this.modules.backend=l),(l.type==="logger"||l.log&&l.warn&&l.error)&&(this.modules.logger=l),l.type==="languageDetector"&&(this.modules.languageDetector=l),l.type==="i18nFormat"&&(this.modules.i18nFormat=l),l.type==="postProcessor"&&My.addPostProcessor(l),l.type==="formatter"&&(this.modules.formatter=l),l.type==="3rdParty"&&this.modules.external.push(l),this}setResolvedLanguage(l){if(!(!l||!this.languages)&&!(["cimode","dev"].indexOf(l)>-1)){for(let r=0;r<this.languages.length;r++){const i=this.languages[r];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(l)<0&&this.store.hasLanguageSomeTranslations(l)&&(this.resolvedLanguage=l,this.languages.unshift(l))}}changeLanguage(l,r){this.isLanguageChangingTo=l;const i=ko();this.emit("languageChanging",l);const s=h=>{this.language=h,this.languages=this.services.languageUtils.toResolveHierarchy(h),this.resolvedLanguage=void 0,this.setResolvedLanguage(h)},c=(h,p)=>{p?this.isLanguageChangingTo===l&&(s(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,i.resolve((...m)=>this.t(...m)),r&&r(h,(...m)=>this.t(...m))},d=h=>{!l&&!h&&this.services.languageDetector&&(h=[]);const p=Te(h)?h:h&&h[0],m=this.store.hasLanguageSomeTranslations(p)?p:this.services.languageUtils.getBestMatchFromCodes(Te(h)?[h]:h);m&&(this.language||s(m),this.translator.language||this.translator.changeLanguage(m),this.services.languageDetector?.cacheUserLanguage?.(m)),this.loadResources(m,x=>{c(x,m)})};return!l&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!l&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(l),i}getFixedT(l,r,i){const s=(c,d,...h)=>{let p;typeof d!="object"?p=this.options.overloadTranslationOptionHandler([c,d].concat(h)):p={...d},p.lng=p.lng||s.lng,p.lngs=p.lngs||s.lngs,p.ns=p.ns||s.ns,p.keyPrefix!==""&&(p.keyPrefix=p.keyPrefix||i||s.keyPrefix);const m=this.options.keySeparator||".";let x;return p.keyPrefix&&Array.isArray(c)?x=c.map(v=>(typeof v=="function"&&(v=rd(v,{...this.options,...d})),`${p.keyPrefix}${m}${v}`)):(typeof c=="function"&&(c=rd(c,{...this.options,...d})),x=p.keyPrefix?`${p.keyPrefix}${m}${c}`:c),this.t(x,p)};return Te(l)?s.lng=l:s.lngs=l,s.ns=r,s.keyPrefix=i,s}t(...l){return this.translator?.translate(...l)}exists(...l){return this.translator?.exists(...l)}setDefaultNamespace(l){this.options.defaultNS=l}hasLoadedNamespace(l,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=r.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const d=(h,p)=>{const m=this.services.backendConnector.state[`${h}|${p}`];return m===-1||m===0||m===2};if(r.precheck){const h=r.precheck(this,d);if(h!==void 0)return h}return!!(this.hasResourceBundle(i,l)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(i,l)&&(!s||d(c,l)))}loadNamespaces(l,r){const i=ko();return this.options.ns?(Te(l)&&(l=[l]),l.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{i.resolve(),r&&r(s)}),i):(r&&r(),Promise.resolve())}loadLanguages(l,r){const i=ko();Te(l)&&(l=[l]);const s=this.options.preload||[],c=l.filter(d=>s.indexOf(d)<0&&this.services.languageUtils.isSupportedCode(d));return c.length?(this.options.preload=s.concat(c),this.loadResources(d=>{i.resolve(),r&&r(d)}),i):(r&&r(),Promise.resolve())}dir(l){if(l||(l=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!l)return"rtl";try{const s=new Intl.Locale(l);if(s&&s.getTextInfo){const c=s.getTextInfo();if(c&&c.direction)return c.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services?.languageUtils||new bv(Tv());return l.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(i.getLanguagePartFromCode(l))>-1||l.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(l={},r){const i=new qo(l,r);return i.createInstance=qo.createInstance,i}cloneInstance(l={},r=bs){const i=l.forkResourceStore;i&&delete l.forkResourceStore;const s={...this.options,...l,isClone:!0},c=new qo(s);if((l.debug!==void 0||l.prefix!==void 0)&&(c.logger=c.logger.clone(l)),["store","services","language"].forEach(h=>{c[h]=this[h]}),c.services={...this.services},c.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},i){const h=Object.keys(this.store.data).reduce((p,m)=>(p[m]={...this.store.data[m]},p[m]=Object.keys(p[m]).reduce((x,v)=>(x[v]={...p[m][v]},x),p[m]),p),{});c.store=new vv(h,s),c.services.resourceStore=c.store}return l.interpolation&&(c.services.interpolator=new Cv(s)),c.translator=new Us(c.services,s),c.translator.on("*",(h,...p)=>{c.emit(h,...p)}),c.init(s,r),c.translator.options=s,c.translator.backendConnector.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},c}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ht=qo.createInstance();Ht.createInstance;Ht.dir;Ht.init;Ht.loadResources;Ht.reloadResources;Ht.use;Ht.changeLanguage;Ht.getFixedT;Ht.t;Ht.exists;Ht.setDefaultNamespace;Ht.hasLoadedNamespace;Ht.loadNamespaces;Ht.loadLanguages;const jw=(n,l,r,i)=>{const s=[r,{code:l,...i||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(s,"warn","react-i18next::",!0);El(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...s):console?.warn&&console.warn(...s)},Av={},Ly=(n,l,r,i)=>{El(r)&&Av[r]||(El(r)&&(Av[r]=new Date),jw(n,l,r,i))},ky=(n,l)=>()=>{if(n.isInitialized)l();else{const r=()=>{setTimeout(()=>{n.off("initialized",r)},0),l()};n.on("initialized",r)}},od=(n,l,r)=>{n.loadNamespaces(l,ky(n,r))},Nv=(n,l,r,i)=>{if(El(r)&&(r=[r]),n.options.preload&&n.options.preload.indexOf(l)>-1)return od(n,r,i);r.forEach(s=>{n.options.ns.indexOf(s)<0&&n.options.ns.push(s)}),n.loadLanguages(l,ky(n,i))},Dw=(n,l,r={})=>!l.languages||!l.languages.length?(Ly(l,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:l.languages}),!0):l.hasLoadedNamespace(n,{lng:r.lng,precheck:(i,s)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,n))return!1}}),El=n=>typeof n=="string",_w=n=>typeof n=="object"&&n!==null,Mw=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,zw={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Lw=n=>zw[n],kw=n=>n.replace(Mw,Lw);let id={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:kw,transDefaultProps:void 0};const Uw=(n={})=>{id={...id,...n}},Hw=()=>id;let Uy;const Bw=n=>{Uy=n},Pw=()=>Uy,Vw={type:"3rdParty",init(n){Uw(n.options.react),Bw(n)}},Iw=y.createContext();class Yw{constructor(){this.usedNamespaces={}}addUsedNamespaces(l){l.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Pf={exports:{}},Vf={};var Ov;function qw(){if(Ov)return Vf;Ov=1;var n=Zs();function l(v,w){return v===w&&(v!==0||1/v===1/w)||v!==v&&w!==w}var r=typeof Object.is=="function"?Object.is:l,i=n.useState,s=n.useEffect,c=n.useLayoutEffect,d=n.useDebugValue;function h(v,w){var C=w(),T=i({inst:{value:C,getSnapshot:w}}),E=T[0].inst,R=T[1];return c(function(){E.value=C,E.getSnapshot=w,p(E)&&R({inst:E})},[v,C,w]),s(function(){return p(E)&&R({inst:E}),v(function(){p(E)&&R({inst:E})})},[v]),d(C),C}function p(v){var w=v.getSnapshot;v=v.value;try{var C=w();return!r(v,C)}catch{return!0}}function m(v,w){return w()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:h;return Vf.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:x,Vf}var jv;function Gw(){return jv||(jv=1,Pf.exports=qw()),Pf.exports}var $w=Gw();const Xw=(n,l)=>El(l)?l:_w(l)&&El(l.defaultValue)?l.defaultValue:Array.isArray(n)?n[n.length-1]:n,Fw={t:Xw,ready:!1},Kw=()=>()=>{},Qo=(n,l={})=>{const{i18n:r}=l,{i18n:i,defaultNS:s}=y.useContext(Iw)||{},c=r||i||Pw();c&&!c.reportNamespaces&&(c.reportNamespaces=new Yw),c||Ly(c,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const d=y.useMemo(()=>({...Hw(),...c?.options?.react,...l}),[c,l]),{useSuspense:h,keyPrefix:p}=d,m=s||c?.options?.defaultNS,x=El(m)?[m]:m||["translation"],v=y.useMemo(()=>x,x);c?.reportNamespaces?.addUsedNamespaces?.(v);const w=y.useRef(0),C=y.useCallback(J=>{if(!c)return Kw;const{bindI18n:ne,bindI18nStore:re}=d,K=()=>{w.current+=1,J()};return ne&&c.on(ne,K),re&&c.store.on(re,K),()=>{ne&&ne.split(" ").forEach(ie=>c.off(ie,K)),re&&re.split(" ").forEach(ie=>c.store.off(ie,K))}},[c,d]),T=y.useRef(),E=y.useCallback(()=>{if(!c)return Fw;const J=!!(c.isInitialized||c.initializedStoreOnce)&&v.every(he=>Dw(he,c,d)),ne=l.lng||c.language,re=w.current,K=T.current;if(K&&K.ready===J&&K.lng===ne&&K.keyPrefix===p&&K.revision===re)return K;const ce={t:c.getFixedT(ne,d.nsMode==="fallback"?v:v[0],p),ready:J,lng:ne,keyPrefix:p,revision:re};return T.current=ce,ce},[c,v,p,d,l.lng]),[R,N]=y.useState(0),{t:M,ready:z}=$w.useSyncExternalStore(C,E,E);y.useEffect(()=>{if(c&&!z&&!h){const J=()=>N(ne=>ne+1);l.lng?Nv(c,l.lng,v,J):od(c,v,J)}},[c,l.lng,v,z,h,R]);const P=c||{},G=y.useRef(null),k=y.useRef(),L=J=>{const ne=Object.getOwnPropertyDescriptors(J);ne.__original&&delete ne.__original;const re=Object.create(Object.getPrototypeOf(J),ne);if(!Object.prototype.hasOwnProperty.call(re,"__original"))try{Object.defineProperty(re,"__original",{value:J,writable:!1,enumerable:!1,configurable:!1})}catch{}return re},Y=y.useMemo(()=>{const J=P,ne=J?.language;let re=J;J&&(G.current&&G.current.__original===J?k.current!==ne?(re=L(J),G.current=re,k.current=ne):re=G.current:(re=L(J),G.current=re,k.current=ne));const K=[M,re,z];return K.t=M,K.i18n=re,K.ready=z,K},[M,P,z,P.resolvedLanguage,P.language,P.languages]);if(c&&h&&!z)throw new Promise(J=>{const ne=()=>J();l.lng?Nv(c,l.lng,v,ne):od(c,v,ne)});return Y},{slice:Qw,forEach:Zw}=[];function Ww(n){return Zw.call(Qw.call(arguments,1),l=>{if(l)for(const r in l)n[r]===void 0&&(n[r]=l[r])}),n}function Jw(n){return typeof n!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(r=>r.test(n))}const Dv=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,eC=function(n,l){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(l);let c=`${n}=${s}`;if(i.maxAge>0){const d=i.maxAge-0;if(Number.isNaN(d))throw new Error("maxAge should be a Number");c+=`; Max-Age=${Math.floor(d)}`}if(i.domain){if(!Dv.test(i.domain))throw new TypeError("option domain is invalid");c+=`; Domain=${i.domain}`}if(i.path){if(!Dv.test(i.path))throw new TypeError("option path is invalid");c+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");c+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(c+="; HttpOnly"),i.secure&&(c+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"strict":c+="; SameSite=Strict";break;case"none":c+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(c+="; Partitioned"),c},_v={create(n,l,r,i){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+r*60*1e3)),i&&(s.domain=i),document.cookie=eC(n,l,s)},read(n){const l=`${n}=`,r=document.cookie.split(";");for(let i=0;i<r.length;i++){let s=r[i];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(l)===0)return s.substring(l.length,s.length)}return null},remove(n,l){this.create(n,"",-1,l)}};var tC={name:"cookie",lookup(n){let{lookupCookie:l}=n;if(l&&typeof document<"u")return _v.read(l)||void 0},cacheUserLanguage(n,l){let{lookupCookie:r,cookieMinutes:i,cookieDomain:s,cookieOptions:c}=l;r&&typeof document<"u"&&_v.create(r,n,i,s,c)}},nC={name:"querystring",lookup(n){let{lookupQuerystring:l}=n,r;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const c=i.substring(1).split("&");for(let d=0;d<c.length;d++){const h=c[d].indexOf("=");h>0&&c[d].substring(0,h)===l&&(r=c[d].substring(h+1))}}return r}},aC={name:"hash",lookup(n){let{lookupHash:l,lookupFromHashIndex:r}=n,i;if(typeof window<"u"){const{hash:s}=window.location;if(s&&s.length>2){const c=s.substring(1);if(l){const d=c.split("&");for(let h=0;h<d.length;h++){const p=d[h].indexOf("=");p>0&&d[h].substring(0,p)===l&&(i=d[h].substring(p+1))}}if(i)return i;if(!i&&r>-1){const d=s.match(/\/([a-zA-Z-]*)/g);return Array.isArray(d)?d[typeof r=="number"?r:0]?.replace("/",""):void 0}}}return i}};let br=null;const Mv=()=>{if(br!==null)return br;try{if(br=typeof window<"u"&&window.localStorage!==null,!br)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{br=!1}return br};var lC={name:"localStorage",lookup(n){let{lookupLocalStorage:l}=n;if(l&&Mv())return window.localStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupLocalStorage:r}=l;r&&Mv()&&window.localStorage.setItem(r,n)}};let xr=null;const zv=()=>{if(xr!==null)return xr;try{if(xr=typeof window<"u"&&window.sessionStorage!==null,!xr)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{xr=!1}return xr};var rC={name:"sessionStorage",lookup(n){let{lookupSessionStorage:l}=n;if(l&&zv())return window.sessionStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupSessionStorage:r}=l;r&&zv()&&window.sessionStorage.setItem(r,n)}},oC={name:"navigator",lookup(n){const l=[];if(typeof navigator<"u"){const{languages:r,userLanguage:i,language:s}=navigator;if(r)for(let c=0;c<r.length;c++)l.push(r[c]);i&&l.push(i),s&&l.push(s)}return l.length>0?l:void 0}},iC={name:"htmlTag",lookup(n){let{htmlTag:l}=n,r;const i=l||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(r=i.getAttribute("lang")),r}},sC={name:"path",lookup(n){let{lookupFromPathIndex:l}=n;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof l=="number"?l:0]?.replace("/",""):void 0}},cC={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:l}=n;const r=typeof l=="number"?l+1:1,i=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[r]}};let Hy=!1;try{document.cookie,Hy=!0}catch{}const By=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Hy||By.splice(1,1);const uC=()=>({order:By,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class Py{constructor(l){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(l,r)}init(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=l,this.options=Ww(r,this.options||{},uC()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(tC),this.addDetector(nC),this.addDetector(lC),this.addDetector(rC),this.addDetector(oC),this.addDetector(iC),this.addDetector(sC),this.addDetector(cC),this.addDetector(aC)}addDetector(l){return this.detectors[l.name]=l,this}detect(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return l.forEach(i=>{if(this.detectors[i]){let s=this.detectors[i].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(r=r.concat(s))}}),r=r.filter(i=>i!=null&&!Jw(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(l){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(l)>-1||r.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(l,this.options)}))}}Py.type="languageDetector";const fC={en:{translation:{title:"MTranServer",subtitle:"Fast and reliable translation service",translate:"Translate",translating:"Translating...",sourceLanguage:"Source Language",targetLanguage:"Target Language",sourceText:"Source Text",translation:"Translation",enterText:"Enter text to translate...",translationWillAppear:"Translation will appear here...",selectLanguage:"Select language",autoDetect:"Auto Detect",translationCompleted:"Translation completed",translationFailed:"Translation failed",firstTranslationTip:"The first translation requires downloading the model. Please wait.",enterTextError:"Please enter text to translate",failedToLoadLanguages:"Failed to load languages",theme:"Theme",language:"Language",light:"Light",dark:"Dark",system:"System",autoTranslate:"Auto Translate",autoTranslateDesc:"Automatically translate as you type",apiToken:"API Token",apiTokenPlaceholder:"Please enter API token",apiTokenSaved:"API token saved",apiTokenCleared:"API token cleared",save:"Save",apiTokenRequired:"API token is required to access this service",copied:"Copied to clipboard",copyFailed:"Failed to copy",clear:"Clear",history:"History",clearAll:"Clear All",noHistory:"No history",historyDesc:"Recent translations",searchPlaceholder:"Search history...",noResults:"No results found",apiDocs:"API Documentation",addPanel:"Add Translation Panel",widescreen:"Widescreen View",standardView:"Standard View",closePanel:"Close Panel",uploadFile:"Upload file",voiceInputStart:"Start voice input",voiceInputStop:"Stop voice input",speechNotSupported:"Speech recognition is not supported in this browser",speechInputFailed:"Voice input failed",listen:"Listen",copy:"Copy",delete:"Delete",switchLanguage:"Switch Language",toggleTheme:"Toggle Theme",translateShortcut:"Ctrl + Enter to translate",languageSwitcher:"Language",languageSearchPlaceholder:"Search languages...",languageRecent:"Recent",languageAll:"All Languages",followSystemLanguage:"Follow System",desktopSettings:"Desktop Settings",desktopSettingsDesc:"Manage server configuration and desktop preferences",serverStatus:"Service Status",serverStatusRunning:"Running",serverStatusStopped:"Stopped",generalSettings:"General",storageSettings:"Storage",securitySettings:"Security",performanceSettings:"Performance",loggingSettings:"Logging",host:"Host",port:"Port",logLevel:"Log Level",locale:"Language",enableWebUI:"Web UI",enableWebUIDesc:"Enable the built-in web UI",enableOfflineMode:"Offline Mode",enableOfflineModeDesc:"Disable online features and updates",checkUpdate:"Check Updates",checkUpdateDesc:"Check for new versions at startup",modelDir:"Model Directory",configDir:"Config Directory",logDir:"Log Directory",workerIdleTimeout:"Worker Idle Timeout (s)",workersPerLanguage:"Workers Per Language",maxLengthBreak:"Max Length Break",cacheSize:"Cache Size",logToFile:"Log to File",logToFileDesc:"Write logs to file",logConsole:"Log to Console",logConsoleDesc:"Output logs to console",logRequests:"Log Requests",logRequestsDesc:"Record each request",apply:"Apply",restart:"Restart",resetDefaults:"Reset to Defaults",backToMain:"Back to Main",loadingConfig:"Loading configuration...",loadingConfigFailed:"Failed to load configuration",settingsApplied:"Settings applied",settingsApplyFailed:"Failed to apply settings",serverRestarted:"Server restarted",serverRestartFailed:"Failed to restart server",settingsReset:"Defaults restored",settingsResetFailed:"Failed to reset defaults",desktopOnly:"Desktop only",desktopOnlyDesc:"Desktop settings are only available in the desktop client",version:"Version",saving:"Saving..."}},zh:{translation:{title:"MTranServer",subtitle:"快速可靠的翻译服务",translate:"翻译",translating:"翻译中...",sourceLanguage:"源语言",targetLanguage:"目标语言",sourceText:"源文本",translation:"翻译结果",enterText:"输入要翻译的文本...",translationWillAppear:"翻译结果将显示在这里...",selectLanguage:"选择语言",autoDetect:"自动检测",translationCompleted:"翻译完成",translationFailed:"翻译失败",firstTranslationTip:"第一次翻译需要下载模型,请耐心等待。",enterTextError:"请输入要翻译的文本",failedToLoadLanguages:"加载语言列表失败",theme:"主题",language:"语言",light:"浅色",dark:"深色",system:"跟随系统",autoTranslate:"自动翻译",autoTranslateDesc:"输入时自动翻译",apiToken:"API Token",apiTokenPlaceholder:"请输入 API token",apiTokenSaved:"API token 已保存",apiTokenCleared:"API token 已清除",save:"保存",apiTokenRequired:"访问此服务需要 API token",copied:"已复制到剪贴板",copyFailed:"复制失败",clear:"清空",history:"历史记录",clearAll:"清空全部",noHistory:"暂无历史记录",historyDesc:"最近的翻译记录",searchPlaceholder:"搜索历史记录...",noResults:"未找到结果",apiDocs:"API 文档",addPanel:"添加翻译面板",widescreen:"宽屏模式",standardView:"标准视图",closePanel:"关闭面板",uploadFile:"上传文件",voiceInputStart:"开始语音输入",voiceInputStop:"停止语音输入",speechNotSupported:"当前浏览器不支持语音识别",speechInputFailed:"语音输入失败",listen:"朗读",copy:"复制",delete:"删除",switchLanguage:"切换语言",toggleTheme:"切换主题",translateShortcut:"Ctrl + Enter 快捷翻译",languageSwitcher:"语言",languageSearchPlaceholder:"搜索语言...",languageRecent:"最近使用",languageAll:"全部语言",followSystemLanguage:"跟随系统",desktopSettings:"桌面端设置",desktopSettingsDesc:"管理服务配置与桌面偏好",serverStatus:"服务状态",serverStatusRunning:"启动中",serverStatusStopped:"已停止",generalSettings:"常规",storageSettings:"存储",securitySettings:"安全",performanceSettings:"性能",loggingSettings:"日志",host:"主机",port:"端口",logLevel:"日志级别",locale:"语言",enableWebUI:"Web UI",enableWebUIDesc:"启用内置 Web UI",enableOfflineMode:"离线模式",enableOfflineModeDesc:"禁用在线功能与更新检查",checkUpdate:"检查更新",checkUpdateDesc:"启动时检查新版本",modelDir:"模型目录",configDir:"配置目录",logDir:"日志目录",workerIdleTimeout:"空闲超时(秒)",workersPerLanguage:"每语言工作数",maxLengthBreak:"最大断句长度",cacheSize:"缓存大小",logToFile:"写入文件",logToFileDesc:"将日志写入文件",logConsole:"控制台日志",logConsoleDesc:"在控制台输出日志",logRequests:"请求日志",logRequestsDesc:"记录每个请求",apply:"应用",restart:"重启",resetDefaults:"恢复默认值",backToMain:"返回主界面",loadingConfig:"正在加载配置...",loadingConfigFailed:"加载配置失败",settingsApplied:"设置已应用",settingsApplyFailed:"应用设置失败",serverRestarted:"服务已重启",serverRestartFailed:"服务重启失败",settingsReset:"默认值已恢复",settingsResetFailed:"恢复默认值失败",desktopOnly:"仅限桌面端",desktopOnlyDesc:"桌面端设置仅在桌面客户端可用",version:"版本",saving:"保存中..."}},ja:{translation:{title:"MTranServer",subtitle:"高速で信頼性の高い翻訳サービス",translate:"翻訳",translating:"翻訳中...",sourceLanguage:"ソース言語",targetLanguage:"ターゲット言語",sourceText:"ソーステキスト",translation:"翻訳",enterText:"翻訳するテキストを入力...",translationWillAppear:"翻訳がここに表示されます...",selectLanguage:"言語を選択",autoDetect:"自動検出",translationCompleted:"翻訳完了",translationFailed:"翻訳失敗",firstTranslationTip:"初回の翻訳ではモデルのダウンロードが必要です。しばらくお待ちください。",enterTextError:"翻訳するテキストを入力してください",failedToLoadLanguages:"言語の読み込みに失敗しました",theme:"テーマ",language:"言語",light:"ライト",dark:"ダーク",system:"システム",autoTranslate:"自動翻訳",autoTranslateDesc:"入力時に自動翻訳",apiToken:"APIトークン",apiTokenPlaceholder:"APIトークンを入力してください",apiTokenSaved:"APIトークンが保存されました",apiTokenCleared:"APIトークンがクリアされました",save:"保存",apiTokenRequired:"このサービスにアクセスするにはAPIトークンが必要です",copied:"クリップボードにコピーしました",copyFailed:"コピーに失敗しました",clear:"クリア",history:"履歴",clearAll:"すべてクリア",noHistory:"履歴はありません",historyDesc:"最近の翻訳履歴",searchPlaceholder:"履歴を検索...",noResults:"結果が見つかりません",apiDocs:"APIドキュメント",addPanel:"翻訳パネルを追加",widescreen:"ワイドスクリーン表示",standardView:"標準表示",closePanel:"パネルを閉じる",uploadFile:"ファイルをアップロード",voiceInputStart:"音声入力を開始",voiceInputStop:"音声入力を停止",speechNotSupported:"このブラウザは音声認識に対応していません",speechInputFailed:"音声入力に失敗しました",listen:"読み上げ",copy:"コピー",delete:"削除",switchLanguage:"言語を切り替え",toggleTheme:"テーマを切り替え",translateShortcut:"Ctrl + Enterで翻訳",languageSwitcher:"言語",languageSearchPlaceholder:"言語を検索...",languageRecent:"最近",languageAll:"すべての言語",followSystemLanguage:"システムに従う",desktopSettings:"デスクトップ設定",desktopSettingsDesc:"サーバー設定とデスクトップ設定を管理",serverStatus:"サービス状態",serverStatusRunning:"稼働中",serverStatusStopped:"停止中",generalSettings:"一般",storageSettings:"ストレージ",securitySettings:"セキュリティ",performanceSettings:"パフォーマンス",loggingSettings:"ログ",host:"ホスト",port:"ポート",logLevel:"ログレベル",locale:"言語",enableWebUI:"Web UI",enableWebUIDesc:"内蔵 Web UI を有効化",enableOfflineMode:"オフラインモード",enableOfflineModeDesc:"オンライン機能と更新確認を無効化",checkUpdate:"更新チェック",checkUpdateDesc:"起動時に新しいバージョンを確認",modelDir:"モデルディレクトリ",configDir:"設定ディレクトリ",logDir:"ログディレクトリ",workerIdleTimeout:"アイドルタイムアウト(秒)",workersPerLanguage:"言語ごとのワーカー数",maxLengthBreak:"最大分割長",cacheSize:"キャッシュサイズ",logToFile:"ファイルに記録",logToFileDesc:"ログをファイルに書き込む",logConsole:"コンソール出力",logConsoleDesc:"コンソールにログを出力",logRequests:"リクエストログ",logRequestsDesc:"各リクエストを記録",apply:"適用",restart:"再起動",resetDefaults:"デフォルトに戻す",backToMain:"メインに戻る",loadingConfig:"設定を読み込み中...",loadingConfigFailed:"設定の読み込みに失敗しました",settingsApplied:"設定を適用しました",settingsApplyFailed:"設定の適用に失敗しました",serverRestarted:"サーバーを再起動しました",serverRestartFailed:"サーバーの再起動に失敗しました",settingsReset:"デフォルトを復元しました",settingsResetFailed:"デフォルトの復元に失敗しました",desktopOnly:"デスクトップ専用",desktopOnlyDesc:"デスクトップ設定はデスクトップクライアントのみ利用できます",version:"バージョン",saving:"保存中..."}}};Ht.use(Py).use(Vw).init({resources:fC,fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"]}});function Lv(n,l){if(typeof n=="function")return n(l);n!=null&&(n.current=l)}function bn(...n){return l=>{let r=!1;const i=n.map(s=>{const c=Lv(s,l);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let s=0;s<i.length;s++){const c=i[s];typeof c=="function"?c():Lv(n[s],null)}}}}function He(...n){return y.useCallback(bn(...n),n)}var dC=Symbol.for("react.lazy"),Hs=zd[" use ".trim().toString()];function hC(n){return typeof n=="object"&&n!==null&&"then"in n}function Vy(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===dC&&"_payload"in n&&hC(n._payload)}function Ld(n){const l=mC(n),r=y.forwardRef((i,s)=>{let{children:c,...d}=i;Vy(c)&&typeof Hs=="function"&&(c=Hs(c._payload));const h=y.Children.toArray(c),p=h.find(vC);if(p){const m=p.props.children,x=h.map(v=>v===p?y.Children.count(m)>1?y.Children.only(null):y.isValidElement(m)?m.props.children:null:v);return g.jsx(l,{...d,ref:s,children:y.isValidElement(m)?y.cloneElement(m,void 0,x):null})}return g.jsx(l,{...d,ref:s,children:c})});return r.displayName=`${n}.Slot`,r}var pC=Ld("Slot");function mC(n){const l=y.forwardRef((r,i)=>{let{children:s,...c}=r;if(Vy(s)&&typeof Hs=="function"&&(s=Hs(s._payload)),y.isValidElement(s)){const d=bC(s),h=yC(c,s.props);return s.type!==y.Fragment&&(h.ref=i?bn(i,d):d),y.cloneElement(s,h)}return y.Children.count(s)>1?y.Children.only(null):null});return l.displayName=`${n}.SlotClone`,l}var gC=Symbol("radix.slottable");function vC(n){return y.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===gC}function yC(n,l){const r={...l};for(const i in l){const s=n[i],c=l[i];/^on[A-Z]/.test(i)?s&&c?r[i]=(...h)=>{const p=c(...h);return s(...h),p}:s&&(r[i]=s):i==="style"?r[i]={...s,...c}:i==="className"&&(r[i]=[s,c].filter(Boolean).join(" "))}return{...n,...r}}function bC(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?n.props.ref:n.props.ref||n.ref)}function Iy(n){var l,r,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(l=0;l<s;l++)n[l]&&(r=Iy(n[l]))&&(i&&(i+=" "),i+=r)}else for(r in n)n[r]&&(i&&(i+=" "),i+=r);return i}function Yy(){for(var n,l,r=0,i="",s=arguments.length;r<s;r++)(n=arguments[r])&&(l=Iy(n))&&(i&&(i+=" "),i+=l);return i}const kv=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,Uv=Yy,qy=(n,l)=>r=>{var i;if(l?.variants==null)return Uv(n,r?.class,r?.className);const{variants:s,defaultVariants:c}=l,d=Object.keys(s).map(m=>{const x=r?.[m],v=c?.[m];if(x===null)return null;const w=kv(x)||kv(v);return s[m][w]}),h=r&&Object.entries(r).reduce((m,x)=>{let[v,w]=x;return w===void 0||(m[v]=w),m},{}),p=l==null||(i=l.compoundVariants)===null||i===void 0?void 0:i.reduce((m,x)=>{let{class:v,className:w,...C}=x;return Object.entries(C).every(T=>{let[E,R]=T;return Array.isArray(R)?R.includes({...c,...h}[E]):{...c,...h}[E]===R})?[...m,v,w]:m},[]);return Uv(n,d,p,r?.class,r?.className)},xC=(n,l)=>{const r=new Array(n.length+l.length);for(let i=0;i<n.length;i++)r[i]=n[i];for(let i=0;i<l.length;i++)r[n.length+i]=l[i];return r},SC=(n,l)=>({classGroupId:n,validator:l}),Gy=(n=new Map,l=null,r)=>({nextPart:n,validators:l,classGroupId:r}),Bs="-",Hv=[],wC="arbitrary..",CC=n=>{const l=TC(n),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return EC(d);const h=d.split(Bs),p=h[0]===""&&h.length>1?1:0;return $y(h,p,l)},getConflictingClassGroupIds:(d,h)=>{if(h){const p=i[d],m=r[d];return p?m?xC(m,p):p:m||Hv}return r[d]||Hv}}},$y=(n,l,r)=>{if(n.length-l===0)return r.classGroupId;const s=n[l],c=r.nextPart.get(s);if(c){const m=$y(n,l+1,c);if(m)return m}const d=r.validators;if(d===null)return;const h=l===0?n.join(Bs):n.slice(l).join(Bs),p=d.length;for(let m=0;m<p;m++){const x=d[m];if(x.validator(h))return x.classGroupId}},EC=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const l=n.slice(1,-1),r=l.indexOf(":"),i=l.slice(0,r);return i?wC+i:void 0})(),TC=n=>{const{theme:l,classGroups:r}=n;return RC(r,l)},RC=(n,l)=>{const r=Gy();for(const i in n){const s=n[i];kd(s,r,i,l)}return r},kd=(n,l,r,i)=>{const s=n.length;for(let c=0;c<s;c++){const d=n[c];AC(d,l,r,i)}},AC=(n,l,r,i)=>{if(typeof n=="string"){NC(n,l,r);return}if(typeof n=="function"){OC(n,l,r,i);return}jC(n,l,r,i)},NC=(n,l,r)=>{const i=n===""?l:Xy(l,n);i.classGroupId=r},OC=(n,l,r,i)=>{if(DC(n)){kd(n(i),l,r,i);return}l.validators===null&&(l.validators=[]),l.validators.push(SC(r,n))},jC=(n,l,r,i)=>{const s=Object.entries(n),c=s.length;for(let d=0;d<c;d++){const[h,p]=s[d];kd(p,Xy(l,h),r,i)}},Xy=(n,l)=>{let r=n;const i=l.split(Bs),s=i.length;for(let c=0;c<s;c++){const d=i[c];let h=r.nextPart.get(d);h||(h=Gy(),r.nextPart.set(d,h)),r=h}return r},DC=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,_C=n=>{if(n<1)return{get:()=>{},set:()=>{}};let l=0,r=Object.create(null),i=Object.create(null);const s=(c,d)=>{r[c]=d,l++,l>n&&(l=0,i=r,r=Object.create(null))};return{get(c){let d=r[c];if(d!==void 0)return d;if((d=i[c])!==void 0)return s(c,d),d},set(c,d){c in r?r[c]=d:s(c,d)}}},sd="!",Bv=":",MC=[],Pv=(n,l,r,i,s)=>({modifiers:n,hasImportantModifier:l,baseClassName:r,maybePostfixModifierPosition:i,isExternal:s}),zC=n=>{const{prefix:l,experimentalParseClassName:r}=n;let i=s=>{const c=[];let d=0,h=0,p=0,m;const x=s.length;for(let E=0;E<x;E++){const R=s[E];if(d===0&&h===0){if(R===Bv){c.push(s.slice(p,E)),p=E+1;continue}if(R==="/"){m=E;continue}}R==="["?d++:R==="]"?d--:R==="("?h++:R===")"&&h--}const v=c.length===0?s:s.slice(p);let w=v,C=!1;v.endsWith(sd)?(w=v.slice(0,-1),C=!0):v.startsWith(sd)&&(w=v.slice(1),C=!0);const T=m&&m>p?m-p:void 0;return Pv(c,C,w,T)};if(l){const s=l+Bv,c=i;i=d=>d.startsWith(s)?c(d.slice(s.length)):Pv(MC,!1,d,void 0,!0)}if(r){const s=i;i=c=>r({className:c,parseClassName:s})}return i},LC=n=>{const l=new Map;return n.orderSensitiveModifiers.forEach((r,i)=>{l.set(r,1e6+i)}),r=>{const i=[];let s=[];for(let c=0;c<r.length;c++){const d=r[c],h=d[0]==="[",p=l.has(d);h||p?(s.length>0&&(s.sort(),i.push(...s),s=[]),i.push(d)):s.push(d)}return s.length>0&&(s.sort(),i.push(...s)),i}},kC=n=>({cache:_C(n.cacheSize),parseClassName:zC(n),sortModifiers:LC(n),...CC(n)}),UC=/\s+/,HC=(n,l)=>{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:s,sortModifiers:c}=l,d=[],h=n.trim().split(UC);let p="";for(let m=h.length-1;m>=0;m-=1){const x=h[m],{isExternal:v,modifiers:w,hasImportantModifier:C,baseClassName:T,maybePostfixModifierPosition:E}=r(x);if(v){p=x+(p.length>0?" "+p:p);continue}let R=!!E,N=i(R?T.substring(0,E):T);if(!N){if(!R){p=x+(p.length>0?" "+p:p);continue}if(N=i(T),!N){p=x+(p.length>0?" "+p:p);continue}R=!1}const M=w.length===0?"":w.length===1?w[0]:c(w).join(":"),z=C?M+sd:M,P=z+N;if(d.indexOf(P)>-1)continue;d.push(P);const G=s(N,R);for(let k=0;k<G.length;++k){const L=G[k];d.push(z+L)}p=x+(p.length>0?" "+p:p)}return p},BC=(...n)=>{let l=0,r,i,s="";for(;l<n.length;)(r=n[l++])&&(i=Fy(r))&&(s&&(s+=" "),s+=i);return s},Fy=n=>{if(typeof n=="string")return n;let l,r="";for(let i=0;i<n.length;i++)n[i]&&(l=Fy(n[i]))&&(r&&(r+=" "),r+=l);return r},PC=(n,...l)=>{let r,i,s,c;const d=p=>{const m=l.reduce((x,v)=>v(x),n());return r=kC(m),i=r.cache.get,s=r.cache.set,c=h,h(p)},h=p=>{const m=i(p);if(m)return m;const x=HC(p,r);return s(p,x),x};return c=d,(...p)=>c(BC(...p))},VC=[],vt=n=>{const l=r=>r[n]||VC;return l.isThemeGetter=!0,l},Ky=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,IC=/^\d+\/\d+$/,YC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,GC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$C=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,XC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Sr=n=>IC.test(n),_e=n=>!!n&&!Number.isNaN(Number(n)),Ya=n=>!!n&&Number.isInteger(Number(n)),If=n=>n.endsWith("%")&&_e(n.slice(0,-1)),pa=n=>YC.test(n),FC=()=>!0,KC=n=>qC.test(n)&&!GC.test(n),Zy=()=>!1,QC=n=>$C.test(n),ZC=n=>XC.test(n),WC=n=>!me(n)&&!ge(n),JC=n=>Lr(n,e0,Zy),me=n=>Ky.test(n),wl=n=>Lr(n,t0,KC),Yf=n=>Lr(n,lE,_e),Vv=n=>Lr(n,Wy,Zy),eE=n=>Lr(n,Jy,ZC),xs=n=>Lr(n,n0,QC),ge=n=>Qy.test(n),Uo=n=>kr(n,t0),tE=n=>kr(n,rE),Iv=n=>kr(n,Wy),nE=n=>kr(n,e0),aE=n=>kr(n,Jy),Ss=n=>kr(n,n0,!0),Lr=(n,l,r)=>{const i=Ky.exec(n);return i?i[1]?l(i[1]):r(i[2]):!1},kr=(n,l,r=!1)=>{const i=Qy.exec(n);return i?i[1]?l(i[1]):r:!1},Wy=n=>n==="position"||n==="percentage",Jy=n=>n==="image"||n==="url",e0=n=>n==="length"||n==="size"||n==="bg-size",t0=n=>n==="length",lE=n=>n==="number",rE=n=>n==="family-name",n0=n=>n==="shadow",oE=()=>{const n=vt("color"),l=vt("font"),r=vt("text"),i=vt("font-weight"),s=vt("tracking"),c=vt("leading"),d=vt("breakpoint"),h=vt("container"),p=vt("spacing"),m=vt("radius"),x=vt("shadow"),v=vt("inset-shadow"),w=vt("text-shadow"),C=vt("drop-shadow"),T=vt("blur"),E=vt("perspective"),R=vt("aspect"),N=vt("ease"),M=vt("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...P(),ge,me],k=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],Y=()=>[ge,me,p],J=()=>[Sr,"full","auto",...Y()],ne=()=>[Ya,"none","subgrid",ge,me],re=()=>["auto",{span:["full",Ya,ge,me]},Ya,ge,me],K=()=>[Ya,"auto",ge,me],ie=()=>["auto","min","max","fr",ge,me],ce=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],he=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...Y()],$=()=>[Sr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Y()],B=()=>[n,ge,me],ue=()=>[...P(),Iv,Vv,{position:[ge,me]}],de=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",nE,JC,{size:[ge,me]}],O=()=>[If,Uo,wl],U=()=>["","none","full",m,ge,me],X=()=>["",_e,Uo,wl],Q=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[_e,If,Iv,Vv],se=()=>["","none",T,ge,me],fe=()=>["none",_e,ge,me],be=()=>["none",_e,ge,me],Ae=()=>[_e,ge,me],De=()=>[Sr,"full",...Y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pa],breakpoint:[pa],color:[FC],container:[pa],"drop-shadow":[pa],ease:["in","out","in-out"],font:[WC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pa],shadow:[pa],spacing:["px",_e],text:[pa],"text-shadow":[pa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Sr,me,ge,R]}],container:["container"],columns:[{columns:[_e,me,ge,h]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:J()}],"inset-x":[{"inset-x":J()}],"inset-y":[{"inset-y":J()}],start:[{start:J()}],end:[{end:J()}],top:[{top:J()}],right:[{right:J()}],bottom:[{bottom:J()}],left:[{left:J()}],visibility:["visible","invisible","collapse"],z:[{z:[Ya,"auto",ge,me]}],basis:[{basis:[Sr,"full","auto",h,...Y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Sr,"auto","initial","none",me]}],grow:[{grow:["",_e,ge,me]}],shrink:[{shrink:["",_e,ge,me]}],order:[{order:[Ya,"first","last","none",ge,me]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:Y()}],"gap-x":[{"gap-x":Y()}],"gap-y":[{"gap-y":Y()}],"justify-content":[{justify:[...ce(),"normal"]}],"justify-items":[{"justify-items":[...he(),"normal"]}],"justify-self":[{"justify-self":["auto",...he()]}],"align-content":[{content:["normal",...ce()]}],"align-items":[{items:[...he(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...he(),{baseline:["","last"]}]}],"place-content":[{"place-content":ce()}],"place-items":[{"place-items":[...he(),"baseline"]}],"place-self":[{"place-self":["auto",...he()]}],p:[{p:Y()}],px:[{px:Y()}],py:[{py:Y()}],ps:[{ps:Y()}],pe:[{pe:Y()}],pt:[{pt:Y()}],pr:[{pr:Y()}],pb:[{pb:Y()}],pl:[{pl:Y()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":Y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Y()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[h,"screen",...$()]}],"min-w":[{"min-w":[h,"screen","none",...$()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[d]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",r,Uo,wl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,ge,Yf]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",If,me]}],"font-family":[{font:[tE,me,l]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ge,me]}],"line-clamp":[{"line-clamp":[_e,"none",ge,Yf]}],leading:[{leading:[c,...Y()]}],"list-image":[{"list-image":["none",ge,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",ge,wl]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[_e,"auto",ge,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ge,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ue()}],"bg-repeat":[{bg:de()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ya,ge,me],radial:["",ge,me],conic:[Ya,ge,me]},aE,eE]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,ge,me]}],"outline-w":[{outline:["",_e,Uo,wl]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",x,Ss,xs]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",v,Ss,xs]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[_e,wl]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",w,Ss,xs]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[_e,ge,me]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[ge,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ue()}],"mask-repeat":[{mask:de()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,me]}],filter:[{filter:["","none",ge,me]}],blur:[{blur:se()}],brightness:[{brightness:[_e,ge,me]}],contrast:[{contrast:[_e,ge,me]}],"drop-shadow":[{"drop-shadow":["","none",C,Ss,xs]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",_e,ge,me]}],"hue-rotate":[{"hue-rotate":[_e,ge,me]}],invert:[{invert:["",_e,ge,me]}],saturate:[{saturate:[_e,ge,me]}],sepia:[{sepia:["",_e,ge,me]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,me]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[_e,ge,me]}],"backdrop-contrast":[{"backdrop-contrast":[_e,ge,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,ge,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,ge,me]}],"backdrop-invert":[{"backdrop-invert":["",_e,ge,me]}],"backdrop-opacity":[{"backdrop-opacity":[_e,ge,me]}],"backdrop-saturate":[{"backdrop-saturate":[_e,ge,me]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,ge,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Y()}],"border-spacing-x":[{"border-spacing-x":Y()}],"border-spacing-y":[{"border-spacing-y":Y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",ge,me]}],ease:[{ease:["linear","initial",N,ge,me]}],delay:[{delay:[_e,ge,me]}],animate:[{animate:["none",M,ge,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,ge,me]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:Ae()}],"skew-x":[{"skew-x":Ae()}],"skew-y":[{"skew-y":Ae()}],transform:[{transform:[ge,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:De()}],"translate-x":[{"translate-x":De()}],"translate-y":[{"translate-y":De()}],"translate-z":[{"translate-z":De()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Y()}],"scroll-mx":[{"scroll-mx":Y()}],"scroll-my":[{"scroll-my":Y()}],"scroll-ms":[{"scroll-ms":Y()}],"scroll-me":[{"scroll-me":Y()}],"scroll-mt":[{"scroll-mt":Y()}],"scroll-mr":[{"scroll-mr":Y()}],"scroll-mb":[{"scroll-mb":Y()}],"scroll-ml":[{"scroll-ml":Y()}],"scroll-p":[{"scroll-p":Y()}],"scroll-px":[{"scroll-px":Y()}],"scroll-py":[{"scroll-py":Y()}],"scroll-ps":[{"scroll-ps":Y()}],"scroll-pe":[{"scroll-pe":Y()}],"scroll-pt":[{"scroll-pt":Y()}],"scroll-pr":[{"scroll-pr":Y()}],"scroll-pb":[{"scroll-pb":Y()}],"scroll-pl":[{"scroll-pl":Y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge,me]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[_e,Uo,wl,Yf]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},iE=PC(oE);function je(...n){return iE(Yy(n))}const sE=qy("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function tt({className:n,variant:l,size:r,asChild:i=!1,...s}){const c=i?pC:"button";return g.jsx(c,{"data-slot":"button",className:je(sE({variant:l,size:r,className:n})),...s})}function we(n,l,{checkForDefaultPrevented:r=!0}={}){return function(s){if(n?.(s),r===!1||!s.defaultPrevented)return l?.(s)}}function cE(n,l){const r=y.createContext(l),i=c=>{const{children:d,...h}=c,p=y.useMemo(()=>h,Object.values(h));return g.jsx(r.Provider,{value:p,children:d})};i.displayName=n+"Provider";function s(c){const d=y.useContext(r);if(d)return d;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${n}\``)}return[i,s]}function Gn(n,l=[]){let r=[];function i(c,d){const h=y.createContext(d),p=r.length;r=[...r,d];const m=v=>{const{scope:w,children:C,...T}=v,E=w?.[n]?.[p]||h,R=y.useMemo(()=>T,Object.values(T));return g.jsx(E.Provider,{value:R,children:C})};m.displayName=c+"Provider";function x(v,w){const C=w?.[n]?.[p]||h,T=y.useContext(C);if(T)return T;if(d!==void 0)return d;throw new Error(`\`${v}\` must be used within \`${c}\``)}return[m,x]}const s=()=>{const c=r.map(d=>y.createContext(d));return function(h){const p=h?.[n]||c;return y.useMemo(()=>({[`__scope${n}`]:{...h,[n]:p}}),[h,p])}};return s.scopeName=n,[i,uE(s,...l)]}function uE(...n){const l=n[0];if(n.length===1)return l;const r=()=>{const i=n.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(c){const d=i.reduce((h,{useScope:p,scopeName:m})=>{const v=p(c)[`__scope${m}`];return{...h,...v}},{});return y.useMemo(()=>({[`__scope${l.scopeName}`]:d}),[d])}};return r.scopeName=l.scopeName,r}var Zo=Dy();const a0=jy(Zo);function fE(n){const l=dE(n),r=y.forwardRef((i,s)=>{const{children:c,...d}=i,h=y.Children.toArray(c),p=h.find(pE);if(p){const m=p.props.children,x=h.map(v=>v===p?y.Children.count(m)>1?y.Children.only(null):y.isValidElement(m)?m.props.children:null:v);return g.jsx(l,{...d,ref:s,children:y.isValidElement(m)?y.cloneElement(m,void 0,x):null})}return g.jsx(l,{...d,ref:s,children:c})});return r.displayName=`${n}.Slot`,r}function dE(n){const l=y.forwardRef((r,i)=>{const{children:s,...c}=r;if(y.isValidElement(s)){const d=gE(s),h=mE(c,s.props);return s.type!==y.Fragment&&(h.ref=i?bn(i,d):d),y.cloneElement(s,h)}return y.Children.count(s)>1?y.Children.only(null):null});return l.displayName=`${n}.SlotClone`,l}var hE=Symbol("radix.slottable");function pE(n){return y.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===hE}function mE(n,l){const r={...l};for(const i in l){const s=n[i],c=l[i];/^on[A-Z]/.test(i)?s&&c?r[i]=(...h)=>{const p=c(...h);return s(...h),p}:s&&(r[i]=s):i==="style"?r[i]={...s,...c}:i==="className"&&(r[i]=[s,c].filter(Boolean).join(" "))}return{...n,...r}}function gE(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?n.props.ref:n.props.ref||n.ref)}var vE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=vE.reduce((n,l)=>{const r=fE(`Primitive.${l}`),i=y.forwardRef((s,c)=>{const{asChild:d,...h}=s,p=d?r:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(p,{...h,ref:c})});return i.displayName=`Primitive.${l}`,{...n,[l]:i}},{});function yE(n,l){n&&Zo.flushSync(()=>n.dispatchEvent(l))}function kt(n){const l=y.useRef(n);return y.useEffect(()=>{l.current=n}),y.useMemo(()=>(...r)=>l.current?.(...r),[])}function bE(n,l=globalThis?.document){const r=kt(n);y.useEffect(()=>{const i=s=>{s.key==="Escape"&&r(s)};return l.addEventListener("keydown",i,{capture:!0}),()=>l.removeEventListener("keydown",i,{capture:!0})},[r,l])}var xE="DismissableLayer",cd="dismissableLayer.update",SE="dismissableLayer.pointerDownOutside",wE="dismissableLayer.focusOutside",Yv,l0=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wo=y.forwardRef((n,l)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:d,onDismiss:h,...p}=n,m=y.useContext(l0),[x,v]=y.useState(null),w=x?.ownerDocument??globalThis?.document,[,C]=y.useState({}),T=He(l,L=>v(L)),E=Array.from(m.layers),[R]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),N=E.indexOf(R),M=x?E.indexOf(x):-1,z=m.layersWithOutsidePointerEventsDisabled.size>0,P=M>=N,G=TE(L=>{const Y=L.target,J=[...m.branches].some(ne=>ne.contains(Y));!P||J||(s?.(L),d?.(L),L.defaultPrevented||h?.())},w),k=RE(L=>{const Y=L.target;[...m.branches].some(ne=>ne.contains(Y))||(c?.(L),d?.(L),L.defaultPrevented||h?.())},w);return bE(L=>{M===m.layers.size-1&&(i?.(L),!L.defaultPrevented&&h&&(L.preventDefault(),h()))},w),y.useEffect(()=>{if(x)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Yv=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(x)),m.layers.add(x),qv(),()=>{r&&m.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=Yv)}},[x,w,r,m]),y.useEffect(()=>()=>{x&&(m.layers.delete(x),m.layersWithOutsidePointerEventsDisabled.delete(x),qv())},[x,m]),y.useEffect(()=>{const L=()=>C({});return document.addEventListener(cd,L),()=>document.removeEventListener(cd,L)},[]),g.jsx(Ce.div,{...p,ref:T,style:{pointerEvents:z?P?"auto":"none":void 0,...n.style},onFocusCapture:we(n.onFocusCapture,k.onFocusCapture),onBlurCapture:we(n.onBlurCapture,k.onBlurCapture),onPointerDownCapture:we(n.onPointerDownCapture,G.onPointerDownCapture)})});Wo.displayName=xE;var CE="DismissableLayerBranch",EE=y.forwardRef((n,l)=>{const r=y.useContext(l0),i=y.useRef(null),s=He(l,i);return y.useEffect(()=>{const c=i.current;if(c)return r.branches.add(c),()=>{r.branches.delete(c)}},[r.branches]),g.jsx(Ce.div,{...n,ref:s})});EE.displayName=CE;function TE(n,l=globalThis?.document){const r=kt(n),i=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const c=h=>{if(h.target&&!i.current){let p=function(){r0(SE,r,m,{discrete:!0})};const m={originalEvent:h};h.pointerType==="touch"?(l.removeEventListener("click",s.current),s.current=p,l.addEventListener("click",s.current,{once:!0})):p()}else l.removeEventListener("click",s.current);i.current=!1},d=window.setTimeout(()=>{l.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),l.removeEventListener("pointerdown",c),l.removeEventListener("click",s.current)}},[l,r]),{onPointerDownCapture:()=>i.current=!0}}function RE(n,l=globalThis?.document){const r=kt(n),i=y.useRef(!1);return y.useEffect(()=>{const s=c=>{c.target&&!i.current&&r0(wE,r,{originalEvent:c},{discrete:!1})};return l.addEventListener("focusin",s),()=>l.removeEventListener("focusin",s)},[l,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function qv(){const n=new CustomEvent(cd);document.dispatchEvent(n)}function r0(n,l,r,{discrete:i}){const s=r.originalEvent.target,c=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:r});l&&s.addEventListener(n,l,{once:!0}),i?yE(s,c):s.dispatchEvent(c)}var jt=globalThis?.document?y.useLayoutEffect:()=>{},AE=zd[" useId ".trim().toString()]||(()=>{}),NE=0;function Ut(n){const[l,r]=y.useState(AE());return jt(()=>{r(i=>i??String(NE++))},[n]),n||(l?`radix-${l}`:"")}const OE=["top","right","bottom","left"],Fa=Math.min,ln=Math.max,Ps=Math.round,ws=Math.floor,In=n=>({x:n,y:n}),jE={left:"right",right:"left",bottom:"top",top:"bottom"},DE={start:"end",end:"start"};function ud(n,l,r){return ln(n,Fa(l,r))}function ma(n,l){return typeof n=="function"?n(l):n}function ga(n){return n.split("-")[0]}function Ur(n){return n.split("-")[1]}function Ud(n){return n==="x"?"y":"x"}function Hd(n){return n==="y"?"height":"width"}const _E=new Set(["top","bottom"]);function Vn(n){return _E.has(ga(n))?"y":"x"}function Bd(n){return Ud(Vn(n))}function ME(n,l,r){r===void 0&&(r=!1);const i=Ur(n),s=Bd(n),c=Hd(s);let d=s==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return l.reference[c]>l.floating[c]&&(d=Vs(d)),[d,Vs(d)]}function zE(n){const l=Vs(n);return[fd(n),l,fd(l)]}function fd(n){return n.replace(/start|end/g,l=>DE[l])}const Gv=["left","right"],$v=["right","left"],LE=["top","bottom"],kE=["bottom","top"];function UE(n,l,r){switch(n){case"top":case"bottom":return r?l?$v:Gv:l?Gv:$v;case"left":case"right":return l?LE:kE;default:return[]}}function HE(n,l,r,i){const s=Ur(n);let c=UE(ga(n),r==="start",i);return s&&(c=c.map(d=>d+"-"+s),l&&(c=c.concat(c.map(fd)))),c}function Vs(n){return n.replace(/left|right|bottom|top/g,l=>jE[l])}function BE(n){return{top:0,right:0,bottom:0,left:0,...n}}function o0(n){return typeof n!="number"?BE(n):{top:n,right:n,bottom:n,left:n}}function Is(n){const{x:l,y:r,width:i,height:s}=n;return{width:i,height:s,top:r,left:l,right:l+i,bottom:r+s,x:l,y:r}}function Xv(n,l,r){let{reference:i,floating:s}=n;const c=Vn(l),d=Bd(l),h=Hd(d),p=ga(l),m=c==="y",x=i.x+i.width/2-s.width/2,v=i.y+i.height/2-s.height/2,w=i[h]/2-s[h]/2;let C;switch(p){case"top":C={x,y:i.y-s.height};break;case"bottom":C={x,y:i.y+i.height};break;case"right":C={x:i.x+i.width,y:v};break;case"left":C={x:i.x-s.width,y:v};break;default:C={x:i.x,y:i.y}}switch(Ur(l)){case"start":C[d]-=w*(r&&m?-1:1);break;case"end":C[d]+=w*(r&&m?-1:1);break}return C}const PE=async(n,l,r)=>{const{placement:i="bottom",strategy:s="absolute",middleware:c=[],platform:d}=r,h=c.filter(Boolean),p=await(d.isRTL==null?void 0:d.isRTL(l));let m=await d.getElementRects({reference:n,floating:l,strategy:s}),{x,y:v}=Xv(m,i,p),w=i,C={},T=0;for(let E=0;E<h.length;E++){const{name:R,fn:N}=h[E],{x:M,y:z,data:P,reset:G}=await N({x,y:v,initialPlacement:i,placement:w,strategy:s,middlewareData:C,rects:m,platform:d,elements:{reference:n,floating:l}});x=M??x,v=z??v,C={...C,[R]:{...C[R],...P}},G&&T<=50&&(T++,typeof G=="object"&&(G.placement&&(w=G.placement),G.rects&&(m=G.rects===!0?await d.getElementRects({reference:n,floating:l,strategy:s}):G.rects),{x,y:v}=Xv(m,w,p)),E=-1)}return{x,y:v,placement:w,strategy:s,middlewareData:C}};async function Xo(n,l){var r;l===void 0&&(l={});const{x:i,y:s,platform:c,rects:d,elements:h,strategy:p}=n,{boundary:m="clippingAncestors",rootBoundary:x="viewport",elementContext:v="floating",altBoundary:w=!1,padding:C=0}=ma(l,n),T=o0(C),R=h[w?v==="floating"?"reference":"floating":v],N=Is(await c.getClippingRect({element:(r=await(c.isElement==null?void 0:c.isElement(R)))==null||r?R:R.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(h.floating)),boundary:m,rootBoundary:x,strategy:p})),M=v==="floating"?{x:i,y:s,width:d.floating.width,height:d.floating.height}:d.reference,z=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h.floating)),P=await(c.isElement==null?void 0:c.isElement(z))?await(c.getScale==null?void 0:c.getScale(z))||{x:1,y:1}:{x:1,y:1},G=Is(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:M,offsetParent:z,strategy:p}):M);return{top:(N.top-G.top+T.top)/P.y,bottom:(G.bottom-N.bottom+T.bottom)/P.y,left:(N.left-G.left+T.left)/P.x,right:(G.right-N.right+T.right)/P.x}}const VE=n=>({name:"arrow",options:n,async fn(l){const{x:r,y:i,placement:s,rects:c,platform:d,elements:h,middlewareData:p}=l,{element:m,padding:x=0}=ma(n,l)||{};if(m==null)return{};const v=o0(x),w={x:r,y:i},C=Bd(s),T=Hd(C),E=await d.getDimensions(m),R=C==="y",N=R?"top":"left",M=R?"bottom":"right",z=R?"clientHeight":"clientWidth",P=c.reference[T]+c.reference[C]-w[C]-c.floating[T],G=w[C]-c.reference[C],k=await(d.getOffsetParent==null?void 0:d.getOffsetParent(m));let L=k?k[z]:0;(!L||!await(d.isElement==null?void 0:d.isElement(k)))&&(L=h.floating[z]||c.floating[T]);const Y=P/2-G/2,J=L/2-E[T]/2-1,ne=Fa(v[N],J),re=Fa(v[M],J),K=ne,ie=L-E[T]-re,ce=L/2-E[T]/2+Y,he=ud(K,ce,ie),D=!p.arrow&&Ur(s)!=null&&ce!==he&&c.reference[T]/2-(ce<K?ne:re)-E[T]/2<0,$=D?ce<K?ce-K:ce-ie:0;return{[C]:w[C]+$,data:{[C]:he,centerOffset:ce-he-$,...D&&{alignmentOffset:$}},reset:D}}}),IE=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(l){var r,i;const{placement:s,middlewareData:c,rects:d,initialPlacement:h,platform:p,elements:m}=l,{mainAxis:x=!0,crossAxis:v=!0,fallbackPlacements:w,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:E=!0,...R}=ma(n,l);if((r=c.arrow)!=null&&r.alignmentOffset)return{};const N=ga(s),M=Vn(h),z=ga(h)===h,P=await(p.isRTL==null?void 0:p.isRTL(m.floating)),G=w||(z||!E?[Vs(h)]:zE(h)),k=T!=="none";!w&&k&&G.push(...HE(h,E,T,P));const L=[h,...G],Y=await Xo(l,R),J=[];let ne=((i=c.flip)==null?void 0:i.overflows)||[];if(x&&J.push(Y[N]),v){const ce=ME(s,d,P);J.push(Y[ce[0]],Y[ce[1]])}if(ne=[...ne,{placement:s,overflows:J}],!J.every(ce=>ce<=0)){var re,K;const ce=(((re=c.flip)==null?void 0:re.index)||0)+1,he=L[ce];if(he&&(!(v==="alignment"?M!==Vn(he):!1)||ne.every(B=>Vn(B.placement)===M?B.overflows[0]>0:!0)))return{data:{index:ce,overflows:ne},reset:{placement:he}};let D=(K=ne.filter($=>$.overflows[0]<=0).sort(($,B)=>$.overflows[1]-B.overflows[1])[0])==null?void 0:K.placement;if(!D)switch(C){case"bestFit":{var ie;const $=(ie=ne.filter(B=>{if(k){const ue=Vn(B.placement);return ue===M||ue==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ue=>ue>0).reduce((ue,de)=>ue+de,0)]).sort((B,ue)=>B[1]-ue[1])[0])==null?void 0:ie[0];$&&(D=$);break}case"initialPlacement":D=h;break}if(s!==D)return{reset:{placement:D}}}return{}}}};function Fv(n,l){return{top:n.top-l.height,right:n.right-l.width,bottom:n.bottom-l.height,left:n.left-l.width}}function Kv(n){return OE.some(l=>n[l]>=0)}const YE=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(l){const{rects:r}=l,{strategy:i="referenceHidden",...s}=ma(n,l);switch(i){case"referenceHidden":{const c=await Xo(l,{...s,elementContext:"reference"}),d=Fv(c,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Kv(d)}}}case"escaped":{const c=await Xo(l,{...s,altBoundary:!0}),d=Fv(c,r.floating);return{data:{escapedOffsets:d,escaped:Kv(d)}}}default:return{}}}}},i0=new Set(["left","top"]);async function qE(n,l){const{placement:r,platform:i,elements:s}=n,c=await(i.isRTL==null?void 0:i.isRTL(s.floating)),d=ga(r),h=Ur(r),p=Vn(r)==="y",m=i0.has(d)?-1:1,x=c&&p?-1:1,v=ma(l,n);let{mainAxis:w,crossAxis:C,alignmentAxis:T}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return h&&typeof T=="number"&&(C=h==="end"?T*-1:T),p?{x:C*x,y:w*m}:{x:w*m,y:C*x}}const GE=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(l){var r,i;const{x:s,y:c,placement:d,middlewareData:h}=l,p=await qE(l,n);return d===((r=h.offset)==null?void 0:r.placement)&&(i=h.arrow)!=null&&i.alignmentOffset?{}:{x:s+p.x,y:c+p.y,data:{...p,placement:d}}}}},$E=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(l){const{x:r,y:i,placement:s}=l,{mainAxis:c=!0,crossAxis:d=!1,limiter:h={fn:R=>{let{x:N,y:M}=R;return{x:N,y:M}}},...p}=ma(n,l),m={x:r,y:i},x=await Xo(l,p),v=Vn(ga(s)),w=Ud(v);let C=m[w],T=m[v];if(c){const R=w==="y"?"top":"left",N=w==="y"?"bottom":"right",M=C+x[R],z=C-x[N];C=ud(M,C,z)}if(d){const R=v==="y"?"top":"left",N=v==="y"?"bottom":"right",M=T+x[R],z=T-x[N];T=ud(M,T,z)}const E=h.fn({...l,[w]:C,[v]:T});return{...E,data:{x:E.x-r,y:E.y-i,enabled:{[w]:c,[v]:d}}}}}},XE=function(n){return n===void 0&&(n={}),{options:n,fn(l){const{x:r,y:i,placement:s,rects:c,middlewareData:d}=l,{offset:h=0,mainAxis:p=!0,crossAxis:m=!0}=ma(n,l),x={x:r,y:i},v=Vn(s),w=Ud(v);let C=x[w],T=x[v];const E=ma(h,l),R=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(p){const z=w==="y"?"height":"width",P=c.reference[w]-c.floating[z]+R.mainAxis,G=c.reference[w]+c.reference[z]-R.mainAxis;C<P?C=P:C>G&&(C=G)}if(m){var N,M;const z=w==="y"?"width":"height",P=i0.has(ga(s)),G=c.reference[v]-c.floating[z]+(P&&((N=d.offset)==null?void 0:N[v])||0)+(P?0:R.crossAxis),k=c.reference[v]+c.reference[z]+(P?0:((M=d.offset)==null?void 0:M[v])||0)-(P?R.crossAxis:0);T<G?T=G:T>k&&(T=k)}return{[w]:C,[v]:T}}}},FE=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(l){var r,i;const{placement:s,rects:c,platform:d,elements:h}=l,{apply:p=()=>{},...m}=ma(n,l),x=await Xo(l,m),v=ga(s),w=Ur(s),C=Vn(s)==="y",{width:T,height:E}=c.floating;let R,N;v==="top"||v==="bottom"?(R=v,N=w===(await(d.isRTL==null?void 0:d.isRTL(h.floating))?"start":"end")?"left":"right"):(N=v,R=w==="end"?"top":"bottom");const M=E-x.top-x.bottom,z=T-x.left-x.right,P=Fa(E-x[R],M),G=Fa(T-x[N],z),k=!l.middlewareData.shift;let L=P,Y=G;if((r=l.middlewareData.shift)!=null&&r.enabled.x&&(Y=z),(i=l.middlewareData.shift)!=null&&i.enabled.y&&(L=M),k&&!w){const ne=ln(x.left,0),re=ln(x.right,0),K=ln(x.top,0),ie=ln(x.bottom,0);C?Y=T-2*(ne!==0||re!==0?ne+re:ln(x.left,x.right)):L=E-2*(K!==0||ie!==0?K+ie:ln(x.top,x.bottom))}await p({...l,availableWidth:Y,availableHeight:L});const J=await d.getDimensions(h.floating);return T!==J.width||E!==J.height?{reset:{rects:!0}}:{}}}};function Js(){return typeof window<"u"}function Hr(n){return s0(n)?(n.nodeName||"").toLowerCase():"#document"}function rn(n){var l;return(n==null||(l=n.ownerDocument)==null?void 0:l.defaultView)||window}function $n(n){var l;return(l=(s0(n)?n.ownerDocument:n.document)||window.document)==null?void 0:l.documentElement}function s0(n){return Js()?n instanceof Node||n instanceof rn(n).Node:!1}function On(n){return Js()?n instanceof Element||n instanceof rn(n).Element:!1}function Yn(n){return Js()?n instanceof HTMLElement||n instanceof rn(n).HTMLElement:!1}function Qv(n){return!Js()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof rn(n).ShadowRoot}const KE=new Set(["inline","contents"]);function Jo(n){const{overflow:l,overflowX:r,overflowY:i,display:s}=jn(n);return/auto|scroll|overlay|hidden|clip/.test(l+i+r)&&!KE.has(s)}const QE=new Set(["table","td","th"]);function ZE(n){return QE.has(Hr(n))}const WE=[":popover-open",":modal"];function ec(n){return WE.some(l=>{try{return n.matches(l)}catch{return!1}})}const JE=["transform","translate","scale","rotate","perspective"],eT=["transform","translate","scale","rotate","perspective","filter"],tT=["paint","layout","strict","content"];function Pd(n){const l=Vd(),r=On(n)?jn(n):n;return JE.some(i=>r[i]?r[i]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!l&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!l&&(r.filter?r.filter!=="none":!1)||eT.some(i=>(r.willChange||"").includes(i))||tT.some(i=>(r.contain||"").includes(i))}function nT(n){let l=Ka(n);for(;Yn(l)&&!Dr(l);){if(Pd(l))return l;if(ec(l))return null;l=Ka(l)}return null}function Vd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const aT=new Set(["html","body","#document"]);function Dr(n){return aT.has(Hr(n))}function jn(n){return rn(n).getComputedStyle(n)}function tc(n){return On(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Ka(n){if(Hr(n)==="html")return n;const l=n.assignedSlot||n.parentNode||Qv(n)&&n.host||$n(n);return Qv(l)?l.host:l}function c0(n){const l=Ka(n);return Dr(l)?n.ownerDocument?n.ownerDocument.body:n.body:Yn(l)&&Jo(l)?l:c0(l)}function Fo(n,l,r){var i;l===void 0&&(l=[]),r===void 0&&(r=!0);const s=c0(n),c=s===((i=n.ownerDocument)==null?void 0:i.body),d=rn(s);if(c){const h=dd(d);return l.concat(d,d.visualViewport||[],Jo(s)?s:[],h&&r?Fo(h):[])}return l.concat(s,Fo(s,[],r))}function dd(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function u0(n){const l=jn(n);let r=parseFloat(l.width)||0,i=parseFloat(l.height)||0;const s=Yn(n),c=s?n.offsetWidth:r,d=s?n.offsetHeight:i,h=Ps(r)!==c||Ps(i)!==d;return h&&(r=c,i=d),{width:r,height:i,$:h}}function Id(n){return On(n)?n:n.contextElement}function Or(n){const l=Id(n);if(!Yn(l))return In(1);const r=l.getBoundingClientRect(),{width:i,height:s,$:c}=u0(l);let d=(c?Ps(r.width):r.width)/i,h=(c?Ps(r.height):r.height)/s;return(!d||!Number.isFinite(d))&&(d=1),(!h||!Number.isFinite(h))&&(h=1),{x:d,y:h}}const lT=In(0);function f0(n){const l=rn(n);return!Vd()||!l.visualViewport?lT:{x:l.visualViewport.offsetLeft,y:l.visualViewport.offsetTop}}function rT(n,l,r){return l===void 0&&(l=!1),!r||l&&r!==rn(n)?!1:l}function Tl(n,l,r,i){l===void 0&&(l=!1),r===void 0&&(r=!1);const s=n.getBoundingClientRect(),c=Id(n);let d=In(1);l&&(i?On(i)&&(d=Or(i)):d=Or(n));const h=rT(c,r,i)?f0(c):In(0);let p=(s.left+h.x)/d.x,m=(s.top+h.y)/d.y,x=s.width/d.x,v=s.height/d.y;if(c){const w=rn(c),C=i&&On(i)?rn(i):i;let T=w,E=dd(T);for(;E&&i&&C!==T;){const R=Or(E),N=E.getBoundingClientRect(),M=jn(E),z=N.left+(E.clientLeft+parseFloat(M.paddingLeft))*R.x,P=N.top+(E.clientTop+parseFloat(M.paddingTop))*R.y;p*=R.x,m*=R.y,x*=R.x,v*=R.y,p+=z,m+=P,T=rn(E),E=dd(T)}}return Is({width:x,height:v,x:p,y:m})}function nc(n,l){const r=tc(n).scrollLeft;return l?l.left+r:Tl($n(n)).left+r}function d0(n,l){const r=n.getBoundingClientRect(),i=r.left+l.scrollLeft-nc(n,r),s=r.top+l.scrollTop;return{x:i,y:s}}function oT(n){let{elements:l,rect:r,offsetParent:i,strategy:s}=n;const c=s==="fixed",d=$n(i),h=l?ec(l.floating):!1;if(i===d||h&&c)return r;let p={scrollLeft:0,scrollTop:0},m=In(1);const x=In(0),v=Yn(i);if((v||!v&&!c)&&((Hr(i)!=="body"||Jo(d))&&(p=tc(i)),Yn(i))){const C=Tl(i);m=Or(i),x.x=C.x+i.clientLeft,x.y=C.y+i.clientTop}const w=d&&!v&&!c?d0(d,p):In(0);return{width:r.width*m.x,height:r.height*m.y,x:r.x*m.x-p.scrollLeft*m.x+x.x+w.x,y:r.y*m.y-p.scrollTop*m.y+x.y+w.y}}function iT(n){return Array.from(n.getClientRects())}function sT(n){const l=$n(n),r=tc(n),i=n.ownerDocument.body,s=ln(l.scrollWidth,l.clientWidth,i.scrollWidth,i.clientWidth),c=ln(l.scrollHeight,l.clientHeight,i.scrollHeight,i.clientHeight);let d=-r.scrollLeft+nc(n);const h=-r.scrollTop;return jn(i).direction==="rtl"&&(d+=ln(l.clientWidth,i.clientWidth)-s),{width:s,height:c,x:d,y:h}}const Zv=25;function cT(n,l){const r=rn(n),i=$n(n),s=r.visualViewport;let c=i.clientWidth,d=i.clientHeight,h=0,p=0;if(s){c=s.width,d=s.height;const x=Vd();(!x||x&&l==="fixed")&&(h=s.offsetLeft,p=s.offsetTop)}const m=nc(i);if(m<=0){const x=i.ownerDocument,v=x.body,w=getComputedStyle(v),C=x.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,T=Math.abs(i.clientWidth-v.clientWidth-C);T<=Zv&&(c-=T)}else m<=Zv&&(c+=m);return{width:c,height:d,x:h,y:p}}const uT=new Set(["absolute","fixed"]);function fT(n,l){const r=Tl(n,!0,l==="fixed"),i=r.top+n.clientTop,s=r.left+n.clientLeft,c=Yn(n)?Or(n):In(1),d=n.clientWidth*c.x,h=n.clientHeight*c.y,p=s*c.x,m=i*c.y;return{width:d,height:h,x:p,y:m}}function Wv(n,l,r){let i;if(l==="viewport")i=cT(n,r);else if(l==="document")i=sT($n(n));else if(On(l))i=fT(l,r);else{const s=f0(n);i={x:l.x-s.x,y:l.y-s.y,width:l.width,height:l.height}}return Is(i)}function h0(n,l){const r=Ka(n);return r===l||!On(r)||Dr(r)?!1:jn(r).position==="fixed"||h0(r,l)}function dT(n,l){const r=l.get(n);if(r)return r;let i=Fo(n,[],!1).filter(h=>On(h)&&Hr(h)!=="body"),s=null;const c=jn(n).position==="fixed";let d=c?Ka(n):n;for(;On(d)&&!Dr(d);){const h=jn(d),p=Pd(d);!p&&h.position==="fixed"&&(s=null),(c?!p&&!s:!p&&h.position==="static"&&!!s&&uT.has(s.position)||Jo(d)&&!p&&h0(n,d))?i=i.filter(x=>x!==d):s=h,d=Ka(d)}return l.set(n,i),i}function hT(n){let{element:l,boundary:r,rootBoundary:i,strategy:s}=n;const d=[...r==="clippingAncestors"?ec(l)?[]:dT(l,this._c):[].concat(r),i],h=d[0],p=d.reduce((m,x)=>{const v=Wv(l,x,s);return m.top=ln(v.top,m.top),m.right=Fa(v.right,m.right),m.bottom=Fa(v.bottom,m.bottom),m.left=ln(v.left,m.left),m},Wv(l,h,s));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function pT(n){const{width:l,height:r}=u0(n);return{width:l,height:r}}function mT(n,l,r){const i=Yn(l),s=$n(l),c=r==="fixed",d=Tl(n,!0,c,l);let h={scrollLeft:0,scrollTop:0};const p=In(0);function m(){p.x=nc(s)}if(i||!i&&!c)if((Hr(l)!=="body"||Jo(s))&&(h=tc(l)),i){const C=Tl(l,!0,c,l);p.x=C.x+l.clientLeft,p.y=C.y+l.clientTop}else s&&m();c&&!i&&s&&m();const x=s&&!i&&!c?d0(s,h):In(0),v=d.left+h.scrollLeft-p.x-x.x,w=d.top+h.scrollTop-p.y-x.y;return{x:v,y:w,width:d.width,height:d.height}}function qf(n){return jn(n).position==="static"}function Jv(n,l){if(!Yn(n)||jn(n).position==="fixed")return null;if(l)return l(n);let r=n.offsetParent;return $n(n)===r&&(r=r.ownerDocument.body),r}function p0(n,l){const r=rn(n);if(ec(n))return r;if(!Yn(n)){let s=Ka(n);for(;s&&!Dr(s);){if(On(s)&&!qf(s))return s;s=Ka(s)}return r}let i=Jv(n,l);for(;i&&ZE(i)&&qf(i);)i=Jv(i,l);return i&&Dr(i)&&qf(i)&&!Pd(i)?r:i||nT(n)||r}const gT=async function(n){const l=this.getOffsetParent||p0,r=this.getDimensions,i=await r(n.floating);return{reference:mT(n.reference,await l(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function vT(n){return jn(n).direction==="rtl"}const yT={convertOffsetParentRelativeRectToViewportRelativeRect:oT,getDocumentElement:$n,getClippingRect:hT,getOffsetParent:p0,getElementRects:gT,getClientRects:iT,getDimensions:pT,getScale:Or,isElement:On,isRTL:vT};function m0(n,l){return n.x===l.x&&n.y===l.y&&n.width===l.width&&n.height===l.height}function bT(n,l){let r=null,i;const s=$n(n);function c(){var h;clearTimeout(i),(h=r)==null||h.disconnect(),r=null}function d(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),c();const m=n.getBoundingClientRect(),{left:x,top:v,width:w,height:C}=m;if(h||l(),!w||!C)return;const T=ws(v),E=ws(s.clientWidth-(x+w)),R=ws(s.clientHeight-(v+C)),N=ws(x),z={rootMargin:-T+"px "+-E+"px "+-R+"px "+-N+"px",threshold:ln(0,Fa(1,p))||1};let P=!0;function G(k){const L=k[0].intersectionRatio;if(L!==p){if(!P)return d();L?d(!1,L):i=setTimeout(()=>{d(!1,1e-7)},1e3)}L===1&&!m0(m,n.getBoundingClientRect())&&d(),P=!1}try{r=new IntersectionObserver(G,{...z,root:s.ownerDocument})}catch{r=new IntersectionObserver(G,z)}r.observe(n)}return d(!0),c}function xT(n,l,r,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:c=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:p=!1}=i,m=Id(n),x=s||c?[...m?Fo(m):[],...Fo(l)]:[];x.forEach(N=>{s&&N.addEventListener("scroll",r,{passive:!0}),c&&N.addEventListener("resize",r)});const v=m&&h?bT(m,r):null;let w=-1,C=null;d&&(C=new ResizeObserver(N=>{let[M]=N;M&&M.target===m&&C&&(C.unobserve(l),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var z;(z=C)==null||z.observe(l)})),r()}),m&&!p&&C.observe(m),C.observe(l));let T,E=p?Tl(n):null;p&&R();function R(){const N=Tl(n);E&&!m0(E,N)&&r(),E=N,T=requestAnimationFrame(R)}return r(),()=>{var N;x.forEach(M=>{s&&M.removeEventListener("scroll",r),c&&M.removeEventListener("resize",r)}),v?.(),(N=C)==null||N.disconnect(),C=null,p&&cancelAnimationFrame(T)}}const ST=GE,wT=$E,CT=IE,ET=FE,TT=YE,ey=VE,RT=XE,AT=(n,l,r)=>{const i=new Map,s={platform:yT,...r},c={...s.platform,_c:i};return PE(n,l,{...s,platform:c})};var NT=typeof document<"u",OT=function(){},Ds=NT?y.useLayoutEffect:OT;function Ys(n,l){if(n===l)return!0;if(typeof n!=typeof l)return!1;if(typeof n=="function"&&n.toString()===l.toString())return!0;let r,i,s;if(n&&l&&typeof n=="object"){if(Array.isArray(n)){if(r=n.length,r!==l.length)return!1;for(i=r;i--!==0;)if(!Ys(n[i],l[i]))return!1;return!0}if(s=Object.keys(n),r=s.length,r!==Object.keys(l).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(l,s[i]))return!1;for(i=r;i--!==0;){const c=s[i];if(!(c==="_owner"&&n.$$typeof)&&!Ys(n[c],l[c]))return!1}return!0}return n!==n&&l!==l}function g0(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function ty(n,l){const r=g0(n);return Math.round(l*r)/r}function Gf(n){const l=y.useRef(n);return Ds(()=>{l.current=n}),l}function jT(n){n===void 0&&(n={});const{placement:l="bottom",strategy:r="absolute",middleware:i=[],platform:s,elements:{reference:c,floating:d}={},transform:h=!0,whileElementsMounted:p,open:m}=n,[x,v]=y.useState({x:0,y:0,strategy:r,placement:l,middlewareData:{},isPositioned:!1}),[w,C]=y.useState(i);Ys(w,i)||C(i);const[T,E]=y.useState(null),[R,N]=y.useState(null),M=y.useCallback(B=>{B!==k.current&&(k.current=B,E(B))},[]),z=y.useCallback(B=>{B!==L.current&&(L.current=B,N(B))},[]),P=c||T,G=d||R,k=y.useRef(null),L=y.useRef(null),Y=y.useRef(x),J=p!=null,ne=Gf(p),re=Gf(s),K=Gf(m),ie=y.useCallback(()=>{if(!k.current||!L.current)return;const B={placement:l,strategy:r,middleware:w};re.current&&(B.platform=re.current),AT(k.current,L.current,B).then(ue=>{const de={...ue,isPositioned:K.current!==!1};ce.current&&!Ys(Y.current,de)&&(Y.current=de,Zo.flushSync(()=>{v(de)}))})},[w,l,r,re,K]);Ds(()=>{m===!1&&Y.current.isPositioned&&(Y.current.isPositioned=!1,v(B=>({...B,isPositioned:!1})))},[m]);const ce=y.useRef(!1);Ds(()=>(ce.current=!0,()=>{ce.current=!1}),[]),Ds(()=>{if(P&&(k.current=P),G&&(L.current=G),P&&G){if(ne.current)return ne.current(P,G,ie);ie()}},[P,G,ie,ne,J]);const he=y.useMemo(()=>({reference:k,floating:L,setReference:M,setFloating:z}),[M,z]),D=y.useMemo(()=>({reference:P,floating:G}),[P,G]),$=y.useMemo(()=>{const B={position:r,left:0,top:0};if(!D.floating)return B;const ue=ty(D.floating,x.x),de=ty(D.floating,x.y);return h?{...B,transform:"translate("+ue+"px, "+de+"px)",...g0(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ue,top:de}},[r,h,D.floating,x.x,x.y]);return y.useMemo(()=>({...x,update:ie,refs:he,elements:D,floatingStyles:$}),[x,ie,he,D,$])}const DT=n=>{function l(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:n,fn(r){const{element:i,padding:s}=typeof n=="function"?n(r):n;return i&&l(i)?i.current!=null?ey({element:i.current,padding:s}).fn(r):{}:i?ey({element:i,padding:s}).fn(r):{}}}},_T=(n,l)=>({...ST(n),options:[n,l]}),MT=(n,l)=>({...wT(n),options:[n,l]}),zT=(n,l)=>({...RT(n),options:[n,l]}),LT=(n,l)=>({...CT(n),options:[n,l]}),kT=(n,l)=>({...ET(n),options:[n,l]}),UT=(n,l)=>({...TT(n),options:[n,l]}),HT=(n,l)=>({...DT(n),options:[n,l]});var BT="Arrow",v0=y.forwardRef((n,l)=>{const{children:r,width:i=10,height:s=5,...c}=n;return g.jsx(Ce.svg,{...c,ref:l,width:i,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?r:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});v0.displayName=BT;var PT=v0;function y0(n){const[l,r]=y.useState(void 0);return jt(()=>{if(n){r({width:n.offsetWidth,height:n.offsetHeight});const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const c=s[0];let d,h;if("borderBoxSize"in c){const p=c.borderBoxSize,m=Array.isArray(p)?p[0]:p;d=m.inlineSize,h=m.blockSize}else d=n.offsetWidth,h=n.offsetHeight;r({width:d,height:h})});return i.observe(n,{box:"border-box"}),()=>i.unobserve(n)}else r(void 0)},[n]),l}var Yd="Popper",[b0,Br]=Gn(Yd),[VT,x0]=b0(Yd),S0=n=>{const{__scopePopper:l,children:r}=n,[i,s]=y.useState(null);return g.jsx(VT,{scope:l,anchor:i,onAnchorChange:s,children:r})};S0.displayName=Yd;var w0="PopperAnchor",C0=y.forwardRef((n,l)=>{const{__scopePopper:r,virtualRef:i,...s}=n,c=x0(w0,r),d=y.useRef(null),h=He(l,d),p=y.useRef(null);return y.useEffect(()=>{const m=p.current;p.current=i?.current||d.current,m!==p.current&&c.onAnchorChange(p.current)}),i?null:g.jsx(Ce.div,{...s,ref:h})});C0.displayName=w0;var qd="PopperContent",[IT,YT]=b0(qd),E0=y.forwardRef((n,l)=>{const{__scopePopper:r,side:i="bottom",sideOffset:s=0,align:c="center",alignOffset:d=0,arrowPadding:h=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:x=0,sticky:v="partial",hideWhenDetached:w=!1,updatePositionStrategy:C="optimized",onPlaced:T,...E}=n,R=x0(qd,r),[N,M]=y.useState(null),z=He(l,Z=>M(Z)),[P,G]=y.useState(null),k=y0(P),L=k?.width??0,Y=k?.height??0,J=i+(c!=="center"?"-"+c:""),ne=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},re=Array.isArray(m)?m:[m],K=re.length>0,ie={padding:ne,boundary:re.filter(GT),altBoundary:K},{refs:ce,floatingStyles:he,placement:D,isPositioned:$,middlewareData:B}=jT({strategy:"fixed",placement:J,whileElementsMounted:(...Z)=>xT(...Z,{animationFrame:C==="always"}),elements:{reference:R.anchor},middleware:[_T({mainAxis:s+Y,alignmentAxis:d}),p&&MT({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?zT():void 0,...ie}),p&<({...ie}),kT({...ie,apply:({elements:Z,rects:se,availableWidth:fe,availableHeight:be})=>{const{width:Ae,height:De}=se.reference,ft=Z.floating.style;ft.setProperty("--radix-popper-available-width",`${fe}px`),ft.setProperty("--radix-popper-available-height",`${be}px`),ft.setProperty("--radix-popper-anchor-width",`${Ae}px`),ft.setProperty("--radix-popper-anchor-height",`${De}px`)}}),P&&HT({element:P,padding:h}),$T({arrowWidth:L,arrowHeight:Y}),w&&UT({strategy:"referenceHidden",...ie})]}),[ue,de]=A0(D),A=kt(T);jt(()=>{$&&A?.()},[$,A]);const O=B.arrow?.x,U=B.arrow?.y,X=B.arrow?.centerOffset!==0,[Q,oe]=y.useState();return jt(()=>{N&&oe(window.getComputedStyle(N).zIndex)},[N]),g.jsx("div",{ref:ce.setFloating,"data-radix-popper-content-wrapper":"",style:{...he,transform:$?he.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:g.jsx(IT,{scope:r,placedSide:ue,onArrowChange:G,arrowX:O,arrowY:U,shouldHideArrow:X,children:g.jsx(Ce.div,{"data-side":ue,"data-align":de,...E,ref:z,style:{...E.style,animation:$?void 0:"none"}})})})});E0.displayName=qd;var T0="PopperArrow",qT={top:"bottom",right:"left",bottom:"top",left:"right"},R0=y.forwardRef(function(l,r){const{__scopePopper:i,...s}=l,c=YT(T0,i),d=qT[c.placedSide];return g.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:g.jsx(PT,{...s,ref:r,style:{...s.style,display:"block"}})})});R0.displayName=T0;function GT(n){return n!==null}var $T=n=>({name:"transformOrigin",options:n,fn(l){const{placement:r,rects:i,middlewareData:s}=l,d=s.arrow?.centerOffset!==0,h=d?0:n.arrowWidth,p=d?0:n.arrowHeight,[m,x]=A0(r),v={start:"0%",center:"50%",end:"100%"}[x],w=(s.arrow?.x??0)+h/2,C=(s.arrow?.y??0)+p/2;let T="",E="";return m==="bottom"?(T=d?v:`${w}px`,E=`${-p}px`):m==="top"?(T=d?v:`${w}px`,E=`${i.floating.height+p}px`):m==="right"?(T=`${-p}px`,E=d?v:`${C}px`):m==="left"&&(T=`${i.floating.width+p}px`,E=d?v:`${C}px`),{data:{x:T,y:E}}}});function A0(n){const[l,r="center"]=n.split("-");return[l,r]}var Gd=S0,ac=C0,$d=E0,Xd=R0,XT="Portal",ei=y.forwardRef((n,l)=>{const{container:r,...i}=n,[s,c]=y.useState(!1);jt(()=>c(!0),[]);const d=r||s&&globalThis?.document?.body;return d?a0.createPortal(g.jsx(Ce.div,{...i,ref:l}),d):null});ei.displayName=XT;function FT(n,l){return y.useReducer((r,i)=>l[r][i]??r,n)}var xn=n=>{const{present:l,children:r}=n,i=KT(l),s=typeof r=="function"?r({present:i.isPresent}):y.Children.only(r),c=He(i.ref,QT(s));return typeof r=="function"||i.isPresent?y.cloneElement(s,{ref:c}):null};xn.displayName="Presence";function KT(n){const[l,r]=y.useState(),i=y.useRef(null),s=y.useRef(n),c=y.useRef("none"),d=n?"mounted":"unmounted",[h,p]=FT(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const m=Cs(i.current);c.current=h==="mounted"?m:"none"},[h]),jt(()=>{const m=i.current,x=s.current;if(x!==n){const w=c.current,C=Cs(m);n?p("MOUNT"):C==="none"||m?.display==="none"?p("UNMOUNT"):p(x&&w!==C?"ANIMATION_OUT":"UNMOUNT"),s.current=n}},[n,p]),jt(()=>{if(l){let m;const x=l.ownerDocument.defaultView??window,v=C=>{const E=Cs(i.current).includes(CSS.escape(C.animationName));if(C.target===l&&E&&(p("ANIMATION_END"),!s.current)){const R=l.style.animationFillMode;l.style.animationFillMode="forwards",m=x.setTimeout(()=>{l.style.animationFillMode==="forwards"&&(l.style.animationFillMode=R)})}},w=C=>{C.target===l&&(c.current=Cs(i.current))};return l.addEventListener("animationstart",w),l.addEventListener("animationcancel",v),l.addEventListener("animationend",v),()=>{x.clearTimeout(m),l.removeEventListener("animationstart",w),l.removeEventListener("animationcancel",v),l.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[l,p]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:y.useCallback(m=>{i.current=m?getComputedStyle(m):null,r(m)},[])}}function Cs(n){return n?.animationName||"none"}function QT(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?n.props.ref:n.props.ref||n.ref)}var ZT=Symbol("radix.slottable");function WT(n){const l=({children:r})=>g.jsx(g.Fragment,{children:r});return l.displayName=`${n}.Slottable`,l.__radixId=ZT,l}var JT=zd[" useInsertionEffect ".trim().toString()]||jt;function qn({prop:n,defaultProp:l,onChange:r=()=>{},caller:i}){const[s,c,d]=e2({defaultProp:l,onChange:r}),h=n!==void 0,p=h?n:s;{const x=y.useRef(n!==void 0);y.useEffect(()=>{const v=x.current;v!==h&&console.warn(`${i} is changing from ${v?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=h},[h,i])}const m=y.useCallback(x=>{if(h){const v=t2(x)?x(n):x;v!==n&&d.current?.(v)}else c(x)},[h,n,c,d]);return[p,m]}function e2({defaultProp:n,onChange:l}){const[r,i]=y.useState(n),s=y.useRef(r),c=y.useRef(l);return JT(()=>{c.current=l},[l]),y.useEffect(()=>{s.current!==r&&(c.current?.(r),s.current=r)},[r,s]),[r,i,c]}function t2(n){return typeof n=="function"}var N0=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"}),n2="VisuallyHidden",O0=y.forwardRef((n,l)=>g.jsx(Ce.span,{...n,ref:l,style:{...N0,...n.style}}));O0.displayName=n2;var a2=O0,[lc]=Gn("Tooltip",[Br]),rc=Br(),j0="TooltipProvider",l2=700,hd="tooltip.open",[r2,Fd]=lc(j0),D0=n=>{const{__scopeTooltip:l,delayDuration:r=l2,skipDelayDuration:i=300,disableHoverableContent:s=!1,children:c}=n,d=y.useRef(!0),h=y.useRef(!1),p=y.useRef(0);return y.useEffect(()=>{const m=p.current;return()=>window.clearTimeout(m)},[]),g.jsx(r2,{scope:l,isOpenDelayedRef:d,delayDuration:r,onOpen:y.useCallback(()=>{window.clearTimeout(p.current),d.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>d.current=!0,i)},[i]),isPointerInTransitRef:h,onPointerInTransitChange:y.useCallback(m=>{h.current=m},[]),disableHoverableContent:s,children:c})};D0.displayName=j0;var Ko="Tooltip",[o2,ti]=lc(Ko),_0=n=>{const{__scopeTooltip:l,children:r,open:i,defaultOpen:s,onOpenChange:c,disableHoverableContent:d,delayDuration:h}=n,p=Fd(Ko,n.__scopeTooltip),m=rc(l),[x,v]=y.useState(null),w=Ut(),C=y.useRef(0),T=d??p.disableHoverableContent,E=h??p.delayDuration,R=y.useRef(!1),[N,M]=qn({prop:i,defaultProp:s??!1,onChange:L=>{L?(p.onOpen(),document.dispatchEvent(new CustomEvent(hd))):p.onClose(),c?.(L)},caller:Ko}),z=y.useMemo(()=>N?R.current?"delayed-open":"instant-open":"closed",[N]),P=y.useCallback(()=>{window.clearTimeout(C.current),C.current=0,R.current=!1,M(!0)},[M]),G=y.useCallback(()=>{window.clearTimeout(C.current),C.current=0,M(!1)},[M]),k=y.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>{R.current=!0,M(!0),C.current=0},E)},[E,M]);return y.useEffect(()=>()=>{C.current&&(window.clearTimeout(C.current),C.current=0)},[]),g.jsx(Gd,{...m,children:g.jsx(o2,{scope:l,contentId:w,open:N,stateAttribute:z,trigger:x,onTriggerChange:v,onTriggerEnter:y.useCallback(()=>{p.isOpenDelayedRef.current?k():P()},[p.isOpenDelayedRef,k,P]),onTriggerLeave:y.useCallback(()=>{T?G():(window.clearTimeout(C.current),C.current=0)},[G,T]),onOpen:P,onClose:G,disableHoverableContent:T,children:r})})};_0.displayName=Ko;var pd="TooltipTrigger",M0=y.forwardRef((n,l)=>{const{__scopeTooltip:r,...i}=n,s=ti(pd,r),c=Fd(pd,r),d=rc(r),h=y.useRef(null),p=He(l,h,s.onTriggerChange),m=y.useRef(!1),x=y.useRef(!1),v=y.useCallback(()=>m.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),g.jsx(ac,{asChild:!0,...d,children:g.jsx(Ce.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...i,ref:p,onPointerMove:we(n.onPointerMove,w=>{w.pointerType!=="touch"&&!x.current&&!c.isPointerInTransitRef.current&&(s.onTriggerEnter(),x.current=!0)}),onPointerLeave:we(n.onPointerLeave,()=>{s.onTriggerLeave(),x.current=!1}),onPointerDown:we(n.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:we(n.onFocus,()=>{m.current||s.onOpen()}),onBlur:we(n.onBlur,s.onClose),onClick:we(n.onClick,s.onClose)})})});M0.displayName=pd;var Kd="TooltipPortal",[i2,s2]=lc(Kd,{forceMount:void 0}),z0=n=>{const{__scopeTooltip:l,forceMount:r,children:i,container:s}=n,c=ti(Kd,l);return g.jsx(i2,{scope:l,forceMount:r,children:g.jsx(xn,{present:r||c.open,children:g.jsx(ei,{asChild:!0,container:s,children:i})})})};z0.displayName=Kd;var _r="TooltipContent",L0=y.forwardRef((n,l)=>{const r=s2(_r,n.__scopeTooltip),{forceMount:i=r.forceMount,side:s="top",...c}=n,d=ti(_r,n.__scopeTooltip);return g.jsx(xn,{present:i||d.open,children:d.disableHoverableContent?g.jsx(k0,{side:s,...c,ref:l}):g.jsx(c2,{side:s,...c,ref:l})})}),c2=y.forwardRef((n,l)=>{const r=ti(_r,n.__scopeTooltip),i=Fd(_r,n.__scopeTooltip),s=y.useRef(null),c=He(l,s),[d,h]=y.useState(null),{trigger:p,onClose:m}=r,x=s.current,{onPointerInTransitChange:v}=i,w=y.useCallback(()=>{h(null),v(!1)},[v]),C=y.useCallback((T,E)=>{const R=T.currentTarget,N={x:T.clientX,y:T.clientY},M=h2(N,R.getBoundingClientRect()),z=p2(N,M),P=m2(E.getBoundingClientRect()),G=v2([...z,...P]);h(G),v(!0)},[v]);return y.useEffect(()=>()=>w(),[w]),y.useEffect(()=>{if(p&&x){const T=R=>C(R,x),E=R=>C(R,p);return p.addEventListener("pointerleave",T),x.addEventListener("pointerleave",E),()=>{p.removeEventListener("pointerleave",T),x.removeEventListener("pointerleave",E)}}},[p,x,C,w]),y.useEffect(()=>{if(d){const T=E=>{const R=E.target,N={x:E.clientX,y:E.clientY},M=p?.contains(R)||x?.contains(R),z=!g2(N,d);M?w():z&&(w(),m())};return document.addEventListener("pointermove",T),()=>document.removeEventListener("pointermove",T)}},[p,x,d,m,w]),g.jsx(k0,{...n,ref:c})}),[u2,f2]=lc(Ko,{isInside:!1}),d2=WT("TooltipContent"),k0=y.forwardRef((n,l)=>{const{__scopeTooltip:r,children:i,"aria-label":s,onEscapeKeyDown:c,onPointerDownOutside:d,...h}=n,p=ti(_r,r),m=rc(r),{onClose:x}=p;return y.useEffect(()=>(document.addEventListener(hd,x),()=>document.removeEventListener(hd,x)),[x]),y.useEffect(()=>{if(p.trigger){const v=w=>{w.target?.contains(p.trigger)&&x()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[p.trigger,x]),g.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:v=>v.preventDefault(),onDismiss:x,children:g.jsxs($d,{"data-state":p.stateAttribute,...m,...h,ref:l,style:{...h.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:[g.jsx(d2,{children:i}),g.jsx(u2,{scope:r,isInside:!0,children:g.jsx(a2,{id:p.contentId,role:"tooltip",children:s||i})})]})})});L0.displayName=_r;var U0="TooltipArrow",H0=y.forwardRef((n,l)=>{const{__scopeTooltip:r,...i}=n,s=rc(r);return f2(U0,r).isInside?null:g.jsx(Xd,{...s,...i,ref:l})});H0.displayName=U0;function h2(n,l){const r=Math.abs(l.top-n.y),i=Math.abs(l.bottom-n.y),s=Math.abs(l.right-n.x),c=Math.abs(l.left-n.x);switch(Math.min(r,i,s,c)){case c:return"left";case s:return"right";case r:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function p2(n,l,r=5){const i=[];switch(l){case"top":i.push({x:n.x-r,y:n.y+r},{x:n.x+r,y:n.y+r});break;case"bottom":i.push({x:n.x-r,y:n.y-r},{x:n.x+r,y:n.y-r});break;case"left":i.push({x:n.x+r,y:n.y-r},{x:n.x+r,y:n.y+r});break;case"right":i.push({x:n.x-r,y:n.y-r},{x:n.x-r,y:n.y+r});break}return i}function m2(n){const{top:l,right:r,bottom:i,left:s}=n;return[{x:s,y:l},{x:r,y:l},{x:r,y:i},{x:s,y:i}]}function g2(n,l){const{x:r,y:i}=n;let s=!1;for(let c=0,d=l.length-1;c<l.length;d=c++){const h=l[c],p=l[d],m=h.x,x=h.y,v=p.x,w=p.y;x>i!=w>i&&r<(v-m)*(i-x)/(w-x)+m&&(s=!s)}return s}function v2(n){const l=n.slice();return l.sort((r,i)=>r.x<i.x?-1:r.x>i.x?1:r.y<i.y?-1:r.y>i.y?1:0),y2(l)}function y2(n){if(n.length<=1)return n.slice();const l=[];for(let i=0;i<n.length;i++){const s=n[i];for(;l.length>=2;){const c=l[l.length-1],d=l[l.length-2];if((c.x-d.x)*(s.y-d.y)>=(c.y-d.y)*(s.x-d.x))l.pop();else break}l.push(s)}l.pop();const r=[];for(let i=n.length-1;i>=0;i--){const s=n[i];for(;r.length>=2;){const c=r[r.length-1],d=r[r.length-2];if((c.x-d.x)*(s.y-d.y)>=(c.y-d.y)*(s.x-d.x))r.pop();else break}r.push(s)}return r.pop(),l.length===1&&r.length===1&&l[0].x===r[0].x&&l[0].y===r[0].y?l:l.concat(r)}var b2=D0,x2=_0,S2=M0,w2=z0,C2=L0,E2=H0;function T2({delayDuration:n=0,...l}){return g.jsx(b2,{"data-slot":"tooltip-provider",delayDuration:n,...l})}function At({...n}){return g.jsx(T2,{children:g.jsx(x2,{"data-slot":"tooltip",...n})})}function Nt({...n}){return g.jsx(S2,{"data-slot":"tooltip-trigger",...n})}function Ot({className:n,sideOffset:l=0,children:r,...i}){return g.jsx(w2,{children:g.jsxs(C2,{"data-slot":"tooltip-content",sideOffset:l,className:je("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",n),...i,children:[r,g.jsx(E2,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function R2(n){if(typeof document>"u")return;let l=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",l.appendChild(r),r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n))}const A2=n=>{switch(n){case"success":return j2;case"info":return _2;case"warning":return D2;case"error":return M2;default:return null}},N2=Array(12).fill(0),O2=({visible:n,className:l})=>le.createElement("div",{className:["sonner-loading-wrapper",l].filter(Boolean).join(" "),"data-visible":n},le.createElement("div",{className:"sonner-spinner"},N2.map((r,i)=>le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),j2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),D2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),_2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),M2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),z2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),L2=()=>{const[n,l]=le.useState(document.hidden);return le.useEffect(()=>{const r=()=>{l(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),n};let md=1;class k2{constructor(){this.subscribe=l=>(this.subscribers.push(l),()=>{const r=this.subscribers.indexOf(l);this.subscribers.splice(r,1)}),this.publish=l=>{this.subscribers.forEach(r=>r(l))},this.addToast=l=>{this.publish(l),this.toasts=[...this.toasts,l]},this.create=l=>{var r;const{message:i,...s}=l,c=typeof l?.id=="number"||((r=l.id)==null?void 0:r.length)>0?l.id:md++,d=this.toasts.find(p=>p.id===c),h=l.dismissible===void 0?!0:l.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),d?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...l,id:c,title:i}),{...p,...l,id:c,dismissible:h,title:i}):p):this.addToast({title:i,...s,dismissible:h,id:c}),c},this.dismiss=l=>(l?(this.dismissedToasts.add(l),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:l,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),l),this.message=(l,r)=>this.create({...r,message:l}),this.error=(l,r)=>this.create({...r,message:l,type:"error"}),this.success=(l,r)=>this.create({...r,type:"success",message:l}),this.info=(l,r)=>this.create({...r,type:"info",message:l}),this.warning=(l,r)=>this.create({...r,type:"warning",message:l}),this.loading=(l,r)=>this.create({...r,type:"loading",message:l}),this.promise=(l,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:l,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(l instanceof Function?l():l);let c=i!==void 0,d;const h=s.then(async m=>{if(d=["resolve",m],le.isValidElement(m))c=!1,this.create({id:i,type:"default",message:m});else if(H2(m)&&!m.ok){c=!1;const v=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,w=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description,T=typeof v=="object"&&!le.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:w,...T})}else if(m instanceof Error){c=!1;const v=typeof r.error=="function"?await r.error(m):r.error,w=typeof r.description=="function"?await r.description(m):r.description,T=typeof v=="object"&&!le.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:w,...T})}else if(r.success!==void 0){c=!1;const v=typeof r.success=="function"?await r.success(m):r.success,w=typeof r.description=="function"?await r.description(m):r.description,T=typeof v=="object"&&!le.isValidElement(v)?v:{message:v};this.create({id:i,type:"success",description:w,...T})}}).catch(async m=>{if(d=["reject",m],r.error!==void 0){c=!1;const x=typeof r.error=="function"?await r.error(m):r.error,v=typeof r.description=="function"?await r.description(m):r.description,C=typeof x=="object"&&!le.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:v,...C})}}).finally(()=>{c&&(this.dismiss(i),i=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((m,x)=>h.then(()=>d[0]==="reject"?x(d[1]):m(d[1])).catch(x));return typeof i!="string"&&typeof i!="number"?{unwrap:p}:Object.assign(i,{unwrap:p})},this.custom=(l,r)=>{const i=r?.id||md++;return this.create({jsx:l(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(l=>!this.dismissedToasts.has(l.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Kt=new k2,U2=(n,l)=>{const r=l?.id||md++;return Kt.addToast({title:n,...l,id:r}),r},H2=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",B2=U2,P2=()=>Kt.toasts,V2=()=>Kt.getActiveToasts(),ut=Object.assign(B2,{success:Kt.success,info:Kt.info,warning:Kt.warning,error:Kt.error,custom:Kt.custom,message:Kt.message,promise:Kt.promise,dismiss:Kt.dismiss,loading:Kt.loading},{getHistory:P2,getToasts:V2});R2("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Es(n){return n.label!==void 0}const I2=3,Y2="24px",q2="16px",ny=4e3,G2=356,$2=14,X2=45,F2=200;function Hn(...n){return n.filter(Boolean).join(" ")}function K2(n){const[l,r]=n.split("-"),i=[];return l&&i.push(l),r&&i.push(r),i}const Q2=n=>{var l,r,i,s,c,d,h,p,m;const{invert:x,toast:v,unstyled:w,interacting:C,setHeights:T,visibleToasts:E,heights:R,index:N,toasts:M,expanded:z,removeToast:P,defaultRichColors:G,closeButton:k,style:L,cancelButtonStyle:Y,actionButtonStyle:J,className:ne="",descriptionClassName:re="",duration:K,position:ie,gap:ce,expandByDefault:he,classNames:D,icons:$,closeButtonAriaLabel:B="Close toast"}=n,[ue,de]=le.useState(null),[A,O]=le.useState(null),[U,X]=le.useState(!1),[Q,oe]=le.useState(!1),[Z,se]=le.useState(!1),[fe,be]=le.useState(!1),[Ae,De]=le.useState(!1),[ft,it]=le.useState(0),[wn,on]=le.useState(0),Qt=le.useRef(v.duration||K||ny),ae=le.useRef(null),xe=le.useRef(null),Ve=N===0,nt=N+1<=E,Ye=v.type,St=v.dismissible!==!1,at=v.className||"",jl=v.descriptionClassName||"",Fn=le.useMemo(()=>R.findIndex(Ee=>Ee.toastId===v.id)||0,[R,v.id]),ri=le.useMemo(()=>{var Ee;return(Ee=v.closeButton)!=null?Ee:k},[v.closeButton,k]),tl=le.useMemo(()=>v.duration||K||ny,[v.duration,K]),Ir=le.useRef(0),Kn=le.useRef(0),oi=le.useRef(0),va=le.useRef(null),[nl,zt]=ie.split("-"),Cn=le.useMemo(()=>R.reduce((Ee,Je,yt)=>yt>=Fn?Ee:Ee+Je.height,0),[R,Fn]),Dt=L2(),xc=v.invert||x,Yr=Ye==="loading";Kn.current=le.useMemo(()=>Fn*ce+Cn,[Fn,Cn]),le.useEffect(()=>{Qt.current=tl},[tl]),le.useEffect(()=>{X(!0)},[]),le.useEffect(()=>{const Ee=xe.current;if(Ee){const Je=Ee.getBoundingClientRect().height;return on(Je),T(yt=>[{toastId:v.id,height:Je,position:v.position},...yt]),()=>T(yt=>yt.filter(_t=>_t.toastId!==v.id))}},[T,v.id]),le.useLayoutEffect(()=>{if(!U)return;const Ee=xe.current,Je=Ee.style.height;Ee.style.height="auto";const yt=Ee.getBoundingClientRect().height;Ee.style.height=Je,on(yt),T(_t=>_t.find(lt=>lt.toastId===v.id)?_t.map(lt=>lt.toastId===v.id?{...lt,height:yt}:lt):[{toastId:v.id,height:yt,position:v.position},..._t])},[U,v.title,v.description,T,v.id,v.jsx,v.action,v.cancel]);const _n=le.useCallback(()=>{oe(!0),it(Kn.current),T(Ee=>Ee.filter(Je=>Je.toastId!==v.id)),setTimeout(()=>{P(v)},F2)},[v,P,T,Kn]);le.useEffect(()=>{if(v.promise&&Ye==="loading"||v.duration===1/0||v.type==="loading")return;let Ee;return z||C||Dt?(()=>{if(oi.current<Ir.current){const _t=new Date().getTime()-Ir.current;Qt.current=Qt.current-_t}oi.current=new Date().getTime()})():Qt.current!==1/0&&(Ir.current=new Date().getTime(),Ee=setTimeout(()=>{v.onAutoClose==null||v.onAutoClose.call(v,v),_n()},Qt.current)),()=>clearTimeout(Ee)},[z,C,v,Ye,Dt,_n]),le.useEffect(()=>{v.delete&&(_n(),v.onDismiss==null||v.onDismiss.call(v,v))},[_n,v.delete]);function Dl(){var Ee;if($?.loading){var Je;return le.createElement("div",{className:Hn(D?.loader,v==null||(Je=v.classNames)==null?void 0:Je.loader,"sonner-loader"),"data-visible":Ye==="loading"},$.loading)}return le.createElement(O2,{className:Hn(D?.loader,v==null||(Ee=v.classNames)==null?void 0:Ee.loader),visible:Ye==="loading"})}const _l=v.icon||$?.[Ye]||A2(Ye);var al,Mn;return le.createElement("li",{tabIndex:0,ref:xe,className:Hn(ne,at,D?.toast,v==null||(l=v.classNames)==null?void 0:l.toast,D?.default,D?.[Ye],v==null||(r=v.classNames)==null?void 0:r[Ye]),"data-sonner-toast":"","data-rich-colors":(al=v.richColors)!=null?al:G,"data-styled":!(v.jsx||v.unstyled||w),"data-mounted":U,"data-promise":!!v.promise,"data-swiped":Ae,"data-removed":Q,"data-visible":nt,"data-y-position":nl,"data-x-position":zt,"data-index":N,"data-front":Ve,"data-swiping":Z,"data-dismissible":St,"data-type":Ye,"data-invert":xc,"data-swipe-out":fe,"data-swipe-direction":A,"data-expanded":!!(z||he&&U),"data-testid":v.testId,style:{"--index":N,"--toasts-before":N,"--z-index":M.length-N,"--offset":`${Q?ft:Kn.current}px`,"--initial-height":he?"auto":`${wn}px`,...L,...v.style},onDragEnd:()=>{se(!1),de(null),va.current=null},onPointerDown:Ee=>{Ee.button!==2&&(Yr||!St||(ae.current=new Date,it(Kn.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(se(!0),va.current={x:Ee.clientX,y:Ee.clientY})))},onPointerUp:()=>{var Ee,Je,yt;if(fe||!St)return;va.current=null;const _t=Number(((Ee=xe.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ya=Number(((Je=xe.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),lt=new Date().getTime()-((yt=ae.current)==null?void 0:yt.getTime()),Bt=ue==="x"?_t:ya,ll=Math.abs(Bt)/lt;if(Math.abs(Bt)>=X2||ll>.11){it(Kn.current),v.onDismiss==null||v.onDismiss.call(v,v),O(ue==="x"?_t>0?"right":"left":ya>0?"down":"up"),_n(),be(!0);return}else{var Pt,Vt;(Pt=xe.current)==null||Pt.style.setProperty("--swipe-amount-x","0px"),(Vt=xe.current)==null||Vt.style.setProperty("--swipe-amount-y","0px")}De(!1),se(!1),de(null)},onPointerMove:Ee=>{var Je,yt,_t;if(!va.current||!St||((Je=window.getSelection())==null?void 0:Je.toString().length)>0)return;const lt=Ee.clientY-va.current.y,Bt=Ee.clientX-va.current.x;var ll;const Pt=(ll=n.swipeDirections)!=null?ll:K2(ie);!ue&&(Math.abs(Bt)>1||Math.abs(lt)>1)&&de(Math.abs(Bt)>Math.abs(lt)?"x":"y");let Vt={x:0,y:0};const Ml=En=>1/(1.5+Math.abs(En)/20);if(ue==="y"){if(Pt.includes("top")||Pt.includes("bottom"))if(Pt.includes("top")&<<0||Pt.includes("bottom")&<>0)Vt.y=lt;else{const En=lt*Ml(lt);Vt.y=Math.abs(En)<Math.abs(lt)?En:lt}}else if(ue==="x"&&(Pt.includes("left")||Pt.includes("right")))if(Pt.includes("left")&&Bt<0||Pt.includes("right")&&Bt>0)Vt.x=Bt;else{const En=Bt*Ml(Bt);Vt.x=Math.abs(En)<Math.abs(Bt)?En:Bt}(Math.abs(Vt.x)>0||Math.abs(Vt.y)>0)&&De(!0),(yt=xe.current)==null||yt.style.setProperty("--swipe-amount-x",`${Vt.x}px`),(_t=xe.current)==null||_t.style.setProperty("--swipe-amount-y",`${Vt.y}px`)}},ri&&!v.jsx&&Ye!=="loading"?le.createElement("button",{"aria-label":B,"data-disabled":Yr,"data-close-button":!0,onClick:Yr||!St?()=>{}:()=>{_n(),v.onDismiss==null||v.onDismiss.call(v,v)},className:Hn(D?.closeButton,v==null||(i=v.classNames)==null?void 0:i.closeButton)},(Mn=$?.close)!=null?Mn:z2):null,(Ye||v.icon||v.promise)&&v.icon!==null&&($?.[Ye]!==null||v.icon)?le.createElement("div",{"data-icon":"",className:Hn(D?.icon,v==null||(s=v.classNames)==null?void 0:s.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||Dl():null,v.type!=="loading"?_l:null):null,le.createElement("div",{"data-content":"",className:Hn(D?.content,v==null||(c=v.classNames)==null?void 0:c.content)},le.createElement("div",{"data-title":"",className:Hn(D?.title,v==null||(d=v.classNames)==null?void 0:d.title)},v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title),v.description?le.createElement("div",{"data-description":"",className:Hn(re,jl,D?.description,v==null||(h=v.classNames)==null?void 0:h.description)},typeof v.description=="function"?v.description():v.description):null),le.isValidElement(v.cancel)?v.cancel:v.cancel&&Es(v.cancel)?le.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||Y,onClick:Ee=>{Es(v.cancel)&&St&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,Ee),_n())},className:Hn(D?.cancelButton,v==null||(p=v.classNames)==null?void 0:p.cancelButton)},v.cancel.label):null,le.isValidElement(v.action)?v.action:v.action&&Es(v.action)?le.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||J,onClick:Ee=>{Es(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,Ee),!Ee.defaultPrevented&&_n())},className:Hn(D?.actionButton,v==null||(m=v.classNames)==null?void 0:m.actionButton)},v.action.label):null)};function ay(){if(typeof window>"u"||typeof document>"u")return"ltr";const n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function Z2(n,l){const r={};return[n,l].forEach((i,s)=>{const c=s===1,d=c?"--mobile-offset":"--offset",h=c?q2:Y2;function p(m){["top","right","bottom","left"].forEach(x=>{r[`${d}-${x}`]=typeof m=="number"?`${m}px`:m})}typeof i=="number"||typeof i=="string"?p(i):typeof i=="object"?["top","right","bottom","left"].forEach(m=>{i[m]===void 0?r[`${d}-${m}`]=h:r[`${d}-${m}`]=typeof i[m]=="number"?`${i[m]}px`:i[m]}):p(h)}),r}const W2=le.forwardRef(function(l,r){const{id:i,invert:s,position:c="bottom-right",hotkey:d=["altKey","KeyT"],expand:h,closeButton:p,className:m,offset:x,mobileOffset:v,theme:w="light",richColors:C,duration:T,style:E,visibleToasts:R=I2,toastOptions:N,dir:M=ay(),gap:z=$2,icons:P,containerAriaLabel:G="Notifications"}=l,[k,L]=le.useState([]),Y=le.useMemo(()=>i?k.filter(U=>U.toasterId===i):k.filter(U=>!U.toasterId),[k,i]),J=le.useMemo(()=>Array.from(new Set([c].concat(Y.filter(U=>U.position).map(U=>U.position)))),[Y,c]),[ne,re]=le.useState([]),[K,ie]=le.useState(!1),[ce,he]=le.useState(!1),[D,$]=le.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=le.useRef(null),ue=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),de=le.useRef(null),A=le.useRef(!1),O=le.useCallback(U=>{L(X=>{var Q;return(Q=X.find(oe=>oe.id===U.id))!=null&&Q.delete||Kt.dismiss(U.id),X.filter(({id:oe})=>oe!==U.id)})},[]);return le.useEffect(()=>Kt.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{L(X=>X.map(Q=>Q.id===U.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{a0.flushSync(()=>{L(X=>{const Q=X.findIndex(oe=>oe.id===U.id);return Q!==-1?[...X.slice(0,Q),{...X[Q],...U},...X.slice(Q+1)]:[U,...X]})})})}),[k]),le.useEffect(()=>{if(w!=="system"){$(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:X})=>{$(X?"dark":"light")})}catch{U.addListener(({matches:Q})=>{try{$(Q?"dark":"light")}catch(oe){console.error(oe)}})}},[w]),le.useEffect(()=>{k.length<=1&&ie(!1)},[k]),le.useEffect(()=>{const U=X=>{var Q;if(d.every(se=>X[se]||X.code===se)){var Z;ie(!0),(Z=B.current)==null||Z.focus()}X.code==="Escape"&&(document.activeElement===B.current||(Q=B.current)!=null&&Q.contains(document.activeElement))&&ie(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[d]),le.useEffect(()=>{if(B.current)return()=>{de.current&&(de.current.focus({preventScroll:!0}),de.current=null,A.current=!1)}},[B.current]),le.createElement("section",{ref:r,"aria-label":`${G} ${ue}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},J.map((U,X)=>{var Q;const[oe,Z]=U.split("-");return Y.length?le.createElement("ol",{key:U,dir:M==="auto"?ay():M,tabIndex:-1,ref:B,className:m,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":oe,"data-x-position":Z,style:{"--front-toast-height":`${((Q=ne[0])==null?void 0:Q.height)||0}px`,"--width":`${G2}px`,"--gap":`${z}px`,...E,...Z2(x,v)},onBlur:se=>{A.current&&!se.currentTarget.contains(se.relatedTarget)&&(A.current=!1,de.current&&(de.current.focus({preventScroll:!0}),de.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||A.current||(A.current=!0,de.current=se.relatedTarget)},onMouseEnter:()=>ie(!0),onMouseMove:()=>ie(!0),onMouseLeave:()=>{ce||ie(!1)},onDragEnd:()=>ie(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||he(!0)},onPointerUp:()=>he(!1)},Y.filter(se=>!se.position&&X===0||se.position===U).map((se,fe)=>{var be,Ae;return le.createElement(Q2,{key:se.id,icons:P,index:fe,toast:se,defaultRichColors:C,duration:(be=N?.duration)!=null?be:T,className:N?.className,descriptionClassName:N?.descriptionClassName,invert:s,visibleToasts:R,closeButton:(Ae=N?.closeButton)!=null?Ae:p,interacting:ce,position:U,style:N?.style,unstyled:N?.unstyled,classNames:N?.classNames,cancelButtonStyle:N?.cancelButtonStyle,actionButtonStyle:N?.actionButtonStyle,closeButtonAriaLabel:N?.closeButtonAriaLabel,removeToast:O,toasts:Y.filter(De=>De.position==se.position),heights:ne.filter(De=>De.position==se.position),setHeights:re,expandByDefault:h,gap:z,expanded:K,swipeDirections:l.swipeDirections})})):null}))});const J2=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),eR=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,r,i)=>i?i.toUpperCase():r.toLowerCase()),ly=n=>{const l=eR(n);return l.charAt(0).toUpperCase()+l.slice(1)},B0=(...n)=>n.filter((l,r,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===r).join(" ").trim(),tR=n=>{for(const l in n)if(l.startsWith("aria-")||l==="role"||l==="title")return!0};var nR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const aR=y.forwardRef(({color:n="currentColor",size:l=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:s="",children:c,iconNode:d,...h},p)=>y.createElement("svg",{ref:p,...nR,width:l,height:l,stroke:n,strokeWidth:i?Number(r)*24/Number(l):r,className:B0("lucide",s),...!c&&!tR(h)&&{"aria-hidden":"true"},...h},[...d.map(([m,x])=>y.createElement(m,x)),...Array.isArray(c)?c:[c]]));const Qe=(n,l)=>{const r=y.forwardRef(({className:i,...s},c)=>y.createElement(aR,{ref:c,iconNode:l,className:B0(`lucide-${J2(ly(n))}`,`lucide-${n}`,i),...s}));return r.displayName=ly(n),r};const lR=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],rR=Qe("arrow-right-left",lR);const oR=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],iR=Qe("book-open",oR);const sR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_s=Qe("check",sR);const cR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qs=Qe("chevron-down",cR);const uR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],fR=Qe("chevron-up",uR);const dR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],hR=Qe("circle-check",dR);const pR=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ry=Qe("copy",pR);const mR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],gR=Qe("globe",mR);const vR=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],yR=Qe("history",vR);const bR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],xR=Qe("info",bR);const SR=[["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",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],wR=Qe("key",SR);const CR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],P0=Qe("loader-circle",CR);const ER=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],TR=Qe("maximize-2",ER);const RR=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]],AR=Qe("mic-off",RR);const NR=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],OR=Qe("mic",NR);const jR=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],DR=Qe("minimize-2",jR);const _R=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],MR=Qe("moon",_R);const zR=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],LR=Qe("octagon-x",zR);const kR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],UR=Qe("plus",kR);const HR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],V0=Qe("search",HR);const BR=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],PR=Qe("sun",BR);const VR=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],IR=Qe("trash-2",VR);const YR=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],qR=Qe("triangle-alert",YR);const GR=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],$R=Qe("upload",GR);const XR=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],oy=Qe("volume-2",XR);const FR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gs=Qe("x",FR),I0=y.createContext(void 0);function KR({children:n}){const[l,r]=y.useState(()=>localStorage.getItem("theme")||"system"),[i,s]=y.useState("light");return y.useEffect(()=>{const c=window.document.documentElement,d=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",h=p=>{const m=p==="system"?d():p;s(m),c.classList.remove("light","dark"),c.classList.add(m)};if(h(l),localStorage.setItem("theme",l),l==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)"),m=()=>h("system");return p.addEventListener("change",m),()=>p.removeEventListener("change",m)}},[l]),g.jsx(I0.Provider,{value:{theme:l,setTheme:r,actualTheme:i},children:n})}function QR(){const n=y.useContext(I0);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}function yn({className:n,type:l,...r}){return g.jsx("input",{type:l,"data-slot":"input",className:je("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n),...r})}var $f="focusScope.autoFocusOnMount",Xf="focusScope.autoFocusOnUnmount",iy={bubbles:!1,cancelable:!0},ZR="FocusScope",oc=y.forwardRef((n,l)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:c,...d}=n,[h,p]=y.useState(null),m=kt(s),x=kt(c),v=y.useRef(null),w=He(l,E=>p(E)),C=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(i){let E=function(z){if(C.paused||!h)return;const P=z.target;h.contains(P)?v.current=P:Ga(v.current,{select:!0})},R=function(z){if(C.paused||!h)return;const P=z.relatedTarget;P!==null&&(h.contains(P)||Ga(v.current,{select:!0}))},N=function(z){if(document.activeElement===document.body)for(const G of z)G.removedNodes.length>0&&Ga(h)};document.addEventListener("focusin",E),document.addEventListener("focusout",R);const M=new MutationObserver(N);return h&&M.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",R),M.disconnect()}}},[i,h,C.paused]),y.useEffect(()=>{if(h){cy.add(C);const E=document.activeElement;if(!h.contains(E)){const N=new CustomEvent($f,iy);h.addEventListener($f,m),h.dispatchEvent(N),N.defaultPrevented||(WR(aA(Y0(h)),{select:!0}),document.activeElement===E&&Ga(h))}return()=>{h.removeEventListener($f,m),setTimeout(()=>{const N=new CustomEvent(Xf,iy);h.addEventListener(Xf,x),h.dispatchEvent(N),N.defaultPrevented||Ga(E??document.body,{select:!0}),h.removeEventListener(Xf,x),cy.remove(C)},0)}}},[h,m,x,C]);const T=y.useCallback(E=>{if(!r&&!i||C.paused)return;const R=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,N=document.activeElement;if(R&&N){const M=E.currentTarget,[z,P]=JR(M);z&&P?!E.shiftKey&&N===P?(E.preventDefault(),r&&Ga(z,{select:!0})):E.shiftKey&&N===z&&(E.preventDefault(),r&&Ga(P,{select:!0})):N===M&&E.preventDefault()}},[r,i,C.paused]);return g.jsx(Ce.div,{tabIndex:-1,...d,ref:w,onKeyDown:T})});oc.displayName=ZR;function WR(n,{select:l=!1}={}){const r=document.activeElement;for(const i of n)if(Ga(i,{select:l}),document.activeElement!==r)return}function JR(n){const l=Y0(n),r=sy(l,n),i=sy(l.reverse(),n);return[r,i]}function Y0(n){const l=[],r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)l.push(r.currentNode);return l}function sy(n,l){for(const r of n)if(!eA(r,{upTo:l}))return r}function eA(n,{upTo:l}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(l!==void 0&&n===l)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function tA(n){return n instanceof HTMLInputElement&&"select"in n}function Ga(n,{select:l=!1}={}){if(n&&n.focus){const r=document.activeElement;n.focus({preventScroll:!0}),n!==r&&tA(n)&&l&&n.select()}}var cy=nA();function nA(){let n=[];return{add(l){const r=n[0];l!==r&&r?.pause(),n=uy(n,l),n.unshift(l)},remove(l){n=uy(n,l),n[0]?.resume()}}}function uy(n,l){const r=[...n],i=r.indexOf(l);return i!==-1&&r.splice(i,1),r}function aA(n){return n.filter(l=>l.tagName!=="A")}var Ff=0;function Qd(){y.useEffect(()=>{const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",n[0]??fy()),document.body.insertAdjacentElement("beforeend",n[1]??fy()),Ff++,()=>{Ff===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(l=>l.remove()),Ff--}},[])}function fy(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var Bn=function(){return Bn=Object.assign||function(l){for(var r,i=1,s=arguments.length;i<s;i++){r=arguments[i];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(l[c]=r[c])}return l},Bn.apply(this,arguments)};function q0(n,l){var r={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&l.indexOf(i)<0&&(r[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(n);s<i.length;s++)l.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(n,i[s])&&(r[i[s]]=n[i[s]]);return r}function lA(n,l,r){if(r||arguments.length===2)for(var i=0,s=l.length,c;i<s;i++)(c||!(i in l))&&(c||(c=Array.prototype.slice.call(l,0,i)),c[i]=l[i]);return n.concat(c||Array.prototype.slice.call(l))}var Ms="right-scroll-bar-position",zs="width-before-scroll-bar",rA="with-scroll-bars-hidden",oA="--removed-body-scroll-bar-size";function Kf(n,l){return typeof n=="function"?n(l):n&&(n.current=l),n}function iA(n,l){var r=y.useState(function(){return{value:n,callback:l,facade:{get current(){return r.value},set current(i){var s=r.value;s!==i&&(r.value=i,r.callback(i,s))}}}})[0];return r.callback=l,r.facade}var sA=typeof window<"u"?y.useLayoutEffect:y.useEffect,dy=new WeakMap;function cA(n,l){var r=iA(null,function(i){return n.forEach(function(s){return Kf(s,i)})});return sA(function(){var i=dy.get(r);if(i){var s=new Set(i),c=new Set(n),d=r.current;s.forEach(function(h){c.has(h)||Kf(h,null)}),c.forEach(function(h){s.has(h)||Kf(h,d)})}dy.set(r,n)},[n]),r}function uA(n){return n}function fA(n,l){l===void 0&&(l=uA);var r=[],i=!1,s={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:n},useMedium:function(c){var d=l(c,i);return r.push(d),function(){r=r.filter(function(h){return h!==d})}},assignSyncMedium:function(c){for(i=!0;r.length;){var d=r;r=[],d.forEach(c)}r={push:function(h){return c(h)},filter:function(){return r}}},assignMedium:function(c){i=!0;var d=[];if(r.length){var h=r;r=[],h.forEach(c),d=r}var p=function(){var x=d;d=[],x.forEach(c)},m=function(){return Promise.resolve().then(p)};m(),r={push:function(x){d.push(x),m()},filter:function(x){return d=d.filter(x),r}}}};return s}function dA(n){n===void 0&&(n={});var l=fA(null);return l.options=Bn({async:!0,ssr:!1},n),l}var G0=function(n){var l=n.sideCar,r=q0(n,["sideCar"]);if(!l)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=l.read();if(!i)throw new Error("Sidecar medium not found");return y.createElement(i,Bn({},r))};G0.isSideCarExport=!0;function hA(n,l){return n.useMedium(l),G0}var $0=dA(),Qf=function(){},ic=y.forwardRef(function(n,l){var r=y.useRef(null),i=y.useState({onScrollCapture:Qf,onWheelCapture:Qf,onTouchMoveCapture:Qf}),s=i[0],c=i[1],d=n.forwardProps,h=n.children,p=n.className,m=n.removeScrollBar,x=n.enabled,v=n.shards,w=n.sideCar,C=n.noRelative,T=n.noIsolation,E=n.inert,R=n.allowPinchZoom,N=n.as,M=N===void 0?"div":N,z=n.gapMode,P=q0(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),G=w,k=cA([r,l]),L=Bn(Bn({},P),s);return y.createElement(y.Fragment,null,x&&y.createElement(G,{sideCar:$0,removeScrollBar:m,shards:v,noRelative:C,noIsolation:T,inert:E,setCallbacks:c,allowPinchZoom:!!R,lockRef:r,gapMode:z}),d?y.cloneElement(y.Children.only(h),Bn(Bn({},L),{ref:k})):y.createElement(M,Bn({},L,{className:p,ref:k}),h))});ic.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ic.classNames={fullWidth:zs,zeroRight:Ms};var pA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mA(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var l=pA();return l&&n.setAttribute("nonce",l),n}function gA(n,l){n.styleSheet?n.styleSheet.cssText=l:n.appendChild(document.createTextNode(l))}function vA(n){var l=document.head||document.getElementsByTagName("head")[0];l.appendChild(n)}var yA=function(){var n=0,l=null;return{add:function(r){n==0&&(l=mA())&&(gA(l,r),vA(l)),n++},remove:function(){n--,!n&&l&&(l.parentNode&&l.parentNode.removeChild(l),l=null)}}},bA=function(){var n=yA();return function(l,r){y.useEffect(function(){return n.add(l),function(){n.remove()}},[l&&r])}},X0=function(){var n=bA(),l=function(r){var i=r.styles,s=r.dynamic;return n(i,s),null};return l},xA={left:0,top:0,right:0,gap:0},Zf=function(n){return parseInt(n||"",10)||0},SA=function(n){var l=window.getComputedStyle(document.body),r=l[n==="padding"?"paddingLeft":"marginLeft"],i=l[n==="padding"?"paddingTop":"marginTop"],s=l[n==="padding"?"paddingRight":"marginRight"];return[Zf(r),Zf(i),Zf(s)]},wA=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return xA;var l=SA(n),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:l[0],top:l[1],right:l[2],gap:Math.max(0,i-r+l[2]-l[0])}},CA=X0(),jr="data-scroll-locked",EA=function(n,l,r,i){var s=n.left,c=n.top,d=n.right,h=n.gap;return r===void 0&&(r="margin"),`
|
|
9
|
+
`).replace(C1,"")}function Eg(e,t){return t=Cg(t),Cg(e)===t}function Xe(e,t,a,o,u,f){switch(a){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||Pl(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&Pl(e,""+o);break;case"className":si(e,"class",o);break;case"tabIndex":si(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":si(e,a,o);break;case"style":Eh(e,o,f);break;case"data":if(t!=="object"){si(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=ui(""+o),e.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(a==="formAction"?(t!=="input"&&Xe(e,t,"name",u.name,u,null),Xe(e,t,"formEncType",u.formEncType,u,null),Xe(e,t,"formMethod",u.formMethod,u,null),Xe(e,t,"formTarget",u.formTarget,u,null)):(Xe(e,t,"encType",u.encType,u,null),Xe(e,t,"method",u.method,u,null),Xe(e,t,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=ui(""+o),e.setAttribute(a,o);break;case"onClick":o!=null&&(e.onclick=Zn);break;case"onScroll":o!=null&&ze("scroll",e);break;case"onScrollEnd":o!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(a=o.__html,a!=null){if(u.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}a=ui(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""+o):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":o===!0?e.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,o):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(a,o):e.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(a):e.setAttribute(a,o);break;case"popover":ze("beforetoggle",e),ze("toggle",e),ii(e,"popover",o);break;case"xlinkActuate":Qn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Qn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Qn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Qn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Qn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Qn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":ii(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Zx.get(a)||a,ii(e,a,o))}}function pf(e,t,a,o,u,f){switch(a){case"style":Eh(e,o,f);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(a=o.__html,a!=null){if(u.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof o=="string"?Pl(e,o):(typeof o=="number"||typeof o=="bigint")&&Pl(e,""+o);break;case"onScroll":o!=null&&ze("scroll",e);break;case"onScrollEnd":o!=null&&ze("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Zn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!mh.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),t=a.slice(2,u?a.length-7:void 0),f=e[It]||null,f=f!=null?f[a]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof o=="function")){typeof f!="function"&&f!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,o,u);break e}a in e?e[a]=o:o===!0?e.setAttribute(a,""):ii(e,a,o)}}}function Rt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var o=!1,u=!1,f;for(f in a)if(a.hasOwnProperty(f)){var b=a[f];if(b!=null)switch(f){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Xe(e,t,f,b,a,null)}}u&&Xe(e,t,"srcSet",a.srcSet,a,null),o&&Xe(e,t,"src",a.src,a,null);return;case"input":ze("invalid",e);var S=f=b=u=null,j=null,I=null;for(o in a)if(a.hasOwnProperty(o)){var W=a[o];if(W!=null)switch(o){case"name":u=W;break;case"type":b=W;break;case"checked":j=W;break;case"defaultChecked":I=W;break;case"value":f=W;break;case"defaultValue":S=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(i(137,t));break;default:Xe(e,t,o,W,a,null)}}xh(e,f,S,j,I,b,u,!1);return;case"select":ze("invalid",e),o=b=f=null;for(u in a)if(a.hasOwnProperty(u)&&(S=a[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":b=S;break;case"multiple":o=S;default:Xe(e,t,u,S,a,null)}t=f,a=b,e.multiple=!!o,t!=null?Bl(e,!!o,t,!1):a!=null&&Bl(e,!!o,a,!0);return;case"textarea":ze("invalid",e),f=u=o=null;for(b in a)if(a.hasOwnProperty(b)&&(S=a[b],S!=null))switch(b){case"value":o=S;break;case"defaultValue":u=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:Xe(e,t,b,S,a,null)}wh(e,o,u,f);return;case"option":for(j in a)a.hasOwnProperty(j)&&(o=a[j],o!=null)&&(j==="selected"?e.selected=o&&typeof o!="function"&&typeof o!="symbol":Xe(e,t,j,o,a,null));return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(o=0;o<To.length;o++)ze(To[o],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("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(I in a)if(a.hasOwnProperty(I)&&(o=a[I],o!=null))switch(I){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Xe(e,t,I,o,a,null)}return;default:if(Ac(t)){for(W in a)a.hasOwnProperty(W)&&(o=a[W],o!==void 0&&pf(e,t,W,o,a,void 0));return}}for(S in a)a.hasOwnProperty(S)&&(o=a[S],o!=null&&Xe(e,t,S,o,a,null))}function E1(e,t,a,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,b=null,S=null,j=null,I=null,W=null;for(F in a){var te=a[F];if(a.hasOwnProperty(F)&&te!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":j=te;default:o.hasOwnProperty(F)||Xe(e,t,F,null,o,te)}}for(var q in o){var F=o[q];if(te=a[q],o.hasOwnProperty(q)&&(F!=null||te!=null))switch(q){case"type":f=F;break;case"name":u=F;break;case"checked":I=F;break;case"defaultChecked":W=F;break;case"value":b=F;break;case"defaultValue":S=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(i(137,t));break;default:F!==te&&Xe(e,t,q,F,o,te)}}Tc(e,b,S,j,I,W,f,u);return;case"select":F=b=S=q=null;for(f in a)if(j=a[f],a.hasOwnProperty(f)&&j!=null)switch(f){case"value":break;case"multiple":F=j;default:o.hasOwnProperty(f)||Xe(e,t,f,null,o,j)}for(u in o)if(f=o[u],j=a[u],o.hasOwnProperty(u)&&(f!=null||j!=null))switch(u){case"value":q=f;break;case"defaultValue":S=f;break;case"multiple":b=f;default:f!==j&&Xe(e,t,u,f,o,j)}t=S,a=b,o=F,q!=null?Bl(e,!!a,q,!1):!!o!=!!a&&(t!=null?Bl(e,!!a,t,!0):Bl(e,!!a,a?[]:"",!1));return;case"textarea":F=q=null;for(S in a)if(u=a[S],a.hasOwnProperty(S)&&u!=null&&!o.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Xe(e,t,S,null,o,u)}for(b in o)if(u=o[b],f=a[b],o.hasOwnProperty(b)&&(u!=null||f!=null))switch(b){case"value":q=u;break;case"defaultValue":F=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(i(91));break;default:u!==f&&Xe(e,t,b,u,o,f)}Sh(e,q,F);return;case"option":for(var pe in a)q=a[pe],a.hasOwnProperty(pe)&&q!=null&&!o.hasOwnProperty(pe)&&(pe==="selected"?e.selected=!1:Xe(e,t,pe,null,o,q));for(j in o)q=o[j],F=a[j],o.hasOwnProperty(j)&&q!==F&&(q!=null||F!=null)&&(j==="selected"?e.selected=q&&typeof q!="function"&&typeof q!="symbol":Xe(e,t,j,q,o,F));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 Se in a)q=a[Se],a.hasOwnProperty(Se)&&q!=null&&!o.hasOwnProperty(Se)&&Xe(e,t,Se,null,o,q);for(I in o)if(q=o[I],F=a[I],o.hasOwnProperty(I)&&q!==F&&(q!=null||F!=null))switch(I){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(137,t));break;default:Xe(e,t,I,q,o,F)}return;default:if(Ac(t)){for(var Fe in a)q=a[Fe],a.hasOwnProperty(Fe)&&q!==void 0&&!o.hasOwnProperty(Fe)&&pf(e,t,Fe,void 0,o,q);for(W in o)q=o[W],F=a[W],!o.hasOwnProperty(W)||q===F||q===void 0&&F===void 0||pf(e,t,W,q,o,F);return}}for(var H in a)q=a[H],a.hasOwnProperty(H)&&q!=null&&!o.hasOwnProperty(H)&&Xe(e,t,H,null,o,q);for(te in o)q=o[te],F=a[te],!o.hasOwnProperty(te)||q===F||q==null&&F==null||Xe(e,t,te,q,o,F)}function Tg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function T1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var u=a[o],f=u.transferSize,b=u.initiatorType,S=u.duration;if(f&&S&&Tg(b)){for(b=0,S=u.responseEnd,o+=1;o<a.length;o++){var j=a[o],I=j.startTime;if(I>S)break;var W=j.transferSize,te=j.initiatorType;W&&Tg(te)&&(j=j.responseEnd,b+=W*(j<S?1:(S-I)/(j-I)))}if(--o,t+=8*(f+b)/(u.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 mf=null,gf=null;function rs(e){return e.nodeType===9?e:e.ownerDocument}function Rg(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 Ag(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 vf(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 yf=null;function R1(){var e=window.event;return e&&e.type==="popstate"?e===yf?!1:(yf=e,!0):(yf=null,!1)}var Ng=typeof setTimeout=="function"?setTimeout:void 0,A1=typeof clearTimeout=="function"?clearTimeout:void 0,Og=typeof Promise=="function"?Promise:void 0,N1=typeof queueMicrotask=="function"?queueMicrotask:typeof Og<"u"?function(e){return Og.resolve(null).then(e).catch(O1)}:Ng;function O1(e){setTimeout(function(){throw e})}function Ua(e){return e==="head"}function jg(e,t){var a=t,o=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(o===0){e.removeChild(u),vr(t);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")Ao(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ao(a);for(var f=a.firstChild;f;){var b=f.nextSibling,S=f.nodeName;f[qr]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||a.removeChild(f),f=b}}else a==="body"&&Ao(e.ownerDocument.body);a=u}while(a);vr(t)}function Dg(e,t){var a=e;e=0;do{var o=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=o}while(a)}function bf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":bf(a),Cc(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function j1(e,t,a,o){for(;e.nodeType===1;){var u=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[qr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=gn(e.nextSibling),e===null)break}return null}function D1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=gn(e.nextSibling),e===null))return null;return e}function _g(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=gn(e.nextSibling),e===null))return null;return e}function xf(e){return e.data==="$?"||e.data==="$~"}function Sf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function _1(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var o=function(){t(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function gn(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 wf=null;function Mg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return gn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function zg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Lg(e,t,a){switch(t=rs(a),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 Ao(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Cc(e)}var vn=new Map,kg=new Set;function os(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ha=$.d;$.d={f:M1,r:z1,D:L1,C:k1,L:U1,m:H1,X:P1,S:B1,M:V1};function M1(){var e=ha.f(),t=Zi();return e||t}function z1(e){var t=kl(e);t!==null&&t.tag===5&&t.type==="form"?Jp(t):ha.r(e)}var pr=typeof document>"u"?null:document;function Ug(e,t,a){var o=pr;if(o&&typeof t=="string"&&t){var u=cn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),kg.has(u)||(kg.add(u),e={rel:e,crossOrigin:a,href:t},o.querySelector(u)===null&&(t=o.createElement("link"),Rt(t,"link",e),bt(t),o.head.appendChild(t)))}}function L1(e){ha.D(e),Ug("dns-prefetch",e,null)}function k1(e,t){ha.C(e,t),Ug("preconnect",e,t)}function U1(e,t,a){ha.L(e,t,a);var o=pr;if(o&&e&&t){var u='link[rel="preload"][as="'+cn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+cn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+cn(a.imageSizes)+'"]')):u+='[href="'+cn(e)+'"]';var f=u;switch(t){case"style":f=mr(e);break;case"script":f=gr(e)}vn.has(f)||(e=v({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),vn.set(f,e),o.querySelector(u)!==null||t==="style"&&o.querySelector(No(f))||t==="script"&&o.querySelector(Oo(f))||(t=o.createElement("link"),Rt(t,"link",e),bt(t),o.head.appendChild(t)))}}function H1(e,t){ha.m(e,t);var a=pr;if(a&&e){var o=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+cn(o)+'"][href="'+cn(e)+'"]',f=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=gr(e)}if(!vn.has(f)&&(e=v({rel:"modulepreload",href:e},t),vn.set(f,e),a.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Oo(f)))return}o=a.createElement("link"),Rt(o,"link",e),bt(o),a.head.appendChild(o)}}}function B1(e,t,a){ha.S(e,t,a);var o=pr;if(o&&e){var u=Ul(o).hoistableStyles,f=mr(e);t=t||"default";var b=u.get(f);if(!b){var S={loading:0,preload:null};if(b=o.querySelector(No(f)))S.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},a),(a=vn.get(f))&&Cf(e,a);var j=b=o.createElement("link");bt(j),Rt(j,"link",e),j._p=new Promise(function(I,W){j.onload=I,j.onerror=W}),j.addEventListener("load",function(){S.loading|=1}),j.addEventListener("error",function(){S.loading|=2}),S.loading|=4,is(b,t,o)}b={type:"stylesheet",instance:b,count:1,state:S},u.set(f,b)}}}function P1(e,t){ha.X(e,t);var a=pr;if(a&&e){var o=Ul(a).hoistableScripts,u=gr(e),f=o.get(u);f||(f=a.querySelector(Oo(u)),f||(e=v({src:e,async:!0},t),(t=vn.get(u))&&Ef(e,t),f=a.createElement("script"),bt(f),Rt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(u,f))}}function V1(e,t){ha.M(e,t);var a=pr;if(a&&e){var o=Ul(a).hoistableScripts,u=gr(e),f=o.get(u);f||(f=a.querySelector(Oo(u)),f||(e=v({src:e,async:!0,type:"module"},t),(t=vn.get(u))&&Ef(e,t),f=a.createElement("script"),bt(f),Rt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(u,f))}}function Hg(e,t,a,o){var u=(u=oe.current)?os(u):null;if(!u)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=mr(a.href),a=Ul(u).hoistableStyles,o=a.get(t),o||(o={type:"style",instance:null,count:0,state:null},a.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=mr(a.href);var f=Ul(u).hoistableStyles,b=f.get(e);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,b),(f=u.querySelector(No(e)))&&!f._p&&(b.instance=f,b.state.loading=5),vn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},vn.set(e,a),f||I1(u,e,a,b.state))),t&&o===null)throw Error(i(528,""));return b}if(t&&o!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=gr(a),a=Ul(u).hoistableScripts,o=a.get(t),o||(o={type:"script",instance:null,count:0,state:null},a.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function mr(e){return'href="'+cn(e)+'"'}function No(e){return'link[rel="stylesheet"]['+e+"]"}function Bg(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function I1(e,t,a,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),Rt(t,"link",a),bt(t),e.head.appendChild(t))}function gr(e){return'[src="'+cn(e)+'"]'}function Oo(e){return"script[async]"+e}function Pg(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+cn(a.href)+'"]');if(o)return t.instance=o,bt(o),o;var u=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),bt(o),Rt(o,"style",u),is(o,a.precedence,e),t.instance=o;case"stylesheet":u=mr(a.href);var f=e.querySelector(No(u));if(f)return t.state.loading|=4,t.instance=f,bt(f),f;o=Bg(a),(u=vn.get(u))&&Cf(o,u),f=(e.ownerDocument||e).createElement("link"),bt(f);var b=f;return b._p=new Promise(function(S,j){b.onload=S,b.onerror=j}),Rt(f,"link",o),t.state.loading|=4,is(f,a.precedence,e),t.instance=f;case"script":return f=gr(a.src),(u=e.querySelector(Oo(f)))?(t.instance=u,bt(u),u):(o=a,(u=vn.get(f))&&(o=v({},a),Ef(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),bt(u),Rt(u,"link",o),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,is(o,a.precedence,e));return t.instance}function is(e,t,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,f=u,b=0;b<o.length;b++){var S=o[b];if(S.dataset.precedence===t)f=S;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Cf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ef(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ss=null;function Vg(e,t,a){if(ss===null){var o=new Map,u=ss=new Map;u.set(a,o)}else u=ss,o=u.get(a),o||(o=new Map,u.set(a,o));if(o.has(e))return o;for(o.set(e,null),a=a.getElementsByTagName(e),u=0;u<a.length;u++){var f=a[u];if(!(f[qr]||f[wt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var S=o.get(b);S?S.push(f):o.set(b,[f])}}return o}function Ig(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Y1(e,t,a){if(a===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 Yg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function q1(e,t,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=mr(o.href),f=t.querySelector(No(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=cs.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=f,bt(f);return}f=t.ownerDocument||t,o=Bg(o),(u=vn.get(u))&&Cf(o,u),f=f.createElement("link"),bt(f);var b=f;b._p=new Promise(function(S,j){b.onload=S,b.onerror=j}),Rt(f,"link",o),a.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=cs.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Tf=0;function G1(e,t){return e.stylesheets&&e.count===0&&fs(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var o=setTimeout(function(){if(e.stylesheets&&fs(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Tf===0&&(Tf=62500*T1());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fs(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Tf?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function cs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var us=null;function fs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,us=new Map,t.forEach($1,e),us=null,cs.call(e))}function $1(e,t){if(!(t.state.loading&4)){var a=us.get(e);if(a)var o=a.get(null);else{a=new Map,us.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var b=u[f];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(a.set(b.dataset.precedence,b),o=b)}o&&a.set(null,o)}u=t.instance,b=u.getAttribute("data-precedence"),f=a.get(b)||o,f===o&&a.set(null,u),a.set(b,u),this.count++,o=cs.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var jo={$$typeof:z,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function X1(e,t,a,o,u,f,b,S,j){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=ya(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ya(0),this.hiddenUpdates=ya(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function qg(e,t,a,o,u,f,b,S,j,I,W,te){return e=new X1(e,t,a,b,j,I,W,te,S),t=1,f===!0&&(t|=24),f=Wt(3,null,null,t),e.current=f,f.stateNode=e,t=au(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:o,isDehydrated:a,cache:t},iu(f),e}function Gg(e){return e?(e=Xl,e):Xl}function $g(e,t,a,o,u,f){u=Gg(u),o.context===null?o.context=u:o.pendingContext=u,o=Ra(t),o.payload={element:a},f=f===void 0?null:f,f!==null&&(o.callback=f),a=Aa(e,o,t),a!==null&&(Ft(a,e,t),io(a,e,t))}function Xg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Rf(e,t){Xg(e,t),(e=e.alternate)&&Xg(e,t)}function Fg(e){if(e.tag===13||e.tag===31){var t=cl(e,67108864);t!==null&&Ft(t,e,67108864),Rf(e,67108864)}}function Kg(e){if(e.tag===13||e.tag===31){var t=an();t=Ml(t);var a=cl(e,t);a!==null&&Ft(a,e,t),Rf(e,t)}}var ds=!0;function F1(e,t,a,o){var u=D.T;D.T=null;var f=$.p;try{$.p=2,Af(e,t,a,o)}finally{$.p=f,D.T=u}}function K1(e,t,a,o){var u=D.T;D.T=null;var f=$.p;try{$.p=8,Af(e,t,a,o)}finally{$.p=f,D.T=u}}function Af(e,t,a,o){if(ds){var u=Nf(o);if(u===null)hf(e,t,o,hs,a),Zg(e,o);else if(Z1(u,e,t,a,o))o.stopPropagation();else if(Zg(e,o),t&4&&-1<Q1.indexOf(e)){for(;u!==null;){var f=kl(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=Mn(f.pendingLanes);if(b!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;b;){var j=1<<31-Dt(b);S.entanglements[1]|=j,b&=~j}Un(f),(Ie&6)===0&&(Ki=at()+500,Eo(0))}}break;case 31:case 13:S=cl(f,2),S!==null&&Ft(S,f,2),Zi(),Rf(f,2)}if(f=Nf(o),f===null&&hf(e,t,o,hs,a),f===u)break;u=f}u!==null&&o.stopPropagation()}else hf(e,t,o,null,a)}}function Nf(e){return e=Oc(e),Of(e)}var hs=null;function Of(e){if(hs=null,e=Ll(e),e!==null){var t=c(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=d(t),e!==null)return e;e=null}else if(a===31){if(e=h(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return hs=e,null}function Qg(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(jl()){case Fn:return 2;case ri:return 8;case tl:case Ir:return 32;case Kn:return 268435456;default:return 32}default:return 32}}var jf=!1,Ha=null,Ba=null,Pa=null,Do=new Map,_o=new Map,Va=[],Q1="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 Zg(e,t){switch(e){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":Ba=null;break;case"mouseover":case"mouseout":Pa=null;break;case"pointerover":case"pointerout":Do.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_o.delete(t.pointerId)}}function Mo(e,t,a,o,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:a,eventSystemFlags:o,nativeEvent:f,targetContainers:[u]},t!==null&&(t=kl(t),t!==null&&Fg(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function Z1(e,t,a,o,u){switch(t){case"focusin":return Ha=Mo(Ha,e,t,a,o,u),!0;case"dragenter":return Ba=Mo(Ba,e,t,a,o,u),!0;case"mouseover":return Pa=Mo(Pa,e,t,a,o,u),!0;case"pointerover":var f=u.pointerId;return Do.set(f,Mo(Do.get(f)||null,e,t,a,o,u)),!0;case"gotpointercapture":return f=u.pointerId,_o.set(f,Mo(_o.get(f)||null,e,t,a,o,u)),!0}return!1}function Wg(e){var t=Ll(e.target);if(t!==null){var a=c(t);if(a!==null){if(t=a.tag,t===13){if(t=d(a),t!==null){e.blockedOn=t,dh(e.priority,function(){Kg(a)});return}}else if(t===31){if(t=h(a),t!==null){e.blockedOn=t,dh(e.priority,function(){Kg(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ps(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Nf(e.nativeEvent);if(a===null){a=e.nativeEvent;var o=new a.constructor(a.type,a);Nc=o,a.target.dispatchEvent(o),Nc=null}else return t=kl(a),t!==null&&Fg(t),e.blockedOn=a,!1;t.shift()}return!0}function Jg(e,t,a){ps(e)&&a.delete(t)}function W1(){jf=!1,Ha!==null&&ps(Ha)&&(Ha=null),Ba!==null&&ps(Ba)&&(Ba=null),Pa!==null&&ps(Pa)&&(Pa=null),Do.forEach(Jg),_o.forEach(Jg)}function ms(e,t){e.blockedOn===t&&(e.blockedOn=null,jf||(jf=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,W1)))}var gs=null;function ev(e){gs!==e&&(gs=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){gs===e&&(gs=null);for(var t=0;t<e.length;t+=3){var a=e[t],o=e[t+1],u=e[t+2];if(typeof o!="function"){if(Of(o||a)===null)continue;break}var f=kl(a);f!==null&&(e.splice(t,3),t-=3,Au(f,{pending:!0,data:u,method:a.method,action:o},o,u))}}))}function vr(e){function t(j){return ms(j,e)}Ha!==null&&ms(Ha,e),Ba!==null&&ms(Ba,e),Pa!==null&&ms(Pa,e),Do.forEach(t),_o.forEach(t);for(var a=0;a<Va.length;a++){var o=Va[a];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Va.length&&(a=Va[0],a.blockedOn===null);)Wg(a),a.blockedOn===null&&Va.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var u=a[o],f=a[o+1],b=u[It]||null;if(typeof f=="function")b||ev(a);else if(b){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,b=f[It]||null)S=b.formAction;else if(Of(u)!==null)continue}else S=b.action;typeof S=="function"?a[o+1]=S:(a.splice(o,3),o-=3),ev(a)}}}function tv(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(b){return u=b})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Df(e){this._internalRoot=e}vs.prototype.render=Df.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,o=an();$g(a,o,e,t,null,null)},vs.prototype.unmount=Df.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$g(e.current,2,null,e,null,null),Zi(),t[zl]=null}};function vs(e){this._internalRoot=e}vs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Sc();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Va.length&&t!==0&&t<Va[a].priority;a++);Va.splice(a,0,e),a===0&&Wg(e)}};var nv=l.version;if(nv!=="19.2.3")throw Error(i(527,nv,"19.2.3"));$.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=m(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var J1={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ys=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ys.isDisabled&&ys.supportsFiber)try{nl=ys.inject(J1),zt=ys}catch{}}return Lo.createRoot=function(e,t){if(!s(e))throw Error(i(299));var a=!1,o="",u=cm,f=um,b=fm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=qg(e,1,!1,null,null,a,o,null,u,f,b,tv),e[zl]=t.current,df(e),new Df(t)},Lo.hydrateRoot=function(e,t,a){if(!s(e))throw Error(i(299));var o=!1,u="",f=cm,b=um,S=fm,j=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(S=a.onRecoverableError),a.formState!==void 0&&(j=a.formState)),t=qg(e,1,!0,t,a??null,o,u,j,f,b,S,tv),t.context=Gg(null),a=t.current,o=an(),o=Ml(o),u=Ra(o),u.callback=null,Aa(a,u,o),a=o,t.current.lanes=a,lt(t,a),Un(t),e[zl]=t.current,df(e),new vs(t)},Lo.version="19.2.3",Lo}var dv;function cw(){if(dv)return zf.exports;dv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),zf.exports=sw(),zf.exports}var uw=cw();const Te=n=>typeof n=="string",ko=()=>{let n,l;const r=new Promise((i,s)=>{n=i,l=s});return r.resolve=n,r.reject=l,r},hv=n=>n==null?"":""+n,fw=(n,l,r)=>{n.forEach(i=>{l[i]&&(r[i]=l[i])})},dw=/###/g,pv=n=>n&&n.indexOf("###")>-1?n.replace(dw,"."):n,mv=n=>!n||Te(n),Yo=(n,l,r)=>{const i=Te(l)?l.split("."):l;let s=0;for(;s<i.length-1;){if(mv(n))return{};const c=pv(i[s]);!n[c]&&r&&(n[c]=new r),Object.prototype.hasOwnProperty.call(n,c)?n=n[c]:n={},++s}return mv(n)?{}:{obj:n,k:pv(i[s])}},gv=(n,l,r)=>{const{obj:i,k:s}=Yo(n,l,Object);if(i!==void 0||l.length===1){i[s]=r;return}let c=l[l.length-1],d=l.slice(0,l.length-1),h=Yo(n,d,Object);for(;h.obj===void 0&&d.length;)c=`${d[d.length-1]}.${c}`,d=d.slice(0,d.length-1),h=Yo(n,d,Object),h?.obj&&typeof h.obj[`${h.k}.${c}`]<"u"&&(h.obj=void 0);h.obj[`${h.k}.${c}`]=r},hw=(n,l,r,i)=>{const{obj:s,k:c}=Yo(n,l,Object);s[c]=s[c]||[],s[c].push(r)},Ls=(n,l)=>{const{obj:r,k:i}=Yo(n,l);if(r&&Object.prototype.hasOwnProperty.call(r,i))return r[i]},pw=(n,l,r)=>{const i=Ls(n,r);return i!==void 0?i:Ls(l,r)},_y=(n,l,r)=>{for(const i in l)i!=="__proto__"&&i!=="constructor"&&(i in n?Te(n[i])||n[i]instanceof String||Te(l[i])||l[i]instanceof String?r&&(n[i]=l[i]):_y(n[i],l[i],r):n[i]=l[i]);return n},yr=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var mw={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const gw=n=>Te(n)?n.replace(/[&<>"'\/]/g,l=>mw[l]):n;class vw{constructor(l){this.capacity=l,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(l){const r=this.regExpMap.get(l);if(r!==void 0)return r;const i=new RegExp(l);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(l,i),this.regExpQueue.push(l),i}}const yw=[" ",",","?","!",";"],bw=new vw(20),xw=(n,l,r)=>{l=l||"",r=r||"";const i=yw.filter(d=>l.indexOf(d)<0&&r.indexOf(d)<0);if(i.length===0)return!0;const s=bw.getRegExp(`(${i.map(d=>d==="?"?"\\?":d).join("|")})`);let c=!s.test(n);if(!c){const d=n.indexOf(r);d>0&&!s.test(n.substring(0,d))&&(c=!0)}return c},ld=(n,l,r=".")=>{if(!n)return;if(n[l])return Object.prototype.hasOwnProperty.call(n,l)?n[l]:void 0;const i=l.split(r);let s=n;for(let c=0;c<i.length;){if(!s||typeof s!="object")return;let d,h="";for(let p=c;p<i.length;++p)if(p!==c&&(h+=r),h+=i[p],d=s[h],d!==void 0){if(["string","number","boolean"].indexOf(typeof d)>-1&&p<i.length-1)continue;c+=p-c+1;break}s=d}return s},$o=n=>n?.replace("_","-"),Sw={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,l){console?.[n]?.apply?.(console,l)}};class ks{constructor(l,r={}){this.init(l,r)}init(l,r={}){this.prefix=r.prefix||"i18next:",this.logger=l||Sw,this.options=r,this.debug=r.debug}log(...l){return this.forward(l,"log","",!0)}warn(...l){return this.forward(l,"warn","",!0)}error(...l){return this.forward(l,"error","")}deprecate(...l){return this.forward(l,"warn","WARNING DEPRECATED: ",!0)}forward(l,r,i,s){return s&&!this.debug?null:(Te(l[0])&&(l[0]=`${i}${this.prefix} ${l[0]}`),this.logger[r](l))}create(l){return new ks(this.logger,{prefix:`${this.prefix}:${l}:`,...this.options})}clone(l){return l=l||this.options,l.prefix=l.prefix||this.prefix,new ks(this.logger,l)}}var Pn=new ks;class Ws{constructor(){this.observers={}}on(l,r){return l.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const s=this.observers[i].get(r)||0;this.observers[i].set(r,s+1)}),this}off(l,r){if(this.observers[l]){if(!r){delete this.observers[l];return}this.observers[l].delete(r)}}emit(l,...r){this.observers[l]&&Array.from(this.observers[l].entries()).forEach(([s,c])=>{for(let d=0;d<c;d++)s(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,c])=>{for(let d=0;d<c;d++)s.apply(s,[l,...r])})}}class vv extends Ws{constructor(l,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=l||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(l){this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}removeNamespaces(l){const r=this.options.ns.indexOf(l);r>-1&&this.options.ns.splice(r,1)}getResource(l,r,i,s={}){const c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,d=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let h;l.indexOf(".")>-1?h=l.split("."):(h=[l,r],i&&(Array.isArray(i)?h.push(...i):Te(i)&&c?h.push(...i.split(c)):h.push(i)));const p=Ls(this.data,h);return!p&&!r&&!i&&l.indexOf(".")>-1&&(l=h[0],r=h[1],i=h.slice(2).join(".")),p||!d||!Te(i)?p:ld(this.data?.[l]?.[r],i,c)}addResource(l,r,i,s,c={silent:!1}){const d=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator;let h=[l,r];i&&(h=h.concat(d?i.split(d):i)),l.indexOf(".")>-1&&(h=l.split("."),s=r,r=h[1]),this.addNamespaces(r),gv(this.data,h,s),c.silent||this.emit("added",l,r,i,s)}addResources(l,r,i,s={silent:!1}){for(const c in i)(Te(i[c])||Array.isArray(i[c]))&&this.addResource(l,r,c,i[c],{silent:!0});s.silent||this.emit("added",l,r,i)}addResourceBundle(l,r,i,s,c,d={silent:!1,skipCopy:!1}){let h=[l,r];l.indexOf(".")>-1&&(h=l.split("."),s=i,i=r,r=h[1]),this.addNamespaces(r);let p=Ls(this.data,h)||{};d.skipCopy||(i=JSON.parse(JSON.stringify(i))),s?_y(p,i,c):p={...p,...i},gv(this.data,h,p),d.silent||this.emit("added",l,r,i)}removeResourceBundle(l,r){this.hasResourceBundle(l,r)&&delete this.data[l][r],this.removeNamespaces(r),this.emit("removed",l,r)}hasResourceBundle(l,r){return this.getResource(l,r)!==void 0}getResourceBundle(l,r){return r||(r=this.options.defaultNS),this.getResource(l,r)}getDataByLanguage(l){return this.data[l]}hasLanguageSomeTranslations(l){const r=this.getDataByLanguage(l);return!!(r&&Object.keys(r)||[]).find(s=>r[s]&&Object.keys(r[s]).length>0)}toJSON(){return this.data}}var My={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,l,r,i,s){return n.forEach(c=>{l=this.processors[c]?.process(l,r,i,s)??l}),l}};const zy=Symbol("i18next/PATH_KEY");function ww(){const n=[],l=Object.create(null);let r;return l.get=(i,s)=>(r?.revoke?.(),s===zy?n:(n.push(s),r=Proxy.revocable(i,l),r.proxy)),Proxy.revocable(Object.create(null),l).proxy}function rd(n,l){const{[zy]:r}=n(ww());return r.join(l?.keySeparator??".")}const yv={},Hf=n=>!Te(n)&&typeof n!="boolean"&&typeof n!="number";class Us extends Ws{constructor(l,r={}){super(),fw(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],l,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Pn.create("translator")}changeLanguage(l){l&&(this.language=l)}exists(l,r={interpolation:{}}){const i={...r};if(l==null)return!1;const s=this.resolve(l,i);if(s?.res===void 0)return!1;const c=Hf(s.res);return!(i.returnObjects===!1&&c)}extractFromKey(l,r){let i=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let c=r.ns||this.options.defaultNS||[];const d=i&&l.indexOf(i)>-1,h=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!xw(l,i,s);if(d&&!h){const p=l.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:l,namespaces:Te(c)?[c]:c};const m=l.split(i);(i!==s||i===s&&this.options.ns.indexOf(m[0])>-1)&&(c=m.shift()),l=m.join(s)}return{key:l,namespaces:Te(c)?[c]:c}}translate(l,r,i){let s=typeof r=="object"?{...r}:r;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),l==null)return"";typeof l=="function"&&(l=rd(l,{...this.options,...s})),Array.isArray(l)||(l=[String(l)]);const c=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,d=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:h,namespaces:p}=this.extractFromKey(l[l.length-1],s),m=p[p.length-1];let x=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;x===void 0&&(x=":");const v=s.lng||this.language,w=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(v?.toLowerCase()==="cimode")return w?c?{res:`${m}${x}${h}`,usedKey:h,exactUsedKey:h,usedLng:v,usedNS:m,usedParams:this.getUsedParamsDetails(s)}:`${m}${x}${h}`:c?{res:h,usedKey:h,exactUsedKey:h,usedLng:v,usedNS:m,usedParams:this.getUsedParamsDetails(s)}:h;const C=this.resolve(l,s);let T=C?.res;const E=C?.usedKey||h,R=C?.exactUsedKey||h,N=["[object Number]","[object Function]","[object RegExp]"],M=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,z=!this.i18nFormat||this.i18nFormat.handleAsObject,P=s.count!==void 0&&!Te(s.count),G=Us.hasDefaultValue(s),k=P?this.pluralResolver.getSuffix(v,s.count,s):"",L=s.ordinal&&P?this.pluralResolver.getSuffix(v,s.count,{ordinal:!1}):"",Y=P&&!s.ordinal&&s.count===0,J=Y&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${k}`]||s[`defaultValue${L}`]||s.defaultValue;let ne=T;z&&!T&&G&&(ne=J);const re=Hf(ne),K=Object.prototype.toString.apply(ne);if(z&&ne&&re&&N.indexOf(K)<0&&!(Te(M)&&Array.isArray(ne))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ie=this.options.returnedObjectHandler?this.options.returnedObjectHandler(E,ne,{...s,ns:p}):`key '${h} (${this.language})' returned an object instead of string.`;return c?(C.res=ie,C.usedParams=this.getUsedParamsDetails(s),C):ie}if(d){const ie=Array.isArray(ne),ce=ie?[]:{},he=ie?R:E;for(const D in ne)if(Object.prototype.hasOwnProperty.call(ne,D)){const $=`${he}${d}${D}`;G&&!T?ce[D]=this.translate($,{...s,defaultValue:Hf(J)?J[D]:void 0,joinArrays:!1,ns:p}):ce[D]=this.translate($,{...s,joinArrays:!1,ns:p}),ce[D]===$&&(ce[D]=ne[D])}T=ce}}else if(z&&Te(M)&&Array.isArray(T))T=T.join(M),T&&(T=this.extendTranslation(T,l,s,i));else{let ie=!1,ce=!1;!this.isValidLookup(T)&&G&&(ie=!0,T=J),this.isValidLookup(T)||(ce=!0,T=h);const D=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ce?void 0:T,$=G&&J!==T&&this.options.updateMissing;if(ce||ie||$){if(this.logger.log($?"updateKey":"missingKey",v,m,h,$?J:T),d){const A=this.resolve(h,{...s,keySeparator:!1});A&&A.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let B=[];const ue=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ue&&ue[0])for(let A=0;A<ue.length;A++)B.push(ue[A]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(s.lng||this.language):B.push(s.lng||this.language);const de=(A,O,U)=>{const X=G&&U!==T?U:D;this.options.missingKeyHandler?this.options.missingKeyHandler(A,m,O,X,$,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(A,m,O,X,$,s),this.emit("missingKey",A,m,O,T)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?B.forEach(A=>{const O=this.pluralResolver.getSuffixes(A,s);Y&&s[`defaultValue${this.options.pluralSeparator}zero`]&&O.indexOf(`${this.options.pluralSeparator}zero`)<0&&O.push(`${this.options.pluralSeparator}zero`),O.forEach(U=>{de([A],h+U,s[`defaultValue${U}`]||J)})}):de(B,h,J))}T=this.extendTranslation(T,l,s,C,i),ce&&T===h&&this.options.appendNamespaceToMissingKey&&(T=`${m}${x}${h}`),(ce||ie)&&this.options.parseMissingKeyHandler&&(T=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${m}${x}${h}`:h,ie?T:void 0,s))}return c?(C.res=T,C.usedParams=this.getUsedParamsDetails(s),C):T}extendTranslation(l,r,i,s,c){if(this.i18nFormat?.parse)l=this.i18nFormat.parse(l,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const p=Te(l)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(p){const v=l.match(this.interpolator.nestingRegexp);m=v&&v.length}let x=i.replace&&!Te(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(x={...this.options.interpolation.defaultVariables,...x}),l=this.interpolator.interpolate(l,x,i.lng||this.language||s.usedLng,i),p){const v=l.match(this.interpolator.nestingRegexp),w=v&&v.length;m<w&&(i.nest=!1)}!i.lng&&s&&s.res&&(i.lng=this.language||s.usedLng),i.nest!==!1&&(l=this.interpolator.nest(l,(...v)=>c?.[0]===v[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${r[0]}`),null):this.translate(...v,r),i)),i.interpolation&&this.interpolator.reset()}const d=i.postProcess||this.options.postProcess,h=Te(d)?[d]:d;return l!=null&&h?.length&&i.applyPostProcessor!==!1&&(l=My.handle(h,l,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),l}resolve(l,r={}){let i,s,c,d,h;return Te(l)&&(l=[l]),l.forEach(p=>{if(this.isValidLookup(i))return;const m=this.extractFromKey(p,r),x=m.key;s=x;let v=m.namespaces;this.options.fallbackNS&&(v=v.concat(this.options.fallbackNS));const w=r.count!==void 0&&!Te(r.count),C=w&&!r.ordinal&&r.count===0,T=r.context!==void 0&&(Te(r.context)||typeof r.context=="number")&&r.context!=="",E=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);v.forEach(R=>{this.isValidLookup(i)||(h=R,!yv[`${E[0]}-${R}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(h)&&(yv[`${E[0]}-${R}`]=!0,this.logger.warn(`key "${s}" for languages "${E.join(", ")}" won't get resolved as namespace "${h}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach(N=>{if(this.isValidLookup(i))return;d=N;const M=[x];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(M,x,N,R,r);else{let P;w&&(P=this.pluralResolver.getSuffix(N,r.count,r));const G=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(w&&(r.ordinal&&P.indexOf(k)===0&&M.push(x+P.replace(k,this.options.pluralSeparator)),M.push(x+P),C&&M.push(x+G)),T){const L=`${x}${this.options.contextSeparator||"_"}${r.context}`;M.push(L),w&&(r.ordinal&&P.indexOf(k)===0&&M.push(L+P.replace(k,this.options.pluralSeparator)),M.push(L+P),C&&M.push(L+G))}}let z;for(;z=M.pop();)this.isValidLookup(i)||(c=z,i=this.getResource(N,R,z,r))}))})}),{res:i,usedKey:s,exactUsedKey:c,usedLng:d,usedNS:h}}isValidLookup(l){return l!==void 0&&!(!this.options.returnNull&&l===null)&&!(!this.options.returnEmptyString&&l==="")}getResource(l,r,i,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(l,r,i,s):this.resourceStore.getResource(l,r,i,s)}getUsedParamsDetails(l={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=l.replace&&!Te(l.replace);let s=i?l.replace:l;if(i&&typeof l.count<"u"&&(s.count=l.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!i){s={...s};for(const c of r)delete s[c]}return s}static hasDefaultValue(l){const r="defaultValue";for(const i in l)if(Object.prototype.hasOwnProperty.call(l,i)&&r===i.substring(0,r.length)&&l[i]!==void 0)return!0;return!1}}class bv{constructor(l){this.options=l,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Pn.create("languageUtils")}getScriptPartFromCode(l){if(l=$o(l),!l||l.indexOf("-")<0)return null;const r=l.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(l){if(l=$o(l),!l||l.indexOf("-")<0)return l;const r=l.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(l){if(Te(l)&&l.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(l)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?l.toLowerCase():l)}return this.options.cleanCode||this.options.lowerCaseLng?l.toLowerCase():l}isSupportedCode(l){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(l=this.getLanguagePartFromCode(l)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(l)>-1}getBestMatchFromCodes(l){if(!l)return null;let r;return l.forEach(i=>{if(r)return;const s=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(s))&&(r=s)}),!r&&this.options.supportedLngs&&l.forEach(i=>{if(r)return;const s=this.getScriptPartFromCode(i);if(this.isSupportedCode(s))return r=s;const c=this.getLanguagePartFromCode(i);if(this.isSupportedCode(c))return r=c;r=this.options.supportedLngs.find(d=>{if(d===c)return d;if(!(d.indexOf("-")<0&&c.indexOf("-")<0)&&(d.indexOf("-")>0&&c.indexOf("-")<0&&d.substring(0,d.indexOf("-"))===c||d.indexOf(c)===0&&c.length>1))return d})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(l,r){if(!l)return[];if(typeof l=="function"&&(l=l(r)),Te(l)&&(l=[l]),Array.isArray(l))return l;if(!r)return l.default||[];let i=l[r];return i||(i=l[this.getScriptPartFromCode(r)]),i||(i=l[this.formatLanguageCode(r)]),i||(i=l[this.getLanguagePartFromCode(r)]),i||(i=l.default),i||[]}toResolveHierarchy(l,r){const i=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],l),s=[],c=d=>{d&&(this.isSupportedCode(d)?s.push(d):this.logger.warn(`rejecting language code not found in supportedLngs: ${d}`))};return Te(l)&&(l.indexOf("-")>-1||l.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&c(this.formatLanguageCode(l)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&c(this.getScriptPartFromCode(l)),this.options.load!=="currentOnly"&&c(this.getLanguagePartFromCode(l))):Te(l)&&c(this.formatLanguageCode(l)),i.forEach(d=>{s.indexOf(d)<0&&c(this.formatLanguageCode(d))}),s}}const xv={zero:0,one:1,two:2,few:3,many:4,other:5},Sv={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Cw{constructor(l,r={}){this.languageUtils=l,this.options=r,this.logger=Pn.create("pluralResolver"),this.pluralRulesCache={}}addRule(l,r){this.rules[l]=r}clearCache(){this.pluralRulesCache={}}getRule(l,r={}){const i=$o(l==="dev"?"en":l),s=r.ordinal?"ordinal":"cardinal",c=JSON.stringify({cleanedCode:i,type:s});if(c in this.pluralRulesCache)return this.pluralRulesCache[c];let d;try{d=new Intl.PluralRules(i,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Sv;if(!l.match(/-|_/))return Sv;const p=this.languageUtils.getLanguagePartFromCode(l);d=this.getRule(p,r)}return this.pluralRulesCache[c]=d,d}needsPlural(l,r={}){let i=this.getRule(l,r);return i||(i=this.getRule("dev",r)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(l,r,i={}){return this.getSuffixes(l,i).map(s=>`${r}${s}`)}getSuffixes(l,r={}){let i=this.getRule(l,r);return i||(i=this.getRule("dev",r)),i?i.resolvedOptions().pluralCategories.sort((s,c)=>xv[s]-xv[c]).map(s=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(l,r,i={}){const s=this.getRule(l,i);return s?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${s.select(r)}`:(this.logger.warn(`no plural rule found for: ${l}`),this.getSuffix("dev",r,i))}}const wv=(n,l,r,i=".",s=!0)=>{let c=pw(n,l,r);return!c&&s&&Te(r)&&(c=ld(n,r,i),c===void 0&&(c=ld(l,r,i))),c},Bf=n=>n.replace(/\$/g,"$$$$");class Cv{constructor(l={}){this.logger=Pn.create("interpolator"),this.options=l,this.format=l?.interpolation?.format||(r=>r),this.init(l)}init(l={}){l.interpolation||(l.interpolation={escapeValue:!0});const{escape:r,escapeValue:i,useRawValueToEscape:s,prefix:c,prefixEscaped:d,suffix:h,suffixEscaped:p,formatSeparator:m,unescapeSuffix:x,unescapePrefix:v,nestingPrefix:w,nestingPrefixEscaped:C,nestingSuffix:T,nestingSuffixEscaped:E,nestingOptionsSeparator:R,maxReplaces:N,alwaysFormat:M}=l.interpolation;this.escape=r!==void 0?r:gw,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=c?yr(c):d||"{{",this.suffix=h?yr(h):p||"}}",this.formatSeparator=m||",",this.unescapePrefix=x?"":v||"-",this.unescapeSuffix=this.unescapePrefix?"":x||"",this.nestingPrefix=w?yr(w):C||yr("$t("),this.nestingSuffix=T?yr(T):E||yr(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=N||1e3,this.alwaysFormat=M!==void 0?M:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const l=(r,i)=>r?.source===i?(r.lastIndex=0,r):new RegExp(i,"g");this.regexp=l(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=l(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=l(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(l,r,i,s){let c,d,h;const p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},m=C=>{if(C.indexOf(this.formatSeparator)<0){const N=wv(r,p,C,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(N,void 0,i,{...s,...r,interpolationkey:C}):N}const T=C.split(this.formatSeparator),E=T.shift().trim(),R=T.join(this.formatSeparator).trim();return this.format(wv(r,p,E,this.options.keySeparator,this.options.ignoreJSONStructure),R,i,{...s,...r,interpolationkey:E})};this.resetRegExp();const x=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,v=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:C=>Bf(C)},{regex:this.regexp,safeValue:C=>this.escapeValue?Bf(this.escape(C)):Bf(C)}].forEach(C=>{for(h=0;c=C.regex.exec(l);){const T=c[1].trim();if(d=m(T),d===void 0)if(typeof x=="function"){const R=x(l,c,s);d=Te(R)?R:""}else if(s&&Object.prototype.hasOwnProperty.call(s,T))d="";else if(v){d=c[0];continue}else this.logger.warn(`missed to pass in variable ${T} for interpolating ${l}`),d="";else!Te(d)&&!this.useRawValueToEscape&&(d=hv(d));const E=C.safeValue(d);if(l=l.replace(c[0],E),v?(C.regex.lastIndex+=d.length,C.regex.lastIndex-=c[0].length):C.regex.lastIndex=0,h++,h>=this.maxReplaces)break}}),l}nest(l,r,i={}){let s,c,d;const h=(p,m)=>{const x=this.nestingOptionsSeparator;if(p.indexOf(x)<0)return p;const v=p.split(new RegExp(`${x}[ ]*{`));let w=`{${v[1]}`;p=v[0],w=this.interpolate(w,d);const C=w.match(/'/g),T=w.match(/"/g);((C?.length??0)%2===0&&!T||T.length%2!==0)&&(w=w.replace(/'/g,'"'));try{d=JSON.parse(w),m&&(d={...m,...d})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,E),`${p}${x}${w}`}return d.defaultValue&&d.defaultValue.indexOf(this.prefix)>-1&&delete d.defaultValue,p};for(;s=this.nestingRegexp.exec(l);){let p=[];d={...i},d=d.replace&&!Te(d.replace)?d.replace:d,d.applyPostProcessor=!1,delete d.defaultValue;const m=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(m!==-1&&(p=s[1].slice(m).split(this.formatSeparator).map(x=>x.trim()).filter(Boolean),s[1]=s[1].slice(0,m)),c=r(h.call(this,s[1].trim(),d),d),c&&s[0]===l&&!Te(c))return c;Te(c)||(c=hv(c)),c||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${l}`),c=""),p.length&&(c=p.reduce((x,v)=>this.format(x,v,i.lng,{...i,interpolationkey:s[1].trim()}),c.trim())),l=l.replace(s[0],c),this.regexp.lastIndex=0}return l}}const Ew=n=>{let l=n.toLowerCase().trim();const r={};if(n.indexOf("(")>-1){const i=n.split("(");l=i[0].toLowerCase().trim();const s=i[1].substring(0,i[1].length-1);l==="currency"&&s.indexOf(":")<0?r.currency||(r.currency=s.trim()):l==="relativetime"&&s.indexOf(":")<0?r.range||(r.range=s.trim()):s.split(";").forEach(d=>{if(d){const[h,...p]=d.split(":"),m=p.join(":").trim().replace(/^'+|'+$/g,""),x=h.trim();r[x]||(r[x]=m),m==="false"&&(r[x]=!1),m==="true"&&(r[x]=!0),isNaN(m)||(r[x]=parseInt(m,10))}})}return{formatName:l,formatOptions:r}},Ev=n=>{const l={};return(r,i,s)=>{let c=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(c={...c,[s.interpolationkey]:void 0});const d=i+JSON.stringify(c);let h=l[d];return h||(h=n($o(i),s),l[d]=h),h(r)}},Tw=n=>(l,r,i)=>n($o(r),i)(l);class Rw{constructor(l={}){this.logger=Pn.create("formatter"),this.options=l,this.init(l)}init(l,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const i=r.cacheInBuiltFormats?Ev:Tw;this.formats={number:i((s,c)=>{const d=new Intl.NumberFormat(s,{...c});return h=>d.format(h)}),currency:i((s,c)=>{const d=new Intl.NumberFormat(s,{...c,style:"currency"});return h=>d.format(h)}),datetime:i((s,c)=>{const d=new Intl.DateTimeFormat(s,{...c});return h=>d.format(h)}),relativetime:i((s,c)=>{const d=new Intl.RelativeTimeFormat(s,{...c});return h=>d.format(h,c.range||"day")}),list:i((s,c)=>{const d=new Intl.ListFormat(s,{...c});return h=>d.format(h)})}}add(l,r){this.formats[l.toLowerCase().trim()]=r}addCached(l,r){this.formats[l.toLowerCase().trim()]=Ev(r)}format(l,r,i,s={}){const c=r.split(this.formatSeparator);if(c.length>1&&c[0].indexOf("(")>1&&c[0].indexOf(")")<0&&c.find(h=>h.indexOf(")")>-1)){const h=c.findIndex(p=>p.indexOf(")")>-1);c[0]=[c[0],...c.splice(1,h)].join(this.formatSeparator)}return c.reduce((h,p)=>{const{formatName:m,formatOptions:x}=Ew(p);if(this.formats[m]){let v=h;try{const w=s?.formatParams?.[s.interpolationkey]||{},C=w.locale||w.lng||s.locale||s.lng||i;v=this.formats[m](h,C,{...x,...s,...w})}catch(w){this.logger.warn(w)}return v}else this.logger.warn(`there was no format function for ${m}`);return h},l)}}const Aw=(n,l)=>{n.pending[l]!==void 0&&(delete n.pending[l],n.pendingCount--)};class Nw extends Ws{constructor(l,r,i,s={}){super(),this.backend=l,this.store=r,this.services=i,this.languageUtils=i.languageUtils,this.options=s,this.logger=Pn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,s.backend,s)}queueLoad(l,r,i,s){const c={},d={},h={},p={};return l.forEach(m=>{let x=!0;r.forEach(v=>{const w=`${m}|${v}`;!i.reload&&this.store.hasResourceBundle(m,v)?this.state[w]=2:this.state[w]<0||(this.state[w]===1?d[w]===void 0&&(d[w]=!0):(this.state[w]=1,x=!1,d[w]===void 0&&(d[w]=!0),c[w]===void 0&&(c[w]=!0),p[v]===void 0&&(p[v]=!0)))}),x||(h[m]=!0)}),(Object.keys(c).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(c),pending:Object.keys(d),toLoadLanguages:Object.keys(h),toLoadNamespaces:Object.keys(p)}}loaded(l,r,i){const s=l.split("|"),c=s[0],d=s[1];r&&this.emit("failedLoading",c,d,r),!r&&i&&this.store.addResourceBundle(c,d,i,void 0,void 0,{skipCopy:!0}),this.state[l]=r?-1:2,r&&i&&(this.state[l]=0);const h={};this.queue.forEach(p=>{hw(p.loaded,[c],d),Aw(p,l),r&&p.errors.push(r),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(m=>{h[m]||(h[m]={});const x=p.loaded[m];x.length&&x.forEach(v=>{h[m][v]===void 0&&(h[m][v]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",h),this.queue=this.queue.filter(p=>!p.done)}read(l,r,i,s=0,c=this.retryTimeout,d){if(!l.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:l,ns:r,fcName:i,tried:s,wait:c,callback:d});return}this.readingCalls++;const h=(m,x)=>{if(this.readingCalls--,this.waitingReads.length>0){const v=this.waitingReads.shift();this.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(m&&x&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,l,r,i,s+1,c*2,d)},c);return}d(m,x)},p=this.backend[i].bind(this.backend);if(p.length===2){try{const m=p(l,r);m&&typeof m.then=="function"?m.then(x=>h(null,x)).catch(h):h(null,m)}catch(m){h(m)}return}return p(l,r,h)}prepareLoading(l,r,i={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Te(l)&&(l=this.languageUtils.toResolveHierarchy(l)),Te(r)&&(r=[r]);const c=this.queueLoad(l,r,i,s);if(!c.toLoad.length)return c.pending.length||s(),null;c.toLoad.forEach(d=>{this.loadOne(d)})}load(l,r,i){this.prepareLoading(l,r,{},i)}reload(l,r,i){this.prepareLoading(l,r,{reload:!0},i)}loadOne(l,r=""){const i=l.split("|"),s=i[0],c=i[1];this.read(s,c,"read",void 0,void 0,(d,h)=>{d&&this.logger.warn(`${r}loading namespace ${c} for language ${s} failed`,d),!d&&h&&this.logger.log(`${r}loaded namespace ${c} for language ${s}`,h),this.loaded(l,d,h)})}saveMissing(l,r,i,s,c,d={},h=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${i}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend?.create){const p={...d,isUpdate:c},m=this.backend.create.bind(this.backend);if(m.length<6)try{let x;m.length===5?x=m(l,r,i,s,p):x=m(l,r,i,s),x&&typeof x.then=="function"?x.then(v=>h(null,v)).catch(h):h(null,x)}catch(x){h(x)}else m(l,r,i,s,h,p)}!l||!l[0]||this.store.addResource(l[0],r,i,s)}}}const Tv=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let l={};if(typeof n[1]=="object"&&(l=n[1]),Te(n[1])&&(l.defaultValue=n[1]),Te(n[2])&&(l.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const r=n[3]||n[2];Object.keys(r).forEach(i=>{l[i]=r[i]})}return l},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Rv=n=>(Te(n.ns)&&(n.ns=[n.ns]),Te(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),Te(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),bs=()=>{},Ow=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(r=>{typeof n[r]=="function"&&(n[r]=n[r].bind(n))})};class qo extends Ws{constructor(l={},r){if(super(),this.options=Rv(l),this.services={},this.logger=Pn,this.modules={external:[]},Ow(this),r&&!this.isInitialized&&!l.isClone){if(!this.options.initAsync)return this.init(l,r),this;setTimeout(()=>{this.init(l,r)},0)}}init(l={},r){this.isInitializing=!0,typeof l=="function"&&(r=l,l={}),l.defaultNS==null&&l.ns&&(Te(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const i=Tv();this.options={...i,...this.options,...Rv(l)},this.options.interpolation={...i.interpolation,...this.options.interpolation},l.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=l.keySeparator),l.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=l.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const s=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?Pn.init(s(this.modules.logger),this.options):Pn.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:m=Rw;const x=new bv(this.options);this.store=new vv(this.options.resources,this.options);const v=this.services;v.logger=Pn,v.resourceStore=this.store,v.languageUtils=x,v.pluralResolver=new Cw(x,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),m&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(v.formatter=s(m),v.formatter.init&&v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new Cv(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new Nw(s(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",(C,...T)=>{this.emit(C,...T)}),this.modules.languageDetector&&(v.languageDetector=s(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=s(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new Us(this.services,this.options),this.translator.on("*",(C,...T)=>{this.emit(C,...T)}),this.modules.external.forEach(C=>{C.init&&C.init(this)})}if(this.format=this.options.interpolation.format,r||(r=bs),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(m=>{this[m]=(...x)=>this.store[m](...x)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=(...x)=>(this.store[m](...x),this)});const h=ko(),p=()=>{const m=(x,v)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),h.resolve(v),r(x,v)};if(this.languages&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),h}loadResources(l,r=bs){let i=r;const s=Te(l)?l:this.language;if(typeof l=="function"&&(i=l),!this.options.resources||this.options.partialBundledLanguages){if(s?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const c=[],d=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(m=>{m!=="cimode"&&c.indexOf(m)<0&&c.push(m)})};s?d(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>d(p)),this.options.preload?.forEach?.(h=>d(h)),this.services.backendConnector.load(c,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(h)})}else i(null)}reloadResources(l,r,i){const s=ko();return typeof l=="function"&&(i=l,l=void 0),typeof r=="function"&&(i=r,r=void 0),l||(l=this.languages),r||(r=this.options.ns),i||(i=bs),this.services.backendConnector.reload(l,r,c=>{s.resolve(),i(c)}),s}use(l){if(!l)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!l.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return l.type==="backend"&&(this.modules.backend=l),(l.type==="logger"||l.log&&l.warn&&l.error)&&(this.modules.logger=l),l.type==="languageDetector"&&(this.modules.languageDetector=l),l.type==="i18nFormat"&&(this.modules.i18nFormat=l),l.type==="postProcessor"&&My.addPostProcessor(l),l.type==="formatter"&&(this.modules.formatter=l),l.type==="3rdParty"&&this.modules.external.push(l),this}setResolvedLanguage(l){if(!(!l||!this.languages)&&!(["cimode","dev"].indexOf(l)>-1)){for(let r=0;r<this.languages.length;r++){const i=this.languages[r];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(l)<0&&this.store.hasLanguageSomeTranslations(l)&&(this.resolvedLanguage=l,this.languages.unshift(l))}}changeLanguage(l,r){this.isLanguageChangingTo=l;const i=ko();this.emit("languageChanging",l);const s=h=>{this.language=h,this.languages=this.services.languageUtils.toResolveHierarchy(h),this.resolvedLanguage=void 0,this.setResolvedLanguage(h)},c=(h,p)=>{p?this.isLanguageChangingTo===l&&(s(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,i.resolve((...m)=>this.t(...m)),r&&r(h,(...m)=>this.t(...m))},d=h=>{!l&&!h&&this.services.languageDetector&&(h=[]);const p=Te(h)?h:h&&h[0],m=this.store.hasLanguageSomeTranslations(p)?p:this.services.languageUtils.getBestMatchFromCodes(Te(h)?[h]:h);m&&(this.language||s(m),this.translator.language||this.translator.changeLanguage(m),this.services.languageDetector?.cacheUserLanguage?.(m)),this.loadResources(m,x=>{c(x,m)})};return!l&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!l&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(l),i}getFixedT(l,r,i){const s=(c,d,...h)=>{let p;typeof d!="object"?p=this.options.overloadTranslationOptionHandler([c,d].concat(h)):p={...d},p.lng=p.lng||s.lng,p.lngs=p.lngs||s.lngs,p.ns=p.ns||s.ns,p.keyPrefix!==""&&(p.keyPrefix=p.keyPrefix||i||s.keyPrefix);const m=this.options.keySeparator||".";let x;return p.keyPrefix&&Array.isArray(c)?x=c.map(v=>(typeof v=="function"&&(v=rd(v,{...this.options,...d})),`${p.keyPrefix}${m}${v}`)):(typeof c=="function"&&(c=rd(c,{...this.options,...d})),x=p.keyPrefix?`${p.keyPrefix}${m}${c}`:c),this.t(x,p)};return Te(l)?s.lng=l:s.lngs=l,s.ns=r,s.keyPrefix=i,s}t(...l){return this.translator?.translate(...l)}exists(...l){return this.translator?.exists(...l)}setDefaultNamespace(l){this.options.defaultNS=l}hasLoadedNamespace(l,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=r.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const d=(h,p)=>{const m=this.services.backendConnector.state[`${h}|${p}`];return m===-1||m===0||m===2};if(r.precheck){const h=r.precheck(this,d);if(h!==void 0)return h}return!!(this.hasResourceBundle(i,l)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(i,l)&&(!s||d(c,l)))}loadNamespaces(l,r){const i=ko();return this.options.ns?(Te(l)&&(l=[l]),l.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{i.resolve(),r&&r(s)}),i):(r&&r(),Promise.resolve())}loadLanguages(l,r){const i=ko();Te(l)&&(l=[l]);const s=this.options.preload||[],c=l.filter(d=>s.indexOf(d)<0&&this.services.languageUtils.isSupportedCode(d));return c.length?(this.options.preload=s.concat(c),this.loadResources(d=>{i.resolve(),r&&r(d)}),i):(r&&r(),Promise.resolve())}dir(l){if(l||(l=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!l)return"rtl";try{const s=new Intl.Locale(l);if(s&&s.getTextInfo){const c=s.getTextInfo();if(c&&c.direction)return c.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services?.languageUtils||new bv(Tv());return l.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(i.getLanguagePartFromCode(l))>-1||l.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(l={},r){const i=new qo(l,r);return i.createInstance=qo.createInstance,i}cloneInstance(l={},r=bs){const i=l.forkResourceStore;i&&delete l.forkResourceStore;const s={...this.options,...l,isClone:!0},c=new qo(s);if((l.debug!==void 0||l.prefix!==void 0)&&(c.logger=c.logger.clone(l)),["store","services","language"].forEach(h=>{c[h]=this[h]}),c.services={...this.services},c.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},i){const h=Object.keys(this.store.data).reduce((p,m)=>(p[m]={...this.store.data[m]},p[m]=Object.keys(p[m]).reduce((x,v)=>(x[v]={...p[m][v]},x),p[m]),p),{});c.store=new vv(h,s),c.services.resourceStore=c.store}return l.interpolation&&(c.services.interpolator=new Cv(s)),c.translator=new Us(c.services,s),c.translator.on("*",(h,...p)=>{c.emit(h,...p)}),c.init(s,r),c.translator.options=s,c.translator.backendConnector.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},c}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ht=qo.createInstance();Ht.createInstance;Ht.dir;Ht.init;Ht.loadResources;Ht.reloadResources;Ht.use;Ht.changeLanguage;Ht.getFixedT;Ht.t;Ht.exists;Ht.setDefaultNamespace;Ht.hasLoadedNamespace;Ht.loadNamespaces;Ht.loadLanguages;const jw=(n,l,r,i)=>{const s=[r,{code:l,...i||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(s,"warn","react-i18next::",!0);El(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...s):console?.warn&&console.warn(...s)},Av={},Ly=(n,l,r,i)=>{El(r)&&Av[r]||(El(r)&&(Av[r]=new Date),jw(n,l,r,i))},ky=(n,l)=>()=>{if(n.isInitialized)l();else{const r=()=>{setTimeout(()=>{n.off("initialized",r)},0),l()};n.on("initialized",r)}},od=(n,l,r)=>{n.loadNamespaces(l,ky(n,r))},Nv=(n,l,r,i)=>{if(El(r)&&(r=[r]),n.options.preload&&n.options.preload.indexOf(l)>-1)return od(n,r,i);r.forEach(s=>{n.options.ns.indexOf(s)<0&&n.options.ns.push(s)}),n.loadLanguages(l,ky(n,i))},Dw=(n,l,r={})=>!l.languages||!l.languages.length?(Ly(l,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:l.languages}),!0):l.hasLoadedNamespace(n,{lng:r.lng,precheck:(i,s)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,n))return!1}}),El=n=>typeof n=="string",_w=n=>typeof n=="object"&&n!==null,Mw=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,zw={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Lw=n=>zw[n],kw=n=>n.replace(Mw,Lw);let id={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:kw,transDefaultProps:void 0};const Uw=(n={})=>{id={...id,...n}},Hw=()=>id;let Uy;const Bw=n=>{Uy=n},Pw=()=>Uy,Vw={type:"3rdParty",init(n){Uw(n.options.react),Bw(n)}},Iw=y.createContext();class Yw{constructor(){this.usedNamespaces={}}addUsedNamespaces(l){l.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Pf={exports:{}},Vf={};var Ov;function qw(){if(Ov)return Vf;Ov=1;var n=Zs();function l(v,w){return v===w&&(v!==0||1/v===1/w)||v!==v&&w!==w}var r=typeof Object.is=="function"?Object.is:l,i=n.useState,s=n.useEffect,c=n.useLayoutEffect,d=n.useDebugValue;function h(v,w){var C=w(),T=i({inst:{value:C,getSnapshot:w}}),E=T[0].inst,R=T[1];return c(function(){E.value=C,E.getSnapshot=w,p(E)&&R({inst:E})},[v,C,w]),s(function(){return p(E)&&R({inst:E}),v(function(){p(E)&&R({inst:E})})},[v]),d(C),C}function p(v){var w=v.getSnapshot;v=v.value;try{var C=w();return!r(v,C)}catch{return!0}}function m(v,w){return w()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:h;return Vf.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:x,Vf}var jv;function Gw(){return jv||(jv=1,Pf.exports=qw()),Pf.exports}var $w=Gw();const Xw=(n,l)=>El(l)?l:_w(l)&&El(l.defaultValue)?l.defaultValue:Array.isArray(n)?n[n.length-1]:n,Fw={t:Xw,ready:!1},Kw=()=>()=>{},Qo=(n,l={})=>{const{i18n:r}=l,{i18n:i,defaultNS:s}=y.useContext(Iw)||{},c=r||i||Pw();c&&!c.reportNamespaces&&(c.reportNamespaces=new Yw),c||Ly(c,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const d=y.useMemo(()=>({...Hw(),...c?.options?.react,...l}),[c,l]),{useSuspense:h,keyPrefix:p}=d,m=s||c?.options?.defaultNS,x=El(m)?[m]:m||["translation"],v=y.useMemo(()=>x,x);c?.reportNamespaces?.addUsedNamespaces?.(v);const w=y.useRef(0),C=y.useCallback(J=>{if(!c)return Kw;const{bindI18n:ne,bindI18nStore:re}=d,K=()=>{w.current+=1,J()};return ne&&c.on(ne,K),re&&c.store.on(re,K),()=>{ne&&ne.split(" ").forEach(ie=>c.off(ie,K)),re&&re.split(" ").forEach(ie=>c.store.off(ie,K))}},[c,d]),T=y.useRef(),E=y.useCallback(()=>{if(!c)return Fw;const J=!!(c.isInitialized||c.initializedStoreOnce)&&v.every(he=>Dw(he,c,d)),ne=l.lng||c.language,re=w.current,K=T.current;if(K&&K.ready===J&&K.lng===ne&&K.keyPrefix===p&&K.revision===re)return K;const ce={t:c.getFixedT(ne,d.nsMode==="fallback"?v:v[0],p),ready:J,lng:ne,keyPrefix:p,revision:re};return T.current=ce,ce},[c,v,p,d,l.lng]),[R,N]=y.useState(0),{t:M,ready:z}=$w.useSyncExternalStore(C,E,E);y.useEffect(()=>{if(c&&!z&&!h){const J=()=>N(ne=>ne+1);l.lng?Nv(c,l.lng,v,J):od(c,v,J)}},[c,l.lng,v,z,h,R]);const P=c||{},G=y.useRef(null),k=y.useRef(),L=J=>{const ne=Object.getOwnPropertyDescriptors(J);ne.__original&&delete ne.__original;const re=Object.create(Object.getPrototypeOf(J),ne);if(!Object.prototype.hasOwnProperty.call(re,"__original"))try{Object.defineProperty(re,"__original",{value:J,writable:!1,enumerable:!1,configurable:!1})}catch{}return re},Y=y.useMemo(()=>{const J=P,ne=J?.language;let re=J;J&&(G.current&&G.current.__original===J?k.current!==ne?(re=L(J),G.current=re,k.current=ne):re=G.current:(re=L(J),G.current=re,k.current=ne));const K=[M,re,z];return K.t=M,K.i18n=re,K.ready=z,K},[M,P,z,P.resolvedLanguage,P.language,P.languages]);if(c&&h&&!z)throw new Promise(J=>{const ne=()=>J();l.lng?Nv(c,l.lng,v,ne):od(c,v,ne)});return Y},{slice:Qw,forEach:Zw}=[];function Ww(n){return Zw.call(Qw.call(arguments,1),l=>{if(l)for(const r in l)n[r]===void 0&&(n[r]=l[r])}),n}function Jw(n){return typeof n!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(r=>r.test(n))}const Dv=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,eC=function(n,l){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(l);let c=`${n}=${s}`;if(i.maxAge>0){const d=i.maxAge-0;if(Number.isNaN(d))throw new Error("maxAge should be a Number");c+=`; Max-Age=${Math.floor(d)}`}if(i.domain){if(!Dv.test(i.domain))throw new TypeError("option domain is invalid");c+=`; Domain=${i.domain}`}if(i.path){if(!Dv.test(i.path))throw new TypeError("option path is invalid");c+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");c+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(c+="; HttpOnly"),i.secure&&(c+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"strict":c+="; SameSite=Strict";break;case"none":c+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(c+="; Partitioned"),c},_v={create(n,l,r,i){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+r*60*1e3)),i&&(s.domain=i),document.cookie=eC(n,l,s)},read(n){const l=`${n}=`,r=document.cookie.split(";");for(let i=0;i<r.length;i++){let s=r[i];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(l)===0)return s.substring(l.length,s.length)}return null},remove(n,l){this.create(n,"",-1,l)}};var tC={name:"cookie",lookup(n){let{lookupCookie:l}=n;if(l&&typeof document<"u")return _v.read(l)||void 0},cacheUserLanguage(n,l){let{lookupCookie:r,cookieMinutes:i,cookieDomain:s,cookieOptions:c}=l;r&&typeof document<"u"&&_v.create(r,n,i,s,c)}},nC={name:"querystring",lookup(n){let{lookupQuerystring:l}=n,r;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const c=i.substring(1).split("&");for(let d=0;d<c.length;d++){const h=c[d].indexOf("=");h>0&&c[d].substring(0,h)===l&&(r=c[d].substring(h+1))}}return r}},aC={name:"hash",lookup(n){let{lookupHash:l,lookupFromHashIndex:r}=n,i;if(typeof window<"u"){const{hash:s}=window.location;if(s&&s.length>2){const c=s.substring(1);if(l){const d=c.split("&");for(let h=0;h<d.length;h++){const p=d[h].indexOf("=");p>0&&d[h].substring(0,p)===l&&(i=d[h].substring(p+1))}}if(i)return i;if(!i&&r>-1){const d=s.match(/\/([a-zA-Z-]*)/g);return Array.isArray(d)?d[typeof r=="number"?r:0]?.replace("/",""):void 0}}}return i}};let br=null;const Mv=()=>{if(br!==null)return br;try{if(br=typeof window<"u"&&window.localStorage!==null,!br)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{br=!1}return br};var lC={name:"localStorage",lookup(n){let{lookupLocalStorage:l}=n;if(l&&Mv())return window.localStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupLocalStorage:r}=l;r&&Mv()&&window.localStorage.setItem(r,n)}};let xr=null;const zv=()=>{if(xr!==null)return xr;try{if(xr=typeof window<"u"&&window.sessionStorage!==null,!xr)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{xr=!1}return xr};var rC={name:"sessionStorage",lookup(n){let{lookupSessionStorage:l}=n;if(l&&zv())return window.sessionStorage.getItem(l)||void 0},cacheUserLanguage(n,l){let{lookupSessionStorage:r}=l;r&&zv()&&window.sessionStorage.setItem(r,n)}},oC={name:"navigator",lookup(n){const l=[];if(typeof navigator<"u"){const{languages:r,userLanguage:i,language:s}=navigator;if(r)for(let c=0;c<r.length;c++)l.push(r[c]);i&&l.push(i),s&&l.push(s)}return l.length>0?l:void 0}},iC={name:"htmlTag",lookup(n){let{htmlTag:l}=n,r;const i=l||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(r=i.getAttribute("lang")),r}},sC={name:"path",lookup(n){let{lookupFromPathIndex:l}=n;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof l=="number"?l:0]?.replace("/",""):void 0}},cC={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:l}=n;const r=typeof l=="number"?l+1:1,i=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[r]}};let Hy=!1;try{document.cookie,Hy=!0}catch{}const By=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Hy||By.splice(1,1);const uC=()=>({order:By,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class Py{constructor(l){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(l,r)}init(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=l,this.options=Ww(r,this.options||{},uC()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(tC),this.addDetector(nC),this.addDetector(lC),this.addDetector(rC),this.addDetector(oC),this.addDetector(iC),this.addDetector(sC),this.addDetector(cC),this.addDetector(aC)}addDetector(l){return this.detectors[l.name]=l,this}detect(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return l.forEach(i=>{if(this.detectors[i]){let s=this.detectors[i].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(r=r.concat(s))}}),r=r.filter(i=>i!=null&&!Jw(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(l){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(l)>-1||r.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(l,this.options)}))}}Py.type="languageDetector";const fC={en:{translation:{title:"MTranServer",subtitle:"Fast and reliable translation service",translate:"Translate",translating:"Translating...",sourceLanguage:"Source Language",targetLanguage:"Target Language",sourceText:"Source Text",translation:"Translation",enterText:"Enter text to translate...",translationWillAppear:"Translation will appear here...",selectLanguage:"Select language",autoDetect:"Auto Detect",translationCompleted:"Translation completed",translationFailed:"Translation failed",firstTranslationTip:"The first translation requires downloading the model. Please wait.",enterTextError:"Please enter text to translate",failedToLoadLanguages:"Failed to load languages",theme:"Theme",language:"Language",light:"Light",dark:"Dark",system:"System",autoTranslate:"Auto Translate",autoTranslateDesc:"Automatically translate as you type",apiToken:"API Token",apiTokenPlaceholder:"Please enter API token",apiTokenSaved:"API token saved",apiTokenCleared:"API token cleared",save:"Save",apiTokenRequired:"API token is required to access this service",copied:"Copied to clipboard",copyFailed:"Failed to copy",clear:"Clear",history:"History",clearAll:"Clear All",noHistory:"No history",historyDesc:"Recent translations",searchPlaceholder:"Search history...",noResults:"No results found",apiDocs:"API Documentation",addPanel:"Add Translation Panel",widescreen:"Widescreen View",standardView:"Standard View",closePanel:"Close Panel",uploadFile:"Upload file",voiceInputStart:"Start voice input",voiceInputStop:"Stop voice input",speechNotSupported:"Speech recognition is not supported in this browser",speechInputFailed:"Voice input failed",listen:"Listen",copy:"Copy",delete:"Delete",switchLanguage:"Switch Language",toggleTheme:"Toggle Theme",translateShortcut:"Ctrl + Enter to translate",languageSwitcher:"Language",languageSearchPlaceholder:"Search languages...",languageRecent:"Recent",languageAll:"All Languages",followSystemLanguage:"Follow System",desktopSettings:"Desktop Settings",desktopSettingsDesc:"Manage server configuration and desktop preferences",serverStatus:"Service Status",serverStatusRunning:"Running",serverStatusStopped:"Stopped",generalSettings:"General",storageSettings:"Storage",securitySettings:"Security",performanceSettings:"Performance",loggingSettings:"Logging",host:"Host",port:"Port",logLevel:"Log Level",locale:"Language",enableWebUI:"Web UI",enableWebUIDesc:"Enable the built-in web UI",enableOfflineMode:"Offline Mode",enableOfflineModeDesc:"Disable online features and updates",checkUpdate:"Check Updates",checkUpdateDesc:"Check for new versions at startup",modelDir:"Model Directory",configDir:"Config Directory",logDir:"Log Directory",workerIdleTimeout:"Worker Idle Timeout (s)",workersPerLanguage:"Workers Per Language",maxSentenceLength:"Max Length Break",cacheSize:"Cache Size",logToFile:"Log to File",logToFileDesc:"Write logs to file",logConsole:"Log to Console",logConsoleDesc:"Output logs to console",logRequests:"Log Requests",logRequestsDesc:"Record each request",apply:"Apply",restart:"Restart",resetDefaults:"Reset to Defaults",backToMain:"Back to Main",loadingConfig:"Loading configuration...",loadingConfigFailed:"Failed to load configuration",settingsApplied:"Settings applied",settingsApplyFailed:"Failed to apply settings",serverRestarted:"Server restarted",serverRestartFailed:"Failed to restart server",settingsReset:"Defaults restored",settingsResetFailed:"Failed to reset defaults",desktopOnly:"Desktop only",desktopOnlyDesc:"Desktop settings are only available in the desktop client",version:"Version",saving:"Saving..."}},zh:{translation:{title:"MTranServer",subtitle:"快速可靠的翻译服务",translate:"翻译",translating:"翻译中...",sourceLanguage:"源语言",targetLanguage:"目标语言",sourceText:"源文本",translation:"翻译结果",enterText:"输入要翻译的文本...",translationWillAppear:"翻译结果将显示在这里...",selectLanguage:"选择语言",autoDetect:"自动检测",translationCompleted:"翻译完成",translationFailed:"翻译失败",firstTranslationTip:"第一次翻译需要下载模型,请耐心等待。",enterTextError:"请输入要翻译的文本",failedToLoadLanguages:"加载语言列表失败",theme:"主题",language:"语言",light:"浅色",dark:"深色",system:"跟随系统",autoTranslate:"自动翻译",autoTranslateDesc:"输入时自动翻译",apiToken:"API Token",apiTokenPlaceholder:"请输入 API token",apiTokenSaved:"API token 已保存",apiTokenCleared:"API token 已清除",save:"保存",apiTokenRequired:"访问此服务需要 API token",copied:"已复制到剪贴板",copyFailed:"复制失败",clear:"清空",history:"历史记录",clearAll:"清空全部",noHistory:"暂无历史记录",historyDesc:"最近的翻译记录",searchPlaceholder:"搜索历史记录...",noResults:"未找到结果",apiDocs:"API 文档",addPanel:"添加翻译面板",widescreen:"宽屏模式",standardView:"标准视图",closePanel:"关闭面板",uploadFile:"上传文件",voiceInputStart:"开始语音输入",voiceInputStop:"停止语音输入",speechNotSupported:"当前浏览器不支持语音识别",speechInputFailed:"语音输入失败",listen:"朗读",copy:"复制",delete:"删除",switchLanguage:"切换语言",toggleTheme:"切换主题",translateShortcut:"Ctrl + Enter 快捷翻译",languageSwitcher:"语言",languageSearchPlaceholder:"搜索语言...",languageRecent:"最近使用",languageAll:"全部语言",followSystemLanguage:"跟随系统",desktopSettings:"桌面端设置",desktopSettingsDesc:"管理服务配置与桌面偏好",serverStatus:"服务状态",serverStatusRunning:"启动中",serverStatusStopped:"已停止",generalSettings:"常规",storageSettings:"存储",securitySettings:"安全",performanceSettings:"性能",loggingSettings:"日志",host:"主机",port:"端口",logLevel:"日志级别",locale:"语言",enableWebUI:"Web UI",enableWebUIDesc:"启用内置 Web UI",enableOfflineMode:"离线模式",enableOfflineModeDesc:"禁用在线功能与更新检查",checkUpdate:"检查更新",checkUpdateDesc:"启动时检查新版本",modelDir:"模型目录",configDir:"配置目录",logDir:"日志目录",workerIdleTimeout:"空闲超时(秒)",workersPerLanguage:"每语言工作数",maxSentenceLength:"最大断句长度",cacheSize:"缓存大小",logToFile:"写入文件",logToFileDesc:"将日志写入文件",logConsole:"控制台日志",logConsoleDesc:"在控制台输出日志",logRequests:"请求日志",logRequestsDesc:"记录每个请求",apply:"应用",restart:"重启",resetDefaults:"恢复默认值",backToMain:"返回主界面",loadingConfig:"正在加载配置...",loadingConfigFailed:"加载配置失败",settingsApplied:"设置已应用",settingsApplyFailed:"应用设置失败",serverRestarted:"服务已重启",serverRestartFailed:"服务重启失败",settingsReset:"默认值已恢复",settingsResetFailed:"恢复默认值失败",desktopOnly:"仅限桌面端",desktopOnlyDesc:"桌面端设置仅在桌面客户端可用",version:"版本",saving:"保存中..."}},ja:{translation:{title:"MTranServer",subtitle:"高速で信頼性の高い翻訳サービス",translate:"翻訳",translating:"翻訳中...",sourceLanguage:"ソース言語",targetLanguage:"ターゲット言語",sourceText:"ソーステキスト",translation:"翻訳",enterText:"翻訳するテキストを入力...",translationWillAppear:"翻訳がここに表示されます...",selectLanguage:"言語を選択",autoDetect:"自動検出",translationCompleted:"翻訳完了",translationFailed:"翻訳失敗",firstTranslationTip:"初回の翻訳ではモデルのダウンロードが必要です。しばらくお待ちください。",enterTextError:"翻訳するテキストを入力してください",failedToLoadLanguages:"言語の読み込みに失敗しました",theme:"テーマ",language:"言語",light:"ライト",dark:"ダーク",system:"システム",autoTranslate:"自動翻訳",autoTranslateDesc:"入力時に自動翻訳",apiToken:"APIトークン",apiTokenPlaceholder:"APIトークンを入力してください",apiTokenSaved:"APIトークンが保存されました",apiTokenCleared:"APIトークンがクリアされました",save:"保存",apiTokenRequired:"このサービスにアクセスするにはAPIトークンが必要です",copied:"クリップボードにコピーしました",copyFailed:"コピーに失敗しました",clear:"クリア",history:"履歴",clearAll:"すべてクリア",noHistory:"履歴はありません",historyDesc:"最近の翻訳履歴",searchPlaceholder:"履歴を検索...",noResults:"結果が見つかりません",apiDocs:"APIドキュメント",addPanel:"翻訳パネルを追加",widescreen:"ワイドスクリーン表示",standardView:"標準表示",closePanel:"パネルを閉じる",uploadFile:"ファイルをアップロード",voiceInputStart:"音声入力を開始",voiceInputStop:"音声入力を停止",speechNotSupported:"このブラウザは音声認識に対応していません",speechInputFailed:"音声入力に失敗しました",listen:"読み上げ",copy:"コピー",delete:"削除",switchLanguage:"言語を切り替え",toggleTheme:"テーマを切り替え",translateShortcut:"Ctrl + Enterで翻訳",languageSwitcher:"言語",languageSearchPlaceholder:"言語を検索...",languageRecent:"最近",languageAll:"すべての言語",followSystemLanguage:"システムに従う",desktopSettings:"デスクトップ設定",desktopSettingsDesc:"サーバー設定とデスクトップ設定を管理",serverStatus:"サービス状態",serverStatusRunning:"稼働中",serverStatusStopped:"停止中",generalSettings:"一般",storageSettings:"ストレージ",securitySettings:"セキュリティ",performanceSettings:"パフォーマンス",loggingSettings:"ログ",host:"ホスト",port:"ポート",logLevel:"ログレベル",locale:"言語",enableWebUI:"Web UI",enableWebUIDesc:"内蔵 Web UI を有効化",enableOfflineMode:"オフラインモード",enableOfflineModeDesc:"オンライン機能と更新確認を無効化",checkUpdate:"更新チェック",checkUpdateDesc:"起動時に新しいバージョンを確認",modelDir:"モデルディレクトリ",configDir:"設定ディレクトリ",logDir:"ログディレクトリ",workerIdleTimeout:"アイドルタイムアウト(秒)",workersPerLanguage:"言語ごとのワーカー数",maxSentenceLength:"最大分割長",cacheSize:"キャッシュサイズ",logToFile:"ファイルに記録",logToFileDesc:"ログをファイルに書き込む",logConsole:"コンソール出力",logConsoleDesc:"コンソールにログを出力",logRequests:"リクエストログ",logRequestsDesc:"各リクエストを記録",apply:"適用",restart:"再起動",resetDefaults:"デフォルトに戻す",backToMain:"メインに戻る",loadingConfig:"設定を読み込み中...",loadingConfigFailed:"設定の読み込みに失敗しました",settingsApplied:"設定を適用しました",settingsApplyFailed:"設定の適用に失敗しました",serverRestarted:"サーバーを再起動しました",serverRestartFailed:"サーバーの再起動に失敗しました",settingsReset:"デフォルトを復元しました",settingsResetFailed:"デフォルトの復元に失敗しました",desktopOnly:"デスクトップ専用",desktopOnlyDesc:"デスクトップ設定はデスクトップクライアントのみ利用できます",version:"バージョン",saving:"保存中..."}}};Ht.use(Py).use(Vw).init({resources:fC,fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"]}});function Lv(n,l){if(typeof n=="function")return n(l);n!=null&&(n.current=l)}function bn(...n){return l=>{let r=!1;const i=n.map(s=>{const c=Lv(s,l);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let s=0;s<i.length;s++){const c=i[s];typeof c=="function"?c():Lv(n[s],null)}}}}function He(...n){return y.useCallback(bn(...n),n)}var dC=Symbol.for("react.lazy"),Hs=zd[" use ".trim().toString()];function hC(n){return typeof n=="object"&&n!==null&&"then"in n}function Vy(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===dC&&"_payload"in n&&hC(n._payload)}function Ld(n){const l=mC(n),r=y.forwardRef((i,s)=>{let{children:c,...d}=i;Vy(c)&&typeof Hs=="function"&&(c=Hs(c._payload));const h=y.Children.toArray(c),p=h.find(vC);if(p){const m=p.props.children,x=h.map(v=>v===p?y.Children.count(m)>1?y.Children.only(null):y.isValidElement(m)?m.props.children:null:v);return g.jsx(l,{...d,ref:s,children:y.isValidElement(m)?y.cloneElement(m,void 0,x):null})}return g.jsx(l,{...d,ref:s,children:c})});return r.displayName=`${n}.Slot`,r}var pC=Ld("Slot");function mC(n){const l=y.forwardRef((r,i)=>{let{children:s,...c}=r;if(Vy(s)&&typeof Hs=="function"&&(s=Hs(s._payload)),y.isValidElement(s)){const d=bC(s),h=yC(c,s.props);return s.type!==y.Fragment&&(h.ref=i?bn(i,d):d),y.cloneElement(s,h)}return y.Children.count(s)>1?y.Children.only(null):null});return l.displayName=`${n}.SlotClone`,l}var gC=Symbol("radix.slottable");function vC(n){return y.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===gC}function yC(n,l){const r={...l};for(const i in l){const s=n[i],c=l[i];/^on[A-Z]/.test(i)?s&&c?r[i]=(...h)=>{const p=c(...h);return s(...h),p}:s&&(r[i]=s):i==="style"?r[i]={...s,...c}:i==="className"&&(r[i]=[s,c].filter(Boolean).join(" "))}return{...n,...r}}function bC(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?n.props.ref:n.props.ref||n.ref)}function Iy(n){var l,r,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(l=0;l<s;l++)n[l]&&(r=Iy(n[l]))&&(i&&(i+=" "),i+=r)}else for(r in n)n[r]&&(i&&(i+=" "),i+=r);return i}function Yy(){for(var n,l,r=0,i="",s=arguments.length;r<s;r++)(n=arguments[r])&&(l=Iy(n))&&(i&&(i+=" "),i+=l);return i}const kv=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,Uv=Yy,qy=(n,l)=>r=>{var i;if(l?.variants==null)return Uv(n,r?.class,r?.className);const{variants:s,defaultVariants:c}=l,d=Object.keys(s).map(m=>{const x=r?.[m],v=c?.[m];if(x===null)return null;const w=kv(x)||kv(v);return s[m][w]}),h=r&&Object.entries(r).reduce((m,x)=>{let[v,w]=x;return w===void 0||(m[v]=w),m},{}),p=l==null||(i=l.compoundVariants)===null||i===void 0?void 0:i.reduce((m,x)=>{let{class:v,className:w,...C}=x;return Object.entries(C).every(T=>{let[E,R]=T;return Array.isArray(R)?R.includes({...c,...h}[E]):{...c,...h}[E]===R})?[...m,v,w]:m},[]);return Uv(n,d,p,r?.class,r?.className)},xC=(n,l)=>{const r=new Array(n.length+l.length);for(let i=0;i<n.length;i++)r[i]=n[i];for(let i=0;i<l.length;i++)r[n.length+i]=l[i];return r},SC=(n,l)=>({classGroupId:n,validator:l}),Gy=(n=new Map,l=null,r)=>({nextPart:n,validators:l,classGroupId:r}),Bs="-",Hv=[],wC="arbitrary..",CC=n=>{const l=TC(n),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return EC(d);const h=d.split(Bs),p=h[0]===""&&h.length>1?1:0;return $y(h,p,l)},getConflictingClassGroupIds:(d,h)=>{if(h){const p=i[d],m=r[d];return p?m?xC(m,p):p:m||Hv}return r[d]||Hv}}},$y=(n,l,r)=>{if(n.length-l===0)return r.classGroupId;const s=n[l],c=r.nextPart.get(s);if(c){const m=$y(n,l+1,c);if(m)return m}const d=r.validators;if(d===null)return;const h=l===0?n.join(Bs):n.slice(l).join(Bs),p=d.length;for(let m=0;m<p;m++){const x=d[m];if(x.validator(h))return x.classGroupId}},EC=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const l=n.slice(1,-1),r=l.indexOf(":"),i=l.slice(0,r);return i?wC+i:void 0})(),TC=n=>{const{theme:l,classGroups:r}=n;return RC(r,l)},RC=(n,l)=>{const r=Gy();for(const i in n){const s=n[i];kd(s,r,i,l)}return r},kd=(n,l,r,i)=>{const s=n.length;for(let c=0;c<s;c++){const d=n[c];AC(d,l,r,i)}},AC=(n,l,r,i)=>{if(typeof n=="string"){NC(n,l,r);return}if(typeof n=="function"){OC(n,l,r,i);return}jC(n,l,r,i)},NC=(n,l,r)=>{const i=n===""?l:Xy(l,n);i.classGroupId=r},OC=(n,l,r,i)=>{if(DC(n)){kd(n(i),l,r,i);return}l.validators===null&&(l.validators=[]),l.validators.push(SC(r,n))},jC=(n,l,r,i)=>{const s=Object.entries(n),c=s.length;for(let d=0;d<c;d++){const[h,p]=s[d];kd(p,Xy(l,h),r,i)}},Xy=(n,l)=>{let r=n;const i=l.split(Bs),s=i.length;for(let c=0;c<s;c++){const d=i[c];let h=r.nextPart.get(d);h||(h=Gy(),r.nextPart.set(d,h)),r=h}return r},DC=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,_C=n=>{if(n<1)return{get:()=>{},set:()=>{}};let l=0,r=Object.create(null),i=Object.create(null);const s=(c,d)=>{r[c]=d,l++,l>n&&(l=0,i=r,r=Object.create(null))};return{get(c){let d=r[c];if(d!==void 0)return d;if((d=i[c])!==void 0)return s(c,d),d},set(c,d){c in r?r[c]=d:s(c,d)}}},sd="!",Bv=":",MC=[],Pv=(n,l,r,i,s)=>({modifiers:n,hasImportantModifier:l,baseClassName:r,maybePostfixModifierPosition:i,isExternal:s}),zC=n=>{const{prefix:l,experimentalParseClassName:r}=n;let i=s=>{const c=[];let d=0,h=0,p=0,m;const x=s.length;for(let E=0;E<x;E++){const R=s[E];if(d===0&&h===0){if(R===Bv){c.push(s.slice(p,E)),p=E+1;continue}if(R==="/"){m=E;continue}}R==="["?d++:R==="]"?d--:R==="("?h++:R===")"&&h--}const v=c.length===0?s:s.slice(p);let w=v,C=!1;v.endsWith(sd)?(w=v.slice(0,-1),C=!0):v.startsWith(sd)&&(w=v.slice(1),C=!0);const T=m&&m>p?m-p:void 0;return Pv(c,C,w,T)};if(l){const s=l+Bv,c=i;i=d=>d.startsWith(s)?c(d.slice(s.length)):Pv(MC,!1,d,void 0,!0)}if(r){const s=i;i=c=>r({className:c,parseClassName:s})}return i},LC=n=>{const l=new Map;return n.orderSensitiveModifiers.forEach((r,i)=>{l.set(r,1e6+i)}),r=>{const i=[];let s=[];for(let c=0;c<r.length;c++){const d=r[c],h=d[0]==="[",p=l.has(d);h||p?(s.length>0&&(s.sort(),i.push(...s),s=[]),i.push(d)):s.push(d)}return s.length>0&&(s.sort(),i.push(...s)),i}},kC=n=>({cache:_C(n.cacheSize),parseClassName:zC(n),sortModifiers:LC(n),...CC(n)}),UC=/\s+/,HC=(n,l)=>{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:s,sortModifiers:c}=l,d=[],h=n.trim().split(UC);let p="";for(let m=h.length-1;m>=0;m-=1){const x=h[m],{isExternal:v,modifiers:w,hasImportantModifier:C,baseClassName:T,maybePostfixModifierPosition:E}=r(x);if(v){p=x+(p.length>0?" "+p:p);continue}let R=!!E,N=i(R?T.substring(0,E):T);if(!N){if(!R){p=x+(p.length>0?" "+p:p);continue}if(N=i(T),!N){p=x+(p.length>0?" "+p:p);continue}R=!1}const M=w.length===0?"":w.length===1?w[0]:c(w).join(":"),z=C?M+sd:M,P=z+N;if(d.indexOf(P)>-1)continue;d.push(P);const G=s(N,R);for(let k=0;k<G.length;++k){const L=G[k];d.push(z+L)}p=x+(p.length>0?" "+p:p)}return p},BC=(...n)=>{let l=0,r,i,s="";for(;l<n.length;)(r=n[l++])&&(i=Fy(r))&&(s&&(s+=" "),s+=i);return s},Fy=n=>{if(typeof n=="string")return n;let l,r="";for(let i=0;i<n.length;i++)n[i]&&(l=Fy(n[i]))&&(r&&(r+=" "),r+=l);return r},PC=(n,...l)=>{let r,i,s,c;const d=p=>{const m=l.reduce((x,v)=>v(x),n());return r=kC(m),i=r.cache.get,s=r.cache.set,c=h,h(p)},h=p=>{const m=i(p);if(m)return m;const x=HC(p,r);return s(p,x),x};return c=d,(...p)=>c(BC(...p))},VC=[],vt=n=>{const l=r=>r[n]||VC;return l.isThemeGetter=!0,l},Ky=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,IC=/^\d+\/\d+$/,YC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,GC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$C=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,XC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Sr=n=>IC.test(n),_e=n=>!!n&&!Number.isNaN(Number(n)),Ya=n=>!!n&&Number.isInteger(Number(n)),If=n=>n.endsWith("%")&&_e(n.slice(0,-1)),pa=n=>YC.test(n),FC=()=>!0,KC=n=>qC.test(n)&&!GC.test(n),Zy=()=>!1,QC=n=>$C.test(n),ZC=n=>XC.test(n),WC=n=>!me(n)&&!ge(n),JC=n=>Lr(n,e0,Zy),me=n=>Ky.test(n),wl=n=>Lr(n,t0,KC),Yf=n=>Lr(n,lE,_e),Vv=n=>Lr(n,Wy,Zy),eE=n=>Lr(n,Jy,ZC),xs=n=>Lr(n,n0,QC),ge=n=>Qy.test(n),Uo=n=>kr(n,t0),tE=n=>kr(n,rE),Iv=n=>kr(n,Wy),nE=n=>kr(n,e0),aE=n=>kr(n,Jy),Ss=n=>kr(n,n0,!0),Lr=(n,l,r)=>{const i=Ky.exec(n);return i?i[1]?l(i[1]):r(i[2]):!1},kr=(n,l,r=!1)=>{const i=Qy.exec(n);return i?i[1]?l(i[1]):r:!1},Wy=n=>n==="position"||n==="percentage",Jy=n=>n==="image"||n==="url",e0=n=>n==="length"||n==="size"||n==="bg-size",t0=n=>n==="length",lE=n=>n==="number",rE=n=>n==="family-name",n0=n=>n==="shadow",oE=()=>{const n=vt("color"),l=vt("font"),r=vt("text"),i=vt("font-weight"),s=vt("tracking"),c=vt("leading"),d=vt("breakpoint"),h=vt("container"),p=vt("spacing"),m=vt("radius"),x=vt("shadow"),v=vt("inset-shadow"),w=vt("text-shadow"),C=vt("drop-shadow"),T=vt("blur"),E=vt("perspective"),R=vt("aspect"),N=vt("ease"),M=vt("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...P(),ge,me],k=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],Y=()=>[ge,me,p],J=()=>[Sr,"full","auto",...Y()],ne=()=>[Ya,"none","subgrid",ge,me],re=()=>["auto",{span:["full",Ya,ge,me]},Ya,ge,me],K=()=>[Ya,"auto",ge,me],ie=()=>["auto","min","max","fr",ge,me],ce=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],he=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...Y()],$=()=>[Sr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Y()],B=()=>[n,ge,me],ue=()=>[...P(),Iv,Vv,{position:[ge,me]}],de=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",nE,JC,{size:[ge,me]}],O=()=>[If,Uo,wl],U=()=>["","none","full",m,ge,me],X=()=>["",_e,Uo,wl],Q=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[_e,If,Iv,Vv],se=()=>["","none",T,ge,me],fe=()=>["none",_e,ge,me],be=()=>["none",_e,ge,me],Ae=()=>[_e,ge,me],De=()=>[Sr,"full",...Y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pa],breakpoint:[pa],color:[FC],container:[pa],"drop-shadow":[pa],ease:["in","out","in-out"],font:[WC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pa],shadow:[pa],spacing:["px",_e],text:[pa],"text-shadow":[pa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Sr,me,ge,R]}],container:["container"],columns:[{columns:[_e,me,ge,h]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:J()}],"inset-x":[{"inset-x":J()}],"inset-y":[{"inset-y":J()}],start:[{start:J()}],end:[{end:J()}],top:[{top:J()}],right:[{right:J()}],bottom:[{bottom:J()}],left:[{left:J()}],visibility:["visible","invisible","collapse"],z:[{z:[Ya,"auto",ge,me]}],basis:[{basis:[Sr,"full","auto",h,...Y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Sr,"auto","initial","none",me]}],grow:[{grow:["",_e,ge,me]}],shrink:[{shrink:["",_e,ge,me]}],order:[{order:[Ya,"first","last","none",ge,me]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:Y()}],"gap-x":[{"gap-x":Y()}],"gap-y":[{"gap-y":Y()}],"justify-content":[{justify:[...ce(),"normal"]}],"justify-items":[{"justify-items":[...he(),"normal"]}],"justify-self":[{"justify-self":["auto",...he()]}],"align-content":[{content:["normal",...ce()]}],"align-items":[{items:[...he(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...he(),{baseline:["","last"]}]}],"place-content":[{"place-content":ce()}],"place-items":[{"place-items":[...he(),"baseline"]}],"place-self":[{"place-self":["auto",...he()]}],p:[{p:Y()}],px:[{px:Y()}],py:[{py:Y()}],ps:[{ps:Y()}],pe:[{pe:Y()}],pt:[{pt:Y()}],pr:[{pr:Y()}],pb:[{pb:Y()}],pl:[{pl:Y()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":Y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Y()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[h,"screen",...$()]}],"min-w":[{"min-w":[h,"screen","none",...$()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[d]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",r,Uo,wl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,ge,Yf]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",If,me]}],"font-family":[{font:[tE,me,l]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ge,me]}],"line-clamp":[{"line-clamp":[_e,"none",ge,Yf]}],leading:[{leading:[c,...Y()]}],"list-image":[{"list-image":["none",ge,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",ge,wl]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[_e,"auto",ge,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ge,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ue()}],"bg-repeat":[{bg:de()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ya,ge,me],radial:["",ge,me],conic:[Ya,ge,me]},aE,eE]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,ge,me]}],"outline-w":[{outline:["",_e,Uo,wl]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",x,Ss,xs]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",v,Ss,xs]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[_e,wl]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",w,Ss,xs]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[_e,ge,me]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[ge,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ue()}],"mask-repeat":[{mask:de()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,me]}],filter:[{filter:["","none",ge,me]}],blur:[{blur:se()}],brightness:[{brightness:[_e,ge,me]}],contrast:[{contrast:[_e,ge,me]}],"drop-shadow":[{"drop-shadow":["","none",C,Ss,xs]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",_e,ge,me]}],"hue-rotate":[{"hue-rotate":[_e,ge,me]}],invert:[{invert:["",_e,ge,me]}],saturate:[{saturate:[_e,ge,me]}],sepia:[{sepia:["",_e,ge,me]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,me]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[_e,ge,me]}],"backdrop-contrast":[{"backdrop-contrast":[_e,ge,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,ge,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,ge,me]}],"backdrop-invert":[{"backdrop-invert":["",_e,ge,me]}],"backdrop-opacity":[{"backdrop-opacity":[_e,ge,me]}],"backdrop-saturate":[{"backdrop-saturate":[_e,ge,me]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,ge,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Y()}],"border-spacing-x":[{"border-spacing-x":Y()}],"border-spacing-y":[{"border-spacing-y":Y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",ge,me]}],ease:[{ease:["linear","initial",N,ge,me]}],delay:[{delay:[_e,ge,me]}],animate:[{animate:["none",M,ge,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,ge,me]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:Ae()}],"skew-x":[{"skew-x":Ae()}],"skew-y":[{"skew-y":Ae()}],transform:[{transform:[ge,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:De()}],"translate-x":[{"translate-x":De()}],"translate-y":[{"translate-y":De()}],"translate-z":[{"translate-z":De()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Y()}],"scroll-mx":[{"scroll-mx":Y()}],"scroll-my":[{"scroll-my":Y()}],"scroll-ms":[{"scroll-ms":Y()}],"scroll-me":[{"scroll-me":Y()}],"scroll-mt":[{"scroll-mt":Y()}],"scroll-mr":[{"scroll-mr":Y()}],"scroll-mb":[{"scroll-mb":Y()}],"scroll-ml":[{"scroll-ml":Y()}],"scroll-p":[{"scroll-p":Y()}],"scroll-px":[{"scroll-px":Y()}],"scroll-py":[{"scroll-py":Y()}],"scroll-ps":[{"scroll-ps":Y()}],"scroll-pe":[{"scroll-pe":Y()}],"scroll-pt":[{"scroll-pt":Y()}],"scroll-pr":[{"scroll-pr":Y()}],"scroll-pb":[{"scroll-pb":Y()}],"scroll-pl":[{"scroll-pl":Y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge,me]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[_e,Uo,wl,Yf]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},iE=PC(oE);function je(...n){return iE(Yy(n))}const sE=qy("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function tt({className:n,variant:l,size:r,asChild:i=!1,...s}){const c=i?pC:"button";return g.jsx(c,{"data-slot":"button",className:je(sE({variant:l,size:r,className:n})),...s})}function we(n,l,{checkForDefaultPrevented:r=!0}={}){return function(s){if(n?.(s),r===!1||!s.defaultPrevented)return l?.(s)}}function cE(n,l){const r=y.createContext(l),i=c=>{const{children:d,...h}=c,p=y.useMemo(()=>h,Object.values(h));return g.jsx(r.Provider,{value:p,children:d})};i.displayName=n+"Provider";function s(c){const d=y.useContext(r);if(d)return d;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${n}\``)}return[i,s]}function Gn(n,l=[]){let r=[];function i(c,d){const h=y.createContext(d),p=r.length;r=[...r,d];const m=v=>{const{scope:w,children:C,...T}=v,E=w?.[n]?.[p]||h,R=y.useMemo(()=>T,Object.values(T));return g.jsx(E.Provider,{value:R,children:C})};m.displayName=c+"Provider";function x(v,w){const C=w?.[n]?.[p]||h,T=y.useContext(C);if(T)return T;if(d!==void 0)return d;throw new Error(`\`${v}\` must be used within \`${c}\``)}return[m,x]}const s=()=>{const c=r.map(d=>y.createContext(d));return function(h){const p=h?.[n]||c;return y.useMemo(()=>({[`__scope${n}`]:{...h,[n]:p}}),[h,p])}};return s.scopeName=n,[i,uE(s,...l)]}function uE(...n){const l=n[0];if(n.length===1)return l;const r=()=>{const i=n.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(c){const d=i.reduce((h,{useScope:p,scopeName:m})=>{const v=p(c)[`__scope${m}`];return{...h,...v}},{});return y.useMemo(()=>({[`__scope${l.scopeName}`]:d}),[d])}};return r.scopeName=l.scopeName,r}var Zo=Dy();const a0=jy(Zo);function fE(n){const l=dE(n),r=y.forwardRef((i,s)=>{const{children:c,...d}=i,h=y.Children.toArray(c),p=h.find(pE);if(p){const m=p.props.children,x=h.map(v=>v===p?y.Children.count(m)>1?y.Children.only(null):y.isValidElement(m)?m.props.children:null:v);return g.jsx(l,{...d,ref:s,children:y.isValidElement(m)?y.cloneElement(m,void 0,x):null})}return g.jsx(l,{...d,ref:s,children:c})});return r.displayName=`${n}.Slot`,r}function dE(n){const l=y.forwardRef((r,i)=>{const{children:s,...c}=r;if(y.isValidElement(s)){const d=gE(s),h=mE(c,s.props);return s.type!==y.Fragment&&(h.ref=i?bn(i,d):d),y.cloneElement(s,h)}return y.Children.count(s)>1?y.Children.only(null):null});return l.displayName=`${n}.SlotClone`,l}var hE=Symbol("radix.slottable");function pE(n){return y.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===hE}function mE(n,l){const r={...l};for(const i in l){const s=n[i],c=l[i];/^on[A-Z]/.test(i)?s&&c?r[i]=(...h)=>{const p=c(...h);return s(...h),p}:s&&(r[i]=s):i==="style"?r[i]={...s,...c}:i==="className"&&(r[i]=[s,c].filter(Boolean).join(" "))}return{...n,...r}}function gE(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?n.props.ref:n.props.ref||n.ref)}var vE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=vE.reduce((n,l)=>{const r=fE(`Primitive.${l}`),i=y.forwardRef((s,c)=>{const{asChild:d,...h}=s,p=d?r:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(p,{...h,ref:c})});return i.displayName=`Primitive.${l}`,{...n,[l]:i}},{});function yE(n,l){n&&Zo.flushSync(()=>n.dispatchEvent(l))}function kt(n){const l=y.useRef(n);return y.useEffect(()=>{l.current=n}),y.useMemo(()=>(...r)=>l.current?.(...r),[])}function bE(n,l=globalThis?.document){const r=kt(n);y.useEffect(()=>{const i=s=>{s.key==="Escape"&&r(s)};return l.addEventListener("keydown",i,{capture:!0}),()=>l.removeEventListener("keydown",i,{capture:!0})},[r,l])}var xE="DismissableLayer",cd="dismissableLayer.update",SE="dismissableLayer.pointerDownOutside",wE="dismissableLayer.focusOutside",Yv,l0=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wo=y.forwardRef((n,l)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:d,onDismiss:h,...p}=n,m=y.useContext(l0),[x,v]=y.useState(null),w=x?.ownerDocument??globalThis?.document,[,C]=y.useState({}),T=He(l,L=>v(L)),E=Array.from(m.layers),[R]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),N=E.indexOf(R),M=x?E.indexOf(x):-1,z=m.layersWithOutsidePointerEventsDisabled.size>0,P=M>=N,G=TE(L=>{const Y=L.target,J=[...m.branches].some(ne=>ne.contains(Y));!P||J||(s?.(L),d?.(L),L.defaultPrevented||h?.())},w),k=RE(L=>{const Y=L.target;[...m.branches].some(ne=>ne.contains(Y))||(c?.(L),d?.(L),L.defaultPrevented||h?.())},w);return bE(L=>{M===m.layers.size-1&&(i?.(L),!L.defaultPrevented&&h&&(L.preventDefault(),h()))},w),y.useEffect(()=>{if(x)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Yv=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(x)),m.layers.add(x),qv(),()=>{r&&m.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=Yv)}},[x,w,r,m]),y.useEffect(()=>()=>{x&&(m.layers.delete(x),m.layersWithOutsidePointerEventsDisabled.delete(x),qv())},[x,m]),y.useEffect(()=>{const L=()=>C({});return document.addEventListener(cd,L),()=>document.removeEventListener(cd,L)},[]),g.jsx(Ce.div,{...p,ref:T,style:{pointerEvents:z?P?"auto":"none":void 0,...n.style},onFocusCapture:we(n.onFocusCapture,k.onFocusCapture),onBlurCapture:we(n.onBlurCapture,k.onBlurCapture),onPointerDownCapture:we(n.onPointerDownCapture,G.onPointerDownCapture)})});Wo.displayName=xE;var CE="DismissableLayerBranch",EE=y.forwardRef((n,l)=>{const r=y.useContext(l0),i=y.useRef(null),s=He(l,i);return y.useEffect(()=>{const c=i.current;if(c)return r.branches.add(c),()=>{r.branches.delete(c)}},[r.branches]),g.jsx(Ce.div,{...n,ref:s})});EE.displayName=CE;function TE(n,l=globalThis?.document){const r=kt(n),i=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const c=h=>{if(h.target&&!i.current){let p=function(){r0(SE,r,m,{discrete:!0})};const m={originalEvent:h};h.pointerType==="touch"?(l.removeEventListener("click",s.current),s.current=p,l.addEventListener("click",s.current,{once:!0})):p()}else l.removeEventListener("click",s.current);i.current=!1},d=window.setTimeout(()=>{l.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),l.removeEventListener("pointerdown",c),l.removeEventListener("click",s.current)}},[l,r]),{onPointerDownCapture:()=>i.current=!0}}function RE(n,l=globalThis?.document){const r=kt(n),i=y.useRef(!1);return y.useEffect(()=>{const s=c=>{c.target&&!i.current&&r0(wE,r,{originalEvent:c},{discrete:!1})};return l.addEventListener("focusin",s),()=>l.removeEventListener("focusin",s)},[l,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function qv(){const n=new CustomEvent(cd);document.dispatchEvent(n)}function r0(n,l,r,{discrete:i}){const s=r.originalEvent.target,c=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:r});l&&s.addEventListener(n,l,{once:!0}),i?yE(s,c):s.dispatchEvent(c)}var jt=globalThis?.document?y.useLayoutEffect:()=>{},AE=zd[" useId ".trim().toString()]||(()=>{}),NE=0;function Ut(n){const[l,r]=y.useState(AE());return jt(()=>{r(i=>i??String(NE++))},[n]),n||(l?`radix-${l}`:"")}const OE=["top","right","bottom","left"],Fa=Math.min,ln=Math.max,Ps=Math.round,ws=Math.floor,In=n=>({x:n,y:n}),jE={left:"right",right:"left",bottom:"top",top:"bottom"},DE={start:"end",end:"start"};function ud(n,l,r){return ln(n,Fa(l,r))}function ma(n,l){return typeof n=="function"?n(l):n}function ga(n){return n.split("-")[0]}function Ur(n){return n.split("-")[1]}function Ud(n){return n==="x"?"y":"x"}function Hd(n){return n==="y"?"height":"width"}const _E=new Set(["top","bottom"]);function Vn(n){return _E.has(ga(n))?"y":"x"}function Bd(n){return Ud(Vn(n))}function ME(n,l,r){r===void 0&&(r=!1);const i=Ur(n),s=Bd(n),c=Hd(s);let d=s==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return l.reference[c]>l.floating[c]&&(d=Vs(d)),[d,Vs(d)]}function zE(n){const l=Vs(n);return[fd(n),l,fd(l)]}function fd(n){return n.replace(/start|end/g,l=>DE[l])}const Gv=["left","right"],$v=["right","left"],LE=["top","bottom"],kE=["bottom","top"];function UE(n,l,r){switch(n){case"top":case"bottom":return r?l?$v:Gv:l?Gv:$v;case"left":case"right":return l?LE:kE;default:return[]}}function HE(n,l,r,i){const s=Ur(n);let c=UE(ga(n),r==="start",i);return s&&(c=c.map(d=>d+"-"+s),l&&(c=c.concat(c.map(fd)))),c}function Vs(n){return n.replace(/left|right|bottom|top/g,l=>jE[l])}function BE(n){return{top:0,right:0,bottom:0,left:0,...n}}function o0(n){return typeof n!="number"?BE(n):{top:n,right:n,bottom:n,left:n}}function Is(n){const{x:l,y:r,width:i,height:s}=n;return{width:i,height:s,top:r,left:l,right:l+i,bottom:r+s,x:l,y:r}}function Xv(n,l,r){let{reference:i,floating:s}=n;const c=Vn(l),d=Bd(l),h=Hd(d),p=ga(l),m=c==="y",x=i.x+i.width/2-s.width/2,v=i.y+i.height/2-s.height/2,w=i[h]/2-s[h]/2;let C;switch(p){case"top":C={x,y:i.y-s.height};break;case"bottom":C={x,y:i.y+i.height};break;case"right":C={x:i.x+i.width,y:v};break;case"left":C={x:i.x-s.width,y:v};break;default:C={x:i.x,y:i.y}}switch(Ur(l)){case"start":C[d]-=w*(r&&m?-1:1);break;case"end":C[d]+=w*(r&&m?-1:1);break}return C}const PE=async(n,l,r)=>{const{placement:i="bottom",strategy:s="absolute",middleware:c=[],platform:d}=r,h=c.filter(Boolean),p=await(d.isRTL==null?void 0:d.isRTL(l));let m=await d.getElementRects({reference:n,floating:l,strategy:s}),{x,y:v}=Xv(m,i,p),w=i,C={},T=0;for(let E=0;E<h.length;E++){const{name:R,fn:N}=h[E],{x:M,y:z,data:P,reset:G}=await N({x,y:v,initialPlacement:i,placement:w,strategy:s,middlewareData:C,rects:m,platform:d,elements:{reference:n,floating:l}});x=M??x,v=z??v,C={...C,[R]:{...C[R],...P}},G&&T<=50&&(T++,typeof G=="object"&&(G.placement&&(w=G.placement),G.rects&&(m=G.rects===!0?await d.getElementRects({reference:n,floating:l,strategy:s}):G.rects),{x,y:v}=Xv(m,w,p)),E=-1)}return{x,y:v,placement:w,strategy:s,middlewareData:C}};async function Xo(n,l){var r;l===void 0&&(l={});const{x:i,y:s,platform:c,rects:d,elements:h,strategy:p}=n,{boundary:m="clippingAncestors",rootBoundary:x="viewport",elementContext:v="floating",altBoundary:w=!1,padding:C=0}=ma(l,n),T=o0(C),R=h[w?v==="floating"?"reference":"floating":v],N=Is(await c.getClippingRect({element:(r=await(c.isElement==null?void 0:c.isElement(R)))==null||r?R:R.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(h.floating)),boundary:m,rootBoundary:x,strategy:p})),M=v==="floating"?{x:i,y:s,width:d.floating.width,height:d.floating.height}:d.reference,z=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h.floating)),P=await(c.isElement==null?void 0:c.isElement(z))?await(c.getScale==null?void 0:c.getScale(z))||{x:1,y:1}:{x:1,y:1},G=Is(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:M,offsetParent:z,strategy:p}):M);return{top:(N.top-G.top+T.top)/P.y,bottom:(G.bottom-N.bottom+T.bottom)/P.y,left:(N.left-G.left+T.left)/P.x,right:(G.right-N.right+T.right)/P.x}}const VE=n=>({name:"arrow",options:n,async fn(l){const{x:r,y:i,placement:s,rects:c,platform:d,elements:h,middlewareData:p}=l,{element:m,padding:x=0}=ma(n,l)||{};if(m==null)return{};const v=o0(x),w={x:r,y:i},C=Bd(s),T=Hd(C),E=await d.getDimensions(m),R=C==="y",N=R?"top":"left",M=R?"bottom":"right",z=R?"clientHeight":"clientWidth",P=c.reference[T]+c.reference[C]-w[C]-c.floating[T],G=w[C]-c.reference[C],k=await(d.getOffsetParent==null?void 0:d.getOffsetParent(m));let L=k?k[z]:0;(!L||!await(d.isElement==null?void 0:d.isElement(k)))&&(L=h.floating[z]||c.floating[T]);const Y=P/2-G/2,J=L/2-E[T]/2-1,ne=Fa(v[N],J),re=Fa(v[M],J),K=ne,ie=L-E[T]-re,ce=L/2-E[T]/2+Y,he=ud(K,ce,ie),D=!p.arrow&&Ur(s)!=null&&ce!==he&&c.reference[T]/2-(ce<K?ne:re)-E[T]/2<0,$=D?ce<K?ce-K:ce-ie:0;return{[C]:w[C]+$,data:{[C]:he,centerOffset:ce-he-$,...D&&{alignmentOffset:$}},reset:D}}}),IE=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(l){var r,i;const{placement:s,middlewareData:c,rects:d,initialPlacement:h,platform:p,elements:m}=l,{mainAxis:x=!0,crossAxis:v=!0,fallbackPlacements:w,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:E=!0,...R}=ma(n,l);if((r=c.arrow)!=null&&r.alignmentOffset)return{};const N=ga(s),M=Vn(h),z=ga(h)===h,P=await(p.isRTL==null?void 0:p.isRTL(m.floating)),G=w||(z||!E?[Vs(h)]:zE(h)),k=T!=="none";!w&&k&&G.push(...HE(h,E,T,P));const L=[h,...G],Y=await Xo(l,R),J=[];let ne=((i=c.flip)==null?void 0:i.overflows)||[];if(x&&J.push(Y[N]),v){const ce=ME(s,d,P);J.push(Y[ce[0]],Y[ce[1]])}if(ne=[...ne,{placement:s,overflows:J}],!J.every(ce=>ce<=0)){var re,K;const ce=(((re=c.flip)==null?void 0:re.index)||0)+1,he=L[ce];if(he&&(!(v==="alignment"?M!==Vn(he):!1)||ne.every(B=>Vn(B.placement)===M?B.overflows[0]>0:!0)))return{data:{index:ce,overflows:ne},reset:{placement:he}};let D=(K=ne.filter($=>$.overflows[0]<=0).sort(($,B)=>$.overflows[1]-B.overflows[1])[0])==null?void 0:K.placement;if(!D)switch(C){case"bestFit":{var ie;const $=(ie=ne.filter(B=>{if(k){const ue=Vn(B.placement);return ue===M||ue==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ue=>ue>0).reduce((ue,de)=>ue+de,0)]).sort((B,ue)=>B[1]-ue[1])[0])==null?void 0:ie[0];$&&(D=$);break}case"initialPlacement":D=h;break}if(s!==D)return{reset:{placement:D}}}return{}}}};function Fv(n,l){return{top:n.top-l.height,right:n.right-l.width,bottom:n.bottom-l.height,left:n.left-l.width}}function Kv(n){return OE.some(l=>n[l]>=0)}const YE=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(l){const{rects:r}=l,{strategy:i="referenceHidden",...s}=ma(n,l);switch(i){case"referenceHidden":{const c=await Xo(l,{...s,elementContext:"reference"}),d=Fv(c,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Kv(d)}}}case"escaped":{const c=await Xo(l,{...s,altBoundary:!0}),d=Fv(c,r.floating);return{data:{escapedOffsets:d,escaped:Kv(d)}}}default:return{}}}}},i0=new Set(["left","top"]);async function qE(n,l){const{placement:r,platform:i,elements:s}=n,c=await(i.isRTL==null?void 0:i.isRTL(s.floating)),d=ga(r),h=Ur(r),p=Vn(r)==="y",m=i0.has(d)?-1:1,x=c&&p?-1:1,v=ma(l,n);let{mainAxis:w,crossAxis:C,alignmentAxis:T}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return h&&typeof T=="number"&&(C=h==="end"?T*-1:T),p?{x:C*x,y:w*m}:{x:w*m,y:C*x}}const GE=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(l){var r,i;const{x:s,y:c,placement:d,middlewareData:h}=l,p=await qE(l,n);return d===((r=h.offset)==null?void 0:r.placement)&&(i=h.arrow)!=null&&i.alignmentOffset?{}:{x:s+p.x,y:c+p.y,data:{...p,placement:d}}}}},$E=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(l){const{x:r,y:i,placement:s}=l,{mainAxis:c=!0,crossAxis:d=!1,limiter:h={fn:R=>{let{x:N,y:M}=R;return{x:N,y:M}}},...p}=ma(n,l),m={x:r,y:i},x=await Xo(l,p),v=Vn(ga(s)),w=Ud(v);let C=m[w],T=m[v];if(c){const R=w==="y"?"top":"left",N=w==="y"?"bottom":"right",M=C+x[R],z=C-x[N];C=ud(M,C,z)}if(d){const R=v==="y"?"top":"left",N=v==="y"?"bottom":"right",M=T+x[R],z=T-x[N];T=ud(M,T,z)}const E=h.fn({...l,[w]:C,[v]:T});return{...E,data:{x:E.x-r,y:E.y-i,enabled:{[w]:c,[v]:d}}}}}},XE=function(n){return n===void 0&&(n={}),{options:n,fn(l){const{x:r,y:i,placement:s,rects:c,middlewareData:d}=l,{offset:h=0,mainAxis:p=!0,crossAxis:m=!0}=ma(n,l),x={x:r,y:i},v=Vn(s),w=Ud(v);let C=x[w],T=x[v];const E=ma(h,l),R=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(p){const z=w==="y"?"height":"width",P=c.reference[w]-c.floating[z]+R.mainAxis,G=c.reference[w]+c.reference[z]-R.mainAxis;C<P?C=P:C>G&&(C=G)}if(m){var N,M;const z=w==="y"?"width":"height",P=i0.has(ga(s)),G=c.reference[v]-c.floating[z]+(P&&((N=d.offset)==null?void 0:N[v])||0)+(P?0:R.crossAxis),k=c.reference[v]+c.reference[z]+(P?0:((M=d.offset)==null?void 0:M[v])||0)-(P?R.crossAxis:0);T<G?T=G:T>k&&(T=k)}return{[w]:C,[v]:T}}}},FE=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(l){var r,i;const{placement:s,rects:c,platform:d,elements:h}=l,{apply:p=()=>{},...m}=ma(n,l),x=await Xo(l,m),v=ga(s),w=Ur(s),C=Vn(s)==="y",{width:T,height:E}=c.floating;let R,N;v==="top"||v==="bottom"?(R=v,N=w===(await(d.isRTL==null?void 0:d.isRTL(h.floating))?"start":"end")?"left":"right"):(N=v,R=w==="end"?"top":"bottom");const M=E-x.top-x.bottom,z=T-x.left-x.right,P=Fa(E-x[R],M),G=Fa(T-x[N],z),k=!l.middlewareData.shift;let L=P,Y=G;if((r=l.middlewareData.shift)!=null&&r.enabled.x&&(Y=z),(i=l.middlewareData.shift)!=null&&i.enabled.y&&(L=M),k&&!w){const ne=ln(x.left,0),re=ln(x.right,0),K=ln(x.top,0),ie=ln(x.bottom,0);C?Y=T-2*(ne!==0||re!==0?ne+re:ln(x.left,x.right)):L=E-2*(K!==0||ie!==0?K+ie:ln(x.top,x.bottom))}await p({...l,availableWidth:Y,availableHeight:L});const J=await d.getDimensions(h.floating);return T!==J.width||E!==J.height?{reset:{rects:!0}}:{}}}};function Js(){return typeof window<"u"}function Hr(n){return s0(n)?(n.nodeName||"").toLowerCase():"#document"}function rn(n){var l;return(n==null||(l=n.ownerDocument)==null?void 0:l.defaultView)||window}function $n(n){var l;return(l=(s0(n)?n.ownerDocument:n.document)||window.document)==null?void 0:l.documentElement}function s0(n){return Js()?n instanceof Node||n instanceof rn(n).Node:!1}function On(n){return Js()?n instanceof Element||n instanceof rn(n).Element:!1}function Yn(n){return Js()?n instanceof HTMLElement||n instanceof rn(n).HTMLElement:!1}function Qv(n){return!Js()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof rn(n).ShadowRoot}const KE=new Set(["inline","contents"]);function Jo(n){const{overflow:l,overflowX:r,overflowY:i,display:s}=jn(n);return/auto|scroll|overlay|hidden|clip/.test(l+i+r)&&!KE.has(s)}const QE=new Set(["table","td","th"]);function ZE(n){return QE.has(Hr(n))}const WE=[":popover-open",":modal"];function ec(n){return WE.some(l=>{try{return n.matches(l)}catch{return!1}})}const JE=["transform","translate","scale","rotate","perspective"],eT=["transform","translate","scale","rotate","perspective","filter"],tT=["paint","layout","strict","content"];function Pd(n){const l=Vd(),r=On(n)?jn(n):n;return JE.some(i=>r[i]?r[i]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!l&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!l&&(r.filter?r.filter!=="none":!1)||eT.some(i=>(r.willChange||"").includes(i))||tT.some(i=>(r.contain||"").includes(i))}function nT(n){let l=Ka(n);for(;Yn(l)&&!Dr(l);){if(Pd(l))return l;if(ec(l))return null;l=Ka(l)}return null}function Vd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const aT=new Set(["html","body","#document"]);function Dr(n){return aT.has(Hr(n))}function jn(n){return rn(n).getComputedStyle(n)}function tc(n){return On(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Ka(n){if(Hr(n)==="html")return n;const l=n.assignedSlot||n.parentNode||Qv(n)&&n.host||$n(n);return Qv(l)?l.host:l}function c0(n){const l=Ka(n);return Dr(l)?n.ownerDocument?n.ownerDocument.body:n.body:Yn(l)&&Jo(l)?l:c0(l)}function Fo(n,l,r){var i;l===void 0&&(l=[]),r===void 0&&(r=!0);const s=c0(n),c=s===((i=n.ownerDocument)==null?void 0:i.body),d=rn(s);if(c){const h=dd(d);return l.concat(d,d.visualViewport||[],Jo(s)?s:[],h&&r?Fo(h):[])}return l.concat(s,Fo(s,[],r))}function dd(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function u0(n){const l=jn(n);let r=parseFloat(l.width)||0,i=parseFloat(l.height)||0;const s=Yn(n),c=s?n.offsetWidth:r,d=s?n.offsetHeight:i,h=Ps(r)!==c||Ps(i)!==d;return h&&(r=c,i=d),{width:r,height:i,$:h}}function Id(n){return On(n)?n:n.contextElement}function Or(n){const l=Id(n);if(!Yn(l))return In(1);const r=l.getBoundingClientRect(),{width:i,height:s,$:c}=u0(l);let d=(c?Ps(r.width):r.width)/i,h=(c?Ps(r.height):r.height)/s;return(!d||!Number.isFinite(d))&&(d=1),(!h||!Number.isFinite(h))&&(h=1),{x:d,y:h}}const lT=In(0);function f0(n){const l=rn(n);return!Vd()||!l.visualViewport?lT:{x:l.visualViewport.offsetLeft,y:l.visualViewport.offsetTop}}function rT(n,l,r){return l===void 0&&(l=!1),!r||l&&r!==rn(n)?!1:l}function Tl(n,l,r,i){l===void 0&&(l=!1),r===void 0&&(r=!1);const s=n.getBoundingClientRect(),c=Id(n);let d=In(1);l&&(i?On(i)&&(d=Or(i)):d=Or(n));const h=rT(c,r,i)?f0(c):In(0);let p=(s.left+h.x)/d.x,m=(s.top+h.y)/d.y,x=s.width/d.x,v=s.height/d.y;if(c){const w=rn(c),C=i&&On(i)?rn(i):i;let T=w,E=dd(T);for(;E&&i&&C!==T;){const R=Or(E),N=E.getBoundingClientRect(),M=jn(E),z=N.left+(E.clientLeft+parseFloat(M.paddingLeft))*R.x,P=N.top+(E.clientTop+parseFloat(M.paddingTop))*R.y;p*=R.x,m*=R.y,x*=R.x,v*=R.y,p+=z,m+=P,T=rn(E),E=dd(T)}}return Is({width:x,height:v,x:p,y:m})}function nc(n,l){const r=tc(n).scrollLeft;return l?l.left+r:Tl($n(n)).left+r}function d0(n,l){const r=n.getBoundingClientRect(),i=r.left+l.scrollLeft-nc(n,r),s=r.top+l.scrollTop;return{x:i,y:s}}function oT(n){let{elements:l,rect:r,offsetParent:i,strategy:s}=n;const c=s==="fixed",d=$n(i),h=l?ec(l.floating):!1;if(i===d||h&&c)return r;let p={scrollLeft:0,scrollTop:0},m=In(1);const x=In(0),v=Yn(i);if((v||!v&&!c)&&((Hr(i)!=="body"||Jo(d))&&(p=tc(i)),Yn(i))){const C=Tl(i);m=Or(i),x.x=C.x+i.clientLeft,x.y=C.y+i.clientTop}const w=d&&!v&&!c?d0(d,p):In(0);return{width:r.width*m.x,height:r.height*m.y,x:r.x*m.x-p.scrollLeft*m.x+x.x+w.x,y:r.y*m.y-p.scrollTop*m.y+x.y+w.y}}function iT(n){return Array.from(n.getClientRects())}function sT(n){const l=$n(n),r=tc(n),i=n.ownerDocument.body,s=ln(l.scrollWidth,l.clientWidth,i.scrollWidth,i.clientWidth),c=ln(l.scrollHeight,l.clientHeight,i.scrollHeight,i.clientHeight);let d=-r.scrollLeft+nc(n);const h=-r.scrollTop;return jn(i).direction==="rtl"&&(d+=ln(l.clientWidth,i.clientWidth)-s),{width:s,height:c,x:d,y:h}}const Zv=25;function cT(n,l){const r=rn(n),i=$n(n),s=r.visualViewport;let c=i.clientWidth,d=i.clientHeight,h=0,p=0;if(s){c=s.width,d=s.height;const x=Vd();(!x||x&&l==="fixed")&&(h=s.offsetLeft,p=s.offsetTop)}const m=nc(i);if(m<=0){const x=i.ownerDocument,v=x.body,w=getComputedStyle(v),C=x.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,T=Math.abs(i.clientWidth-v.clientWidth-C);T<=Zv&&(c-=T)}else m<=Zv&&(c+=m);return{width:c,height:d,x:h,y:p}}const uT=new Set(["absolute","fixed"]);function fT(n,l){const r=Tl(n,!0,l==="fixed"),i=r.top+n.clientTop,s=r.left+n.clientLeft,c=Yn(n)?Or(n):In(1),d=n.clientWidth*c.x,h=n.clientHeight*c.y,p=s*c.x,m=i*c.y;return{width:d,height:h,x:p,y:m}}function Wv(n,l,r){let i;if(l==="viewport")i=cT(n,r);else if(l==="document")i=sT($n(n));else if(On(l))i=fT(l,r);else{const s=f0(n);i={x:l.x-s.x,y:l.y-s.y,width:l.width,height:l.height}}return Is(i)}function h0(n,l){const r=Ka(n);return r===l||!On(r)||Dr(r)?!1:jn(r).position==="fixed"||h0(r,l)}function dT(n,l){const r=l.get(n);if(r)return r;let i=Fo(n,[],!1).filter(h=>On(h)&&Hr(h)!=="body"),s=null;const c=jn(n).position==="fixed";let d=c?Ka(n):n;for(;On(d)&&!Dr(d);){const h=jn(d),p=Pd(d);!p&&h.position==="fixed"&&(s=null),(c?!p&&!s:!p&&h.position==="static"&&!!s&&uT.has(s.position)||Jo(d)&&!p&&h0(n,d))?i=i.filter(x=>x!==d):s=h,d=Ka(d)}return l.set(n,i),i}function hT(n){let{element:l,boundary:r,rootBoundary:i,strategy:s}=n;const d=[...r==="clippingAncestors"?ec(l)?[]:dT(l,this._c):[].concat(r),i],h=d[0],p=d.reduce((m,x)=>{const v=Wv(l,x,s);return m.top=ln(v.top,m.top),m.right=Fa(v.right,m.right),m.bottom=Fa(v.bottom,m.bottom),m.left=ln(v.left,m.left),m},Wv(l,h,s));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function pT(n){const{width:l,height:r}=u0(n);return{width:l,height:r}}function mT(n,l,r){const i=Yn(l),s=$n(l),c=r==="fixed",d=Tl(n,!0,c,l);let h={scrollLeft:0,scrollTop:0};const p=In(0);function m(){p.x=nc(s)}if(i||!i&&!c)if((Hr(l)!=="body"||Jo(s))&&(h=tc(l)),i){const C=Tl(l,!0,c,l);p.x=C.x+l.clientLeft,p.y=C.y+l.clientTop}else s&&m();c&&!i&&s&&m();const x=s&&!i&&!c?d0(s,h):In(0),v=d.left+h.scrollLeft-p.x-x.x,w=d.top+h.scrollTop-p.y-x.y;return{x:v,y:w,width:d.width,height:d.height}}function qf(n){return jn(n).position==="static"}function Jv(n,l){if(!Yn(n)||jn(n).position==="fixed")return null;if(l)return l(n);let r=n.offsetParent;return $n(n)===r&&(r=r.ownerDocument.body),r}function p0(n,l){const r=rn(n);if(ec(n))return r;if(!Yn(n)){let s=Ka(n);for(;s&&!Dr(s);){if(On(s)&&!qf(s))return s;s=Ka(s)}return r}let i=Jv(n,l);for(;i&&ZE(i)&&qf(i);)i=Jv(i,l);return i&&Dr(i)&&qf(i)&&!Pd(i)?r:i||nT(n)||r}const gT=async function(n){const l=this.getOffsetParent||p0,r=this.getDimensions,i=await r(n.floating);return{reference:mT(n.reference,await l(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function vT(n){return jn(n).direction==="rtl"}const yT={convertOffsetParentRelativeRectToViewportRelativeRect:oT,getDocumentElement:$n,getClippingRect:hT,getOffsetParent:p0,getElementRects:gT,getClientRects:iT,getDimensions:pT,getScale:Or,isElement:On,isRTL:vT};function m0(n,l){return n.x===l.x&&n.y===l.y&&n.width===l.width&&n.height===l.height}function bT(n,l){let r=null,i;const s=$n(n);function c(){var h;clearTimeout(i),(h=r)==null||h.disconnect(),r=null}function d(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),c();const m=n.getBoundingClientRect(),{left:x,top:v,width:w,height:C}=m;if(h||l(),!w||!C)return;const T=ws(v),E=ws(s.clientWidth-(x+w)),R=ws(s.clientHeight-(v+C)),N=ws(x),z={rootMargin:-T+"px "+-E+"px "+-R+"px "+-N+"px",threshold:ln(0,Fa(1,p))||1};let P=!0;function G(k){const L=k[0].intersectionRatio;if(L!==p){if(!P)return d();L?d(!1,L):i=setTimeout(()=>{d(!1,1e-7)},1e3)}L===1&&!m0(m,n.getBoundingClientRect())&&d(),P=!1}try{r=new IntersectionObserver(G,{...z,root:s.ownerDocument})}catch{r=new IntersectionObserver(G,z)}r.observe(n)}return d(!0),c}function xT(n,l,r,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:c=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:p=!1}=i,m=Id(n),x=s||c?[...m?Fo(m):[],...Fo(l)]:[];x.forEach(N=>{s&&N.addEventListener("scroll",r,{passive:!0}),c&&N.addEventListener("resize",r)});const v=m&&h?bT(m,r):null;let w=-1,C=null;d&&(C=new ResizeObserver(N=>{let[M]=N;M&&M.target===m&&C&&(C.unobserve(l),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var z;(z=C)==null||z.observe(l)})),r()}),m&&!p&&C.observe(m),C.observe(l));let T,E=p?Tl(n):null;p&&R();function R(){const N=Tl(n);E&&!m0(E,N)&&r(),E=N,T=requestAnimationFrame(R)}return r(),()=>{var N;x.forEach(M=>{s&&M.removeEventListener("scroll",r),c&&M.removeEventListener("resize",r)}),v?.(),(N=C)==null||N.disconnect(),C=null,p&&cancelAnimationFrame(T)}}const ST=GE,wT=$E,CT=IE,ET=FE,TT=YE,ey=VE,RT=XE,AT=(n,l,r)=>{const i=new Map,s={platform:yT,...r},c={...s.platform,_c:i};return PE(n,l,{...s,platform:c})};var NT=typeof document<"u",OT=function(){},Ds=NT?y.useLayoutEffect:OT;function Ys(n,l){if(n===l)return!0;if(typeof n!=typeof l)return!1;if(typeof n=="function"&&n.toString()===l.toString())return!0;let r,i,s;if(n&&l&&typeof n=="object"){if(Array.isArray(n)){if(r=n.length,r!==l.length)return!1;for(i=r;i--!==0;)if(!Ys(n[i],l[i]))return!1;return!0}if(s=Object.keys(n),r=s.length,r!==Object.keys(l).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(l,s[i]))return!1;for(i=r;i--!==0;){const c=s[i];if(!(c==="_owner"&&n.$$typeof)&&!Ys(n[c],l[c]))return!1}return!0}return n!==n&&l!==l}function g0(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function ty(n,l){const r=g0(n);return Math.round(l*r)/r}function Gf(n){const l=y.useRef(n);return Ds(()=>{l.current=n}),l}function jT(n){n===void 0&&(n={});const{placement:l="bottom",strategy:r="absolute",middleware:i=[],platform:s,elements:{reference:c,floating:d}={},transform:h=!0,whileElementsMounted:p,open:m}=n,[x,v]=y.useState({x:0,y:0,strategy:r,placement:l,middlewareData:{},isPositioned:!1}),[w,C]=y.useState(i);Ys(w,i)||C(i);const[T,E]=y.useState(null),[R,N]=y.useState(null),M=y.useCallback(B=>{B!==k.current&&(k.current=B,E(B))},[]),z=y.useCallback(B=>{B!==L.current&&(L.current=B,N(B))},[]),P=c||T,G=d||R,k=y.useRef(null),L=y.useRef(null),Y=y.useRef(x),J=p!=null,ne=Gf(p),re=Gf(s),K=Gf(m),ie=y.useCallback(()=>{if(!k.current||!L.current)return;const B={placement:l,strategy:r,middleware:w};re.current&&(B.platform=re.current),AT(k.current,L.current,B).then(ue=>{const de={...ue,isPositioned:K.current!==!1};ce.current&&!Ys(Y.current,de)&&(Y.current=de,Zo.flushSync(()=>{v(de)}))})},[w,l,r,re,K]);Ds(()=>{m===!1&&Y.current.isPositioned&&(Y.current.isPositioned=!1,v(B=>({...B,isPositioned:!1})))},[m]);const ce=y.useRef(!1);Ds(()=>(ce.current=!0,()=>{ce.current=!1}),[]),Ds(()=>{if(P&&(k.current=P),G&&(L.current=G),P&&G){if(ne.current)return ne.current(P,G,ie);ie()}},[P,G,ie,ne,J]);const he=y.useMemo(()=>({reference:k,floating:L,setReference:M,setFloating:z}),[M,z]),D=y.useMemo(()=>({reference:P,floating:G}),[P,G]),$=y.useMemo(()=>{const B={position:r,left:0,top:0};if(!D.floating)return B;const ue=ty(D.floating,x.x),de=ty(D.floating,x.y);return h?{...B,transform:"translate("+ue+"px, "+de+"px)",...g0(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ue,top:de}},[r,h,D.floating,x.x,x.y]);return y.useMemo(()=>({...x,update:ie,refs:he,elements:D,floatingStyles:$}),[x,ie,he,D,$])}const DT=n=>{function l(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:n,fn(r){const{element:i,padding:s}=typeof n=="function"?n(r):n;return i&&l(i)?i.current!=null?ey({element:i.current,padding:s}).fn(r):{}:i?ey({element:i,padding:s}).fn(r):{}}}},_T=(n,l)=>({...ST(n),options:[n,l]}),MT=(n,l)=>({...wT(n),options:[n,l]}),zT=(n,l)=>({...RT(n),options:[n,l]}),LT=(n,l)=>({...CT(n),options:[n,l]}),kT=(n,l)=>({...ET(n),options:[n,l]}),UT=(n,l)=>({...TT(n),options:[n,l]}),HT=(n,l)=>({...DT(n),options:[n,l]});var BT="Arrow",v0=y.forwardRef((n,l)=>{const{children:r,width:i=10,height:s=5,...c}=n;return g.jsx(Ce.svg,{...c,ref:l,width:i,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?r:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});v0.displayName=BT;var PT=v0;function y0(n){const[l,r]=y.useState(void 0);return jt(()=>{if(n){r({width:n.offsetWidth,height:n.offsetHeight});const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const c=s[0];let d,h;if("borderBoxSize"in c){const p=c.borderBoxSize,m=Array.isArray(p)?p[0]:p;d=m.inlineSize,h=m.blockSize}else d=n.offsetWidth,h=n.offsetHeight;r({width:d,height:h})});return i.observe(n,{box:"border-box"}),()=>i.unobserve(n)}else r(void 0)},[n]),l}var Yd="Popper",[b0,Br]=Gn(Yd),[VT,x0]=b0(Yd),S0=n=>{const{__scopePopper:l,children:r}=n,[i,s]=y.useState(null);return g.jsx(VT,{scope:l,anchor:i,onAnchorChange:s,children:r})};S0.displayName=Yd;var w0="PopperAnchor",C0=y.forwardRef((n,l)=>{const{__scopePopper:r,virtualRef:i,...s}=n,c=x0(w0,r),d=y.useRef(null),h=He(l,d),p=y.useRef(null);return y.useEffect(()=>{const m=p.current;p.current=i?.current||d.current,m!==p.current&&c.onAnchorChange(p.current)}),i?null:g.jsx(Ce.div,{...s,ref:h})});C0.displayName=w0;var qd="PopperContent",[IT,YT]=b0(qd),E0=y.forwardRef((n,l)=>{const{__scopePopper:r,side:i="bottom",sideOffset:s=0,align:c="center",alignOffset:d=0,arrowPadding:h=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:x=0,sticky:v="partial",hideWhenDetached:w=!1,updatePositionStrategy:C="optimized",onPlaced:T,...E}=n,R=x0(qd,r),[N,M]=y.useState(null),z=He(l,Z=>M(Z)),[P,G]=y.useState(null),k=y0(P),L=k?.width??0,Y=k?.height??0,J=i+(c!=="center"?"-"+c:""),ne=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},re=Array.isArray(m)?m:[m],K=re.length>0,ie={padding:ne,boundary:re.filter(GT),altBoundary:K},{refs:ce,floatingStyles:he,placement:D,isPositioned:$,middlewareData:B}=jT({strategy:"fixed",placement:J,whileElementsMounted:(...Z)=>xT(...Z,{animationFrame:C==="always"}),elements:{reference:R.anchor},middleware:[_T({mainAxis:s+Y,alignmentAxis:d}),p&&MT({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?zT():void 0,...ie}),p&<({...ie}),kT({...ie,apply:({elements:Z,rects:se,availableWidth:fe,availableHeight:be})=>{const{width:Ae,height:De}=se.reference,ft=Z.floating.style;ft.setProperty("--radix-popper-available-width",`${fe}px`),ft.setProperty("--radix-popper-available-height",`${be}px`),ft.setProperty("--radix-popper-anchor-width",`${Ae}px`),ft.setProperty("--radix-popper-anchor-height",`${De}px`)}}),P&&HT({element:P,padding:h}),$T({arrowWidth:L,arrowHeight:Y}),w&&UT({strategy:"referenceHidden",...ie})]}),[ue,de]=A0(D),A=kt(T);jt(()=>{$&&A?.()},[$,A]);const O=B.arrow?.x,U=B.arrow?.y,X=B.arrow?.centerOffset!==0,[Q,oe]=y.useState();return jt(()=>{N&&oe(window.getComputedStyle(N).zIndex)},[N]),g.jsx("div",{ref:ce.setFloating,"data-radix-popper-content-wrapper":"",style:{...he,transform:$?he.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:g.jsx(IT,{scope:r,placedSide:ue,onArrowChange:G,arrowX:O,arrowY:U,shouldHideArrow:X,children:g.jsx(Ce.div,{"data-side":ue,"data-align":de,...E,ref:z,style:{...E.style,animation:$?void 0:"none"}})})})});E0.displayName=qd;var T0="PopperArrow",qT={top:"bottom",right:"left",bottom:"top",left:"right"},R0=y.forwardRef(function(l,r){const{__scopePopper:i,...s}=l,c=YT(T0,i),d=qT[c.placedSide];return g.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:g.jsx(PT,{...s,ref:r,style:{...s.style,display:"block"}})})});R0.displayName=T0;function GT(n){return n!==null}var $T=n=>({name:"transformOrigin",options:n,fn(l){const{placement:r,rects:i,middlewareData:s}=l,d=s.arrow?.centerOffset!==0,h=d?0:n.arrowWidth,p=d?0:n.arrowHeight,[m,x]=A0(r),v={start:"0%",center:"50%",end:"100%"}[x],w=(s.arrow?.x??0)+h/2,C=(s.arrow?.y??0)+p/2;let T="",E="";return m==="bottom"?(T=d?v:`${w}px`,E=`${-p}px`):m==="top"?(T=d?v:`${w}px`,E=`${i.floating.height+p}px`):m==="right"?(T=`${-p}px`,E=d?v:`${C}px`):m==="left"&&(T=`${i.floating.width+p}px`,E=d?v:`${C}px`),{data:{x:T,y:E}}}});function A0(n){const[l,r="center"]=n.split("-");return[l,r]}var Gd=S0,ac=C0,$d=E0,Xd=R0,XT="Portal",ei=y.forwardRef((n,l)=>{const{container:r,...i}=n,[s,c]=y.useState(!1);jt(()=>c(!0),[]);const d=r||s&&globalThis?.document?.body;return d?a0.createPortal(g.jsx(Ce.div,{...i,ref:l}),d):null});ei.displayName=XT;function FT(n,l){return y.useReducer((r,i)=>l[r][i]??r,n)}var xn=n=>{const{present:l,children:r}=n,i=KT(l),s=typeof r=="function"?r({present:i.isPresent}):y.Children.only(r),c=He(i.ref,QT(s));return typeof r=="function"||i.isPresent?y.cloneElement(s,{ref:c}):null};xn.displayName="Presence";function KT(n){const[l,r]=y.useState(),i=y.useRef(null),s=y.useRef(n),c=y.useRef("none"),d=n?"mounted":"unmounted",[h,p]=FT(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const m=Cs(i.current);c.current=h==="mounted"?m:"none"},[h]),jt(()=>{const m=i.current,x=s.current;if(x!==n){const w=c.current,C=Cs(m);n?p("MOUNT"):C==="none"||m?.display==="none"?p("UNMOUNT"):p(x&&w!==C?"ANIMATION_OUT":"UNMOUNT"),s.current=n}},[n,p]),jt(()=>{if(l){let m;const x=l.ownerDocument.defaultView??window,v=C=>{const E=Cs(i.current).includes(CSS.escape(C.animationName));if(C.target===l&&E&&(p("ANIMATION_END"),!s.current)){const R=l.style.animationFillMode;l.style.animationFillMode="forwards",m=x.setTimeout(()=>{l.style.animationFillMode==="forwards"&&(l.style.animationFillMode=R)})}},w=C=>{C.target===l&&(c.current=Cs(i.current))};return l.addEventListener("animationstart",w),l.addEventListener("animationcancel",v),l.addEventListener("animationend",v),()=>{x.clearTimeout(m),l.removeEventListener("animationstart",w),l.removeEventListener("animationcancel",v),l.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[l,p]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:y.useCallback(m=>{i.current=m?getComputedStyle(m):null,r(m)},[])}}function Cs(n){return n?.animationName||"none"}function QT(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?n.props.ref:n.props.ref||n.ref)}var ZT=Symbol("radix.slottable");function WT(n){const l=({children:r})=>g.jsx(g.Fragment,{children:r});return l.displayName=`${n}.Slottable`,l.__radixId=ZT,l}var JT=zd[" useInsertionEffect ".trim().toString()]||jt;function qn({prop:n,defaultProp:l,onChange:r=()=>{},caller:i}){const[s,c,d]=e2({defaultProp:l,onChange:r}),h=n!==void 0,p=h?n:s;{const x=y.useRef(n!==void 0);y.useEffect(()=>{const v=x.current;v!==h&&console.warn(`${i} is changing from ${v?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=h},[h,i])}const m=y.useCallback(x=>{if(h){const v=t2(x)?x(n):x;v!==n&&d.current?.(v)}else c(x)},[h,n,c,d]);return[p,m]}function e2({defaultProp:n,onChange:l}){const[r,i]=y.useState(n),s=y.useRef(r),c=y.useRef(l);return JT(()=>{c.current=l},[l]),y.useEffect(()=>{s.current!==r&&(c.current?.(r),s.current=r)},[r,s]),[r,i,c]}function t2(n){return typeof n=="function"}var N0=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"}),n2="VisuallyHidden",O0=y.forwardRef((n,l)=>g.jsx(Ce.span,{...n,ref:l,style:{...N0,...n.style}}));O0.displayName=n2;var a2=O0,[lc]=Gn("Tooltip",[Br]),rc=Br(),j0="TooltipProvider",l2=700,hd="tooltip.open",[r2,Fd]=lc(j0),D0=n=>{const{__scopeTooltip:l,delayDuration:r=l2,skipDelayDuration:i=300,disableHoverableContent:s=!1,children:c}=n,d=y.useRef(!0),h=y.useRef(!1),p=y.useRef(0);return y.useEffect(()=>{const m=p.current;return()=>window.clearTimeout(m)},[]),g.jsx(r2,{scope:l,isOpenDelayedRef:d,delayDuration:r,onOpen:y.useCallback(()=>{window.clearTimeout(p.current),d.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>d.current=!0,i)},[i]),isPointerInTransitRef:h,onPointerInTransitChange:y.useCallback(m=>{h.current=m},[]),disableHoverableContent:s,children:c})};D0.displayName=j0;var Ko="Tooltip",[o2,ti]=lc(Ko),_0=n=>{const{__scopeTooltip:l,children:r,open:i,defaultOpen:s,onOpenChange:c,disableHoverableContent:d,delayDuration:h}=n,p=Fd(Ko,n.__scopeTooltip),m=rc(l),[x,v]=y.useState(null),w=Ut(),C=y.useRef(0),T=d??p.disableHoverableContent,E=h??p.delayDuration,R=y.useRef(!1),[N,M]=qn({prop:i,defaultProp:s??!1,onChange:L=>{L?(p.onOpen(),document.dispatchEvent(new CustomEvent(hd))):p.onClose(),c?.(L)},caller:Ko}),z=y.useMemo(()=>N?R.current?"delayed-open":"instant-open":"closed",[N]),P=y.useCallback(()=>{window.clearTimeout(C.current),C.current=0,R.current=!1,M(!0)},[M]),G=y.useCallback(()=>{window.clearTimeout(C.current),C.current=0,M(!1)},[M]),k=y.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>{R.current=!0,M(!0),C.current=0},E)},[E,M]);return y.useEffect(()=>()=>{C.current&&(window.clearTimeout(C.current),C.current=0)},[]),g.jsx(Gd,{...m,children:g.jsx(o2,{scope:l,contentId:w,open:N,stateAttribute:z,trigger:x,onTriggerChange:v,onTriggerEnter:y.useCallback(()=>{p.isOpenDelayedRef.current?k():P()},[p.isOpenDelayedRef,k,P]),onTriggerLeave:y.useCallback(()=>{T?G():(window.clearTimeout(C.current),C.current=0)},[G,T]),onOpen:P,onClose:G,disableHoverableContent:T,children:r})})};_0.displayName=Ko;var pd="TooltipTrigger",M0=y.forwardRef((n,l)=>{const{__scopeTooltip:r,...i}=n,s=ti(pd,r),c=Fd(pd,r),d=rc(r),h=y.useRef(null),p=He(l,h,s.onTriggerChange),m=y.useRef(!1),x=y.useRef(!1),v=y.useCallback(()=>m.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),g.jsx(ac,{asChild:!0,...d,children:g.jsx(Ce.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...i,ref:p,onPointerMove:we(n.onPointerMove,w=>{w.pointerType!=="touch"&&!x.current&&!c.isPointerInTransitRef.current&&(s.onTriggerEnter(),x.current=!0)}),onPointerLeave:we(n.onPointerLeave,()=>{s.onTriggerLeave(),x.current=!1}),onPointerDown:we(n.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:we(n.onFocus,()=>{m.current||s.onOpen()}),onBlur:we(n.onBlur,s.onClose),onClick:we(n.onClick,s.onClose)})})});M0.displayName=pd;var Kd="TooltipPortal",[i2,s2]=lc(Kd,{forceMount:void 0}),z0=n=>{const{__scopeTooltip:l,forceMount:r,children:i,container:s}=n,c=ti(Kd,l);return g.jsx(i2,{scope:l,forceMount:r,children:g.jsx(xn,{present:r||c.open,children:g.jsx(ei,{asChild:!0,container:s,children:i})})})};z0.displayName=Kd;var _r="TooltipContent",L0=y.forwardRef((n,l)=>{const r=s2(_r,n.__scopeTooltip),{forceMount:i=r.forceMount,side:s="top",...c}=n,d=ti(_r,n.__scopeTooltip);return g.jsx(xn,{present:i||d.open,children:d.disableHoverableContent?g.jsx(k0,{side:s,...c,ref:l}):g.jsx(c2,{side:s,...c,ref:l})})}),c2=y.forwardRef((n,l)=>{const r=ti(_r,n.__scopeTooltip),i=Fd(_r,n.__scopeTooltip),s=y.useRef(null),c=He(l,s),[d,h]=y.useState(null),{trigger:p,onClose:m}=r,x=s.current,{onPointerInTransitChange:v}=i,w=y.useCallback(()=>{h(null),v(!1)},[v]),C=y.useCallback((T,E)=>{const R=T.currentTarget,N={x:T.clientX,y:T.clientY},M=h2(N,R.getBoundingClientRect()),z=p2(N,M),P=m2(E.getBoundingClientRect()),G=v2([...z,...P]);h(G),v(!0)},[v]);return y.useEffect(()=>()=>w(),[w]),y.useEffect(()=>{if(p&&x){const T=R=>C(R,x),E=R=>C(R,p);return p.addEventListener("pointerleave",T),x.addEventListener("pointerleave",E),()=>{p.removeEventListener("pointerleave",T),x.removeEventListener("pointerleave",E)}}},[p,x,C,w]),y.useEffect(()=>{if(d){const T=E=>{const R=E.target,N={x:E.clientX,y:E.clientY},M=p?.contains(R)||x?.contains(R),z=!g2(N,d);M?w():z&&(w(),m())};return document.addEventListener("pointermove",T),()=>document.removeEventListener("pointermove",T)}},[p,x,d,m,w]),g.jsx(k0,{...n,ref:c})}),[u2,f2]=lc(Ko,{isInside:!1}),d2=WT("TooltipContent"),k0=y.forwardRef((n,l)=>{const{__scopeTooltip:r,children:i,"aria-label":s,onEscapeKeyDown:c,onPointerDownOutside:d,...h}=n,p=ti(_r,r),m=rc(r),{onClose:x}=p;return y.useEffect(()=>(document.addEventListener(hd,x),()=>document.removeEventListener(hd,x)),[x]),y.useEffect(()=>{if(p.trigger){const v=w=>{w.target?.contains(p.trigger)&&x()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[p.trigger,x]),g.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:v=>v.preventDefault(),onDismiss:x,children:g.jsxs($d,{"data-state":p.stateAttribute,...m,...h,ref:l,style:{...h.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:[g.jsx(d2,{children:i}),g.jsx(u2,{scope:r,isInside:!0,children:g.jsx(a2,{id:p.contentId,role:"tooltip",children:s||i})})]})})});L0.displayName=_r;var U0="TooltipArrow",H0=y.forwardRef((n,l)=>{const{__scopeTooltip:r,...i}=n,s=rc(r);return f2(U0,r).isInside?null:g.jsx(Xd,{...s,...i,ref:l})});H0.displayName=U0;function h2(n,l){const r=Math.abs(l.top-n.y),i=Math.abs(l.bottom-n.y),s=Math.abs(l.right-n.x),c=Math.abs(l.left-n.x);switch(Math.min(r,i,s,c)){case c:return"left";case s:return"right";case r:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function p2(n,l,r=5){const i=[];switch(l){case"top":i.push({x:n.x-r,y:n.y+r},{x:n.x+r,y:n.y+r});break;case"bottom":i.push({x:n.x-r,y:n.y-r},{x:n.x+r,y:n.y-r});break;case"left":i.push({x:n.x+r,y:n.y-r},{x:n.x+r,y:n.y+r});break;case"right":i.push({x:n.x-r,y:n.y-r},{x:n.x-r,y:n.y+r});break}return i}function m2(n){const{top:l,right:r,bottom:i,left:s}=n;return[{x:s,y:l},{x:r,y:l},{x:r,y:i},{x:s,y:i}]}function g2(n,l){const{x:r,y:i}=n;let s=!1;for(let c=0,d=l.length-1;c<l.length;d=c++){const h=l[c],p=l[d],m=h.x,x=h.y,v=p.x,w=p.y;x>i!=w>i&&r<(v-m)*(i-x)/(w-x)+m&&(s=!s)}return s}function v2(n){const l=n.slice();return l.sort((r,i)=>r.x<i.x?-1:r.x>i.x?1:r.y<i.y?-1:r.y>i.y?1:0),y2(l)}function y2(n){if(n.length<=1)return n.slice();const l=[];for(let i=0;i<n.length;i++){const s=n[i];for(;l.length>=2;){const c=l[l.length-1],d=l[l.length-2];if((c.x-d.x)*(s.y-d.y)>=(c.y-d.y)*(s.x-d.x))l.pop();else break}l.push(s)}l.pop();const r=[];for(let i=n.length-1;i>=0;i--){const s=n[i];for(;r.length>=2;){const c=r[r.length-1],d=r[r.length-2];if((c.x-d.x)*(s.y-d.y)>=(c.y-d.y)*(s.x-d.x))r.pop();else break}r.push(s)}return r.pop(),l.length===1&&r.length===1&&l[0].x===r[0].x&&l[0].y===r[0].y?l:l.concat(r)}var b2=D0,x2=_0,S2=M0,w2=z0,C2=L0,E2=H0;function T2({delayDuration:n=0,...l}){return g.jsx(b2,{"data-slot":"tooltip-provider",delayDuration:n,...l})}function At({...n}){return g.jsx(T2,{children:g.jsx(x2,{"data-slot":"tooltip",...n})})}function Nt({...n}){return g.jsx(S2,{"data-slot":"tooltip-trigger",...n})}function Ot({className:n,sideOffset:l=0,children:r,...i}){return g.jsx(w2,{children:g.jsxs(C2,{"data-slot":"tooltip-content",sideOffset:l,className:je("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",n),...i,children:[r,g.jsx(E2,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function R2(n){if(typeof document>"u")return;let l=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",l.appendChild(r),r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n))}const A2=n=>{switch(n){case"success":return j2;case"info":return _2;case"warning":return D2;case"error":return M2;default:return null}},N2=Array(12).fill(0),O2=({visible:n,className:l})=>le.createElement("div",{className:["sonner-loading-wrapper",l].filter(Boolean).join(" "),"data-visible":n},le.createElement("div",{className:"sonner-spinner"},N2.map((r,i)=>le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),j2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),D2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),_2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),M2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),z2=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),L2=()=>{const[n,l]=le.useState(document.hidden);return le.useEffect(()=>{const r=()=>{l(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),n};let md=1;class k2{constructor(){this.subscribe=l=>(this.subscribers.push(l),()=>{const r=this.subscribers.indexOf(l);this.subscribers.splice(r,1)}),this.publish=l=>{this.subscribers.forEach(r=>r(l))},this.addToast=l=>{this.publish(l),this.toasts=[...this.toasts,l]},this.create=l=>{var r;const{message:i,...s}=l,c=typeof l?.id=="number"||((r=l.id)==null?void 0:r.length)>0?l.id:md++,d=this.toasts.find(p=>p.id===c),h=l.dismissible===void 0?!0:l.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),d?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...l,id:c,title:i}),{...p,...l,id:c,dismissible:h,title:i}):p):this.addToast({title:i,...s,dismissible:h,id:c}),c},this.dismiss=l=>(l?(this.dismissedToasts.add(l),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:l,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),l),this.message=(l,r)=>this.create({...r,message:l}),this.error=(l,r)=>this.create({...r,message:l,type:"error"}),this.success=(l,r)=>this.create({...r,type:"success",message:l}),this.info=(l,r)=>this.create({...r,type:"info",message:l}),this.warning=(l,r)=>this.create({...r,type:"warning",message:l}),this.loading=(l,r)=>this.create({...r,type:"loading",message:l}),this.promise=(l,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:l,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(l instanceof Function?l():l);let c=i!==void 0,d;const h=s.then(async m=>{if(d=["resolve",m],le.isValidElement(m))c=!1,this.create({id:i,type:"default",message:m});else if(H2(m)&&!m.ok){c=!1;const v=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,w=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description,T=typeof v=="object"&&!le.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:w,...T})}else if(m instanceof Error){c=!1;const v=typeof r.error=="function"?await r.error(m):r.error,w=typeof r.description=="function"?await r.description(m):r.description,T=typeof v=="object"&&!le.isValidElement(v)?v:{message:v};this.create({id:i,type:"error",description:w,...T})}else if(r.success!==void 0){c=!1;const v=typeof r.success=="function"?await r.success(m):r.success,w=typeof r.description=="function"?await r.description(m):r.description,T=typeof v=="object"&&!le.isValidElement(v)?v:{message:v};this.create({id:i,type:"success",description:w,...T})}}).catch(async m=>{if(d=["reject",m],r.error!==void 0){c=!1;const x=typeof r.error=="function"?await r.error(m):r.error,v=typeof r.description=="function"?await r.description(m):r.description,C=typeof x=="object"&&!le.isValidElement(x)?x:{message:x};this.create({id:i,type:"error",description:v,...C})}}).finally(()=>{c&&(this.dismiss(i),i=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((m,x)=>h.then(()=>d[0]==="reject"?x(d[1]):m(d[1])).catch(x));return typeof i!="string"&&typeof i!="number"?{unwrap:p}:Object.assign(i,{unwrap:p})},this.custom=(l,r)=>{const i=r?.id||md++;return this.create({jsx:l(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(l=>!this.dismissedToasts.has(l.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Kt=new k2,U2=(n,l)=>{const r=l?.id||md++;return Kt.addToast({title:n,...l,id:r}),r},H2=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",B2=U2,P2=()=>Kt.toasts,V2=()=>Kt.getActiveToasts(),ut=Object.assign(B2,{success:Kt.success,info:Kt.info,warning:Kt.warning,error:Kt.error,custom:Kt.custom,message:Kt.message,promise:Kt.promise,dismiss:Kt.dismiss,loading:Kt.loading},{getHistory:P2,getToasts:V2});R2("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Es(n){return n.label!==void 0}const I2=3,Y2="24px",q2="16px",ny=4e3,G2=356,$2=14,X2=45,F2=200;function Hn(...n){return n.filter(Boolean).join(" ")}function K2(n){const[l,r]=n.split("-"),i=[];return l&&i.push(l),r&&i.push(r),i}const Q2=n=>{var l,r,i,s,c,d,h,p,m;const{invert:x,toast:v,unstyled:w,interacting:C,setHeights:T,visibleToasts:E,heights:R,index:N,toasts:M,expanded:z,removeToast:P,defaultRichColors:G,closeButton:k,style:L,cancelButtonStyle:Y,actionButtonStyle:J,className:ne="",descriptionClassName:re="",duration:K,position:ie,gap:ce,expandByDefault:he,classNames:D,icons:$,closeButtonAriaLabel:B="Close toast"}=n,[ue,de]=le.useState(null),[A,O]=le.useState(null),[U,X]=le.useState(!1),[Q,oe]=le.useState(!1),[Z,se]=le.useState(!1),[fe,be]=le.useState(!1),[Ae,De]=le.useState(!1),[ft,it]=le.useState(0),[wn,on]=le.useState(0),Qt=le.useRef(v.duration||K||ny),ae=le.useRef(null),xe=le.useRef(null),Ve=N===0,nt=N+1<=E,Ye=v.type,St=v.dismissible!==!1,at=v.className||"",jl=v.descriptionClassName||"",Fn=le.useMemo(()=>R.findIndex(Ee=>Ee.toastId===v.id)||0,[R,v.id]),ri=le.useMemo(()=>{var Ee;return(Ee=v.closeButton)!=null?Ee:k},[v.closeButton,k]),tl=le.useMemo(()=>v.duration||K||ny,[v.duration,K]),Ir=le.useRef(0),Kn=le.useRef(0),oi=le.useRef(0),va=le.useRef(null),[nl,zt]=ie.split("-"),Cn=le.useMemo(()=>R.reduce((Ee,Je,yt)=>yt>=Fn?Ee:Ee+Je.height,0),[R,Fn]),Dt=L2(),xc=v.invert||x,Yr=Ye==="loading";Kn.current=le.useMemo(()=>Fn*ce+Cn,[Fn,Cn]),le.useEffect(()=>{Qt.current=tl},[tl]),le.useEffect(()=>{X(!0)},[]),le.useEffect(()=>{const Ee=xe.current;if(Ee){const Je=Ee.getBoundingClientRect().height;return on(Je),T(yt=>[{toastId:v.id,height:Je,position:v.position},...yt]),()=>T(yt=>yt.filter(_t=>_t.toastId!==v.id))}},[T,v.id]),le.useLayoutEffect(()=>{if(!U)return;const Ee=xe.current,Je=Ee.style.height;Ee.style.height="auto";const yt=Ee.getBoundingClientRect().height;Ee.style.height=Je,on(yt),T(_t=>_t.find(lt=>lt.toastId===v.id)?_t.map(lt=>lt.toastId===v.id?{...lt,height:yt}:lt):[{toastId:v.id,height:yt,position:v.position},..._t])},[U,v.title,v.description,T,v.id,v.jsx,v.action,v.cancel]);const _n=le.useCallback(()=>{oe(!0),it(Kn.current),T(Ee=>Ee.filter(Je=>Je.toastId!==v.id)),setTimeout(()=>{P(v)},F2)},[v,P,T,Kn]);le.useEffect(()=>{if(v.promise&&Ye==="loading"||v.duration===1/0||v.type==="loading")return;let Ee;return z||C||Dt?(()=>{if(oi.current<Ir.current){const _t=new Date().getTime()-Ir.current;Qt.current=Qt.current-_t}oi.current=new Date().getTime()})():Qt.current!==1/0&&(Ir.current=new Date().getTime(),Ee=setTimeout(()=>{v.onAutoClose==null||v.onAutoClose.call(v,v),_n()},Qt.current)),()=>clearTimeout(Ee)},[z,C,v,Ye,Dt,_n]),le.useEffect(()=>{v.delete&&(_n(),v.onDismiss==null||v.onDismiss.call(v,v))},[_n,v.delete]);function Dl(){var Ee;if($?.loading){var Je;return le.createElement("div",{className:Hn(D?.loader,v==null||(Je=v.classNames)==null?void 0:Je.loader,"sonner-loader"),"data-visible":Ye==="loading"},$.loading)}return le.createElement(O2,{className:Hn(D?.loader,v==null||(Ee=v.classNames)==null?void 0:Ee.loader),visible:Ye==="loading"})}const _l=v.icon||$?.[Ye]||A2(Ye);var al,Mn;return le.createElement("li",{tabIndex:0,ref:xe,className:Hn(ne,at,D?.toast,v==null||(l=v.classNames)==null?void 0:l.toast,D?.default,D?.[Ye],v==null||(r=v.classNames)==null?void 0:r[Ye]),"data-sonner-toast":"","data-rich-colors":(al=v.richColors)!=null?al:G,"data-styled":!(v.jsx||v.unstyled||w),"data-mounted":U,"data-promise":!!v.promise,"data-swiped":Ae,"data-removed":Q,"data-visible":nt,"data-y-position":nl,"data-x-position":zt,"data-index":N,"data-front":Ve,"data-swiping":Z,"data-dismissible":St,"data-type":Ye,"data-invert":xc,"data-swipe-out":fe,"data-swipe-direction":A,"data-expanded":!!(z||he&&U),"data-testid":v.testId,style:{"--index":N,"--toasts-before":N,"--z-index":M.length-N,"--offset":`${Q?ft:Kn.current}px`,"--initial-height":he?"auto":`${wn}px`,...L,...v.style},onDragEnd:()=>{se(!1),de(null),va.current=null},onPointerDown:Ee=>{Ee.button!==2&&(Yr||!St||(ae.current=new Date,it(Kn.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(se(!0),va.current={x:Ee.clientX,y:Ee.clientY})))},onPointerUp:()=>{var Ee,Je,yt;if(fe||!St)return;va.current=null;const _t=Number(((Ee=xe.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ya=Number(((Je=xe.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),lt=new Date().getTime()-((yt=ae.current)==null?void 0:yt.getTime()),Bt=ue==="x"?_t:ya,ll=Math.abs(Bt)/lt;if(Math.abs(Bt)>=X2||ll>.11){it(Kn.current),v.onDismiss==null||v.onDismiss.call(v,v),O(ue==="x"?_t>0?"right":"left":ya>0?"down":"up"),_n(),be(!0);return}else{var Pt,Vt;(Pt=xe.current)==null||Pt.style.setProperty("--swipe-amount-x","0px"),(Vt=xe.current)==null||Vt.style.setProperty("--swipe-amount-y","0px")}De(!1),se(!1),de(null)},onPointerMove:Ee=>{var Je,yt,_t;if(!va.current||!St||((Je=window.getSelection())==null?void 0:Je.toString().length)>0)return;const lt=Ee.clientY-va.current.y,Bt=Ee.clientX-va.current.x;var ll;const Pt=(ll=n.swipeDirections)!=null?ll:K2(ie);!ue&&(Math.abs(Bt)>1||Math.abs(lt)>1)&&de(Math.abs(Bt)>Math.abs(lt)?"x":"y");let Vt={x:0,y:0};const Ml=En=>1/(1.5+Math.abs(En)/20);if(ue==="y"){if(Pt.includes("top")||Pt.includes("bottom"))if(Pt.includes("top")&<<0||Pt.includes("bottom")&<>0)Vt.y=lt;else{const En=lt*Ml(lt);Vt.y=Math.abs(En)<Math.abs(lt)?En:lt}}else if(ue==="x"&&(Pt.includes("left")||Pt.includes("right")))if(Pt.includes("left")&&Bt<0||Pt.includes("right")&&Bt>0)Vt.x=Bt;else{const En=Bt*Ml(Bt);Vt.x=Math.abs(En)<Math.abs(Bt)?En:Bt}(Math.abs(Vt.x)>0||Math.abs(Vt.y)>0)&&De(!0),(yt=xe.current)==null||yt.style.setProperty("--swipe-amount-x",`${Vt.x}px`),(_t=xe.current)==null||_t.style.setProperty("--swipe-amount-y",`${Vt.y}px`)}},ri&&!v.jsx&&Ye!=="loading"?le.createElement("button",{"aria-label":B,"data-disabled":Yr,"data-close-button":!0,onClick:Yr||!St?()=>{}:()=>{_n(),v.onDismiss==null||v.onDismiss.call(v,v)},className:Hn(D?.closeButton,v==null||(i=v.classNames)==null?void 0:i.closeButton)},(Mn=$?.close)!=null?Mn:z2):null,(Ye||v.icon||v.promise)&&v.icon!==null&&($?.[Ye]!==null||v.icon)?le.createElement("div",{"data-icon":"",className:Hn(D?.icon,v==null||(s=v.classNames)==null?void 0:s.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||Dl():null,v.type!=="loading"?_l:null):null,le.createElement("div",{"data-content":"",className:Hn(D?.content,v==null||(c=v.classNames)==null?void 0:c.content)},le.createElement("div",{"data-title":"",className:Hn(D?.title,v==null||(d=v.classNames)==null?void 0:d.title)},v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title),v.description?le.createElement("div",{"data-description":"",className:Hn(re,jl,D?.description,v==null||(h=v.classNames)==null?void 0:h.description)},typeof v.description=="function"?v.description():v.description):null),le.isValidElement(v.cancel)?v.cancel:v.cancel&&Es(v.cancel)?le.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||Y,onClick:Ee=>{Es(v.cancel)&&St&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,Ee),_n())},className:Hn(D?.cancelButton,v==null||(p=v.classNames)==null?void 0:p.cancelButton)},v.cancel.label):null,le.isValidElement(v.action)?v.action:v.action&&Es(v.action)?le.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||J,onClick:Ee=>{Es(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,Ee),!Ee.defaultPrevented&&_n())},className:Hn(D?.actionButton,v==null||(m=v.classNames)==null?void 0:m.actionButton)},v.action.label):null)};function ay(){if(typeof window>"u"||typeof document>"u")return"ltr";const n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function Z2(n,l){const r={};return[n,l].forEach((i,s)=>{const c=s===1,d=c?"--mobile-offset":"--offset",h=c?q2:Y2;function p(m){["top","right","bottom","left"].forEach(x=>{r[`${d}-${x}`]=typeof m=="number"?`${m}px`:m})}typeof i=="number"||typeof i=="string"?p(i):typeof i=="object"?["top","right","bottom","left"].forEach(m=>{i[m]===void 0?r[`${d}-${m}`]=h:r[`${d}-${m}`]=typeof i[m]=="number"?`${i[m]}px`:i[m]}):p(h)}),r}const W2=le.forwardRef(function(l,r){const{id:i,invert:s,position:c="bottom-right",hotkey:d=["altKey","KeyT"],expand:h,closeButton:p,className:m,offset:x,mobileOffset:v,theme:w="light",richColors:C,duration:T,style:E,visibleToasts:R=I2,toastOptions:N,dir:M=ay(),gap:z=$2,icons:P,containerAriaLabel:G="Notifications"}=l,[k,L]=le.useState([]),Y=le.useMemo(()=>i?k.filter(U=>U.toasterId===i):k.filter(U=>!U.toasterId),[k,i]),J=le.useMemo(()=>Array.from(new Set([c].concat(Y.filter(U=>U.position).map(U=>U.position)))),[Y,c]),[ne,re]=le.useState([]),[K,ie]=le.useState(!1),[ce,he]=le.useState(!1),[D,$]=le.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=le.useRef(null),ue=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),de=le.useRef(null),A=le.useRef(!1),O=le.useCallback(U=>{L(X=>{var Q;return(Q=X.find(oe=>oe.id===U.id))!=null&&Q.delete||Kt.dismiss(U.id),X.filter(({id:oe})=>oe!==U.id)})},[]);return le.useEffect(()=>Kt.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{L(X=>X.map(Q=>Q.id===U.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{a0.flushSync(()=>{L(X=>{const Q=X.findIndex(oe=>oe.id===U.id);return Q!==-1?[...X.slice(0,Q),{...X[Q],...U},...X.slice(Q+1)]:[U,...X]})})})}),[k]),le.useEffect(()=>{if(w!=="system"){$(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:X})=>{$(X?"dark":"light")})}catch{U.addListener(({matches:Q})=>{try{$(Q?"dark":"light")}catch(oe){console.error(oe)}})}},[w]),le.useEffect(()=>{k.length<=1&&ie(!1)},[k]),le.useEffect(()=>{const U=X=>{var Q;if(d.every(se=>X[se]||X.code===se)){var Z;ie(!0),(Z=B.current)==null||Z.focus()}X.code==="Escape"&&(document.activeElement===B.current||(Q=B.current)!=null&&Q.contains(document.activeElement))&&ie(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[d]),le.useEffect(()=>{if(B.current)return()=>{de.current&&(de.current.focus({preventScroll:!0}),de.current=null,A.current=!1)}},[B.current]),le.createElement("section",{ref:r,"aria-label":`${G} ${ue}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},J.map((U,X)=>{var Q;const[oe,Z]=U.split("-");return Y.length?le.createElement("ol",{key:U,dir:M==="auto"?ay():M,tabIndex:-1,ref:B,className:m,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":oe,"data-x-position":Z,style:{"--front-toast-height":`${((Q=ne[0])==null?void 0:Q.height)||0}px`,"--width":`${G2}px`,"--gap":`${z}px`,...E,...Z2(x,v)},onBlur:se=>{A.current&&!se.currentTarget.contains(se.relatedTarget)&&(A.current=!1,de.current&&(de.current.focus({preventScroll:!0}),de.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||A.current||(A.current=!0,de.current=se.relatedTarget)},onMouseEnter:()=>ie(!0),onMouseMove:()=>ie(!0),onMouseLeave:()=>{ce||ie(!1)},onDragEnd:()=>ie(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||he(!0)},onPointerUp:()=>he(!1)},Y.filter(se=>!se.position&&X===0||se.position===U).map((se,fe)=>{var be,Ae;return le.createElement(Q2,{key:se.id,icons:P,index:fe,toast:se,defaultRichColors:C,duration:(be=N?.duration)!=null?be:T,className:N?.className,descriptionClassName:N?.descriptionClassName,invert:s,visibleToasts:R,closeButton:(Ae=N?.closeButton)!=null?Ae:p,interacting:ce,position:U,style:N?.style,unstyled:N?.unstyled,classNames:N?.classNames,cancelButtonStyle:N?.cancelButtonStyle,actionButtonStyle:N?.actionButtonStyle,closeButtonAriaLabel:N?.closeButtonAriaLabel,removeToast:O,toasts:Y.filter(De=>De.position==se.position),heights:ne.filter(De=>De.position==se.position),setHeights:re,expandByDefault:h,gap:z,expanded:K,swipeDirections:l.swipeDirections})})):null}))});const J2=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),eR=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,r,i)=>i?i.toUpperCase():r.toLowerCase()),ly=n=>{const l=eR(n);return l.charAt(0).toUpperCase()+l.slice(1)},B0=(...n)=>n.filter((l,r,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===r).join(" ").trim(),tR=n=>{for(const l in n)if(l.startsWith("aria-")||l==="role"||l==="title")return!0};var nR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const aR=y.forwardRef(({color:n="currentColor",size:l=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:s="",children:c,iconNode:d,...h},p)=>y.createElement("svg",{ref:p,...nR,width:l,height:l,stroke:n,strokeWidth:i?Number(r)*24/Number(l):r,className:B0("lucide",s),...!c&&!tR(h)&&{"aria-hidden":"true"},...h},[...d.map(([m,x])=>y.createElement(m,x)),...Array.isArray(c)?c:[c]]));const Qe=(n,l)=>{const r=y.forwardRef(({className:i,...s},c)=>y.createElement(aR,{ref:c,iconNode:l,className:B0(`lucide-${J2(ly(n))}`,`lucide-${n}`,i),...s}));return r.displayName=ly(n),r};const lR=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],rR=Qe("arrow-right-left",lR);const oR=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],iR=Qe("book-open",oR);const sR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_s=Qe("check",sR);const cR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qs=Qe("chevron-down",cR);const uR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],fR=Qe("chevron-up",uR);const dR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],hR=Qe("circle-check",dR);const pR=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ry=Qe("copy",pR);const mR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],gR=Qe("globe",mR);const vR=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],yR=Qe("history",vR);const bR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],xR=Qe("info",bR);const SR=[["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",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],wR=Qe("key",SR);const CR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],P0=Qe("loader-circle",CR);const ER=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],TR=Qe("maximize-2",ER);const RR=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]],AR=Qe("mic-off",RR);const NR=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],OR=Qe("mic",NR);const jR=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],DR=Qe("minimize-2",jR);const _R=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],MR=Qe("moon",_R);const zR=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],LR=Qe("octagon-x",zR);const kR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],UR=Qe("plus",kR);const HR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],V0=Qe("search",HR);const BR=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],PR=Qe("sun",BR);const VR=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],IR=Qe("trash-2",VR);const YR=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],qR=Qe("triangle-alert",YR);const GR=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],$R=Qe("upload",GR);const XR=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],oy=Qe("volume-2",XR);const FR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gs=Qe("x",FR),I0=y.createContext(void 0);function KR({children:n}){const[l,r]=y.useState(()=>localStorage.getItem("theme")||"system"),[i,s]=y.useState("light");return y.useEffect(()=>{const c=window.document.documentElement,d=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",h=p=>{const m=p==="system"?d():p;s(m),c.classList.remove("light","dark"),c.classList.add(m)};if(h(l),localStorage.setItem("theme",l),l==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)"),m=()=>h("system");return p.addEventListener("change",m),()=>p.removeEventListener("change",m)}},[l]),g.jsx(I0.Provider,{value:{theme:l,setTheme:r,actualTheme:i},children:n})}function QR(){const n=y.useContext(I0);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}function yn({className:n,type:l,...r}){return g.jsx("input",{type:l,"data-slot":"input",className:je("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n),...r})}var $f="focusScope.autoFocusOnMount",Xf="focusScope.autoFocusOnUnmount",iy={bubbles:!1,cancelable:!0},ZR="FocusScope",oc=y.forwardRef((n,l)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:c,...d}=n,[h,p]=y.useState(null),m=kt(s),x=kt(c),v=y.useRef(null),w=He(l,E=>p(E)),C=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(i){let E=function(z){if(C.paused||!h)return;const P=z.target;h.contains(P)?v.current=P:Ga(v.current,{select:!0})},R=function(z){if(C.paused||!h)return;const P=z.relatedTarget;P!==null&&(h.contains(P)||Ga(v.current,{select:!0}))},N=function(z){if(document.activeElement===document.body)for(const G of z)G.removedNodes.length>0&&Ga(h)};document.addEventListener("focusin",E),document.addEventListener("focusout",R);const M=new MutationObserver(N);return h&&M.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",R),M.disconnect()}}},[i,h,C.paused]),y.useEffect(()=>{if(h){cy.add(C);const E=document.activeElement;if(!h.contains(E)){const N=new CustomEvent($f,iy);h.addEventListener($f,m),h.dispatchEvent(N),N.defaultPrevented||(WR(aA(Y0(h)),{select:!0}),document.activeElement===E&&Ga(h))}return()=>{h.removeEventListener($f,m),setTimeout(()=>{const N=new CustomEvent(Xf,iy);h.addEventListener(Xf,x),h.dispatchEvent(N),N.defaultPrevented||Ga(E??document.body,{select:!0}),h.removeEventListener(Xf,x),cy.remove(C)},0)}}},[h,m,x,C]);const T=y.useCallback(E=>{if(!r&&!i||C.paused)return;const R=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,N=document.activeElement;if(R&&N){const M=E.currentTarget,[z,P]=JR(M);z&&P?!E.shiftKey&&N===P?(E.preventDefault(),r&&Ga(z,{select:!0})):E.shiftKey&&N===z&&(E.preventDefault(),r&&Ga(P,{select:!0})):N===M&&E.preventDefault()}},[r,i,C.paused]);return g.jsx(Ce.div,{tabIndex:-1,...d,ref:w,onKeyDown:T})});oc.displayName=ZR;function WR(n,{select:l=!1}={}){const r=document.activeElement;for(const i of n)if(Ga(i,{select:l}),document.activeElement!==r)return}function JR(n){const l=Y0(n),r=sy(l,n),i=sy(l.reverse(),n);return[r,i]}function Y0(n){const l=[],r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)l.push(r.currentNode);return l}function sy(n,l){for(const r of n)if(!eA(r,{upTo:l}))return r}function eA(n,{upTo:l}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(l!==void 0&&n===l)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function tA(n){return n instanceof HTMLInputElement&&"select"in n}function Ga(n,{select:l=!1}={}){if(n&&n.focus){const r=document.activeElement;n.focus({preventScroll:!0}),n!==r&&tA(n)&&l&&n.select()}}var cy=nA();function nA(){let n=[];return{add(l){const r=n[0];l!==r&&r?.pause(),n=uy(n,l),n.unshift(l)},remove(l){n=uy(n,l),n[0]?.resume()}}}function uy(n,l){const r=[...n],i=r.indexOf(l);return i!==-1&&r.splice(i,1),r}function aA(n){return n.filter(l=>l.tagName!=="A")}var Ff=0;function Qd(){y.useEffect(()=>{const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",n[0]??fy()),document.body.insertAdjacentElement("beforeend",n[1]??fy()),Ff++,()=>{Ff===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(l=>l.remove()),Ff--}},[])}function fy(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var Bn=function(){return Bn=Object.assign||function(l){for(var r,i=1,s=arguments.length;i<s;i++){r=arguments[i];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(l[c]=r[c])}return l},Bn.apply(this,arguments)};function q0(n,l){var r={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&l.indexOf(i)<0&&(r[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(n);s<i.length;s++)l.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(n,i[s])&&(r[i[s]]=n[i[s]]);return r}function lA(n,l,r){if(r||arguments.length===2)for(var i=0,s=l.length,c;i<s;i++)(c||!(i in l))&&(c||(c=Array.prototype.slice.call(l,0,i)),c[i]=l[i]);return n.concat(c||Array.prototype.slice.call(l))}var Ms="right-scroll-bar-position",zs="width-before-scroll-bar",rA="with-scroll-bars-hidden",oA="--removed-body-scroll-bar-size";function Kf(n,l){return typeof n=="function"?n(l):n&&(n.current=l),n}function iA(n,l){var r=y.useState(function(){return{value:n,callback:l,facade:{get current(){return r.value},set current(i){var s=r.value;s!==i&&(r.value=i,r.callback(i,s))}}}})[0];return r.callback=l,r.facade}var sA=typeof window<"u"?y.useLayoutEffect:y.useEffect,dy=new WeakMap;function cA(n,l){var r=iA(null,function(i){return n.forEach(function(s){return Kf(s,i)})});return sA(function(){var i=dy.get(r);if(i){var s=new Set(i),c=new Set(n),d=r.current;s.forEach(function(h){c.has(h)||Kf(h,null)}),c.forEach(function(h){s.has(h)||Kf(h,d)})}dy.set(r,n)},[n]),r}function uA(n){return n}function fA(n,l){l===void 0&&(l=uA);var r=[],i=!1,s={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:n},useMedium:function(c){var d=l(c,i);return r.push(d),function(){r=r.filter(function(h){return h!==d})}},assignSyncMedium:function(c){for(i=!0;r.length;){var d=r;r=[],d.forEach(c)}r={push:function(h){return c(h)},filter:function(){return r}}},assignMedium:function(c){i=!0;var d=[];if(r.length){var h=r;r=[],h.forEach(c),d=r}var p=function(){var x=d;d=[],x.forEach(c)},m=function(){return Promise.resolve().then(p)};m(),r={push:function(x){d.push(x),m()},filter:function(x){return d=d.filter(x),r}}}};return s}function dA(n){n===void 0&&(n={});var l=fA(null);return l.options=Bn({async:!0,ssr:!1},n),l}var G0=function(n){var l=n.sideCar,r=q0(n,["sideCar"]);if(!l)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=l.read();if(!i)throw new Error("Sidecar medium not found");return y.createElement(i,Bn({},r))};G0.isSideCarExport=!0;function hA(n,l){return n.useMedium(l),G0}var $0=dA(),Qf=function(){},ic=y.forwardRef(function(n,l){var r=y.useRef(null),i=y.useState({onScrollCapture:Qf,onWheelCapture:Qf,onTouchMoveCapture:Qf}),s=i[0],c=i[1],d=n.forwardProps,h=n.children,p=n.className,m=n.removeScrollBar,x=n.enabled,v=n.shards,w=n.sideCar,C=n.noRelative,T=n.noIsolation,E=n.inert,R=n.allowPinchZoom,N=n.as,M=N===void 0?"div":N,z=n.gapMode,P=q0(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),G=w,k=cA([r,l]),L=Bn(Bn({},P),s);return y.createElement(y.Fragment,null,x&&y.createElement(G,{sideCar:$0,removeScrollBar:m,shards:v,noRelative:C,noIsolation:T,inert:E,setCallbacks:c,allowPinchZoom:!!R,lockRef:r,gapMode:z}),d?y.cloneElement(y.Children.only(h),Bn(Bn({},L),{ref:k})):y.createElement(M,Bn({},L,{className:p,ref:k}),h))});ic.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ic.classNames={fullWidth:zs,zeroRight:Ms};var pA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mA(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var l=pA();return l&&n.setAttribute("nonce",l),n}function gA(n,l){n.styleSheet?n.styleSheet.cssText=l:n.appendChild(document.createTextNode(l))}function vA(n){var l=document.head||document.getElementsByTagName("head")[0];l.appendChild(n)}var yA=function(){var n=0,l=null;return{add:function(r){n==0&&(l=mA())&&(gA(l,r),vA(l)),n++},remove:function(){n--,!n&&l&&(l.parentNode&&l.parentNode.removeChild(l),l=null)}}},bA=function(){var n=yA();return function(l,r){y.useEffect(function(){return n.add(l),function(){n.remove()}},[l&&r])}},X0=function(){var n=bA(),l=function(r){var i=r.styles,s=r.dynamic;return n(i,s),null};return l},xA={left:0,top:0,right:0,gap:0},Zf=function(n){return parseInt(n||"",10)||0},SA=function(n){var l=window.getComputedStyle(document.body),r=l[n==="padding"?"paddingLeft":"marginLeft"],i=l[n==="padding"?"paddingTop":"marginTop"],s=l[n==="padding"?"paddingRight":"marginRight"];return[Zf(r),Zf(i),Zf(s)]},wA=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return xA;var l=SA(n),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:l[0],top:l[1],right:l[2],gap:Math.max(0,i-r+l[2]-l[0])}},CA=X0(),jr="data-scroll-locked",EA=function(n,l,r,i){var s=n.left,c=n.top,d=n.right,h=n.gap;return r===void 0&&(r="margin"),`
|
|
10
10
|
.`.concat(rA,` {
|
|
11
11
|
overflow: hidden `).concat(i,`;
|
|
12
12
|
padding-right: `).concat(h,"px ").concat(i,`;
|
|
@@ -50,4 +50,4 @@ Error generating stack: `+o.message+`
|
|
|
50
50
|
|
|
51
51
|
If you want to hide the \`${l.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
52
52
|
|
|
53
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${l.docsSlug}`;return y.useEffect(()=>{n&&(document.getElementById(n)||console.error(r))},[r,n]),null},nN="DialogDescriptionWarning",aN=({contentRef:n,descriptionId:l})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hb(nN).contentName}}.`;return y.useEffect(()=>{const s=n.current?.getAttribute("aria-describedby");l&&s&&(document.getElementById(l)||console.warn(i))},[i,n,l]),null},th=J0,lN=tb,nh=ab,ah=lb,lh=rb,pb=ib,mb=cb,gb=fb;function rN({...n}){return g.jsx(th,{"data-slot":"dialog",...n})}function oN({...n}){return g.jsx(lN,{"data-slot":"dialog-trigger",...n})}function iN({...n}){return g.jsx(nh,{"data-slot":"dialog-portal",...n})}function sN({className:n,...l}){return g.jsx(ah,{"data-slot":"dialog-overlay",className:je("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...l})}function cN({className:n,children:l,showCloseButton:r=!0,...i}){return g.jsxs(iN,{"data-slot":"dialog-portal",children:[g.jsx(sN,{}),g.jsxs(lh,{"data-slot":"dialog-content",className:je("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",n),...i,children:[l,r&&g.jsxs(gb,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[g.jsx(Gs,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function uN({className:n,...l}){return g.jsx("div",{"data-slot":"dialog-header",className:je("flex flex-col gap-2 text-center sm:text-left",n),...l})}function fN({className:n,...l}){return g.jsx(pb,{"data-slot":"dialog-title",className:je("text-lg leading-none font-semibold",n),...l})}function dN({className:n,...l}){return g.jsx(mb,{"data-slot":"dialog-description",className:je("text-muted-foreground text-sm",n),...l})}function hN(n){const l=pN(n),r=y.forwardRef((i,s)=>{const{children:c,...d}=i,h=y.Children.toArray(c),p=h.find(gN);if(p){const m=p.props.children,x=h.map(v=>v===p?y.Children.count(m)>1?y.Children.only(null):y.isValidElement(m)?m.props.children:null:v);return g.jsx(l,{...d,ref:s,children:y.isValidElement(m)?y.cloneElement(m,void 0,x):null})}return g.jsx(l,{...d,ref:s,children:c})});return r.displayName=`${n}.Slot`,r}function pN(n){const l=y.forwardRef((r,i)=>{const{children:s,...c}=r;if(y.isValidElement(s)){const d=yN(s),h=vN(c,s.props);return s.type!==y.Fragment&&(h.ref=i?bn(i,d):d),y.cloneElement(s,h)}return y.Children.count(s)>1?y.Children.only(null):null});return l.displayName=`${n}.SlotClone`,l}var mN=Symbol("radix.slottable");function gN(n){return y.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===mN}function vN(n,l){const r={...l};for(const i in l){const s=n[i],c=l[i];/^on[A-Z]/.test(i)?s&&c?r[i]=(...h)=>{const p=c(...h);return s(...h),p}:s&&(r[i]=s):i==="style"?r[i]={...s,...c}:i==="className"&&(r[i]=[s,c].filter(Boolean).join(" "))}return{...n,...r}}function yN(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?n.props.ref:n.props.ref||n.ref)}var uc="Popover",[vb]=Gn(uc,[Br]),ni=Br(),[bN,Za]=vb(uc),yb=n=>{const{__scopePopover:l,children:r,open:i,defaultOpen:s,onOpenChange:c,modal:d=!1}=n,h=ni(l),p=y.useRef(null),[m,x]=y.useState(!1),[v,w]=qn({prop:i,defaultProp:s??!1,onChange:c,caller:uc});return g.jsx(Gd,{...h,children:g.jsx(bN,{scope:l,contentId:Ut(),triggerRef:p,open:v,onOpenChange:w,onOpenToggle:y.useCallback(()=>w(C=>!C),[w]),hasCustomAnchor:m,onCustomAnchorAdd:y.useCallback(()=>x(!0),[]),onCustomAnchorRemove:y.useCallback(()=>x(!1),[]),modal:d,children:r})})};yb.displayName=uc;var bb="PopoverAnchor",xN=y.forwardRef((n,l)=>{const{__scopePopover:r,...i}=n,s=Za(bb,r),c=ni(r),{onCustomAnchorAdd:d,onCustomAnchorRemove:h}=s;return y.useEffect(()=>(d(),()=>h()),[d,h]),g.jsx(ac,{...c,...i,ref:l})});xN.displayName=bb;var xb="PopoverTrigger",Sb=y.forwardRef((n,l)=>{const{__scopePopover:r,...i}=n,s=Za(xb,r),c=ni(r),d=He(l,s.triggerRef),h=g.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Rb(s.open),...i,ref:d,onClick:we(n.onClick,s.onOpenToggle)});return s.hasCustomAnchor?h:g.jsx(ac,{asChild:!0,...c,children:h})});Sb.displayName=xb;var rh="PopoverPortal",[SN,wN]=vb(rh,{forceMount:void 0}),wb=n=>{const{__scopePopover:l,forceMount:r,children:i,container:s}=n,c=Za(rh,l);return g.jsx(SN,{scope:l,forceMount:r,children:g.jsx(xn,{present:r||c.open,children:g.jsx(ei,{asChild:!0,container:s,children:i})})})};wb.displayName=rh;var Mr="PopoverContent",Cb=y.forwardRef((n,l)=>{const r=wN(Mr,n.__scopePopover),{forceMount:i=r.forceMount,...s}=n,c=Za(Mr,n.__scopePopover);return g.jsx(xn,{present:i||c.open,children:c.modal?g.jsx(EN,{...s,ref:l}):g.jsx(TN,{...s,ref:l})})});Cb.displayName=Mr;var CN=hN("PopoverContent.RemoveScroll"),EN=y.forwardRef((n,l)=>{const r=Za(Mr,n.__scopePopover),i=y.useRef(null),s=He(l,i),c=y.useRef(!1);return y.useEffect(()=>{const d=i.current;if(d)return Zd(d)},[]),g.jsx(sc,{as:CN,allowPinchZoom:!0,children:g.jsx(Eb,{...n,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(n.onCloseAutoFocus,d=>{d.preventDefault(),c.current||r.triggerRef.current?.focus()}),onPointerDownOutside:we(n.onPointerDownOutside,d=>{const h=d.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,m=h.button===2||p;c.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:we(n.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})}),TN=y.forwardRef((n,l)=>{const r=Za(Mr,n.__scopePopover),i=y.useRef(!1),s=y.useRef(!1);return g.jsx(Eb,{...n,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{n.onCloseAutoFocus?.(c),c.defaultPrevented||(i.current||r.triggerRef.current?.focus(),c.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:c=>{n.onInteractOutside?.(c),c.defaultPrevented||(i.current=!0,c.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const d=c.target;r.triggerRef.current?.contains(d)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&s.current&&c.preventDefault()}})}),Eb=y.forwardRef((n,l)=>{const{__scopePopover:r,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:x,...v}=n,w=Za(Mr,r),C=ni(r);return Qd(),g.jsx(oc,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:c,children:g.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:d,onInteractOutside:x,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onDismiss:()=>w.onOpenChange(!1),children:g.jsx($d,{"data-state":Rb(w.open),role:"dialog",id:w.contentId,...C,...v,ref:l,style:{...v.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)"}})})})}),Tb="PopoverClose",RN=y.forwardRef((n,l)=>{const{__scopePopover:r,...i}=n,s=Za(Tb,r);return g.jsx(Ce.button,{type:"button",...i,ref:l,onClick:we(n.onClick,()=>s.onOpenChange(!1))})});RN.displayName=Tb;var AN="PopoverArrow",NN=y.forwardRef((n,l)=>{const{__scopePopover:r,...i}=n,s=ni(r);return g.jsx(Xd,{...s,...i,ref:l})});NN.displayName=AN;function Rb(n){return n?"open":"closed"}var ON=yb,jN=Sb,DN=wb,_N=Cb;function vd({...n}){return g.jsx(ON,{"data-slot":"popover",...n})}function yd({...n}){return g.jsx(jN,{"data-slot":"popover-trigger",...n})}function bd({className:n,align:l="center",sideOffset:r=4,...i}){return g.jsx(DN,{children:g.jsx(_N,{"data-slot":"popover-content",align:l,sideOffset:r,className:je("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),...i})})}var vy=1,MN=.9,zN=.8,LN=.17,Jf=.1,ed=.999,kN=.9999,UN=.99,HN=/[\\\/_+.#"@\[\(\{&]/,BN=/[\\\/_+.#"@\[\(\{&]/g,PN=/[\s-]/,Ab=/[\s-]/g;function xd(n,l,r,i,s,c,d){if(c===l.length)return s===n.length?vy:UN;var h=`${s},${c}`;if(d[h]!==void 0)return d[h];for(var p=i.charAt(c),m=r.indexOf(p,s),x=0,v,w,C,T;m>=0;)v=xd(n,l,r,i,m+1,c+1,d),v>x&&(m===s?v*=vy:HN.test(n.charAt(m-1))?(v*=zN,C=n.slice(s,m-1).match(BN),C&&s>0&&(v*=Math.pow(ed,C.length))):PN.test(n.charAt(m-1))?(v*=MN,T=n.slice(s,m-1).match(Ab),T&&s>0&&(v*=Math.pow(ed,T.length))):(v*=LN,s>0&&(v*=Math.pow(ed,m-s))),n.charAt(m)!==l.charAt(c)&&(v*=kN)),(v<Jf&&r.charAt(m-1)===i.charAt(c+1)||i.charAt(c+1)===i.charAt(c)&&r.charAt(m-1)!==i.charAt(c))&&(w=xd(n,l,r,i,m+1,c+2,d),w*Jf>v&&(v=w*Jf)),v>x&&(x=v),m=r.indexOf(p,m+1);return d[h]=x,x}function yy(n){return n.toLowerCase().replace(Ab," ")}function VN(n,l,r){return n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,xd(n,l,yy(n),yy(l),0,0,{})}var Ho='[cmdk-group=""]',td='[cmdk-group-items=""]',IN='[cmdk-group-heading=""]',Nb='[cmdk-item=""]',by=`${Nb}:not([aria-disabled="true"])`,Sd="cmdk-item-select",Tr="data-value",YN=(n,l,r)=>VN(n,l,r),Ob=y.createContext(void 0),ai=()=>y.useContext(Ob),jb=y.createContext(void 0),oh=()=>y.useContext(jb),Db=y.createContext(void 0),_b=y.forwardRef((n,l)=>{let r=Rr(()=>{var O,U;return{search:"",value:(U=(O=n.value)!=null?O:n.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=Rr(()=>new Set),s=Rr(()=>new Map),c=Rr(()=>new Map),d=Rr(()=>new Set),h=Mb(n),{label:p,children:m,value:x,onValueChange:v,filter:w,shouldFilter:C,loop:T,disablePointerSelection:E=!1,vimBindings:R=!0,...N}=n,M=Ut(),z=Ut(),P=Ut(),G=y.useRef(null),k=eO();Al(()=>{if(x!==void 0){let O=x.trim();r.current.value=O,L.emit()}},[x]),Al(()=>{k(6,ie)},[]);let L=y.useMemo(()=>({subscribe:O=>(d.current.add(O),()=>d.current.delete(O)),snapshot:()=>r.current,setState:(O,U,X)=>{var Q,oe,Z,se;if(!Object.is(r.current[O],U)){if(r.current[O]=U,O==="search")K(),ne(),k(1,re);else if(O==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let fe=document.getElementById(P);fe?fe.focus():(Q=document.getElementById(M))==null||Q.focus()}if(k(7,()=>{var fe;r.current.selectedItemId=(fe=ce())==null?void 0:fe.id,L.emit()}),X||k(5,ie),((oe=h.current)==null?void 0:oe.value)!==void 0){let fe=U??"";(se=(Z=h.current).onValueChange)==null||se.call(Z,fe);return}}L.emit()}},emit:()=>{d.current.forEach(O=>O())}}),[]),Y=y.useMemo(()=>({value:(O,U,X)=>{var Q;U!==((Q=c.current.get(O))==null?void 0:Q.value)&&(c.current.set(O,{value:U,keywords:X}),r.current.filtered.items.set(O,J(U,X)),k(2,()=>{ne(),L.emit()}))},item:(O,U)=>(i.current.add(O),U&&(s.current.has(U)?s.current.get(U).add(O):s.current.set(U,new Set([O]))),k(3,()=>{K(),ne(),r.current.value||re(),L.emit()}),()=>{c.current.delete(O),i.current.delete(O),r.current.filtered.items.delete(O);let X=ce();k(4,()=>{K(),X?.getAttribute("id")===O&&re(),L.emit()})}),group:O=>(s.current.has(O)||s.current.set(O,new Set),()=>{c.current.delete(O),s.current.delete(O)}),filter:()=>h.current.shouldFilter,label:p||n["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:M,inputId:P,labelId:z,listInnerRef:G}),[]);function J(O,U){var X,Q;let oe=(Q=(X=h.current)==null?void 0:X.filter)!=null?Q:YN;return O?oe(O,r.current.search,U):0}function ne(){if(!r.current.search||h.current.shouldFilter===!1)return;let O=r.current.filtered.items,U=[];r.current.filtered.groups.forEach(Q=>{let oe=s.current.get(Q),Z=0;oe.forEach(se=>{let fe=O.get(se);Z=Math.max(fe,Z)}),U.push([Q,Z])});let X=G.current;he().sort((Q,oe)=>{var Z,se;let fe=Q.getAttribute("id"),be=oe.getAttribute("id");return((Z=O.get(be))!=null?Z:0)-((se=O.get(fe))!=null?se:0)}).forEach(Q=>{let oe=Q.closest(td);oe?oe.appendChild(Q.parentElement===oe?Q:Q.closest(`${td} > *`)):X.appendChild(Q.parentElement===X?Q:Q.closest(`${td} > *`))}),U.sort((Q,oe)=>oe[1]-Q[1]).forEach(Q=>{var oe;let Z=(oe=G.current)==null?void 0:oe.querySelector(`${Ho}[${Tr}="${encodeURIComponent(Q[0])}"]`);Z?.parentElement.appendChild(Z)})}function re(){let O=he().find(X=>X.getAttribute("aria-disabled")!=="true"),U=O?.getAttribute(Tr);L.setState("value",U||void 0)}function K(){var O,U,X,Q;if(!r.current.search||h.current.shouldFilter===!1){r.current.filtered.count=i.current.size;return}r.current.filtered.groups=new Set;let oe=0;for(let Z of i.current){let se=(U=(O=c.current.get(Z))==null?void 0:O.value)!=null?U:"",fe=(Q=(X=c.current.get(Z))==null?void 0:X.keywords)!=null?Q:[],be=J(se,fe);r.current.filtered.items.set(Z,be),be>0&&oe++}for(let[Z,se]of s.current)for(let fe of se)if(r.current.filtered.items.get(fe)>0){r.current.filtered.groups.add(Z);break}r.current.filtered.count=oe}function ie(){var O,U,X;let Q=ce();Q&&(((O=Q.parentElement)==null?void 0:O.firstChild)===Q&&((X=(U=Q.closest(Ho))==null?void 0:U.querySelector(IN))==null||X.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function ce(){var O;return(O=G.current)==null?void 0:O.querySelector(`${Nb}[aria-selected="true"]`)}function he(){var O;return Array.from(((O=G.current)==null?void 0:O.querySelectorAll(by))||[])}function D(O){let U=he()[O];U&&L.setState("value",U.getAttribute(Tr))}function $(O){var U;let X=ce(),Q=he(),oe=Q.findIndex(se=>se===X),Z=Q[oe+O];(U=h.current)!=null&&U.loop&&(Z=oe+O<0?Q[Q.length-1]:oe+O===Q.length?Q[0]:Q[oe+O]),Z&&L.setState("value",Z.getAttribute(Tr))}function B(O){let U=ce(),X=U?.closest(Ho),Q;for(;X&&!Q;)X=O>0?WN(X,Ho):JN(X,Ho),Q=X?.querySelector(by);Q?L.setState("value",Q.getAttribute(Tr)):$(O)}let ue=()=>D(he().length-1),de=O=>{O.preventDefault(),O.metaKey?ue():O.altKey?B(1):$(1)},A=O=>{O.preventDefault(),O.metaKey?D(0):O.altKey?B(-1):$(-1)};return y.createElement(Ce.div,{ref:l,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:O=>{var U;(U=N.onKeyDown)==null||U.call(N,O);let X=O.nativeEvent.isComposing||O.keyCode===229;if(!(O.defaultPrevented||X))switch(O.key){case"n":case"j":{R&&O.ctrlKey&&de(O);break}case"ArrowDown":{de(O);break}case"p":case"k":{R&&O.ctrlKey&&A(O);break}case"ArrowUp":{A(O);break}case"Home":{O.preventDefault(),D(0);break}case"End":{O.preventDefault(),ue();break}case"Enter":{O.preventDefault();let Q=ce();if(Q){let oe=new Event(Sd);Q.dispatchEvent(oe)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:Y.inputId,id:Y.labelId,style:nO},p),fc(n,O=>y.createElement(jb.Provider,{value:L},y.createElement(Ob.Provider,{value:Y},O))))}),qN=y.forwardRef((n,l)=>{var r,i;let s=Ut(),c=y.useRef(null),d=y.useContext(Db),h=ai(),p=Mb(n),m=(i=(r=p.current)==null?void 0:r.forceMount)!=null?i:d?.forceMount;Al(()=>{if(!m)return h.item(s,d?.id)},[m]);let x=zb(s,c,[n.value,n.children,c],n.keywords),v=oh(),w=Qa(k=>k.value&&k.value===x.current),C=Qa(k=>m||h.filter()===!1?!0:k.search?k.filtered.items.get(s)>0:!0);y.useEffect(()=>{let k=c.current;if(!(!k||n.disabled))return k.addEventListener(Sd,T),()=>k.removeEventListener(Sd,T)},[C,n.onSelect,n.disabled]);function T(){var k,L;E(),(L=(k=p.current).onSelect)==null||L.call(k,x.current)}function E(){v.setState("value",x.current,!0)}if(!C)return null;let{disabled:R,value:N,onSelect:M,forceMount:z,keywords:P,...G}=n;return y.createElement(Ce.div,{ref:bn(c,l),...G,id:s,"cmdk-item":"",role:"option","aria-disabled":!!R,"aria-selected":!!w,"data-disabled":!!R,"data-selected":!!w,onPointerMove:R||h.getDisablePointerSelection()?void 0:E,onClick:R?void 0:T},n.children)}),GN=y.forwardRef((n,l)=>{let{heading:r,children:i,forceMount:s,...c}=n,d=Ut(),h=y.useRef(null),p=y.useRef(null),m=Ut(),x=ai(),v=Qa(C=>s||x.filter()===!1?!0:C.search?C.filtered.groups.has(d):!0);Al(()=>x.group(d),[]),zb(d,h,[n.value,n.heading,p]);let w=y.useMemo(()=>({id:d,forceMount:s}),[s]);return y.createElement(Ce.div,{ref:bn(h,l),...c,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},r&&y.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:m},r),fc(n,C=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?m:void 0},y.createElement(Db.Provider,{value:w},C))))}),$N=y.forwardRef((n,l)=>{let{alwaysRender:r,...i}=n,s=y.useRef(null),c=Qa(d=>!d.search);return!r&&!c?null:y.createElement(Ce.div,{ref:bn(s,l),...i,"cmdk-separator":"",role:"separator"})}),XN=y.forwardRef((n,l)=>{let{onValueChange:r,...i}=n,s=n.value!=null,c=oh(),d=Qa(m=>m.search),h=Qa(m=>m.selectedItemId),p=ai();return y.useEffect(()=>{n.value!=null&&c.setState("search",n.value)},[n.value]),y.createElement(Ce.input,{ref:l,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":p.listId,"aria-labelledby":p.labelId,"aria-activedescendant":h,id:p.inputId,type:"text",value:s?n.value:d,onChange:m=>{s||c.setState("search",m.target.value),r?.(m.target.value)}})}),FN=y.forwardRef((n,l)=>{let{children:r,label:i="Suggestions",...s}=n,c=y.useRef(null),d=y.useRef(null),h=Qa(m=>m.selectedItemId),p=ai();return y.useEffect(()=>{if(d.current&&c.current){let m=d.current,x=c.current,v,w=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let C=m.offsetHeight;x.style.setProperty("--cmdk-list-height",C.toFixed(1)+"px")})});return w.observe(m),()=>{cancelAnimationFrame(v),w.unobserve(m)}}},[]),y.createElement(Ce.div,{ref:bn(c,l),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":i,id:p.listId},fc(n,m=>y.createElement("div",{ref:bn(d,p.listInnerRef),"cmdk-list-sizer":""},m)))}),KN=y.forwardRef((n,l)=>{let{open:r,onOpenChange:i,overlayClassName:s,contentClassName:c,container:d,...h}=n;return y.createElement(th,{open:r,onOpenChange:i},y.createElement(nh,{container:d},y.createElement(ah,{"cmdk-overlay":"",className:s}),y.createElement(lh,{"aria-label":n.label,"cmdk-dialog":"",className:c},y.createElement(_b,{ref:l,...h}))))}),QN=y.forwardRef((n,l)=>Qa(r=>r.filtered.count===0)?y.createElement(Ce.div,{ref:l,...n,"cmdk-empty":"",role:"presentation"}):null),ZN=y.forwardRef((n,l)=>{let{progress:r,children:i,label:s="Loading...",...c}=n;return y.createElement(Ce.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},fc(n,d=>y.createElement("div",{"aria-hidden":!0},d)))}),Pr=Object.assign(_b,{List:FN,Item:qN,Input:XN,Group:GN,Separator:$N,Dialog:KN,Empty:QN,Loading:ZN});function WN(n,l){let r=n.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function JN(n,l){let r=n.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function Mb(n){let l=y.useRef(n);return Al(()=>{l.current=n}),l}var Al=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Rr(n){let l=y.useRef();return l.current===void 0&&(l.current=n()),l}function Qa(n){let l=oh(),r=()=>n(l.snapshot());return y.useSyncExternalStore(l.subscribe,r,r)}function zb(n,l,r,i=[]){let s=y.useRef(),c=ai();return Al(()=>{var d;let h=(()=>{var m;for(let x of r){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(m=x.current.textContent)==null?void 0:m.trim():s.current}})(),p=i.map(m=>m.trim());c.value(n,h,p),(d=l.current)==null||d.setAttribute(Tr,h),s.current=h}),s}var eO=()=>{let[n,l]=y.useState(),r=Rr(()=>new Map);return Al(()=>{r.current.forEach(i=>i()),r.current=new Map},[n]),(i,s)=>{r.current.set(i,s),l({})}};function tO(n){let l=n.type;return typeof l=="function"?l(n.props):"render"in l?l.render(n.props):n}function fc({asChild:n,children:l},r){return n&&y.isValidElement(l)?y.cloneElement(tO(l),{ref:l.ref},r(l.props.children)):r(l)}var nO={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function wd({className:n,...l}){return g.jsx(Pr,{"data-slot":"command",className:je("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",n),...l})}function Cd({className:n,...l}){return g.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[g.jsx(V0,{className:"size-4 shrink-0 opacity-50"}),g.jsx(Pr.Input,{"data-slot":"command-input",className:je("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),...l})]})}function Ed({className:n,...l}){return g.jsx(Pr.List,{"data-slot":"command-list",className:je("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",n),...l})}function Td({...n}){return g.jsx(Pr.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...n})}function $a({className:n,...l}){return g.jsx(Pr.Group,{"data-slot":"command-group",className:je("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",n),...l})}function Xa({className:n,...l}){return g.jsx(Pr.Item,{"data-slot":"command-item",className:je("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...l})}function xy(n){const l=aO(n),r=y.forwardRef((i,s)=>{const{children:c,...d}=i,h=y.Children.toArray(c),p=h.find(rO);if(p){const m=p.props.children,x=h.map(v=>v===p?y.Children.count(m)>1?y.Children.only(null):y.isValidElement(m)?m.props.children:null:v);return g.jsx(l,{...d,ref:s,children:y.isValidElement(m)?y.cloneElement(m,void 0,x):null})}return g.jsx(l,{...d,ref:s,children:c})});return r.displayName=`${n}.Slot`,r}function aO(n){const l=y.forwardRef((r,i)=>{const{children:s,...c}=r;if(y.isValidElement(s)){const d=iO(s),h=oO(c,s.props);return s.type!==y.Fragment&&(h.ref=i?bn(i,d):d),y.cloneElement(s,h)}return y.Children.count(s)>1?y.Children.only(null):null});return l.displayName=`${n}.SlotClone`,l}var lO=Symbol("radix.slottable");function rO(n){return y.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===lO}function oO(n,l){const r={...l};for(const i in l){const s=n[i],c=l[i];/^on[A-Z]/.test(i)?s&&c?r[i]=(...h)=>{const p=c(...h);return s(...h),p}:s&&(r[i]=s):i==="style"?r[i]={...s,...c}:i==="className"&&(r[i]=[s,c].filter(Boolean).join(" "))}return{...n,...r}}function iO(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?n.props.ref:n.props.ref||n.ref)}function Lb(n){const l=n+"CollectionProvider",[r,i]=Gn(l),[s,c]=r(l,{collectionRef:{current:null},itemMap:new Map}),d=E=>{const{scope:R,children:N}=E,M=le.useRef(null),z=le.useRef(new Map).current;return g.jsx(s,{scope:R,itemMap:z,collectionRef:M,children:N})};d.displayName=l;const h=n+"CollectionSlot",p=xy(h),m=le.forwardRef((E,R)=>{const{scope:N,children:M}=E,z=c(h,N),P=He(R,z.collectionRef);return g.jsx(p,{ref:P,children:M})});m.displayName=h;const x=n+"CollectionItemSlot",v="data-radix-collection-item",w=xy(x),C=le.forwardRef((E,R)=>{const{scope:N,children:M,...z}=E,P=le.useRef(null),G=He(R,P),k=c(x,N);return le.useEffect(()=>(k.itemMap.set(P,{ref:P,...z}),()=>{k.itemMap.delete(P)})),g.jsx(w,{[v]:"",ref:G,children:M})});C.displayName=x;function T(E){const R=c(n+"CollectionConsumer",E);return le.useCallback(()=>{const M=R.collectionRef.current;if(!M)return[];const z=Array.from(M.querySelectorAll(`[${v}]`));return Array.from(R.itemMap.values()).sort((k,L)=>z.indexOf(k.ref.current)-z.indexOf(L.ref.current))},[R.collectionRef,R.itemMap])}return[{Provider:d,Slot:m,ItemSlot:C},T,i]}var sO=y.createContext(void 0);function dc(n){const l=y.useContext(sO);return n||l||"ltr"}var nd="rovingFocusGroup.onEntryFocus",cO={bubbles:!1,cancelable:!0},li="RovingFocusGroup",[Rd,kb,uO]=Lb(li),[fO,Ub]=Gn(li,[uO]),[dO,hO]=fO(li),Hb=y.forwardRef((n,l)=>g.jsx(Rd.Provider,{scope:n.__scopeRovingFocusGroup,children:g.jsx(Rd.Slot,{scope:n.__scopeRovingFocusGroup,children:g.jsx(pO,{...n,ref:l})})}));Hb.displayName=li;var pO=y.forwardRef((n,l)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:s=!1,dir:c,currentTabStopId:d,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:x=!1,...v}=n,w=y.useRef(null),C=He(l,w),T=dc(c),[E,R]=qn({prop:d,defaultProp:h??null,onChange:p,caller:li}),[N,M]=y.useState(!1),z=kt(m),P=kb(r),G=y.useRef(!1),[k,L]=y.useState(0);return y.useEffect(()=>{const Y=w.current;if(Y)return Y.addEventListener(nd,z),()=>Y.removeEventListener(nd,z)},[z]),g.jsx(dO,{scope:r,orientation:i,dir:T,loop:s,currentTabStopId:E,onItemFocus:y.useCallback(Y=>R(Y),[R]),onItemShiftTab:y.useCallback(()=>M(!0),[]),onFocusableItemAdd:y.useCallback(()=>L(Y=>Y+1),[]),onFocusableItemRemove:y.useCallback(()=>L(Y=>Y-1),[]),children:g.jsx(Ce.div,{tabIndex:N||k===0?-1:0,"data-orientation":i,...v,ref:C,style:{outline:"none",...n.style},onMouseDown:we(n.onMouseDown,()=>{G.current=!0}),onFocus:we(n.onFocus,Y=>{const J=!G.current;if(Y.target===Y.currentTarget&&J&&!N){const ne=new CustomEvent(nd,cO);if(Y.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const re=P().filter(D=>D.focusable),K=re.find(D=>D.active),ie=re.find(D=>D.id===E),he=[K,ie,...re].filter(Boolean).map(D=>D.ref.current);Vb(he,x)}}G.current=!1}),onBlur:we(n.onBlur,()=>M(!1))})})}),Bb="RovingFocusGroupItem",Pb=y.forwardRef((n,l)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:s=!1,tabStopId:c,children:d,...h}=n,p=Ut(),m=c||p,x=hO(Bb,r),v=x.currentTabStopId===m,w=kb(r),{onFocusableItemAdd:C,onFocusableItemRemove:T,currentTabStopId:E}=x;return y.useEffect(()=>{if(i)return C(),()=>T()},[i,C,T]),g.jsx(Rd.ItemSlot,{scope:r,id:m,focusable:i,active:s,children:g.jsx(Ce.span,{tabIndex:v?0:-1,"data-orientation":x.orientation,...h,ref:l,onMouseDown:we(n.onMouseDown,R=>{i?x.onItemFocus(m):R.preventDefault()}),onFocus:we(n.onFocus,()=>x.onItemFocus(m)),onKeyDown:we(n.onKeyDown,R=>{if(R.key==="Tab"&&R.shiftKey){x.onItemShiftTab();return}if(R.target!==R.currentTarget)return;const N=vO(R,x.orientation,x.dir);if(N!==void 0){if(R.metaKey||R.ctrlKey||R.altKey||R.shiftKey)return;R.preventDefault();let z=w().filter(P=>P.focusable).map(P=>P.ref.current);if(N==="last")z.reverse();else if(N==="prev"||N==="next"){N==="prev"&&z.reverse();const P=z.indexOf(R.currentTarget);z=x.loop?yO(z,P+1):z.slice(P+1)}setTimeout(()=>Vb(z))}}),children:typeof d=="function"?d({isCurrentTabStop:v,hasTabStop:E!=null}):d})})});Pb.displayName=Bb;var mO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gO(n,l){return l!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function vO(n,l,r){const i=gO(n.key,r);if(!(l==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(l==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return mO[i]}function Vb(n,l=!1){const r=document.activeElement;for(const i of n)if(i===r||(i.focus({preventScroll:l}),document.activeElement!==r))return}function yO(n,l){return n.map((r,i)=>n[(l+i)%n.length])}var bO=Hb,xO=Pb,Ib="Toggle",Yb=y.forwardRef((n,l)=>{const{pressed:r,defaultPressed:i,onPressedChange:s,...c}=n,[d,h]=qn({prop:r,onChange:s,defaultProp:i??!1,caller:Ib});return g.jsx(Ce.button,{type:"button","aria-pressed":d,"data-state":d?"on":"off","data-disabled":n.disabled?"":void 0,...c,ref:l,onClick:we(n.onClick,()=>{n.disabled||h(!d)})})});Yb.displayName=Ib;var Wa="ToggleGroup",[qb]=Gn(Wa,[Ub]),Gb=Ub(),ih=le.forwardRef((n,l)=>{const{type:r,...i}=n;if(r==="single"){const s=i;return g.jsx(SO,{...s,ref:l})}if(r==="multiple"){const s=i;return g.jsx(wO,{...s,ref:l})}throw new Error(`Missing prop \`type\` expected on \`${Wa}\``)});ih.displayName=Wa;var[$b,Xb]=qb(Wa),SO=le.forwardRef((n,l)=>{const{value:r,defaultValue:i,onValueChange:s=()=>{},...c}=n,[d,h]=qn({prop:r,defaultProp:i??"",onChange:s,caller:Wa});return g.jsx($b,{scope:n.__scopeToggleGroup,type:"single",value:le.useMemo(()=>d?[d]:[],[d]),onItemActivate:h,onItemDeactivate:le.useCallback(()=>h(""),[h]),children:g.jsx(Fb,{...c,ref:l})})}),wO=le.forwardRef((n,l)=>{const{value:r,defaultValue:i,onValueChange:s=()=>{},...c}=n,[d,h]=qn({prop:r,defaultProp:i??[],onChange:s,caller:Wa}),p=le.useCallback(x=>h((v=[])=>[...v,x]),[h]),m=le.useCallback(x=>h((v=[])=>v.filter(w=>w!==x)),[h]);return g.jsx($b,{scope:n.__scopeToggleGroup,type:"multiple",value:d,onItemActivate:p,onItemDeactivate:m,children:g.jsx(Fb,{...c,ref:l})})});ih.displayName=Wa;var[CO,EO]=qb(Wa),Fb=le.forwardRef((n,l)=>{const{__scopeToggleGroup:r,disabled:i=!1,rovingFocus:s=!0,orientation:c,dir:d,loop:h=!0,...p}=n,m=Gb(r),x=dc(d),v={role:"group",dir:x,...p};return g.jsx(CO,{scope:r,rovingFocus:s,disabled:i,children:s?g.jsx(bO,{asChild:!0,...m,orientation:c,dir:x,loop:h,children:g.jsx(Ce.div,{...v,ref:l})}):g.jsx(Ce.div,{...v,ref:l})})}),Xs="ToggleGroupItem",Kb=le.forwardRef((n,l)=>{const r=Xb(Xs,n.__scopeToggleGroup),i=EO(Xs,n.__scopeToggleGroup),s=Gb(n.__scopeToggleGroup),c=r.value.includes(n.value),d=i.disabled||n.disabled,h={...n,pressed:c,disabled:d},p=le.useRef(null);return i.rovingFocus?g.jsx(xO,{asChild:!0,...s,focusable:!d,active:c,ref:p,children:g.jsx(Sy,{...h,ref:l})}):g.jsx(Sy,{...h,ref:l})});Kb.displayName=Xs;var Sy=le.forwardRef((n,l)=>{const{__scopeToggleGroup:r,value:i,...s}=n,c=Xb(Xs,r),d={role:"radio","aria-checked":n.pressed,"aria-pressed":void 0},h=c.type==="single"?d:void 0;return g.jsx(Yb,{...h,...s,ref:l,onPressedChange:p=>{p?c.onItemActivate(i):c.onItemDeactivate(i)}})}),TO=ih,RO=Kb;const AO=qy("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Qb=y.createContext({size:"default",variant:"default",spacing:0});function Ad({className:n,variant:l,size:r,spacing:i=0,children:s,...c}){return g.jsx(TO,{"data-slot":"toggle-group","data-variant":l,"data-size":r,"data-spacing":i,style:{"--gap":i},className:je("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",n),...c,children:g.jsx(Qb.Provider,{value:{variant:l,size:r,spacing:i},children:s})})}function Go({className:n,children:l,variant:r,size:i,...s}){const c=y.useContext(Qb);return g.jsx(RO,{"data-slot":"toggle-group-item","data-variant":c.variant||r,"data-size":c.size||i,"data-spacing":c.spacing,className:je(AO({variant:c.variant||r,size:c.size||i}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",n),...s,children:l})}function NO({showTokenDialog:n,setShowTokenDialog:l,onTokenSaved:r}){const{t:i,i18n:s}=Qo(),{actualTheme:c,setTheme:d}=QR(),[h,p]=y.useState(!1),[m,x]=y.useState(()=>localStorage.getItem("apiToken")||""),[v,w]=y.useState(!1),[C,T]=y.useState(()=>localStorage.getItem("uiLangMode")||"manual"),[E,R]=y.useState(()=>{try{const K=localStorage.getItem("recentUILanguages");if(!K)return[];const ie=JSON.parse(K);return Array.isArray(ie)?ie:[]}catch{return[]}});y.useEffect(()=>{n!==void 0&&p(n)},[n]);const N=[{code:"en",name:"English",short:"EN"},{code:"zh",name:"中文",short:"中"},{code:"ja",name:"日本語",short:"日"}],M=()=>{d(c==="dark"?"light":"dark")},z=()=>{const K=navigator.language?.toLowerCase()||"en";return K.startsWith("zh")?"zh":K.startsWith("ja")?"ja":"en"},P=K=>{const ie=[K,...E.filter(ce=>ce!==K)].slice(0,3);R(ie),localStorage.setItem("recentUILanguages",JSON.stringify(ie))},G=K=>{if(K==="system"){const ie=z();T("system"),localStorage.setItem("uiLangMode","system"),s.changeLanguage(ie)}else T("manual"),localStorage.setItem("uiLangMode","manual"),s.changeLanguage(K),P(K);w(!1)};y.useEffect(()=>{if(C!=="system")return;const K=z();K!==s.language&&s.changeLanguage(K);const ie=()=>{const ce=z();ce!==s.language&&s.changeLanguage(ce)};return window.addEventListener("languagechange",ie),()=>window.removeEventListener("languagechange",ie)},[C,s]);const k=()=>{m.trim()?(localStorage.setItem("apiToken",m.trim()),ut.success(i("apiTokenSaved"))):(localStorage.removeItem("apiToken"),ut.success(i("apiTokenCleared"))),(!n||m.trim()!=="")&&(p(!1),l&&l(!1),r&&r())},L=K=>{p(K),l&&l(K)},Y=C==="system"?z():s.language,J=N.find(K=>K.code===Y)||N[0],ne=y.useMemo(()=>E.flatMap(K=>{const ie=N.find(ce=>ce.code===K);return ie?[ie]:[]}),[E]),re=C==="system"?"system":J.code;return g.jsxs("div",{className:"flex gap-1 sm:gap-2",children:[g.jsxs(rN,{open:h,onOpenChange:L,children:[g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(oN,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8 sm:h-9 sm:w-9","aria-label":i("apiToken"),children:g.jsx(wR,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:i("apiToken")})})]}),g.jsxs(cN,{className:"w-[calc(100%-2rem)] sm:max-w-md",children:[g.jsxs(uN,{children:[g.jsx(fN,{children:i("apiToken")}),g.jsx(dN,{children:i(n?"apiTokenRequired":"apiTokenPlaceholder")})]}),g.jsxs("div",{className:"space-y-4",children:[g.jsx(yn,{type:"password",placeholder:i("apiTokenPlaceholder"),value:m,onChange:K=>x(K.target.value)}),g.jsx(tt,{onClick:k,className:"w-full",children:i("save")})]})]})]}),g.jsxs(vd,{open:v,onOpenChange:w,children:[g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(yd,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8 sm:h-9 sm:w-9","aria-label":i("switchLanguage"),children:g.jsx(gR,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:i("switchLanguage")})})]}),g.jsxs(bd,{className:"w-72 p-2",align:"end",children:[g.jsx("div",{className:"mb-2 text-sm font-medium",children:i("languageSwitcher")}),g.jsx("div",{className:"mb-3",children:g.jsxs(Ad,{type:"single",value:re,onValueChange:K=>{K&&G(K)},variant:"outline",size:"sm",className:"w-full justify-between",children:[g.jsx(Go,{value:"system",className:"flex-1",children:i("system")}),N.map(K=>g.jsx(Go,{value:K.code,className:"flex-1",children:K.short},K.code))]})}),g.jsxs(wd,{children:[g.jsx(Cd,{placeholder:i("languageSearchPlaceholder"),autoFocus:!0}),g.jsxs(Ed,{children:[g.jsx(Td,{children:i("noResults")}),g.jsx($a,{heading:i("followSystemLanguage"),children:g.jsxs(Xa,{value:"system",onSelect:()=>G("system"),children:[g.jsx("span",{className:"flex-1",children:i("followSystemLanguage")}),C==="system"&&g.jsx(_s,{className:"h-4 w-4"})]})}),ne.length>0&&g.jsx($a,{heading:i("languageRecent"),children:ne.map(K=>g.jsxs(Xa,{value:K.code,onSelect:()=>G(K.code),children:[g.jsx("span",{className:"flex-1",children:K.name}),C!=="system"&&K.code===J.code&&g.jsx(_s,{className:"h-4 w-4"})]},K.code))}),g.jsx($a,{heading:i("languageAll"),children:N.map(K=>g.jsxs(Xa,{value:K.code,onSelect:()=>G(K.code),children:[g.jsx("span",{className:"flex-1",children:K.name}),C!=="system"&&K.code===J.code&&g.jsx(_s,{className:"h-4 w-4"})]},K.code))})]})]})]})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:M,className:"h-8 w-8 sm:h-9 sm:w-9","aria-label":i("toggleTheme"),children:c==="dark"?g.jsx(PR,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"}):g.jsx(MR,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),g.jsx(Ot,{children:g.jsx("p",{children:i("toggleTheme")})})]})]})}function OO({...n}){return g.jsx(th,{"data-slot":"sheet",...n})}function jO({...n}){return g.jsx(nh,{"data-slot":"sheet-portal",...n})}function DO({className:n,...l}){return g.jsx(ah,{"data-slot":"sheet-overlay",className:je("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...l})}function _O({className:n,children:l,side:r="right",...i}){return g.jsxs(jO,{children:[g.jsx(DO,{}),g.jsxs(lh,{"data-slot":"sheet-content",className:je("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",n),...i,children:[l,g.jsxs(gb,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[g.jsx(Gs,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function MO({className:n,...l}){return g.jsx("div",{"data-slot":"sheet-header",className:je("flex flex-col gap-1.5 p-4",n),...l})}function zO({className:n,...l}){return g.jsx("div",{"data-slot":"sheet-footer",className:je("mt-auto flex flex-col gap-2 p-4",n),...l})}function LO({className:n,...l}){return g.jsx(pb,{"data-slot":"sheet-title",className:je("text-foreground font-semibold",n),...l})}function kO({className:n,...l}){return g.jsx(mb,{"data-slot":"sheet-description",className:je("text-muted-foreground text-sm",n),...l})}function Nd(n,[l,r]){return Math.min(r,Math.max(l,n))}function UO(n,l){return y.useReducer((r,i)=>l[r][i]??r,n)}var sh="ScrollArea",[Zb]=Gn(sh),[HO,Sn]=Zb(sh),Wb=y.forwardRef((n,l)=>{const{__scopeScrollArea:r,type:i="hover",dir:s,scrollHideDelay:c=600,...d}=n,[h,p]=y.useState(null),[m,x]=y.useState(null),[v,w]=y.useState(null),[C,T]=y.useState(null),[E,R]=y.useState(null),[N,M]=y.useState(0),[z,P]=y.useState(0),[G,k]=y.useState(!1),[L,Y]=y.useState(!1),J=He(l,re=>p(re)),ne=dc(s);return g.jsx(HO,{scope:r,type:i,dir:ne,scrollHideDelay:c,scrollArea:h,viewport:m,onViewportChange:x,content:v,onContentChange:w,scrollbarX:C,onScrollbarXChange:T,scrollbarXEnabled:G,onScrollbarXEnabledChange:k,scrollbarY:E,onScrollbarYChange:R,scrollbarYEnabled:L,onScrollbarYEnabledChange:Y,onCornerWidthChange:M,onCornerHeightChange:P,children:g.jsx(Ce.div,{dir:ne,...d,ref:J,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":z+"px",...n.style}})})});Wb.displayName=sh;var Jb="ScrollAreaViewport",ex=y.forwardRef((n,l)=>{const{__scopeScrollArea:r,children:i,nonce:s,...c}=n,d=Sn(Jb,r),h=y.useRef(null),p=He(l,h,d.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),g.jsx(Ce.div,{"data-radix-scroll-area-viewport":"",...c,ref:p,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...n.style},children:g.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});ex.displayName=Jb;var Xn="ScrollAreaScrollbar",tx=y.forwardRef((n,l)=>{const{forceMount:r,...i}=n,s=Sn(Xn,n.__scopeScrollArea),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:d}=s,h=n.orientation==="horizontal";return y.useEffect(()=>(h?c(!0):d(!0),()=>{h?c(!1):d(!1)}),[h,c,d]),s.type==="hover"?g.jsx(BO,{...i,ref:l,forceMount:r}):s.type==="scroll"?g.jsx(PO,{...i,ref:l,forceMount:r}):s.type==="auto"?g.jsx(nx,{...i,ref:l,forceMount:r}):s.type==="always"?g.jsx(ch,{...i,ref:l}):null});tx.displayName=Xn;var BO=y.forwardRef((n,l)=>{const{forceMount:r,...i}=n,s=Sn(Xn,n.__scopeScrollArea),[c,d]=y.useState(!1);return y.useEffect(()=>{const h=s.scrollArea;let p=0;if(h){const m=()=>{window.clearTimeout(p),d(!0)},x=()=>{p=window.setTimeout(()=>d(!1),s.scrollHideDelay)};return h.addEventListener("pointerenter",m),h.addEventListener("pointerleave",x),()=>{window.clearTimeout(p),h.removeEventListener("pointerenter",m),h.removeEventListener("pointerleave",x)}}},[s.scrollArea,s.scrollHideDelay]),g.jsx(xn,{present:r||c,children:g.jsx(nx,{"data-state":c?"visible":"hidden",...i,ref:l})})}),PO=y.forwardRef((n,l)=>{const{forceMount:r,...i}=n,s=Sn(Xn,n.__scopeScrollArea),c=n.orientation==="horizontal",d=pc(()=>p("SCROLL_END"),100),[h,p]=UO("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(h==="idle"){const m=window.setTimeout(()=>p("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(m)}},[h,s.scrollHideDelay,p]),y.useEffect(()=>{const m=s.viewport,x=c?"scrollLeft":"scrollTop";if(m){let v=m[x];const w=()=>{const C=m[x];v!==C&&(p("SCROLL"),d()),v=C};return m.addEventListener("scroll",w),()=>m.removeEventListener("scroll",w)}},[s.viewport,c,p,d]),g.jsx(xn,{present:r||h!=="hidden",children:g.jsx(ch,{"data-state":h==="hidden"?"hidden":"visible",...i,ref:l,onPointerEnter:we(n.onPointerEnter,()=>p("POINTER_ENTER")),onPointerLeave:we(n.onPointerLeave,()=>p("POINTER_LEAVE"))})})}),nx=y.forwardRef((n,l)=>{const r=Sn(Xn,n.__scopeScrollArea),{forceMount:i,...s}=n,[c,d]=y.useState(!1),h=n.orientation==="horizontal",p=pc(()=>{if(r.viewport){const m=r.viewport.offsetWidth<r.viewport.scrollWidth,x=r.viewport.offsetHeight<r.viewport.scrollHeight;d(h?m:x)}},10);return zr(r.viewport,p),zr(r.content,p),g.jsx(xn,{present:i||c,children:g.jsx(ch,{"data-state":c?"visible":"hidden",...s,ref:l})})}),ch=y.forwardRef((n,l)=>{const{orientation:r="vertical",...i}=n,s=Sn(Xn,n.__scopeScrollArea),c=y.useRef(null),d=y.useRef(0),[h,p]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=ix(h.viewport,h.content),x={...i,sizes:h,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:w=>c.current=w,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:w=>d.current=w};function v(w,C){return $O(w,d.current,h,C)}return r==="horizontal"?g.jsx(VO,{...x,ref:l,onThumbPositionChange:()=>{if(s.viewport&&c.current){const w=s.viewport.scrollLeft,C=wy(w,h,s.dir);c.current.style.transform=`translate3d(${C}px, 0, 0)`}},onWheelScroll:w=>{s.viewport&&(s.viewport.scrollLeft=w)},onDragScroll:w=>{s.viewport&&(s.viewport.scrollLeft=v(w,s.dir))}}):r==="vertical"?g.jsx(IO,{...x,ref:l,onThumbPositionChange:()=>{if(s.viewport&&c.current){const w=s.viewport.scrollTop,C=wy(w,h);c.current.style.transform=`translate3d(0, ${C}px, 0)`}},onWheelScroll:w=>{s.viewport&&(s.viewport.scrollTop=w)},onDragScroll:w=>{s.viewport&&(s.viewport.scrollTop=v(w))}}):null}),VO=y.forwardRef((n,l)=>{const{sizes:r,onSizesChange:i,...s}=n,c=Sn(Xn,n.__scopeScrollArea),[d,h]=y.useState(),p=y.useRef(null),m=He(l,p,c.onScrollbarXChange);return y.useEffect(()=>{p.current&&h(getComputedStyle(p.current))},[p]),g.jsx(lx,{"data-orientation":"horizontal",...s,ref:m,sizes:r,style:{bottom:0,left:c.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:c.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":hc(r)+"px",...n.style},onThumbPointerDown:x=>n.onThumbPointerDown(x.x),onDragScroll:x=>n.onDragScroll(x.x),onWheelScroll:(x,v)=>{if(c.viewport){const w=c.viewport.scrollLeft+x.deltaX;n.onWheelScroll(w),cx(w,v)&&x.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&i({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:Ks(d.paddingLeft),paddingEnd:Ks(d.paddingRight)}})}})}),IO=y.forwardRef((n,l)=>{const{sizes:r,onSizesChange:i,...s}=n,c=Sn(Xn,n.__scopeScrollArea),[d,h]=y.useState(),p=y.useRef(null),m=He(l,p,c.onScrollbarYChange);return y.useEffect(()=>{p.current&&h(getComputedStyle(p.current))},[p]),g.jsx(lx,{"data-orientation":"vertical",...s,ref:m,sizes:r,style:{top:0,right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":hc(r)+"px",...n.style},onThumbPointerDown:x=>n.onThumbPointerDown(x.y),onDragScroll:x=>n.onDragScroll(x.y),onWheelScroll:(x,v)=>{if(c.viewport){const w=c.viewport.scrollTop+x.deltaY;n.onWheelScroll(w),cx(w,v)&&x.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&i({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:Ks(d.paddingTop),paddingEnd:Ks(d.paddingBottom)}})}})}),[YO,ax]=Zb(Xn),lx=y.forwardRef((n,l)=>{const{__scopeScrollArea:r,sizes:i,hasThumb:s,onThumbChange:c,onThumbPointerUp:d,onThumbPointerDown:h,onThumbPositionChange:p,onDragScroll:m,onWheelScroll:x,onResize:v,...w}=n,C=Sn(Xn,r),[T,E]=y.useState(null),R=He(l,J=>E(J)),N=y.useRef(null),M=y.useRef(""),z=C.viewport,P=i.content-i.viewport,G=kt(x),k=kt(p),L=pc(v,10);function Y(J){if(N.current){const ne=J.clientX-N.current.left,re=J.clientY-N.current.top;m({x:ne,y:re})}}return y.useEffect(()=>{const J=ne=>{const re=ne.target;T?.contains(re)&&G(ne,P)};return document.addEventListener("wheel",J,{passive:!1}),()=>document.removeEventListener("wheel",J,{passive:!1})},[z,T,P,G]),y.useEffect(k,[i,k]),zr(T,L),zr(C.content,L),g.jsx(YO,{scope:r,scrollbar:T,hasThumb:s,onThumbChange:kt(c),onThumbPointerUp:kt(d),onThumbPositionChange:k,onThumbPointerDown:kt(h),children:g.jsx(Ce.div,{...w,ref:R,style:{position:"absolute",...w.style},onPointerDown:we(n.onPointerDown,J=>{J.button===0&&(J.target.setPointerCapture(J.pointerId),N.current=T.getBoundingClientRect(),M.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",C.viewport&&(C.viewport.style.scrollBehavior="auto"),Y(J))}),onPointerMove:we(n.onPointerMove,Y),onPointerUp:we(n.onPointerUp,J=>{const ne=J.target;ne.hasPointerCapture(J.pointerId)&&ne.releasePointerCapture(J.pointerId),document.body.style.webkitUserSelect=M.current,C.viewport&&(C.viewport.style.scrollBehavior=""),N.current=null})})})}),Fs="ScrollAreaThumb",rx=y.forwardRef((n,l)=>{const{forceMount:r,...i}=n,s=ax(Fs,n.__scopeScrollArea);return g.jsx(xn,{present:r||s.hasThumb,children:g.jsx(qO,{ref:l,...i})})}),qO=y.forwardRef((n,l)=>{const{__scopeScrollArea:r,style:i,...s}=n,c=Sn(Fs,r),d=ax(Fs,r),{onThumbPositionChange:h}=d,p=He(l,v=>d.onThumbChange(v)),m=y.useRef(void 0),x=pc(()=>{m.current&&(m.current(),m.current=void 0)},100);return y.useEffect(()=>{const v=c.viewport;if(v){const w=()=>{if(x(),!m.current){const C=XO(v,h);m.current=C,h()}};return h(),v.addEventListener("scroll",w),()=>v.removeEventListener("scroll",w)}},[c.viewport,x,h]),g.jsx(Ce.div,{"data-state":d.hasThumb?"visible":"hidden",...s,ref:p,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:we(n.onPointerDownCapture,v=>{const C=v.target.getBoundingClientRect(),T=v.clientX-C.left,E=v.clientY-C.top;d.onThumbPointerDown({x:T,y:E})}),onPointerUp:we(n.onPointerUp,d.onThumbPointerUp)})});rx.displayName=Fs;var uh="ScrollAreaCorner",ox=y.forwardRef((n,l)=>{const r=Sn(uh,n.__scopeScrollArea),i=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&i?g.jsx(GO,{...n,ref:l}):null});ox.displayName=uh;var GO=y.forwardRef((n,l)=>{const{__scopeScrollArea:r,...i}=n,s=Sn(uh,r),[c,d]=y.useState(0),[h,p]=y.useState(0),m=!!(c&&h);return zr(s.scrollbarX,()=>{const x=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(x),p(x)}),zr(s.scrollbarY,()=>{const x=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(x),d(x)}),m?g.jsx(Ce.div,{...i,ref:l,style:{width:c,height:h,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function Ks(n){return n?parseInt(n,10):0}function ix(n,l){const r=n/l;return isNaN(r)?0:r}function hc(n){const l=ix(n.viewport,n.content),r=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,i=(n.scrollbar.size-r)*l;return Math.max(i,18)}function $O(n,l,r,i="ltr"){const s=hc(r),c=s/2,d=l||c,h=s-d,p=r.scrollbar.paddingStart+d,m=r.scrollbar.size-r.scrollbar.paddingEnd-h,x=r.content-r.viewport,v=i==="ltr"?[0,x]:[x*-1,0];return sx([p,m],v)(n)}function wy(n,l,r="ltr"){const i=hc(l),s=l.scrollbar.paddingStart+l.scrollbar.paddingEnd,c=l.scrollbar.size-s,d=l.content-l.viewport,h=c-i,p=r==="ltr"?[0,d]:[d*-1,0],m=Nd(n,p);return sx([0,d],[0,h])(m)}function sx(n,l){return r=>{if(n[0]===n[1]||l[0]===l[1])return l[0];const i=(l[1]-l[0])/(n[1]-n[0]);return l[0]+i*(r-n[0])}}function cx(n,l){return n>0&&n<l}var XO=(n,l=()=>{})=>{let r={left:n.scrollLeft,top:n.scrollTop},i=0;return(function s(){const c={left:n.scrollLeft,top:n.scrollTop},d=r.left!==c.left,h=r.top!==c.top;(d||h)&&l(),r=c,i=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(i)};function pc(n,l){const r=kt(n),i=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(i.current),[]),y.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(r,l)},[r,l])}function zr(n,l){const r=kt(l);jt(()=>{let i=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(r)});return s.observe(n),()=>{window.cancelAnimationFrame(i),s.unobserve(n)}}},[n,r])}var FO=Wb,KO=ex,QO=ox;function ZO({className:n,children:l,...r}){return g.jsxs(FO,{"data-slot":"scroll-area",className:je("relative",n),...r,children:[g.jsx(KO,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:l}),g.jsx(WO,{}),g.jsx(QO,{})]})}function WO({className:n,orientation:l="vertical",...r}){return g.jsx(tx,{"data-slot":"scroll-area-scrollbar",orientation:l,className:je("flex touch-none p-px transition-colors select-none",l==="vertical"&&"h-full w-2.5 border-l border-l-transparent",l==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",n),...r,children:g.jsx(rx,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function JO({open:n,onOpenChange:l,history:r,onSelect:i,onClear:s,onDelete:c}){const{t:d}=Qo(),[h,p]=y.useState(""),m=y.useMemo(()=>{if(!h.trim())return r;const x=h.toLowerCase();return r.filter(v=>v.sourceText.toLowerCase().includes(x)||v.translatedText.toLowerCase().includes(x))},[r,h]);return g.jsx(OO,{open:n,onOpenChange:l,children:g.jsxs(_O,{side:"right",className:"w-[300px] sm:w-[400px] flex flex-col gap-0",children:[g.jsxs(MO,{className:"pb-4",children:[g.jsx(LO,{children:d("history")}),g.jsx(kO,{children:r.length===0?d("noHistory"):d("historyDesc")})]}),r.length>0&&g.jsx("div",{className:"px-4 pb-4",children:g.jsxs("div",{className:"relative",children:[g.jsx(V0,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground pointer-events-none"}),g.jsx(yn,{placeholder:d("searchPlaceholder"),className:"pl-8",value:h,onChange:x=>p(x.target.value)})]})}),g.jsx(ZO,{className:"flex-1 px-4 min-h-0",children:g.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[m.map(x=>g.jsxs("div",{className:"relative flex flex-col gap-2 rounded-lg border p-3 hover:bg-accent cursor-pointer transition-colors group",onClick:()=>{i(x),l(!1)},children:[g.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[g.jsxs("span",{children:[x.from," → ",x.to]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-6 w-6 -mr-1 text-muted-foreground hover:text-destructive z-10 opacity-0 group-hover:opacity-100 transition-opacity",onClick:v=>{v.stopPropagation(),c(x.id)},"aria-label":d("delete"),children:g.jsx(IR,{className:"h-3 w-3"})})}),g.jsx(Ot,{children:g.jsx("p",{children:d("delete")})})]})]}),g.jsx("div",{className:"text-sm line-clamp-2 font-medium break-all",children:x.sourceText}),g.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2 break-all",children:x.translatedText})]},x.id)),m.length===0&&h&&g.jsx("div",{className:"text-center text-sm text-muted-foreground py-8",children:d("noResults")})]})}),r.length>0&&g.jsx(zO,{className:"p-4 border-t mt-auto",children:g.jsx(tt,{variant:"destructive",className:"w-full",onClick:s,children:d("clearAll")})})]})})}function Ar({className:n,...l}){return g.jsx("div",{"data-slot":"card",className:je("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",n),...l})}function Bo({className:n,...l}){return g.jsx("div",{"data-slot":"card-header",className:je("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",n),...l})}function Po({className:n,...l}){return g.jsx("div",{"data-slot":"card-title",className:je("leading-none font-semibold",n),...l})}function Nr({className:n,...l}){return g.jsx("div",{"data-slot":"card-content",className:je("px-6",n),...l})}function Cy({className:n,...l}){return g.jsx("textarea",{"data-slot":"textarea",className:je("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),...l})}var ej=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tj=ej.reduce((n,l)=>{const r=Ld(`Primitive.${l}`),i=y.forwardRef((s,c)=>{const{asChild:d,...h}=s,p=d?r:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(p,{...h,ref:c})});return i.displayName=`Primitive.${l}`,{...n,[l]:i}},{}),nj="Label",ux=y.forwardRef((n,l)=>g.jsx(tj.label,{...n,ref:l,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(n.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));ux.displayName=nj;var aj=ux;function Ey({className:n,...l}){return g.jsx(aj,{"data-slot":"label",className:je("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",n),...l})}function lj({className:n,...l}){return g.jsx(P0,{role:"status","aria-label":"Loading",className:je("size-4 animate-spin",n),...l})}function fx(n){const l=y.useRef({value:n,previous:n});return y.useMemo(()=>(l.current.value!==n&&(l.current.previous=l.current.value,l.current.value=n),l.current.previous),[n])}var mc="Switch",[rj]=Gn(mc),[oj,ij]=rj(mc),dx=y.forwardRef((n,l)=>{const{__scopeSwitch:r,name:i,checked:s,defaultChecked:c,required:d,disabled:h,value:p="on",onCheckedChange:m,form:x,...v}=n,[w,C]=y.useState(null),T=He(l,z=>C(z)),E=y.useRef(!1),R=w?x||!!w.closest("form"):!0,[N,M]=qn({prop:s,defaultProp:c??!1,onChange:m,caller:mc});return g.jsxs(oj,{scope:r,checked:N,disabled:h,children:[g.jsx(Ce.button,{type:"button",role:"switch","aria-checked":N,"aria-required":d,"data-state":gx(N),"data-disabled":h?"":void 0,disabled:h,value:p,...v,ref:T,onClick:we(n.onClick,z=>{M(P=>!P),R&&(E.current=z.isPropagationStopped(),E.current||z.stopPropagation())})}),R&&g.jsx(mx,{control:w,bubbles:!E.current,name:i,value:p,checked:N,required:d,disabled:h,form:x,style:{transform:"translateX(-100%)"}})]})});dx.displayName=mc;var hx="SwitchThumb",px=y.forwardRef((n,l)=>{const{__scopeSwitch:r,...i}=n,s=ij(hx,r);return g.jsx(Ce.span,{"data-state":gx(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:l})});px.displayName=hx;var sj="SwitchBubbleInput",mx=y.forwardRef(({__scopeSwitch:n,control:l,checked:r,bubbles:i=!0,...s},c)=>{const d=y.useRef(null),h=He(d,c),p=fx(r),m=y0(l);return y.useEffect(()=>{const x=d.current;if(!x)return;const v=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(v,"checked").set;if(p!==r&&C){const T=new Event("click",{bubbles:i});C.call(x,r),x.dispatchEvent(T)}},[p,r,i]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:h,style:{...s.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});mx.displayName=sj;function gx(n){return n?"checked":"unchecked"}var cj=dx,uj=px;function Cl({className:n,...l}){return g.jsx(cj,{"data-slot":"switch",className:je("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",n),...l,children:g.jsx(uj,{"data-slot":"switch-thumb",className:je("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const ad=768;function fj(){const[n,l]=y.useState(void 0);return y.useEffect(()=>{const r=window.matchMedia(`(max-width: ${ad-1}px)`),i=()=>{l(window.innerWidth<ad)};return r.addEventListener("change",i),l(window.innerWidth<ad),()=>r.removeEventListener("change",i)},[]),!!n}const dj=(n,l)=>{if(!n||n.length===0)return[];let r=null;try{r=new Intl.DisplayNames([l],{type:"language"})}catch(s){console.warn("Intl.DisplayNames not supported or invalid locale",s)}return n.filter(s=>s!=="auto").map(s=>{let c=s;if(r)try{c=r.of(s)||s}catch{}return{code:s,name:c}}).sort((s,c)=>s.name.localeCompare(c.name,l))};function hj({id:n,isPrimary:l,languages:r,loadingLanguages:i,addToHistory:s,onDelete:c,canDelete:d}){const{t:h,i18n:p}=Qo(),m=fj(),x=ae=>`panel_${n}_${ae}`,[v,w]=y.useState(()=>localStorage.getItem(x("sourceLang"))||"auto"),[C,T]=y.useState(()=>localStorage.getItem(x("targetLang"))||"zh-Hans"),[E,R]=y.useState(""),[N,M]=y.useState(""),[z,P]=y.useState(!1),[G,k]=y.useState(()=>localStorage.getItem(x("autoTranslate"))==="true"),[L,Y]=y.useState(!1),[J,ne]=y.useState(!1),[re,K]=y.useState(!1),[ie,ce]=y.useState(!0),[he,D]=y.useState(()=>{try{const ae=localStorage.getItem("recentTranslateLanguages");if(!ae)return[];const xe=JSON.parse(ae);return Array.isArray(xe)?xe:[]}catch{return[]}}),$="firstTranslateTipShown",B=y.useRef(null),ue=y.useRef(null),de=y.useRef(null),A=y.useMemo(()=>dj(r,p.language),[r,p.language]),O=y.useMemo(()=>{const ae=["en","zh-Hans","ja"],xe=new Set(A.map(Ve=>Ve.code));return ae.filter(Ve=>xe.has(Ve))},[A]),U=y.useMemo(()=>{const ae=new Map(A.map(xe=>[xe.code,xe]));return he.flatMap(xe=>{const Ve=ae.get(xe);return Ve?[Ve]:[]})},[he,A]);y.useEffect(()=>{localStorage.setItem(x("sourceLang"),v)},[v,n]),y.useEffect(()=>{localStorage.setItem(x("targetLang"),C)},[C,n]),y.useEffect(()=>{localStorage.setItem(x("autoTranslate"),String(G))},[G,n]),y.useEffect(()=>{if(!l)return;const ae=xe=>{const nt=xe.detail;nt&&(w(nt.from),T(nt.to),R(nt.sourceText),M(nt.translatedText))};return window.addEventListener("loadHistoryItem",ae),()=>{window.removeEventListener("loadHistoryItem",ae)}},[l]);const X=y.useCallback(async(ae,xe=!0)=>{const Ve=ae??E;if(!Ve.trim()){xe&&ut.error(h("enterTextError"));return}localStorage.getItem($)!=="true"&&(localStorage.setItem($,"true"),ut(h("firstTranslationTip"),{position:"bottom-right"})),P(!0),M("");try{const nt={from:v,to:C,text:Ve,html:!1},Ye={"Content-Type":"application/json"},St=localStorage.getItem("apiToken");St&&(Ye.Authorization=`Bearer ${St}`);const at=await fetch("/translate",{method:"POST",headers:Ye,body:JSON.stringify(nt)});if(!at.ok){if(at.status===401)throw new Error(h("apiTokenPlaceholder"));const Fn=await at.json();throw new Error(Fn.error||h("translationFailed"))}const jl=await at.json();M(jl.result),s({from:v,to:C,sourceText:Ve,translatedText:jl.result}),xe&&ut.success(h("translationCompleted"))}catch(nt){console.error("Translation error:",nt),xe&&ut.error(nt instanceof Error?nt.message:h("translationFailed"))}finally{P(!1),setTimeout(()=>{B.current?.focus()},0)}},[v,C,E,h,s]),Q=y.useCallback(ae=>{G&&ae.trim()&&(de.current&&clearTimeout(de.current),de.current=window.setTimeout(()=>{X(ae,!1)},800))},[G,X]),oe=ae=>{R(ae),Q(ae)};y.useEffect(()=>()=>{de.current&&window.clearTimeout(de.current)},[]),y.useEffect(()=>{const ae=window.SpeechRecognition||window.webkitSpeechRecognition;if(!ae){ce(!1);return}const xe=new ae;return xe.continuous=!0,xe.interimResults=!1,xe.onresult=Ve=>{let nt="";for(let Ye=Ve.resultIndex;Ye<Ve.results.length;Ye+=1){const St=Ve.results[Ye];St.isFinal&&(nt+=St[0].transcript)}nt.trim()&&R(Ye=>{const St=nt.trim(),at=Ye?`${Ye}${Ye.endsWith(" ")?"":" "}${St}`:St;return Q(at),at})},xe.onerror=()=>{K(!1),ut.error(h("speechInputFailed"))},xe.onend=()=>{K(!1)},ue.current=xe,()=>{xe.onresult=null,xe.onerror=null,xe.onend=null,xe.stop(),ue.current=null}},[Q,h]);const Z=()=>{w(C),T(v),R(N),M(E)},se=ae=>{if(ae==="auto")return;const xe=[ae,...he.filter(Ve=>Ve!==ae)].slice(0,5);D(xe),localStorage.setItem("recentTranslateLanguages",JSON.stringify(xe))},fe=ae=>ae==="auto"?h("autoDetect"):A.find(Ve=>Ve.code===ae)?.name||ae,be=ae=>{w(ae),se(ae),Y(!1)},Ae=ae=>{T(ae),se(ae),ne(!1)},De=async ae=>{if(ae)try{await navigator.clipboard.writeText(ae),ut.success(h("copied"))}catch{ut.error(h("copyFailed"))}},ft=(ae,xe)=>{if(!ae)return;const Ve=new SpeechSynthesisUtterance(ae);Ve.lang=xe==="auto"?"en-US":xe,window.speechSynthesis.speak(Ve)},it=()=>{R(""),M("")},wn=ae=>{(ae.ctrlKey||ae.metaKey)&&ae.key==="Enter"&&(ae.preventDefault(),X())},on=ae=>{const xe=ae.target.files?.[0];if(!xe)return;const Ve=new FileReader;Ve.onload=nt=>{const Ye=nt.target?.result;typeof Ye=="string"&&R(Ye)},Ve.readAsText(xe)},Qt=()=>{if(!ie){ut.error(h("speechNotSupported"));return}const ae=ue.current;if(!ae){ut.error(h("speechNotSupported"));return}if(re){ae.stop(),K(!1);return}ae.lang=v==="auto"?p.language:v;try{ae.start(),K(!0)}catch{K(!1),ut.error(h("speechInputFailed"))}};return g.jsx(Ar,{className:"shadow-lg h-full flex flex-col",children:g.jsxs(Nr,{className:"pt-1 sm:pt-1 space-y-3 sm:space-y-4 flex-1 flex flex-col",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-3 justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-[280px]",children:[g.jsxs(vd,{open:L,onOpenChange:Y,children:[g.jsx(yd,{asChild:!0,children:g.jsxs(tt,{variant:"outline",className:"w-[110px] sm:w-[140px] justify-between",disabled:i,"aria-label":h("sourceLanguage"),children:[g.jsx("span",{className:"truncate",children:fe(v)}),g.jsx(qs,{className:"h-4 w-4 opacity-50"})]})}),g.jsxs(bd,{className:"w-72 p-2",align:"start",children:[O.length>0&&g.jsx("div",{className:"mb-2",children:g.jsxs(Ad,{type:"single",value:v,onValueChange:ae=>{ae&&be(ae)},variant:"outline",size:"sm",className:"w-full justify-between",children:[g.jsx(Go,{value:"auto",className:"flex-1",children:h("autoDetect")}),O.map(ae=>g.jsx(Go,{value:ae,className:"flex-1",children:fe(ae)},ae))]})}),g.jsxs(wd,{children:[g.jsx(Cd,{placeholder:h("languageSearchPlaceholder"),autoFocus:!0}),g.jsxs(Ed,{children:[g.jsx(Td,{children:h("noResults")}),g.jsx($a,{heading:h("autoDetect"),children:g.jsx(Xa,{value:"auto",onSelect:()=>be("auto"),children:h("autoDetect")})}),U.length>0&&g.jsx($a,{heading:h("languageRecent"),children:U.map(ae=>g.jsx(Xa,{value:`${ae.name} ${ae.code}`,onSelect:()=>be(ae.code),children:ae.name},ae.code))}),g.jsx($a,{heading:h("languageAll"),children:A.map(ae=>g.jsx(Xa,{value:`${ae.name} ${ae.code}`,onSelect:()=>be(ae.code),children:ae.name},ae.code))})]})]})]})]}),g.jsx(tt,{variant:"ghost",size:"icon",onClick:Z,disabled:i||v==="auto",className:"h-9 w-9 flex-shrink-0",children:g.jsx(rR,{className:"h-4 w-4"})}),g.jsxs(vd,{open:J,onOpenChange:ne,children:[g.jsx(yd,{asChild:!0,children:g.jsxs(tt,{variant:"outline",className:"w-[110px] sm:w-[140px] justify-between",disabled:i,"aria-label":h("targetLanguage"),children:[g.jsx("span",{className:"truncate",children:fe(C)}),g.jsx(qs,{className:"h-4 w-4 opacity-50"})]})}),g.jsxs(bd,{className:"w-72 p-2",align:"start",children:[O.length>0&&g.jsx("div",{className:"mb-2",children:g.jsx(Ad,{type:"single",value:C,onValueChange:ae=>{ae&&Ae(ae)},variant:"outline",size:"sm",className:"w-full justify-between",children:O.map(ae=>g.jsx(Go,{value:ae,className:"flex-1",children:fe(ae)},ae))})}),g.jsxs(wd,{children:[g.jsx(Cd,{placeholder:h("languageSearchPlaceholder"),autoFocus:!0}),g.jsxs(Ed,{children:[g.jsx(Td,{children:h("noResults")}),U.length>0&&g.jsx($a,{heading:h("languageRecent"),children:U.map(ae=>g.jsx(Xa,{value:`${ae.name} ${ae.code}`,onSelect:()=>Ae(ae.code),children:ae.name},ae.code))}),g.jsx($a,{heading:h("languageAll"),children:A.map(ae=>g.jsx(Xa,{value:`${ae.name} ${ae.code}`,onSelect:()=>Ae(ae.code),children:ae.name},ae.code))})]})]})]})]})]}),g.jsxs("div",{className:"flex items-center gap-2 justify-end flex-shrink-0 ml-auto sm:ml-0",children:[g.jsx(Cl,{id:`auto-translate-${n}`,checked:G,onCheckedChange:k}),g.jsx(Ey,{htmlFor:`auto-translate-${n}`,className:"text-xs cursor-pointer whitespace-nowrap",children:h("autoTranslate")}),d&&g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:c,className:"text-muted-foreground hover:text-destructive h-8 w-8 ml-2 shrink-0","aria-label":h("closePanel"),children:g.jsx(Gs,{className:"h-4 w-4"})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("closePanel")})})]})]})]}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 sm:gap-4 flex-1",children:[g.jsxs("div",{className:"relative group h-full flex flex-col",children:[g.jsx(Cy,{id:`source-text-${n}`,ref:B,placeholder:h("enterText"),value:E,onChange:ae=>oe(ae.target.value),onKeyDown:wn,className:`${m?"min-h-[200px]":"min-h-[300px]"} h-full resize-none text-base pr-10 pb-10 flex-1`,disabled:z}),E&&g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{variant:"ghost",size:"icon",className:"absolute top-2 right-2 h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",onClick:it,"aria-label":h("clear"),children:g.jsx(Gs,{className:"h-4 w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("clear")})})]}),g.jsx("div",{className:"absolute bottom-2 left-2 text-xs text-muted-foreground pointer-events-none",children:E.length}),g.jsxs("div",{className:"absolute bottom-2 right-2 flex gap-1",children:[g.jsx("input",{type:"file",id:`file-upload-${n}`,className:"hidden",accept:".txt,.md,.json,.js,.ts,.go,.py,.java,.c,.cpp,.h,.hpp",onChange:on}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(Ey,{htmlFor:`file-upload-${n}`,className:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-8 w-8 cursor-pointer","aria-label":h("uploadFile"),children:g.jsx($R,{className:"h-4 w-4"})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("uploadFile")})})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Qt,disabled:z||!ie,"aria-label":h(re?"voiceInputStop":"voiceInputStart"),children:re?g.jsx(AR,{className:"h-4 w-4"}):g.jsx(OR,{className:"h-4 w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:h(re?"voiceInputStop":"voiceInputStart")})})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>ft(E,v),disabled:!E,"aria-label":h("listen"),children:g.jsx(oy,{className:"h-4 w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("listen")})})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>De(E),disabled:!E,"aria-label":h("copy"),children:g.jsx(ry,{className:"h-4 w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("copy")})})]})]})]}),g.jsxs("div",{className:"relative h-full flex flex-col",children:[g.jsx(Cy,{id:`translated-text-${n}`,placeholder:h("translationWillAppear"),value:N,readOnly:!0,className:`${m?"min-h-[200px]":"min-h-[300px]"} h-full resize-none text-base bg-muted pb-10 flex-1`}),g.jsx("div",{className:"absolute bottom-2 left-2 text-xs text-muted-foreground pointer-events-none",children:N.length}),g.jsxs("div",{className:"absolute bottom-2 right-2 flex gap-1",children:[g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>ft(N,C),disabled:!N,"aria-label":h("listen"),children:g.jsx(oy,{className:"h-4 w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("listen")})})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>De(N),disabled:!N,"aria-label":h("copy"),children:g.jsx(ry,{className:"h-4 w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("copy")})})]})]})]})]}),!G&&g.jsx("div",{className:"flex justify-center mt-auto pt-2",children:g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{onClick:()=>X(),disabled:z||i||!E.trim(),className:m?"w-full":"min-w-[200px]",size:"lg",children:z?g.jsxs(g.Fragment,{children:[g.jsx(lj,{className:"mr-2 h-4 w-4"}),h("translating")]}):h("translate")})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("translateShortcut")})})]})})]})})}const Os="translation_history",pj=50;function mj(){const[n,l]=y.useState([]);return y.useEffect(()=>{try{const c=localStorage.getItem(Os);c&&l(JSON.parse(c))}catch(c){console.error("Failed to load history",c)}},[]),{history:n,addToHistory:c=>{const d={...c,id:`${Date.now()}-${Math.random().toString(36).substring(2,11)}`,timestamp:Date.now()};l(h=>{const p=h.filter(x=>!(x.sourceText===c.sourceText&&x.from===c.from&&x.to===c.to)),m=[d,...p].slice(0,pj);return localStorage.setItem(Os,JSON.stringify(m)),m})},clearHistory:()=>{l([]),localStorage.removeItem(Os)},deleteItem:c=>{l(d=>{const h=d.filter(p=>p.id!==c);return localStorage.setItem(Os,JSON.stringify(h)),h})}}}function gj(n){const l=vj(n),r=y.forwardRef((i,s)=>{const{children:c,...d}=i,h=y.Children.toArray(c),p=h.find(bj);if(p){const m=p.props.children,x=h.map(v=>v===p?y.Children.count(m)>1?y.Children.only(null):y.isValidElement(m)?m.props.children:null:v);return g.jsx(l,{...d,ref:s,children:y.isValidElement(m)?y.cloneElement(m,void 0,x):null})}return g.jsx(l,{...d,ref:s,children:c})});return r.displayName=`${n}.Slot`,r}function vj(n){const l=y.forwardRef((r,i)=>{const{children:s,...c}=r;if(y.isValidElement(s)){const d=Sj(s),h=xj(c,s.props);return s.type!==y.Fragment&&(h.ref=i?bn(i,d):d),y.cloneElement(s,h)}return y.Children.count(s)>1?y.Children.only(null):null});return l.displayName=`${n}.SlotClone`,l}var yj=Symbol("radix.slottable");function bj(n){return y.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===yj}function xj(n,l){const r={...l};for(const i in l){const s=n[i],c=l[i];/^on[A-Z]/.test(i)?s&&c?r[i]=(...h)=>{const p=c(...h);return s(...h),p}:s&&(r[i]=s):i==="style"?r[i]={...s,...c}:i==="className"&&(r[i]=[s,c].filter(Boolean).join(" "))}return{...n,...r}}function Sj(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?n.props.ref:n.props.ref||n.ref)}var wj=[" ","Enter","ArrowUp","ArrowDown"],Cj=[" ","Enter"],Nl="Select",[gc,vc,Ej]=Lb(Nl),[Vr]=Gn(Nl,[Ej,Br]),yc=Br(),[Tj,Ja]=Vr(Nl),[Rj,Aj]=Vr(Nl),vx=n=>{const{__scopeSelect:l,children:r,open:i,defaultOpen:s,onOpenChange:c,value:d,defaultValue:h,onValueChange:p,dir:m,name:x,autoComplete:v,disabled:w,required:C,form:T}=n,E=yc(l),[R,N]=y.useState(null),[M,z]=y.useState(null),[P,G]=y.useState(!1),k=dc(m),[L,Y]=qn({prop:i,defaultProp:s??!1,onChange:c,caller:Nl}),[J,ne]=qn({prop:d,defaultProp:h,onChange:p,caller:Nl}),re=y.useRef(null),K=R?T||!!R.closest("form"):!0,[ie,ce]=y.useState(new Set),he=Array.from(ie).map(D=>D.props.value).join(";");return g.jsx(Gd,{...E,children:g.jsxs(Tj,{required:C,scope:l,trigger:R,onTriggerChange:N,valueNode:M,onValueNodeChange:z,valueNodeHasChildren:P,onValueNodeHasChildrenChange:G,contentId:Ut(),value:J,onValueChange:ne,open:L,onOpenChange:Y,dir:k,triggerPointerDownPosRef:re,disabled:w,children:[g.jsx(gc.Provider,{scope:l,children:g.jsx(Rj,{scope:n.__scopeSelect,onNativeOptionAdd:y.useCallback(D=>{ce($=>new Set($).add(D))},[]),onNativeOptionRemove:y.useCallback(D=>{ce($=>{const B=new Set($);return B.delete(D),B})},[]),children:r})}),K?g.jsxs(Bx,{"aria-hidden":!0,required:C,tabIndex:-1,name:x,autoComplete:v,value:J,onChange:D=>ne(D.target.value),disabled:w,form:T,children:[J===void 0?g.jsx("option",{value:""}):null,Array.from(ie)]},he):null]})})};vx.displayName=Nl;var yx="SelectTrigger",bx=y.forwardRef((n,l)=>{const{__scopeSelect:r,disabled:i=!1,...s}=n,c=yc(r),d=Ja(yx,r),h=d.disabled||i,p=He(l,d.onTriggerChange),m=vc(r),x=y.useRef("touch"),[v,w,C]=Vx(E=>{const R=m().filter(z=>!z.disabled),N=R.find(z=>z.value===d.value),M=Ix(R,E,N);M!==void 0&&d.onValueChange(M.value)}),T=E=>{h||(d.onOpenChange(!0),C()),E&&(d.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return g.jsx(ac,{asChild:!0,...c,children:g.jsx(Ce.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":Px(d.value)?"":void 0,...s,ref:p,onClick:we(s.onClick,E=>{E.currentTarget.focus(),x.current!=="mouse"&&T(E)}),onPointerDown:we(s.onPointerDown,E=>{x.current=E.pointerType;const R=E.target;R.hasPointerCapture(E.pointerId)&&R.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(T(E),E.preventDefault())}),onKeyDown:we(s.onKeyDown,E=>{const R=v.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&w(E.key),!(R&&E.key===" ")&&wj.includes(E.key)&&(T(),E.preventDefault())})})})});bx.displayName=yx;var xx="SelectValue",Sx=y.forwardRef((n,l)=>{const{__scopeSelect:r,className:i,style:s,children:c,placeholder:d="",...h}=n,p=Ja(xx,r),{onValueNodeHasChildrenChange:m}=p,x=c!==void 0,v=He(l,p.onValueNodeChange);return jt(()=>{m(x)},[m,x]),g.jsx(Ce.span,{...h,ref:v,style:{pointerEvents:"none"},children:Px(p.value)?g.jsx(g.Fragment,{children:d}):c})});Sx.displayName=xx;var Nj="SelectIcon",wx=y.forwardRef((n,l)=>{const{__scopeSelect:r,children:i,...s}=n;return g.jsx(Ce.span,{"aria-hidden":!0,...s,ref:l,children:i||"▼"})});wx.displayName=Nj;var Oj="SelectPortal",Cx=n=>g.jsx(ei,{asChild:!0,...n});Cx.displayName=Oj;var Ol="SelectContent",Ex=y.forwardRef((n,l)=>{const r=Ja(Ol,n.__scopeSelect),[i,s]=y.useState();if(jt(()=>{s(new DocumentFragment)},[]),!r.open){const c=i;return c?Zo.createPortal(g.jsx(Tx,{scope:n.__scopeSelect,children:g.jsx(gc.Slot,{scope:n.__scopeSelect,children:g.jsx("div",{children:n.children})})}),c):null}return g.jsx(Rx,{...n,ref:l})});Ex.displayName=Ol;var Nn=10,[Tx,el]=Vr(Ol),jj="SelectContentImpl",Dj=gj("SelectContent.RemoveScroll"),Rx=y.forwardRef((n,l)=>{const{__scopeSelect:r,position:i="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:c,onPointerDownOutside:d,side:h,sideOffset:p,align:m,alignOffset:x,arrowPadding:v,collisionBoundary:w,collisionPadding:C,sticky:T,hideWhenDetached:E,avoidCollisions:R,...N}=n,M=Ja(Ol,r),[z,P]=y.useState(null),[G,k]=y.useState(null),L=He(l,Z=>P(Z)),[Y,J]=y.useState(null),[ne,re]=y.useState(null),K=vc(r),[ie,ce]=y.useState(!1),he=y.useRef(!1);y.useEffect(()=>{if(z)return Zd(z)},[z]),Qd();const D=y.useCallback(Z=>{const[se,...fe]=K().map(De=>De.ref.current),[be]=fe.slice(-1),Ae=document.activeElement;for(const De of Z)if(De===Ae||(De?.scrollIntoView({block:"nearest"}),De===se&&G&&(G.scrollTop=0),De===be&&G&&(G.scrollTop=G.scrollHeight),De?.focus(),document.activeElement!==Ae))return},[K,G]),$=y.useCallback(()=>D([Y,z]),[D,Y,z]);y.useEffect(()=>{ie&&$()},[ie,$]);const{onOpenChange:B,triggerPointerDownPosRef:ue}=M;y.useEffect(()=>{if(z){let Z={x:0,y:0};const se=be=>{Z={x:Math.abs(Math.round(be.pageX)-(ue.current?.x??0)),y:Math.abs(Math.round(be.pageY)-(ue.current?.y??0))}},fe=be=>{Z.x<=10&&Z.y<=10?be.preventDefault():z.contains(be.target)||B(!1),document.removeEventListener("pointermove",se),ue.current=null};return ue.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",fe,{capture:!0})}}},[z,B,ue]),y.useEffect(()=>{const Z=()=>B(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[B]);const[de,A]=Vx(Z=>{const se=K().filter(Ae=>!Ae.disabled),fe=se.find(Ae=>Ae.ref.current===document.activeElement),be=Ix(se,Z,fe);be&&setTimeout(()=>be.ref.current.focus())}),O=y.useCallback((Z,se,fe)=>{const be=!he.current&&!fe;(M.value!==void 0&&M.value===se||be)&&(J(Z),be&&(he.current=!0))},[M.value]),U=y.useCallback(()=>z?.focus(),[z]),X=y.useCallback((Z,se,fe)=>{const be=!he.current&&!fe;(M.value!==void 0&&M.value===se||be)&&re(Z)},[M.value]),Q=i==="popper"?Od:Ax,oe=Q===Od?{side:h,sideOffset:p,align:m,alignOffset:x,arrowPadding:v,collisionBoundary:w,collisionPadding:C,sticky:T,hideWhenDetached:E,avoidCollisions:R}:{};return g.jsx(Tx,{scope:r,content:z,viewport:G,onViewportChange:k,itemRefCallback:O,selectedItem:Y,onItemLeave:U,itemTextRefCallback:X,focusSelectedItem:$,selectedItemText:ne,position:i,isPositioned:ie,searchRef:de,children:g.jsx(sc,{as:Dj,allowPinchZoom:!0,children:g.jsx(oc,{asChild:!0,trapped:M.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:we(s,Z=>{M.trigger?.focus({preventScroll:!0}),Z.preventDefault()}),children:g.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>M.onOpenChange(!1),children:g.jsx(Q,{role:"listbox",id:M.contentId,"data-state":M.open?"open":"closed",dir:M.dir,onContextMenu:Z=>Z.preventDefault(),...N,...oe,onPlaced:()=>ce(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:we(N.onKeyDown,Z=>{const se=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!se&&Z.key.length===1&&A(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let be=K().filter(Ae=>!Ae.disabled).map(Ae=>Ae.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(be=be.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const Ae=Z.target,De=be.indexOf(Ae);be=be.slice(De+1)}setTimeout(()=>D(be)),Z.preventDefault()}})})})})})})});Rx.displayName=jj;var _j="SelectItemAlignedPosition",Ax=y.forwardRef((n,l)=>{const{__scopeSelect:r,onPlaced:i,...s}=n,c=Ja(Ol,r),d=el(Ol,r),[h,p]=y.useState(null),[m,x]=y.useState(null),v=He(l,L=>x(L)),w=vc(r),C=y.useRef(!1),T=y.useRef(!0),{viewport:E,selectedItem:R,selectedItemText:N,focusSelectedItem:M}=d,z=y.useCallback(()=>{if(c.trigger&&c.valueNode&&h&&m&&E&&R&&N){const L=c.trigger.getBoundingClientRect(),Y=m.getBoundingClientRect(),J=c.valueNode.getBoundingClientRect(),ne=N.getBoundingClientRect();if(c.dir!=="rtl"){const Ae=ne.left-Y.left,De=J.left-Ae,ft=L.left-De,it=L.width+ft,wn=Math.max(it,Y.width),on=window.innerWidth-Nn,Qt=Nd(De,[Nn,Math.max(Nn,on-wn)]);h.style.minWidth=it+"px",h.style.left=Qt+"px"}else{const Ae=Y.right-ne.right,De=window.innerWidth-J.right-Ae,ft=window.innerWidth-L.right-De,it=L.width+ft,wn=Math.max(it,Y.width),on=window.innerWidth-Nn,Qt=Nd(De,[Nn,Math.max(Nn,on-wn)]);h.style.minWidth=it+"px",h.style.right=Qt+"px"}const re=w(),K=window.innerHeight-Nn*2,ie=E.scrollHeight,ce=window.getComputedStyle(m),he=parseInt(ce.borderTopWidth,10),D=parseInt(ce.paddingTop,10),$=parseInt(ce.borderBottomWidth,10),B=parseInt(ce.paddingBottom,10),ue=he+D+ie+B+$,de=Math.min(R.offsetHeight*5,ue),A=window.getComputedStyle(E),O=parseInt(A.paddingTop,10),U=parseInt(A.paddingBottom,10),X=L.top+L.height/2-Nn,Q=K-X,oe=R.offsetHeight/2,Z=R.offsetTop+oe,se=he+D+Z,fe=ue-se;if(se<=X){const Ae=re.length>0&&R===re[re.length-1].ref.current;h.style.bottom="0px";const De=m.clientHeight-E.offsetTop-E.offsetHeight,ft=Math.max(Q,oe+(Ae?U:0)+De+$),it=se+ft;h.style.height=it+"px"}else{const Ae=re.length>0&&R===re[0].ref.current;h.style.top="0px";const ft=Math.max(X,he+E.offsetTop+(Ae?O:0)+oe)+fe;h.style.height=ft+"px",E.scrollTop=se-X+E.offsetTop}h.style.margin=`${Nn}px 0`,h.style.minHeight=de+"px",h.style.maxHeight=K+"px",i?.(),requestAnimationFrame(()=>C.current=!0)}},[w,c.trigger,c.valueNode,h,m,E,R,N,c.dir,i]);jt(()=>z(),[z]);const[P,G]=y.useState();jt(()=>{m&&G(window.getComputedStyle(m).zIndex)},[m]);const k=y.useCallback(L=>{L&&T.current===!0&&(z(),M?.(),T.current=!1)},[z,M]);return g.jsx(zj,{scope:r,contentWrapper:h,shouldExpandOnScrollRef:C,onScrollButtonChange:k,children:g.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:g.jsx(Ce.div,{...s,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Ax.displayName=_j;var Mj="SelectPopperPosition",Od=y.forwardRef((n,l)=>{const{__scopeSelect:r,align:i="start",collisionPadding:s=Nn,...c}=n,d=yc(r);return g.jsx($d,{...d,...c,ref:l,align:i,collisionPadding:s,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Od.displayName=Mj;var[zj,fh]=Vr(Ol,{}),jd="SelectViewport",Nx=y.forwardRef((n,l)=>{const{__scopeSelect:r,nonce:i,...s}=n,c=el(jd,r),d=fh(jd,r),h=He(l,c.onViewportChange),p=y.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),g.jsx(gc.Slot,{scope:r,children:g.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:we(s.onScroll,m=>{const x=m.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=d;if(w?.current&&v){const C=Math.abs(p.current-x.scrollTop);if(C>0){const T=window.innerHeight-Nn*2,E=parseFloat(v.style.minHeight),R=parseFloat(v.style.height),N=Math.max(E,R);if(N<T){const M=N+C,z=Math.min(T,M),P=M-z;v.style.height=z+"px",v.style.bottom==="0px"&&(x.scrollTop=P>0?P:0,v.style.justifyContent="flex-end")}}}p.current=x.scrollTop})})})]})});Nx.displayName=jd;var Ox="SelectGroup",[Lj,kj]=Vr(Ox),Uj=y.forwardRef((n,l)=>{const{__scopeSelect:r,...i}=n,s=Ut();return g.jsx(Lj,{scope:r,id:s,children:g.jsx(Ce.div,{role:"group","aria-labelledby":s,...i,ref:l})})});Uj.displayName=Ox;var jx="SelectLabel",Hj=y.forwardRef((n,l)=>{const{__scopeSelect:r,...i}=n,s=kj(jx,r);return g.jsx(Ce.div,{id:s.id,...i,ref:l})});Hj.displayName=jx;var Qs="SelectItem",[Bj,Dx]=Vr(Qs),_x=y.forwardRef((n,l)=>{const{__scopeSelect:r,value:i,disabled:s=!1,textValue:c,...d}=n,h=Ja(Qs,r),p=el(Qs,r),m=h.value===i,[x,v]=y.useState(c??""),[w,C]=y.useState(!1),T=He(l,M=>p.itemRefCallback?.(M,i,s)),E=Ut(),R=y.useRef("touch"),N=()=>{s||(h.onValueChange(i),h.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(Bj,{scope:r,value:i,disabled:s,textId:E,isSelected:m,onItemTextChange:y.useCallback(M=>{v(z=>z||(M?.textContent??"").trim())},[]),children:g.jsx(gc.ItemSlot,{scope:r,value:i,disabled:s,textValue:x,children:g.jsx(Ce.div,{role:"option","aria-labelledby":E,"data-highlighted":w?"":void 0,"aria-selected":m&&w,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...d,ref:T,onFocus:we(d.onFocus,()=>C(!0)),onBlur:we(d.onBlur,()=>C(!1)),onClick:we(d.onClick,()=>{R.current!=="mouse"&&N()}),onPointerUp:we(d.onPointerUp,()=>{R.current==="mouse"&&N()}),onPointerDown:we(d.onPointerDown,M=>{R.current=M.pointerType}),onPointerMove:we(d.onPointerMove,M=>{R.current=M.pointerType,s?p.onItemLeave?.():R.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(d.onPointerLeave,M=>{M.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:we(d.onKeyDown,M=>{p.searchRef?.current!==""&&M.key===" "||(Cj.includes(M.key)&&N(),M.key===" "&&M.preventDefault())})})})})});_x.displayName=Qs;var Io="SelectItemText",Mx=y.forwardRef((n,l)=>{const{__scopeSelect:r,className:i,style:s,...c}=n,d=Ja(Io,r),h=el(Io,r),p=Dx(Io,r),m=Aj(Io,r),[x,v]=y.useState(null),w=He(l,N=>v(N),p.onItemTextChange,N=>h.itemTextRefCallback?.(N,p.value,p.disabled)),C=x?.textContent,T=y.useMemo(()=>g.jsx("option",{value:p.value,disabled:p.disabled,children:C},p.value),[p.disabled,p.value,C]),{onNativeOptionAdd:E,onNativeOptionRemove:R}=m;return jt(()=>(E(T),()=>R(T)),[E,R,T]),g.jsxs(g.Fragment,{children:[g.jsx(Ce.span,{id:p.textId,...c,ref:w}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren?Zo.createPortal(c.children,d.valueNode):null]})});Mx.displayName=Io;var zx="SelectItemIndicator",Lx=y.forwardRef((n,l)=>{const{__scopeSelect:r,...i}=n;return Dx(zx,r).isSelected?g.jsx(Ce.span,{"aria-hidden":!0,...i,ref:l}):null});Lx.displayName=zx;var Dd="SelectScrollUpButton",kx=y.forwardRef((n,l)=>{const r=el(Dd,n.__scopeSelect),i=fh(Dd,n.__scopeSelect),[s,c]=y.useState(!1),d=He(l,i.onScrollButtonChange);return jt(()=>{if(r.viewport&&r.isPositioned){let h=function(){const m=p.scrollTop>0;c(m)};const p=r.viewport;return h(),p.addEventListener("scroll",h),()=>p.removeEventListener("scroll",h)}},[r.viewport,r.isPositioned]),s?g.jsx(Hx,{...n,ref:d,onAutoScroll:()=>{const{viewport:h,selectedItem:p}=r;h&&p&&(h.scrollTop=h.scrollTop-p.offsetHeight)}}):null});kx.displayName=Dd;var _d="SelectScrollDownButton",Ux=y.forwardRef((n,l)=>{const r=el(_d,n.__scopeSelect),i=fh(_d,n.__scopeSelect),[s,c]=y.useState(!1),d=He(l,i.onScrollButtonChange);return jt(()=>{if(r.viewport&&r.isPositioned){let h=function(){const m=p.scrollHeight-p.clientHeight,x=Math.ceil(p.scrollTop)<m;c(x)};const p=r.viewport;return h(),p.addEventListener("scroll",h),()=>p.removeEventListener("scroll",h)}},[r.viewport,r.isPositioned]),s?g.jsx(Hx,{...n,ref:d,onAutoScroll:()=>{const{viewport:h,selectedItem:p}=r;h&&p&&(h.scrollTop=h.scrollTop+p.offsetHeight)}}):null});Ux.displayName=_d;var Hx=y.forwardRef((n,l)=>{const{__scopeSelect:r,onAutoScroll:i,...s}=n,c=el("SelectScrollButton",r),d=y.useRef(null),h=vc(r),p=y.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return y.useEffect(()=>()=>p(),[p]),jt(()=>{h().find(x=>x.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[h]),g.jsx(Ce.div,{"aria-hidden":!0,...s,ref:l,style:{flexShrink:0,...s.style},onPointerDown:we(s.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(i,50))}),onPointerMove:we(s.onPointerMove,()=>{c.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(i,50))}),onPointerLeave:we(s.onPointerLeave,()=>{p()})})}),Pj="SelectSeparator",Vj=y.forwardRef((n,l)=>{const{__scopeSelect:r,...i}=n;return g.jsx(Ce.div,{"aria-hidden":!0,...i,ref:l})});Vj.displayName=Pj;var Md="SelectArrow",Ij=y.forwardRef((n,l)=>{const{__scopeSelect:r,...i}=n,s=yc(r),c=Ja(Md,r),d=el(Md,r);return c.open&&d.position==="popper"?g.jsx(Xd,{...s,...i,ref:l}):null});Ij.displayName=Md;var Yj="SelectBubbleInput",Bx=y.forwardRef(({__scopeSelect:n,value:l,...r},i)=>{const s=y.useRef(null),c=He(i,s),d=fx(l);return y.useEffect(()=>{const h=s.current;if(!h)return;const p=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==l&&x){const v=new Event("change",{bubbles:!0});x.call(h,l),h.dispatchEvent(v)}},[d,l]),g.jsx(Ce.select,{...r,style:{...N0,...r.style},ref:c,defaultValue:l})});Bx.displayName=Yj;function Px(n){return n===""||n===void 0}function Vx(n){const l=kt(n),r=y.useRef(""),i=y.useRef(0),s=y.useCallback(d=>{const h=r.current+d;l(h),(function p(m){r.current=m,window.clearTimeout(i.current),m!==""&&(i.current=window.setTimeout(()=>p(""),1e3))})(h)},[l]),c=y.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,s,c]}function Ix(n,l,r){const s=l.length>1&&Array.from(l).every(m=>m===l[0])?l[0]:l,c=r?n.indexOf(r):-1;let d=qj(n,Math.max(c,0));s.length===1&&(d=d.filter(m=>m!==r));const p=d.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return p!==r?p:void 0}function qj(n,l){return n.map((r,i)=>n[(l+i)%n.length])}var Gj=vx,$j=bx,Xj=Sx,Fj=wx,Kj=Cx,Qj=Ex,Zj=Nx,Wj=_x,Jj=Mx,eD=Lx,tD=kx,nD=Ux;function Ty({...n}){return g.jsx(Gj,{"data-slot":"select",...n})}function Ry({...n}){return g.jsx(Xj,{"data-slot":"select-value",...n})}function Ay({className:n,size:l="default",children:r,...i}){return g.jsxs($j,{"data-slot":"select-trigger","data-size":l,className:je("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...i,children:[r,g.jsx(Fj,{asChild:!0,children:g.jsx(qs,{className:"size-4 opacity-50"})})]})}function Ny({className:n,children:l,position:r="popper",align:i="center",...s}){return g.jsx(Kj,{children:g.jsxs(Qj,{"data-slot":"select-content",className:je("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:r,align:i,...s,children:[g.jsx(aD,{}),g.jsx(Zj,{className:je("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:l}),g.jsx(lD,{})]})})}function qa({className:n,children:l,...r}){return g.jsxs(Wj,{"data-slot":"select-item",className:je("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),...r,children:[g.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:g.jsx(eD,{children:g.jsx(_s,{className:"size-4"})})}),g.jsx(Jj,{children:l})]})}function aD({className:n,...l}){return g.jsx(tD,{"data-slot":"select-scroll-up-button",className:je("flex cursor-default items-center justify-center py-1",n),...l,children:g.jsx(fR,{className:"size-4"})})}function lD({className:n,...l}){return g.jsx(nD,{"data-slot":"select-scroll-down-button",className:je("flex cursor-default items-center justify-center py-1",n),...l,children:g.jsx(qs,{className:"size-4"})})}var rD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oD=rD.reduce((n,l)=>{const r=Ld(`Primitive.${l}`),i=y.forwardRef((s,c)=>{const{asChild:d,...h}=s,p=d?r:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(p,{...h,ref:c})});return i.displayName=`Primitive.${l}`,{...n,[l]:i}},{}),iD="Separator",Oy="horizontal",sD=["horizontal","vertical"],Yx=y.forwardRef((n,l)=>{const{decorative:r,orientation:i=Oy,...s}=n,c=cD(i)?i:Oy,h=r?{role:"none"}:{"aria-orientation":c==="vertical"?c:void 0,role:"separator"};return g.jsx(oD.div,{"data-orientation":c,...h,...s,ref:l})});Yx.displayName=iD;function cD(n){return sD.includes(n)}var uD=Yx;function fD({className:n,orientation:l="horizontal",decorative:r=!0,...i}){return g.jsx(uD,{"data-slot":"separator",decorative:r,orientation:l,className:je("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),...i})}const dD=()=>!!window.mtranDesktop?.isDesktop;async function hD(){return window.mtranDesktop?window.mtranDesktop.getConfig():null}async function pD(n){return window.mtranDesktop?window.mtranDesktop.applyConfig(n):null}async function mD(){return window.mtranDesktop?window.mtranDesktop.resetConfig():null}async function gD(){return window.mtranDesktop?window.mtranDesktop.restartServer():null}async function bc(n,l){const r=await fetch(`/ui/api/settings${n}`,{method:l?"POST":"GET",headers:l?{"Content-Type":"application/json"}:void 0,body:l?JSON.stringify(l):void 0});if(!r.ok)throw new Error(`Request failed: ${r.status}`);return r.json()}async function vD(){return bc("")}async function yD(n){return bc("/apply",{config:n})}async function bD(){return bc("/reset",{})}async function xD(){return bc("/restart",{})}function js(n){return{locale:n.locale,server:{host:n.server.host,port:String(n.server.port),logLevel:n.server.logLevel,enableWebUI:n.server.enableWebUI,enableOfflineMode:n.server.enableOfflineMode,workerIdleTimeout:String(n.server.workerIdleTimeout),workersPerLanguage:String(n.server.workersPerLanguage),apiToken:n.server.apiToken,logDir:n.server.logDir,logToFile:n.server.logToFile,logConsole:n.server.logConsole,logRequests:n.server.logRequests,maxLengthBreak:String(n.server.maxLengthBreak),checkUpdate:n.server.checkUpdate,cacheSize:String(n.server.cacheSize),modelDir:n.server.modelDir,configDir:n.server.configDir}}}function Vo(n,l){const r=Number(n);return Number.isFinite(r)?r:l}function SD(){const{t:n}=Qo(),l=dD(),r=l?hD:vD,i=l?pD:yD,s=l?mD:bD,c=l?gD:xD,[d,h]=y.useState(null),[p,m]=y.useState(null),[x,v]=y.useState(""),[w,C]=y.useState(""),[T,E]=y.useState(!0),[R,N]=y.useState(!1);y.useEffect(()=>{r().then(k=>{k&&(h(k.config),m(js(k.config)),v(k.status),C(k.version))}).catch(()=>{ut.error(n("loadingConfigFailed"))}).finally(()=>E(!1))},[r,n]);const M=y.useMemo(()=>x?n(x==="running"?"serverStatusRunning":"serverStatusStopped"):"",[x,n]),z=async()=>{if(!p||!d)return;N(!0);const k={locale:p.locale,server:{...d.server,host:p.server.host,port:Vo(p.server.port,d.server.port),logLevel:p.server.logLevel,enableWebUI:p.server.enableWebUI,enableOfflineMode:p.server.enableOfflineMode,workerIdleTimeout:Vo(p.server.workerIdleTimeout,d.server.workerIdleTimeout),workersPerLanguage:Vo(p.server.workersPerLanguage,d.server.workersPerLanguage),apiToken:p.server.apiToken,logDir:p.server.logDir,logToFile:p.server.logToFile,logConsole:p.server.logConsole,logRequests:p.server.logRequests,maxLengthBreak:Vo(p.server.maxLengthBreak,d.server.maxLengthBreak),checkUpdate:p.server.checkUpdate,cacheSize:Vo(p.server.cacheSize,d.server.cacheSize),modelDir:p.server.modelDir,configDir:p.server.configDir}};try{const L=await i(k);L&&(h(L.config),m(js(L.config)),v(L.status),C(L.version),ut.success(n("settingsApplied")))}catch{ut.error(n("settingsApplyFailed"))}finally{N(!1)}},P=async()=>{N(!0);try{const k=await c();k&&(h(k.config),m(js(k.config)),v(k.status),C(k.version),ut.success(n("serverRestarted")))}catch{ut.error(n("serverRestartFailed"))}finally{N(!1)}},G=async()=>{N(!0);try{const k=await s();k&&(h(k.config),m(js(k.config)),v(k.status),C(k.version),ut.success(n("settingsReset")))}catch{ut.error(n("settingsResetFailed"))}finally{N(!1)}};return T||!p||!d?g.jsx("div",{className:"min-h-screen bg-background p-6",children:g.jsx("div",{className:"mx-auto max-w-3xl text-muted-foreground",children:n("loadingConfig")})}):g.jsx("div",{className:"min-h-screen bg-background p-3 sm:p-4 md:p-6",children:g.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-xl font-semibold text-foreground",children:n("desktopSettings")}),g.jsx("p",{className:"text-xs text-muted-foreground",children:n("desktopSettingsDesc")})]}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[g.jsxs("span",{children:[n("serverStatus"),": ",M]}),w&&g.jsxs("span",{children:[n("version"),": v",w]})]})]}),g.jsxs(Ar,{className:"gap-4 py-4",children:[g.jsx(Bo,{className:"px-4 pb-3",children:g.jsx(Po,{children:n("generalSettings")})}),g.jsxs(Nr,{className:"space-y-3 px-4",children:[g.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("host")}),g.jsx(yn,{value:p.server.host,onChange:k=>m({...p,server:{...p.server,host:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("port")}),g.jsx(yn,{value:p.server.port,onChange:k=>m({...p,server:{...p.server,port:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("logLevel")}),g.jsxs(Ty,{value:p.server.logLevel,onValueChange:k=>m({...p,server:{...p.server,logLevel:k}}),children:[g.jsx(Ay,{children:g.jsx(Ry,{})}),g.jsxs(Ny,{children:[g.jsx(qa,{value:"debug",children:"debug"}),g.jsx(qa,{value:"info",children:"info"}),g.jsx(qa,{value:"warn",children:"warn"}),g.jsx(qa,{value:"error",children:"error"})]})]})]}),l&&g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("locale")}),g.jsxs(Ty,{value:p.locale,onValueChange:k=>m({...p,locale:k}),children:[g.jsx(Ay,{children:g.jsx(Ry,{})}),g.jsxs(Ny,{children:[g.jsx(qa,{value:"system",children:n("system")}),g.jsx(qa,{value:"en",children:"English"}),g.jsx(qa,{value:"zh",children:"中文"}),g.jsx(qa,{value:"ja",children:"日本語"})]})]})]})]}),g.jsx(fD,{}),g.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[g.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border p-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:n("enableWebUI")}),g.jsx("div",{className:"text-xs text-muted-foreground",children:n("enableWebUIDesc")})]}),g.jsx(Cl,{checked:p.server.enableWebUI,onCheckedChange:k=>m({...p,server:{...p.server,enableWebUI:k}})})]}),g.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border p-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:n("enableOfflineMode")}),g.jsx("div",{className:"text-xs text-muted-foreground",children:n("enableOfflineModeDesc")})]}),g.jsx(Cl,{checked:p.server.enableOfflineMode,onCheckedChange:k=>m({...p,server:{...p.server,enableOfflineMode:k}})})]}),g.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border p-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:n("checkUpdate")}),g.jsx("div",{className:"text-xs text-muted-foreground",children:n("checkUpdateDesc")})]}),g.jsx(Cl,{checked:p.server.checkUpdate,onCheckedChange:k=>m({...p,server:{...p.server,checkUpdate:k}})})]})]})]})]}),g.jsxs(Ar,{className:"gap-4 py-4",children:[g.jsx(Bo,{className:"px-4 pb-3",children:g.jsx(Po,{children:n("storageSettings")})}),g.jsx(Nr,{className:"space-y-3 px-4",children:g.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("modelDir")}),g.jsx(yn,{value:p.server.modelDir,onChange:k=>m({...p,server:{...p.server,modelDir:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("configDir")}),g.jsx(yn,{value:p.server.configDir,onChange:k=>m({...p,server:{...p.server,configDir:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("logDir")}),g.jsx(yn,{value:p.server.logDir,onChange:k=>m({...p,server:{...p.server,logDir:k.target.value}})})]})]})})]}),g.jsxs(Ar,{className:"gap-4 py-4",children:[g.jsx(Bo,{className:"px-4 pb-3",children:g.jsx(Po,{children:n("securitySettings")})}),g.jsx(Nr,{className:"space-y-3 px-4",children:g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("apiToken")}),g.jsx(yn,{value:p.server.apiToken,onChange:k=>m({...p,server:{...p.server,apiToken:k.target.value}})})]})})]}),g.jsxs(Ar,{className:"gap-4 py-4",children:[g.jsx(Bo,{className:"px-4 pb-3",children:g.jsx(Po,{children:n("performanceSettings")})}),g.jsx(Nr,{className:"space-y-3 px-4",children:g.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("workerIdleTimeout")}),g.jsx(yn,{value:p.server.workerIdleTimeout,onChange:k=>m({...p,server:{...p.server,workerIdleTimeout:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("workersPerLanguage")}),g.jsx(yn,{value:p.server.workersPerLanguage,onChange:k=>m({...p,server:{...p.server,workersPerLanguage:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("maxLengthBreak")}),g.jsx(yn,{value:p.server.maxLengthBreak,onChange:k=>m({...p,server:{...p.server,maxLengthBreak:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("cacheSize")}),g.jsx(yn,{value:p.server.cacheSize,onChange:k=>m({...p,server:{...p.server,cacheSize:k.target.value}})})]})]})})]}),g.jsxs(Ar,{className:"gap-4 py-4",children:[g.jsx(Bo,{className:"px-4 pb-3",children:g.jsx(Po,{children:n("loggingSettings")})}),g.jsx(Nr,{className:"space-y-3 px-4",children:g.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[g.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border p-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:n("logToFile")}),g.jsx("div",{className:"text-xs text-muted-foreground",children:n("logToFileDesc")})]}),g.jsx(Cl,{checked:p.server.logToFile,onCheckedChange:k=>m({...p,server:{...p.server,logToFile:k}})})]}),g.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border p-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:n("logConsole")}),g.jsx("div",{className:"text-xs text-muted-foreground",children:n("logConsoleDesc")})]}),g.jsx(Cl,{checked:p.server.logConsole,onCheckedChange:k=>m({...p,server:{...p.server,logConsole:k}})})]}),g.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border p-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:n("logRequests")}),g.jsx("div",{className:"text-xs text-muted-foreground",children:n("logRequestsDesc")})]}),g.jsx(Cl,{checked:p.server.logRequests,onCheckedChange:k=>m({...p,server:{...p.server,logRequests:k}})})]})]})})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(tt,{variant:"outline",onClick:()=>window.location.href="/ui/",children:n("backToMain")}),g.jsxs("div",{className:"flex flex-wrap gap-2",children:[g.jsx(tt,{variant:"outline",onClick:G,disabled:R,children:n("resetDefaults")}),g.jsx(tt,{variant:"outline",onClick:P,disabled:R,children:n("restart")}),g.jsx(tt,{onClick:z,disabled:R,children:n(R?"saving":"apply")})]})]})]})})}function wD(n){return n.replace(/\/+$/,"").endsWith("/settings")?"settings":"main"}function CD(){const{t:n}=Qo(),[l,r]=y.useState([]),[i,s]=y.useState(!0),[c,d]=y.useState(()=>localStorage.getItem("widescreen")==="true"),[h,p]=y.useState(!1),[m,x]=y.useState(!1),[v,w]=y.useState(""),[C,T]=y.useState(()=>{const L=localStorage.getItem("translationPanels");if(L)try{const Y=JSON.parse(L);if(Array.isArray(Y)&&Y.length>0)return Y}catch(Y){console.error("Failed to parse saved panels",Y)}return["panel-"+Date.now()]}),{history:E,addToHistory:R,clearHistory:N,deleteItem:M}=mj(),z=async()=>{try{const L=await fetch("/version");if(L.ok){const Y=await L.json();Y.version&&w(Y.version)}}catch(L){console.error("Failed to fetch version:",L)}},P=y.useCallback(async()=>{try{const L={},Y=localStorage.getItem("apiToken");Y&&(L.Authorization=`Bearer ${Y}`);const J=await fetch("/languages",{headers:L});if(J.ok){const ne=await J.json();r(["auto",...ne.languages||[]])}else if(J.status===401)p(!0),ut.error(n("apiTokenPlaceholder"));else throw new Error("Failed to fetch languages")}catch(L){console.error("Error fetching languages:",L),ut.error(n("failedToLoadLanguages"))}finally{s(!1)}},[n]);y.useEffect(()=>{localStorage.setItem("widescreen",String(c))},[c]),y.useEffect(()=>{localStorage.setItem("translationPanels",JSON.stringify(C))},[C]),y.useEffect(()=>{const Y=new URLSearchParams(window.location.search).get("token");Y&&localStorage.setItem("apiToken",Y),P(),z()},[P]);const G=()=>{T(L=>[...L,"panel-"+Date.now()])},k=L=>{C.length<=1||T(Y=>Y.filter(J=>J!==L))};return g.jsxs("div",{className:"min-h-screen bg-background p-3 sm:p-4 md:p-8 flex flex-col",children:[g.jsxs("div",{className:`mx-auto flex-1 w-full transition-all duration-300 ${c?"max-w-full":"max-w-[90rem]"}`,children:[g.jsxs("div",{className:"flex justify-between items-center mb-4 sm:mb-6",children:[g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx("h1",{className:"text-xl sm:text-2xl font-bold text-foreground",children:n("title")}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("a",{href:"/docs",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-9 w-9","aria-label":n("apiDocs"),children:g.jsx(iR,{className:"h-5 w-5 text-muted-foreground"})})}),g.jsx(Ot,{children:g.jsx("p",{children:n("apiDocs")})})]})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:G,"aria-label":n("addPanel"),children:g.jsx(UR,{className:"h-5 w-5"})})}),g.jsx(Ot,{children:g.jsx("p",{children:n("addPanel")})})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:()=>d(!c),"aria-label":n(c?"standardView":"widescreen"),children:c?g.jsx(DR,{className:"h-5 w-5"}):g.jsx(TR,{className:"h-5 w-5"})})}),g.jsx(Ot,{children:g.jsx("p",{children:n(c?"standardView":"widescreen")})})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:()=>x(!0),"aria-label":n("history"),children:g.jsx(yR,{className:"h-5 w-5"})})}),g.jsx(Ot,{children:g.jsx("p",{children:n("history")})})]}),g.jsx(NO,{showTokenDialog:h,setShowTokenDialog:p,onTokenSaved:P})]})]}),g.jsx("div",{className:"flex flex-wrap gap-4 items-stretch",children:C.map((L,Y)=>g.jsx("div",{className:C.length===1?`w-full ${c?"sm:w-[90%]":"sm:w-[75%]"} mx-auto`:"flex-1 min-w-[350px] max-w-full",children:g.jsx(hj,{id:L,isPrimary:Y===0,languages:l,loadingLanguages:i,addToHistory:R,onDelete:()=>k(L),canDelete:C.length>1})},L))})]}),g.jsx("footer",{className:"w-full mt-8 py-4 text-center",children:g.jsxs("a",{href:"https://github.com/xxnuo/MTranServer",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[g.jsx("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:g.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})}),g.jsxs("span",{children:["MTranServer ",v&&g.jsxs("span",{className:"text-xs ml-1 opacity-75",children:["v",v]})]})]})}),g.jsx(JO,{open:m,onOpenChange:x,history:E,onSelect:L=>{const Y=new CustomEvent("loadHistoryItem",{detail:L});window.dispatchEvent(Y),x(!1)},onClear:N,onDelete:M})]})}function ED(){return y.useMemo(()=>wD(window.location.pathname),[])==="settings"?g.jsx(SD,{}):g.jsx(CD,{})}var TD=(n,l,r,i,s,c,d,h)=>{let p=document.documentElement,m=["light","dark"];function x(C){(Array.isArray(n)?n:[n]).forEach(T=>{let E=T==="class",R=E&&c?s.map(N=>c[N]||N):s;E?(p.classList.remove(...R),p.classList.add(c&&c[C]?c[C]:C)):p.setAttribute(T,C)}),v(C)}function v(C){h&&m.includes(C)&&(p.style.colorScheme=C)}function w(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(i)x(i);else try{let C=localStorage.getItem(l)||r,T=d&&C==="system"?w():C;x(T)}catch{}},RD=y.createContext(void 0),AD={setTheme:n=>{},themes:[]},ND=()=>{var n;return(n=y.useContext(RD))!=null?n:AD};y.memo(({forcedTheme:n,storageKey:l,attribute:r,enableSystem:i,enableColorScheme:s,defaultTheme:c,value:d,themes:h,nonce:p,scriptProps:m})=>{let x=JSON.stringify([r,l,c,n,h,d,i,s]).slice(1,-1);return y.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${TD.toString()})(${x})`}})});const OD=({...n})=>{const{theme:l="system"}=ND();return g.jsx(W2,{theme:l,className:"toaster group",icons:{success:g.jsx(hR,{className:"size-4"}),info:g.jsx(xR,{className:"size-4"}),warning:g.jsx(qR,{className:"size-4"}),error:g.jsx(LR,{className:"size-4"}),loading:g.jsx(P0,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...n})};uw.createRoot(document.getElementById("root")).render(g.jsx(y.StrictMode,{children:g.jsxs(KR,{children:[g.jsx(ED,{}),g.jsx(OD,{})]})}));
|
|
53
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${l.docsSlug}`;return y.useEffect(()=>{n&&(document.getElementById(n)||console.error(r))},[r,n]),null},nN="DialogDescriptionWarning",aN=({contentRef:n,descriptionId:l})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hb(nN).contentName}}.`;return y.useEffect(()=>{const s=n.current?.getAttribute("aria-describedby");l&&s&&(document.getElementById(l)||console.warn(i))},[i,n,l]),null},th=J0,lN=tb,nh=ab,ah=lb,lh=rb,pb=ib,mb=cb,gb=fb;function rN({...n}){return g.jsx(th,{"data-slot":"dialog",...n})}function oN({...n}){return g.jsx(lN,{"data-slot":"dialog-trigger",...n})}function iN({...n}){return g.jsx(nh,{"data-slot":"dialog-portal",...n})}function sN({className:n,...l}){return g.jsx(ah,{"data-slot":"dialog-overlay",className:je("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...l})}function cN({className:n,children:l,showCloseButton:r=!0,...i}){return g.jsxs(iN,{"data-slot":"dialog-portal",children:[g.jsx(sN,{}),g.jsxs(lh,{"data-slot":"dialog-content",className:je("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",n),...i,children:[l,r&&g.jsxs(gb,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[g.jsx(Gs,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function uN({className:n,...l}){return g.jsx("div",{"data-slot":"dialog-header",className:je("flex flex-col gap-2 text-center sm:text-left",n),...l})}function fN({className:n,...l}){return g.jsx(pb,{"data-slot":"dialog-title",className:je("text-lg leading-none font-semibold",n),...l})}function dN({className:n,...l}){return g.jsx(mb,{"data-slot":"dialog-description",className:je("text-muted-foreground text-sm",n),...l})}function hN(n){const l=pN(n),r=y.forwardRef((i,s)=>{const{children:c,...d}=i,h=y.Children.toArray(c),p=h.find(gN);if(p){const m=p.props.children,x=h.map(v=>v===p?y.Children.count(m)>1?y.Children.only(null):y.isValidElement(m)?m.props.children:null:v);return g.jsx(l,{...d,ref:s,children:y.isValidElement(m)?y.cloneElement(m,void 0,x):null})}return g.jsx(l,{...d,ref:s,children:c})});return r.displayName=`${n}.Slot`,r}function pN(n){const l=y.forwardRef((r,i)=>{const{children:s,...c}=r;if(y.isValidElement(s)){const d=yN(s),h=vN(c,s.props);return s.type!==y.Fragment&&(h.ref=i?bn(i,d):d),y.cloneElement(s,h)}return y.Children.count(s)>1?y.Children.only(null):null});return l.displayName=`${n}.SlotClone`,l}var mN=Symbol("radix.slottable");function gN(n){return y.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===mN}function vN(n,l){const r={...l};for(const i in l){const s=n[i],c=l[i];/^on[A-Z]/.test(i)?s&&c?r[i]=(...h)=>{const p=c(...h);return s(...h),p}:s&&(r[i]=s):i==="style"?r[i]={...s,...c}:i==="className"&&(r[i]=[s,c].filter(Boolean).join(" "))}return{...n,...r}}function yN(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?n.props.ref:n.props.ref||n.ref)}var uc="Popover",[vb]=Gn(uc,[Br]),ni=Br(),[bN,Za]=vb(uc),yb=n=>{const{__scopePopover:l,children:r,open:i,defaultOpen:s,onOpenChange:c,modal:d=!1}=n,h=ni(l),p=y.useRef(null),[m,x]=y.useState(!1),[v,w]=qn({prop:i,defaultProp:s??!1,onChange:c,caller:uc});return g.jsx(Gd,{...h,children:g.jsx(bN,{scope:l,contentId:Ut(),triggerRef:p,open:v,onOpenChange:w,onOpenToggle:y.useCallback(()=>w(C=>!C),[w]),hasCustomAnchor:m,onCustomAnchorAdd:y.useCallback(()=>x(!0),[]),onCustomAnchorRemove:y.useCallback(()=>x(!1),[]),modal:d,children:r})})};yb.displayName=uc;var bb="PopoverAnchor",xN=y.forwardRef((n,l)=>{const{__scopePopover:r,...i}=n,s=Za(bb,r),c=ni(r),{onCustomAnchorAdd:d,onCustomAnchorRemove:h}=s;return y.useEffect(()=>(d(),()=>h()),[d,h]),g.jsx(ac,{...c,...i,ref:l})});xN.displayName=bb;var xb="PopoverTrigger",Sb=y.forwardRef((n,l)=>{const{__scopePopover:r,...i}=n,s=Za(xb,r),c=ni(r),d=He(l,s.triggerRef),h=g.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Rb(s.open),...i,ref:d,onClick:we(n.onClick,s.onOpenToggle)});return s.hasCustomAnchor?h:g.jsx(ac,{asChild:!0,...c,children:h})});Sb.displayName=xb;var rh="PopoverPortal",[SN,wN]=vb(rh,{forceMount:void 0}),wb=n=>{const{__scopePopover:l,forceMount:r,children:i,container:s}=n,c=Za(rh,l);return g.jsx(SN,{scope:l,forceMount:r,children:g.jsx(xn,{present:r||c.open,children:g.jsx(ei,{asChild:!0,container:s,children:i})})})};wb.displayName=rh;var Mr="PopoverContent",Cb=y.forwardRef((n,l)=>{const r=wN(Mr,n.__scopePopover),{forceMount:i=r.forceMount,...s}=n,c=Za(Mr,n.__scopePopover);return g.jsx(xn,{present:i||c.open,children:c.modal?g.jsx(EN,{...s,ref:l}):g.jsx(TN,{...s,ref:l})})});Cb.displayName=Mr;var CN=hN("PopoverContent.RemoveScroll"),EN=y.forwardRef((n,l)=>{const r=Za(Mr,n.__scopePopover),i=y.useRef(null),s=He(l,i),c=y.useRef(!1);return y.useEffect(()=>{const d=i.current;if(d)return Zd(d)},[]),g.jsx(sc,{as:CN,allowPinchZoom:!0,children:g.jsx(Eb,{...n,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(n.onCloseAutoFocus,d=>{d.preventDefault(),c.current||r.triggerRef.current?.focus()}),onPointerDownOutside:we(n.onPointerDownOutside,d=>{const h=d.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,m=h.button===2||p;c.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:we(n.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})}),TN=y.forwardRef((n,l)=>{const r=Za(Mr,n.__scopePopover),i=y.useRef(!1),s=y.useRef(!1);return g.jsx(Eb,{...n,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{n.onCloseAutoFocus?.(c),c.defaultPrevented||(i.current||r.triggerRef.current?.focus(),c.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:c=>{n.onInteractOutside?.(c),c.defaultPrevented||(i.current=!0,c.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const d=c.target;r.triggerRef.current?.contains(d)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&s.current&&c.preventDefault()}})}),Eb=y.forwardRef((n,l)=>{const{__scopePopover:r,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:x,...v}=n,w=Za(Mr,r),C=ni(r);return Qd(),g.jsx(oc,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:c,children:g.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:d,onInteractOutside:x,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onDismiss:()=>w.onOpenChange(!1),children:g.jsx($d,{"data-state":Rb(w.open),role:"dialog",id:w.contentId,...C,...v,ref:l,style:{...v.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)"}})})})}),Tb="PopoverClose",RN=y.forwardRef((n,l)=>{const{__scopePopover:r,...i}=n,s=Za(Tb,r);return g.jsx(Ce.button,{type:"button",...i,ref:l,onClick:we(n.onClick,()=>s.onOpenChange(!1))})});RN.displayName=Tb;var AN="PopoverArrow",NN=y.forwardRef((n,l)=>{const{__scopePopover:r,...i}=n,s=ni(r);return g.jsx(Xd,{...s,...i,ref:l})});NN.displayName=AN;function Rb(n){return n?"open":"closed"}var ON=yb,jN=Sb,DN=wb,_N=Cb;function vd({...n}){return g.jsx(ON,{"data-slot":"popover",...n})}function yd({...n}){return g.jsx(jN,{"data-slot":"popover-trigger",...n})}function bd({className:n,align:l="center",sideOffset:r=4,...i}){return g.jsx(DN,{children:g.jsx(_N,{"data-slot":"popover-content",align:l,sideOffset:r,className:je("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),...i})})}var vy=1,MN=.9,zN=.8,LN=.17,Jf=.1,ed=.999,kN=.9999,UN=.99,HN=/[\\\/_+.#"@\[\(\{&]/,BN=/[\\\/_+.#"@\[\(\{&]/g,PN=/[\s-]/,Ab=/[\s-]/g;function xd(n,l,r,i,s,c,d){if(c===l.length)return s===n.length?vy:UN;var h=`${s},${c}`;if(d[h]!==void 0)return d[h];for(var p=i.charAt(c),m=r.indexOf(p,s),x=0,v,w,C,T;m>=0;)v=xd(n,l,r,i,m+1,c+1,d),v>x&&(m===s?v*=vy:HN.test(n.charAt(m-1))?(v*=zN,C=n.slice(s,m-1).match(BN),C&&s>0&&(v*=Math.pow(ed,C.length))):PN.test(n.charAt(m-1))?(v*=MN,T=n.slice(s,m-1).match(Ab),T&&s>0&&(v*=Math.pow(ed,T.length))):(v*=LN,s>0&&(v*=Math.pow(ed,m-s))),n.charAt(m)!==l.charAt(c)&&(v*=kN)),(v<Jf&&r.charAt(m-1)===i.charAt(c+1)||i.charAt(c+1)===i.charAt(c)&&r.charAt(m-1)!==i.charAt(c))&&(w=xd(n,l,r,i,m+1,c+2,d),w*Jf>v&&(v=w*Jf)),v>x&&(x=v),m=r.indexOf(p,m+1);return d[h]=x,x}function yy(n){return n.toLowerCase().replace(Ab," ")}function VN(n,l,r){return n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,xd(n,l,yy(n),yy(l),0,0,{})}var Ho='[cmdk-group=""]',td='[cmdk-group-items=""]',IN='[cmdk-group-heading=""]',Nb='[cmdk-item=""]',by=`${Nb}:not([aria-disabled="true"])`,Sd="cmdk-item-select",Tr="data-value",YN=(n,l,r)=>VN(n,l,r),Ob=y.createContext(void 0),ai=()=>y.useContext(Ob),jb=y.createContext(void 0),oh=()=>y.useContext(jb),Db=y.createContext(void 0),_b=y.forwardRef((n,l)=>{let r=Rr(()=>{var O,U;return{search:"",value:(U=(O=n.value)!=null?O:n.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=Rr(()=>new Set),s=Rr(()=>new Map),c=Rr(()=>new Map),d=Rr(()=>new Set),h=Mb(n),{label:p,children:m,value:x,onValueChange:v,filter:w,shouldFilter:C,loop:T,disablePointerSelection:E=!1,vimBindings:R=!0,...N}=n,M=Ut(),z=Ut(),P=Ut(),G=y.useRef(null),k=eO();Al(()=>{if(x!==void 0){let O=x.trim();r.current.value=O,L.emit()}},[x]),Al(()=>{k(6,ie)},[]);let L=y.useMemo(()=>({subscribe:O=>(d.current.add(O),()=>d.current.delete(O)),snapshot:()=>r.current,setState:(O,U,X)=>{var Q,oe,Z,se;if(!Object.is(r.current[O],U)){if(r.current[O]=U,O==="search")K(),ne(),k(1,re);else if(O==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let fe=document.getElementById(P);fe?fe.focus():(Q=document.getElementById(M))==null||Q.focus()}if(k(7,()=>{var fe;r.current.selectedItemId=(fe=ce())==null?void 0:fe.id,L.emit()}),X||k(5,ie),((oe=h.current)==null?void 0:oe.value)!==void 0){let fe=U??"";(se=(Z=h.current).onValueChange)==null||se.call(Z,fe);return}}L.emit()}},emit:()=>{d.current.forEach(O=>O())}}),[]),Y=y.useMemo(()=>({value:(O,U,X)=>{var Q;U!==((Q=c.current.get(O))==null?void 0:Q.value)&&(c.current.set(O,{value:U,keywords:X}),r.current.filtered.items.set(O,J(U,X)),k(2,()=>{ne(),L.emit()}))},item:(O,U)=>(i.current.add(O),U&&(s.current.has(U)?s.current.get(U).add(O):s.current.set(U,new Set([O]))),k(3,()=>{K(),ne(),r.current.value||re(),L.emit()}),()=>{c.current.delete(O),i.current.delete(O),r.current.filtered.items.delete(O);let X=ce();k(4,()=>{K(),X?.getAttribute("id")===O&&re(),L.emit()})}),group:O=>(s.current.has(O)||s.current.set(O,new Set),()=>{c.current.delete(O),s.current.delete(O)}),filter:()=>h.current.shouldFilter,label:p||n["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:M,inputId:P,labelId:z,listInnerRef:G}),[]);function J(O,U){var X,Q;let oe=(Q=(X=h.current)==null?void 0:X.filter)!=null?Q:YN;return O?oe(O,r.current.search,U):0}function ne(){if(!r.current.search||h.current.shouldFilter===!1)return;let O=r.current.filtered.items,U=[];r.current.filtered.groups.forEach(Q=>{let oe=s.current.get(Q),Z=0;oe.forEach(se=>{let fe=O.get(se);Z=Math.max(fe,Z)}),U.push([Q,Z])});let X=G.current;he().sort((Q,oe)=>{var Z,se;let fe=Q.getAttribute("id"),be=oe.getAttribute("id");return((Z=O.get(be))!=null?Z:0)-((se=O.get(fe))!=null?se:0)}).forEach(Q=>{let oe=Q.closest(td);oe?oe.appendChild(Q.parentElement===oe?Q:Q.closest(`${td} > *`)):X.appendChild(Q.parentElement===X?Q:Q.closest(`${td} > *`))}),U.sort((Q,oe)=>oe[1]-Q[1]).forEach(Q=>{var oe;let Z=(oe=G.current)==null?void 0:oe.querySelector(`${Ho}[${Tr}="${encodeURIComponent(Q[0])}"]`);Z?.parentElement.appendChild(Z)})}function re(){let O=he().find(X=>X.getAttribute("aria-disabled")!=="true"),U=O?.getAttribute(Tr);L.setState("value",U||void 0)}function K(){var O,U,X,Q;if(!r.current.search||h.current.shouldFilter===!1){r.current.filtered.count=i.current.size;return}r.current.filtered.groups=new Set;let oe=0;for(let Z of i.current){let se=(U=(O=c.current.get(Z))==null?void 0:O.value)!=null?U:"",fe=(Q=(X=c.current.get(Z))==null?void 0:X.keywords)!=null?Q:[],be=J(se,fe);r.current.filtered.items.set(Z,be),be>0&&oe++}for(let[Z,se]of s.current)for(let fe of se)if(r.current.filtered.items.get(fe)>0){r.current.filtered.groups.add(Z);break}r.current.filtered.count=oe}function ie(){var O,U,X;let Q=ce();Q&&(((O=Q.parentElement)==null?void 0:O.firstChild)===Q&&((X=(U=Q.closest(Ho))==null?void 0:U.querySelector(IN))==null||X.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function ce(){var O;return(O=G.current)==null?void 0:O.querySelector(`${Nb}[aria-selected="true"]`)}function he(){var O;return Array.from(((O=G.current)==null?void 0:O.querySelectorAll(by))||[])}function D(O){let U=he()[O];U&&L.setState("value",U.getAttribute(Tr))}function $(O){var U;let X=ce(),Q=he(),oe=Q.findIndex(se=>se===X),Z=Q[oe+O];(U=h.current)!=null&&U.loop&&(Z=oe+O<0?Q[Q.length-1]:oe+O===Q.length?Q[0]:Q[oe+O]),Z&&L.setState("value",Z.getAttribute(Tr))}function B(O){let U=ce(),X=U?.closest(Ho),Q;for(;X&&!Q;)X=O>0?WN(X,Ho):JN(X,Ho),Q=X?.querySelector(by);Q?L.setState("value",Q.getAttribute(Tr)):$(O)}let ue=()=>D(he().length-1),de=O=>{O.preventDefault(),O.metaKey?ue():O.altKey?B(1):$(1)},A=O=>{O.preventDefault(),O.metaKey?D(0):O.altKey?B(-1):$(-1)};return y.createElement(Ce.div,{ref:l,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:O=>{var U;(U=N.onKeyDown)==null||U.call(N,O);let X=O.nativeEvent.isComposing||O.keyCode===229;if(!(O.defaultPrevented||X))switch(O.key){case"n":case"j":{R&&O.ctrlKey&&de(O);break}case"ArrowDown":{de(O);break}case"p":case"k":{R&&O.ctrlKey&&A(O);break}case"ArrowUp":{A(O);break}case"Home":{O.preventDefault(),D(0);break}case"End":{O.preventDefault(),ue();break}case"Enter":{O.preventDefault();let Q=ce();if(Q){let oe=new Event(Sd);Q.dispatchEvent(oe)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:Y.inputId,id:Y.labelId,style:nO},p),fc(n,O=>y.createElement(jb.Provider,{value:L},y.createElement(Ob.Provider,{value:Y},O))))}),qN=y.forwardRef((n,l)=>{var r,i;let s=Ut(),c=y.useRef(null),d=y.useContext(Db),h=ai(),p=Mb(n),m=(i=(r=p.current)==null?void 0:r.forceMount)!=null?i:d?.forceMount;Al(()=>{if(!m)return h.item(s,d?.id)},[m]);let x=zb(s,c,[n.value,n.children,c],n.keywords),v=oh(),w=Qa(k=>k.value&&k.value===x.current),C=Qa(k=>m||h.filter()===!1?!0:k.search?k.filtered.items.get(s)>0:!0);y.useEffect(()=>{let k=c.current;if(!(!k||n.disabled))return k.addEventListener(Sd,T),()=>k.removeEventListener(Sd,T)},[C,n.onSelect,n.disabled]);function T(){var k,L;E(),(L=(k=p.current).onSelect)==null||L.call(k,x.current)}function E(){v.setState("value",x.current,!0)}if(!C)return null;let{disabled:R,value:N,onSelect:M,forceMount:z,keywords:P,...G}=n;return y.createElement(Ce.div,{ref:bn(c,l),...G,id:s,"cmdk-item":"",role:"option","aria-disabled":!!R,"aria-selected":!!w,"data-disabled":!!R,"data-selected":!!w,onPointerMove:R||h.getDisablePointerSelection()?void 0:E,onClick:R?void 0:T},n.children)}),GN=y.forwardRef((n,l)=>{let{heading:r,children:i,forceMount:s,...c}=n,d=Ut(),h=y.useRef(null),p=y.useRef(null),m=Ut(),x=ai(),v=Qa(C=>s||x.filter()===!1?!0:C.search?C.filtered.groups.has(d):!0);Al(()=>x.group(d),[]),zb(d,h,[n.value,n.heading,p]);let w=y.useMemo(()=>({id:d,forceMount:s}),[s]);return y.createElement(Ce.div,{ref:bn(h,l),...c,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},r&&y.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:m},r),fc(n,C=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?m:void 0},y.createElement(Db.Provider,{value:w},C))))}),$N=y.forwardRef((n,l)=>{let{alwaysRender:r,...i}=n,s=y.useRef(null),c=Qa(d=>!d.search);return!r&&!c?null:y.createElement(Ce.div,{ref:bn(s,l),...i,"cmdk-separator":"",role:"separator"})}),XN=y.forwardRef((n,l)=>{let{onValueChange:r,...i}=n,s=n.value!=null,c=oh(),d=Qa(m=>m.search),h=Qa(m=>m.selectedItemId),p=ai();return y.useEffect(()=>{n.value!=null&&c.setState("search",n.value)},[n.value]),y.createElement(Ce.input,{ref:l,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":p.listId,"aria-labelledby":p.labelId,"aria-activedescendant":h,id:p.inputId,type:"text",value:s?n.value:d,onChange:m=>{s||c.setState("search",m.target.value),r?.(m.target.value)}})}),FN=y.forwardRef((n,l)=>{let{children:r,label:i="Suggestions",...s}=n,c=y.useRef(null),d=y.useRef(null),h=Qa(m=>m.selectedItemId),p=ai();return y.useEffect(()=>{if(d.current&&c.current){let m=d.current,x=c.current,v,w=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let C=m.offsetHeight;x.style.setProperty("--cmdk-list-height",C.toFixed(1)+"px")})});return w.observe(m),()=>{cancelAnimationFrame(v),w.unobserve(m)}}},[]),y.createElement(Ce.div,{ref:bn(c,l),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":i,id:p.listId},fc(n,m=>y.createElement("div",{ref:bn(d,p.listInnerRef),"cmdk-list-sizer":""},m)))}),KN=y.forwardRef((n,l)=>{let{open:r,onOpenChange:i,overlayClassName:s,contentClassName:c,container:d,...h}=n;return y.createElement(th,{open:r,onOpenChange:i},y.createElement(nh,{container:d},y.createElement(ah,{"cmdk-overlay":"",className:s}),y.createElement(lh,{"aria-label":n.label,"cmdk-dialog":"",className:c},y.createElement(_b,{ref:l,...h}))))}),QN=y.forwardRef((n,l)=>Qa(r=>r.filtered.count===0)?y.createElement(Ce.div,{ref:l,...n,"cmdk-empty":"",role:"presentation"}):null),ZN=y.forwardRef((n,l)=>{let{progress:r,children:i,label:s="Loading...",...c}=n;return y.createElement(Ce.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},fc(n,d=>y.createElement("div",{"aria-hidden":!0},d)))}),Pr=Object.assign(_b,{List:FN,Item:qN,Input:XN,Group:GN,Separator:$N,Dialog:KN,Empty:QN,Loading:ZN});function WN(n,l){let r=n.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function JN(n,l){let r=n.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function Mb(n){let l=y.useRef(n);return Al(()=>{l.current=n}),l}var Al=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Rr(n){let l=y.useRef();return l.current===void 0&&(l.current=n()),l}function Qa(n){let l=oh(),r=()=>n(l.snapshot());return y.useSyncExternalStore(l.subscribe,r,r)}function zb(n,l,r,i=[]){let s=y.useRef(),c=ai();return Al(()=>{var d;let h=(()=>{var m;for(let x of r){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(m=x.current.textContent)==null?void 0:m.trim():s.current}})(),p=i.map(m=>m.trim());c.value(n,h,p),(d=l.current)==null||d.setAttribute(Tr,h),s.current=h}),s}var eO=()=>{let[n,l]=y.useState(),r=Rr(()=>new Map);return Al(()=>{r.current.forEach(i=>i()),r.current=new Map},[n]),(i,s)=>{r.current.set(i,s),l({})}};function tO(n){let l=n.type;return typeof l=="function"?l(n.props):"render"in l?l.render(n.props):n}function fc({asChild:n,children:l},r){return n&&y.isValidElement(l)?y.cloneElement(tO(l),{ref:l.ref},r(l.props.children)):r(l)}var nO={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function wd({className:n,...l}){return g.jsx(Pr,{"data-slot":"command",className:je("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",n),...l})}function Cd({className:n,...l}){return g.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[g.jsx(V0,{className:"size-4 shrink-0 opacity-50"}),g.jsx(Pr.Input,{"data-slot":"command-input",className:je("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),...l})]})}function Ed({className:n,...l}){return g.jsx(Pr.List,{"data-slot":"command-list",className:je("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",n),...l})}function Td({...n}){return g.jsx(Pr.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...n})}function $a({className:n,...l}){return g.jsx(Pr.Group,{"data-slot":"command-group",className:je("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",n),...l})}function Xa({className:n,...l}){return g.jsx(Pr.Item,{"data-slot":"command-item",className:je("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...l})}function xy(n){const l=aO(n),r=y.forwardRef((i,s)=>{const{children:c,...d}=i,h=y.Children.toArray(c),p=h.find(rO);if(p){const m=p.props.children,x=h.map(v=>v===p?y.Children.count(m)>1?y.Children.only(null):y.isValidElement(m)?m.props.children:null:v);return g.jsx(l,{...d,ref:s,children:y.isValidElement(m)?y.cloneElement(m,void 0,x):null})}return g.jsx(l,{...d,ref:s,children:c})});return r.displayName=`${n}.Slot`,r}function aO(n){const l=y.forwardRef((r,i)=>{const{children:s,...c}=r;if(y.isValidElement(s)){const d=iO(s),h=oO(c,s.props);return s.type!==y.Fragment&&(h.ref=i?bn(i,d):d),y.cloneElement(s,h)}return y.Children.count(s)>1?y.Children.only(null):null});return l.displayName=`${n}.SlotClone`,l}var lO=Symbol("radix.slottable");function rO(n){return y.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===lO}function oO(n,l){const r={...l};for(const i in l){const s=n[i],c=l[i];/^on[A-Z]/.test(i)?s&&c?r[i]=(...h)=>{const p=c(...h);return s(...h),p}:s&&(r[i]=s):i==="style"?r[i]={...s,...c}:i==="className"&&(r[i]=[s,c].filter(Boolean).join(" "))}return{...n,...r}}function iO(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?n.props.ref:n.props.ref||n.ref)}function Lb(n){const l=n+"CollectionProvider",[r,i]=Gn(l),[s,c]=r(l,{collectionRef:{current:null},itemMap:new Map}),d=E=>{const{scope:R,children:N}=E,M=le.useRef(null),z=le.useRef(new Map).current;return g.jsx(s,{scope:R,itemMap:z,collectionRef:M,children:N})};d.displayName=l;const h=n+"CollectionSlot",p=xy(h),m=le.forwardRef((E,R)=>{const{scope:N,children:M}=E,z=c(h,N),P=He(R,z.collectionRef);return g.jsx(p,{ref:P,children:M})});m.displayName=h;const x=n+"CollectionItemSlot",v="data-radix-collection-item",w=xy(x),C=le.forwardRef((E,R)=>{const{scope:N,children:M,...z}=E,P=le.useRef(null),G=He(R,P),k=c(x,N);return le.useEffect(()=>(k.itemMap.set(P,{ref:P,...z}),()=>{k.itemMap.delete(P)})),g.jsx(w,{[v]:"",ref:G,children:M})});C.displayName=x;function T(E){const R=c(n+"CollectionConsumer",E);return le.useCallback(()=>{const M=R.collectionRef.current;if(!M)return[];const z=Array.from(M.querySelectorAll(`[${v}]`));return Array.from(R.itemMap.values()).sort((k,L)=>z.indexOf(k.ref.current)-z.indexOf(L.ref.current))},[R.collectionRef,R.itemMap])}return[{Provider:d,Slot:m,ItemSlot:C},T,i]}var sO=y.createContext(void 0);function dc(n){const l=y.useContext(sO);return n||l||"ltr"}var nd="rovingFocusGroup.onEntryFocus",cO={bubbles:!1,cancelable:!0},li="RovingFocusGroup",[Rd,kb,uO]=Lb(li),[fO,Ub]=Gn(li,[uO]),[dO,hO]=fO(li),Hb=y.forwardRef((n,l)=>g.jsx(Rd.Provider,{scope:n.__scopeRovingFocusGroup,children:g.jsx(Rd.Slot,{scope:n.__scopeRovingFocusGroup,children:g.jsx(pO,{...n,ref:l})})}));Hb.displayName=li;var pO=y.forwardRef((n,l)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:s=!1,dir:c,currentTabStopId:d,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:x=!1,...v}=n,w=y.useRef(null),C=He(l,w),T=dc(c),[E,R]=qn({prop:d,defaultProp:h??null,onChange:p,caller:li}),[N,M]=y.useState(!1),z=kt(m),P=kb(r),G=y.useRef(!1),[k,L]=y.useState(0);return y.useEffect(()=>{const Y=w.current;if(Y)return Y.addEventListener(nd,z),()=>Y.removeEventListener(nd,z)},[z]),g.jsx(dO,{scope:r,orientation:i,dir:T,loop:s,currentTabStopId:E,onItemFocus:y.useCallback(Y=>R(Y),[R]),onItemShiftTab:y.useCallback(()=>M(!0),[]),onFocusableItemAdd:y.useCallback(()=>L(Y=>Y+1),[]),onFocusableItemRemove:y.useCallback(()=>L(Y=>Y-1),[]),children:g.jsx(Ce.div,{tabIndex:N||k===0?-1:0,"data-orientation":i,...v,ref:C,style:{outline:"none",...n.style},onMouseDown:we(n.onMouseDown,()=>{G.current=!0}),onFocus:we(n.onFocus,Y=>{const J=!G.current;if(Y.target===Y.currentTarget&&J&&!N){const ne=new CustomEvent(nd,cO);if(Y.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const re=P().filter(D=>D.focusable),K=re.find(D=>D.active),ie=re.find(D=>D.id===E),he=[K,ie,...re].filter(Boolean).map(D=>D.ref.current);Vb(he,x)}}G.current=!1}),onBlur:we(n.onBlur,()=>M(!1))})})}),Bb="RovingFocusGroupItem",Pb=y.forwardRef((n,l)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:s=!1,tabStopId:c,children:d,...h}=n,p=Ut(),m=c||p,x=hO(Bb,r),v=x.currentTabStopId===m,w=kb(r),{onFocusableItemAdd:C,onFocusableItemRemove:T,currentTabStopId:E}=x;return y.useEffect(()=>{if(i)return C(),()=>T()},[i,C,T]),g.jsx(Rd.ItemSlot,{scope:r,id:m,focusable:i,active:s,children:g.jsx(Ce.span,{tabIndex:v?0:-1,"data-orientation":x.orientation,...h,ref:l,onMouseDown:we(n.onMouseDown,R=>{i?x.onItemFocus(m):R.preventDefault()}),onFocus:we(n.onFocus,()=>x.onItemFocus(m)),onKeyDown:we(n.onKeyDown,R=>{if(R.key==="Tab"&&R.shiftKey){x.onItemShiftTab();return}if(R.target!==R.currentTarget)return;const N=vO(R,x.orientation,x.dir);if(N!==void 0){if(R.metaKey||R.ctrlKey||R.altKey||R.shiftKey)return;R.preventDefault();let z=w().filter(P=>P.focusable).map(P=>P.ref.current);if(N==="last")z.reverse();else if(N==="prev"||N==="next"){N==="prev"&&z.reverse();const P=z.indexOf(R.currentTarget);z=x.loop?yO(z,P+1):z.slice(P+1)}setTimeout(()=>Vb(z))}}),children:typeof d=="function"?d({isCurrentTabStop:v,hasTabStop:E!=null}):d})})});Pb.displayName=Bb;var mO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gO(n,l){return l!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function vO(n,l,r){const i=gO(n.key,r);if(!(l==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(l==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return mO[i]}function Vb(n,l=!1){const r=document.activeElement;for(const i of n)if(i===r||(i.focus({preventScroll:l}),document.activeElement!==r))return}function yO(n,l){return n.map((r,i)=>n[(l+i)%n.length])}var bO=Hb,xO=Pb,Ib="Toggle",Yb=y.forwardRef((n,l)=>{const{pressed:r,defaultPressed:i,onPressedChange:s,...c}=n,[d,h]=qn({prop:r,onChange:s,defaultProp:i??!1,caller:Ib});return g.jsx(Ce.button,{type:"button","aria-pressed":d,"data-state":d?"on":"off","data-disabled":n.disabled?"":void 0,...c,ref:l,onClick:we(n.onClick,()=>{n.disabled||h(!d)})})});Yb.displayName=Ib;var Wa="ToggleGroup",[qb]=Gn(Wa,[Ub]),Gb=Ub(),ih=le.forwardRef((n,l)=>{const{type:r,...i}=n;if(r==="single"){const s=i;return g.jsx(SO,{...s,ref:l})}if(r==="multiple"){const s=i;return g.jsx(wO,{...s,ref:l})}throw new Error(`Missing prop \`type\` expected on \`${Wa}\``)});ih.displayName=Wa;var[$b,Xb]=qb(Wa),SO=le.forwardRef((n,l)=>{const{value:r,defaultValue:i,onValueChange:s=()=>{},...c}=n,[d,h]=qn({prop:r,defaultProp:i??"",onChange:s,caller:Wa});return g.jsx($b,{scope:n.__scopeToggleGroup,type:"single",value:le.useMemo(()=>d?[d]:[],[d]),onItemActivate:h,onItemDeactivate:le.useCallback(()=>h(""),[h]),children:g.jsx(Fb,{...c,ref:l})})}),wO=le.forwardRef((n,l)=>{const{value:r,defaultValue:i,onValueChange:s=()=>{},...c}=n,[d,h]=qn({prop:r,defaultProp:i??[],onChange:s,caller:Wa}),p=le.useCallback(x=>h((v=[])=>[...v,x]),[h]),m=le.useCallback(x=>h((v=[])=>v.filter(w=>w!==x)),[h]);return g.jsx($b,{scope:n.__scopeToggleGroup,type:"multiple",value:d,onItemActivate:p,onItemDeactivate:m,children:g.jsx(Fb,{...c,ref:l})})});ih.displayName=Wa;var[CO,EO]=qb(Wa),Fb=le.forwardRef((n,l)=>{const{__scopeToggleGroup:r,disabled:i=!1,rovingFocus:s=!0,orientation:c,dir:d,loop:h=!0,...p}=n,m=Gb(r),x=dc(d),v={role:"group",dir:x,...p};return g.jsx(CO,{scope:r,rovingFocus:s,disabled:i,children:s?g.jsx(bO,{asChild:!0,...m,orientation:c,dir:x,loop:h,children:g.jsx(Ce.div,{...v,ref:l})}):g.jsx(Ce.div,{...v,ref:l})})}),Xs="ToggleGroupItem",Kb=le.forwardRef((n,l)=>{const r=Xb(Xs,n.__scopeToggleGroup),i=EO(Xs,n.__scopeToggleGroup),s=Gb(n.__scopeToggleGroup),c=r.value.includes(n.value),d=i.disabled||n.disabled,h={...n,pressed:c,disabled:d},p=le.useRef(null);return i.rovingFocus?g.jsx(xO,{asChild:!0,...s,focusable:!d,active:c,ref:p,children:g.jsx(Sy,{...h,ref:l})}):g.jsx(Sy,{...h,ref:l})});Kb.displayName=Xs;var Sy=le.forwardRef((n,l)=>{const{__scopeToggleGroup:r,value:i,...s}=n,c=Xb(Xs,r),d={role:"radio","aria-checked":n.pressed,"aria-pressed":void 0},h=c.type==="single"?d:void 0;return g.jsx(Yb,{...h,...s,ref:l,onPressedChange:p=>{p?c.onItemActivate(i):c.onItemDeactivate(i)}})}),TO=ih,RO=Kb;const AO=qy("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Qb=y.createContext({size:"default",variant:"default",spacing:0});function Ad({className:n,variant:l,size:r,spacing:i=0,children:s,...c}){return g.jsx(TO,{"data-slot":"toggle-group","data-variant":l,"data-size":r,"data-spacing":i,style:{"--gap":i},className:je("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",n),...c,children:g.jsx(Qb.Provider,{value:{variant:l,size:r,spacing:i},children:s})})}function Go({className:n,children:l,variant:r,size:i,...s}){const c=y.useContext(Qb);return g.jsx(RO,{"data-slot":"toggle-group-item","data-variant":c.variant||r,"data-size":c.size||i,"data-spacing":c.spacing,className:je(AO({variant:c.variant||r,size:c.size||i}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",n),...s,children:l})}function NO({showTokenDialog:n,setShowTokenDialog:l,onTokenSaved:r}){const{t:i,i18n:s}=Qo(),{actualTheme:c,setTheme:d}=QR(),[h,p]=y.useState(!1),[m,x]=y.useState(()=>localStorage.getItem("apiToken")||""),[v,w]=y.useState(!1),[C,T]=y.useState(()=>localStorage.getItem("uiLangMode")||"manual"),[E,R]=y.useState(()=>{try{const K=localStorage.getItem("recentUILanguages");if(!K)return[];const ie=JSON.parse(K);return Array.isArray(ie)?ie:[]}catch{return[]}});y.useEffect(()=>{n!==void 0&&p(n)},[n]);const N=[{code:"en",name:"English",short:"EN"},{code:"zh",name:"中文",short:"中"},{code:"ja",name:"日本語",short:"日"}],M=()=>{d(c==="dark"?"light":"dark")},z=()=>{const K=navigator.language?.toLowerCase()||"en";return K.startsWith("zh")?"zh":K.startsWith("ja")?"ja":"en"},P=K=>{const ie=[K,...E.filter(ce=>ce!==K)].slice(0,3);R(ie),localStorage.setItem("recentUILanguages",JSON.stringify(ie))},G=K=>{if(K==="system"){const ie=z();T("system"),localStorage.setItem("uiLangMode","system"),s.changeLanguage(ie)}else T("manual"),localStorage.setItem("uiLangMode","manual"),s.changeLanguage(K),P(K);w(!1)};y.useEffect(()=>{if(C!=="system")return;const K=z();K!==s.language&&s.changeLanguage(K);const ie=()=>{const ce=z();ce!==s.language&&s.changeLanguage(ce)};return window.addEventListener("languagechange",ie),()=>window.removeEventListener("languagechange",ie)},[C,s]);const k=()=>{m.trim()?(localStorage.setItem("apiToken",m.trim()),ut.success(i("apiTokenSaved"))):(localStorage.removeItem("apiToken"),ut.success(i("apiTokenCleared"))),(!n||m.trim()!=="")&&(p(!1),l&&l(!1),r&&r())},L=K=>{p(K),l&&l(K)},Y=C==="system"?z():s.language,J=N.find(K=>K.code===Y)||N[0],ne=y.useMemo(()=>E.flatMap(K=>{const ie=N.find(ce=>ce.code===K);return ie?[ie]:[]}),[E]),re=C==="system"?"system":J.code;return g.jsxs("div",{className:"flex gap-1 sm:gap-2",children:[g.jsxs(rN,{open:h,onOpenChange:L,children:[g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(oN,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8 sm:h-9 sm:w-9","aria-label":i("apiToken"),children:g.jsx(wR,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:i("apiToken")})})]}),g.jsxs(cN,{className:"w-[calc(100%-2rem)] sm:max-w-md",children:[g.jsxs(uN,{children:[g.jsx(fN,{children:i("apiToken")}),g.jsx(dN,{children:i(n?"apiTokenRequired":"apiTokenPlaceholder")})]}),g.jsxs("div",{className:"space-y-4",children:[g.jsx(yn,{type:"password",placeholder:i("apiTokenPlaceholder"),value:m,onChange:K=>x(K.target.value)}),g.jsx(tt,{onClick:k,className:"w-full",children:i("save")})]})]})]}),g.jsxs(vd,{open:v,onOpenChange:w,children:[g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(yd,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8 sm:h-9 sm:w-9","aria-label":i("switchLanguage"),children:g.jsx(gR,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:i("switchLanguage")})})]}),g.jsxs(bd,{className:"w-72 p-2",align:"end",children:[g.jsx("div",{className:"mb-2 text-sm font-medium",children:i("languageSwitcher")}),g.jsx("div",{className:"mb-3",children:g.jsxs(Ad,{type:"single",value:re,onValueChange:K=>{K&&G(K)},variant:"outline",size:"sm",className:"w-full justify-between",children:[g.jsx(Go,{value:"system",className:"flex-1",children:i("system")}),N.map(K=>g.jsx(Go,{value:K.code,className:"flex-1",children:K.short},K.code))]})}),g.jsxs(wd,{children:[g.jsx(Cd,{placeholder:i("languageSearchPlaceholder"),autoFocus:!0}),g.jsxs(Ed,{children:[g.jsx(Td,{children:i("noResults")}),g.jsx($a,{heading:i("followSystemLanguage"),children:g.jsxs(Xa,{value:"system",onSelect:()=>G("system"),children:[g.jsx("span",{className:"flex-1",children:i("followSystemLanguage")}),C==="system"&&g.jsx(_s,{className:"h-4 w-4"})]})}),ne.length>0&&g.jsx($a,{heading:i("languageRecent"),children:ne.map(K=>g.jsxs(Xa,{value:K.code,onSelect:()=>G(K.code),children:[g.jsx("span",{className:"flex-1",children:K.name}),C!=="system"&&K.code===J.code&&g.jsx(_s,{className:"h-4 w-4"})]},K.code))}),g.jsx($a,{heading:i("languageAll"),children:N.map(K=>g.jsxs(Xa,{value:K.code,onSelect:()=>G(K.code),children:[g.jsx("span",{className:"flex-1",children:K.name}),C!=="system"&&K.code===J.code&&g.jsx(_s,{className:"h-4 w-4"})]},K.code))})]})]})]})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:M,className:"h-8 w-8 sm:h-9 sm:w-9","aria-label":i("toggleTheme"),children:c==="dark"?g.jsx(PR,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"}):g.jsx(MR,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),g.jsx(Ot,{children:g.jsx("p",{children:i("toggleTheme")})})]})]})}function OO({...n}){return g.jsx(th,{"data-slot":"sheet",...n})}function jO({...n}){return g.jsx(nh,{"data-slot":"sheet-portal",...n})}function DO({className:n,...l}){return g.jsx(ah,{"data-slot":"sheet-overlay",className:je("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...l})}function _O({className:n,children:l,side:r="right",...i}){return g.jsxs(jO,{children:[g.jsx(DO,{}),g.jsxs(lh,{"data-slot":"sheet-content",className:je("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",n),...i,children:[l,g.jsxs(gb,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[g.jsx(Gs,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function MO({className:n,...l}){return g.jsx("div",{"data-slot":"sheet-header",className:je("flex flex-col gap-1.5 p-4",n),...l})}function zO({className:n,...l}){return g.jsx("div",{"data-slot":"sheet-footer",className:je("mt-auto flex flex-col gap-2 p-4",n),...l})}function LO({className:n,...l}){return g.jsx(pb,{"data-slot":"sheet-title",className:je("text-foreground font-semibold",n),...l})}function kO({className:n,...l}){return g.jsx(mb,{"data-slot":"sheet-description",className:je("text-muted-foreground text-sm",n),...l})}function Nd(n,[l,r]){return Math.min(r,Math.max(l,n))}function UO(n,l){return y.useReducer((r,i)=>l[r][i]??r,n)}var sh="ScrollArea",[Zb]=Gn(sh),[HO,Sn]=Zb(sh),Wb=y.forwardRef((n,l)=>{const{__scopeScrollArea:r,type:i="hover",dir:s,scrollHideDelay:c=600,...d}=n,[h,p]=y.useState(null),[m,x]=y.useState(null),[v,w]=y.useState(null),[C,T]=y.useState(null),[E,R]=y.useState(null),[N,M]=y.useState(0),[z,P]=y.useState(0),[G,k]=y.useState(!1),[L,Y]=y.useState(!1),J=He(l,re=>p(re)),ne=dc(s);return g.jsx(HO,{scope:r,type:i,dir:ne,scrollHideDelay:c,scrollArea:h,viewport:m,onViewportChange:x,content:v,onContentChange:w,scrollbarX:C,onScrollbarXChange:T,scrollbarXEnabled:G,onScrollbarXEnabledChange:k,scrollbarY:E,onScrollbarYChange:R,scrollbarYEnabled:L,onScrollbarYEnabledChange:Y,onCornerWidthChange:M,onCornerHeightChange:P,children:g.jsx(Ce.div,{dir:ne,...d,ref:J,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":z+"px",...n.style}})})});Wb.displayName=sh;var Jb="ScrollAreaViewport",ex=y.forwardRef((n,l)=>{const{__scopeScrollArea:r,children:i,nonce:s,...c}=n,d=Sn(Jb,r),h=y.useRef(null),p=He(l,h,d.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),g.jsx(Ce.div,{"data-radix-scroll-area-viewport":"",...c,ref:p,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...n.style},children:g.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});ex.displayName=Jb;var Xn="ScrollAreaScrollbar",tx=y.forwardRef((n,l)=>{const{forceMount:r,...i}=n,s=Sn(Xn,n.__scopeScrollArea),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:d}=s,h=n.orientation==="horizontal";return y.useEffect(()=>(h?c(!0):d(!0),()=>{h?c(!1):d(!1)}),[h,c,d]),s.type==="hover"?g.jsx(BO,{...i,ref:l,forceMount:r}):s.type==="scroll"?g.jsx(PO,{...i,ref:l,forceMount:r}):s.type==="auto"?g.jsx(nx,{...i,ref:l,forceMount:r}):s.type==="always"?g.jsx(ch,{...i,ref:l}):null});tx.displayName=Xn;var BO=y.forwardRef((n,l)=>{const{forceMount:r,...i}=n,s=Sn(Xn,n.__scopeScrollArea),[c,d]=y.useState(!1);return y.useEffect(()=>{const h=s.scrollArea;let p=0;if(h){const m=()=>{window.clearTimeout(p),d(!0)},x=()=>{p=window.setTimeout(()=>d(!1),s.scrollHideDelay)};return h.addEventListener("pointerenter",m),h.addEventListener("pointerleave",x),()=>{window.clearTimeout(p),h.removeEventListener("pointerenter",m),h.removeEventListener("pointerleave",x)}}},[s.scrollArea,s.scrollHideDelay]),g.jsx(xn,{present:r||c,children:g.jsx(nx,{"data-state":c?"visible":"hidden",...i,ref:l})})}),PO=y.forwardRef((n,l)=>{const{forceMount:r,...i}=n,s=Sn(Xn,n.__scopeScrollArea),c=n.orientation==="horizontal",d=pc(()=>p("SCROLL_END"),100),[h,p]=UO("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(h==="idle"){const m=window.setTimeout(()=>p("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(m)}},[h,s.scrollHideDelay,p]),y.useEffect(()=>{const m=s.viewport,x=c?"scrollLeft":"scrollTop";if(m){let v=m[x];const w=()=>{const C=m[x];v!==C&&(p("SCROLL"),d()),v=C};return m.addEventListener("scroll",w),()=>m.removeEventListener("scroll",w)}},[s.viewport,c,p,d]),g.jsx(xn,{present:r||h!=="hidden",children:g.jsx(ch,{"data-state":h==="hidden"?"hidden":"visible",...i,ref:l,onPointerEnter:we(n.onPointerEnter,()=>p("POINTER_ENTER")),onPointerLeave:we(n.onPointerLeave,()=>p("POINTER_LEAVE"))})})}),nx=y.forwardRef((n,l)=>{const r=Sn(Xn,n.__scopeScrollArea),{forceMount:i,...s}=n,[c,d]=y.useState(!1),h=n.orientation==="horizontal",p=pc(()=>{if(r.viewport){const m=r.viewport.offsetWidth<r.viewport.scrollWidth,x=r.viewport.offsetHeight<r.viewport.scrollHeight;d(h?m:x)}},10);return zr(r.viewport,p),zr(r.content,p),g.jsx(xn,{present:i||c,children:g.jsx(ch,{"data-state":c?"visible":"hidden",...s,ref:l})})}),ch=y.forwardRef((n,l)=>{const{orientation:r="vertical",...i}=n,s=Sn(Xn,n.__scopeScrollArea),c=y.useRef(null),d=y.useRef(0),[h,p]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=ix(h.viewport,h.content),x={...i,sizes:h,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:w=>c.current=w,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:w=>d.current=w};function v(w,C){return $O(w,d.current,h,C)}return r==="horizontal"?g.jsx(VO,{...x,ref:l,onThumbPositionChange:()=>{if(s.viewport&&c.current){const w=s.viewport.scrollLeft,C=wy(w,h,s.dir);c.current.style.transform=`translate3d(${C}px, 0, 0)`}},onWheelScroll:w=>{s.viewport&&(s.viewport.scrollLeft=w)},onDragScroll:w=>{s.viewport&&(s.viewport.scrollLeft=v(w,s.dir))}}):r==="vertical"?g.jsx(IO,{...x,ref:l,onThumbPositionChange:()=>{if(s.viewport&&c.current){const w=s.viewport.scrollTop,C=wy(w,h);c.current.style.transform=`translate3d(0, ${C}px, 0)`}},onWheelScroll:w=>{s.viewport&&(s.viewport.scrollTop=w)},onDragScroll:w=>{s.viewport&&(s.viewport.scrollTop=v(w))}}):null}),VO=y.forwardRef((n,l)=>{const{sizes:r,onSizesChange:i,...s}=n,c=Sn(Xn,n.__scopeScrollArea),[d,h]=y.useState(),p=y.useRef(null),m=He(l,p,c.onScrollbarXChange);return y.useEffect(()=>{p.current&&h(getComputedStyle(p.current))},[p]),g.jsx(lx,{"data-orientation":"horizontal",...s,ref:m,sizes:r,style:{bottom:0,left:c.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:c.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":hc(r)+"px",...n.style},onThumbPointerDown:x=>n.onThumbPointerDown(x.x),onDragScroll:x=>n.onDragScroll(x.x),onWheelScroll:(x,v)=>{if(c.viewport){const w=c.viewport.scrollLeft+x.deltaX;n.onWheelScroll(w),cx(w,v)&&x.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&i({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:Ks(d.paddingLeft),paddingEnd:Ks(d.paddingRight)}})}})}),IO=y.forwardRef((n,l)=>{const{sizes:r,onSizesChange:i,...s}=n,c=Sn(Xn,n.__scopeScrollArea),[d,h]=y.useState(),p=y.useRef(null),m=He(l,p,c.onScrollbarYChange);return y.useEffect(()=>{p.current&&h(getComputedStyle(p.current))},[p]),g.jsx(lx,{"data-orientation":"vertical",...s,ref:m,sizes:r,style:{top:0,right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":hc(r)+"px",...n.style},onThumbPointerDown:x=>n.onThumbPointerDown(x.y),onDragScroll:x=>n.onDragScroll(x.y),onWheelScroll:(x,v)=>{if(c.viewport){const w=c.viewport.scrollTop+x.deltaY;n.onWheelScroll(w),cx(w,v)&&x.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&i({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:Ks(d.paddingTop),paddingEnd:Ks(d.paddingBottom)}})}})}),[YO,ax]=Zb(Xn),lx=y.forwardRef((n,l)=>{const{__scopeScrollArea:r,sizes:i,hasThumb:s,onThumbChange:c,onThumbPointerUp:d,onThumbPointerDown:h,onThumbPositionChange:p,onDragScroll:m,onWheelScroll:x,onResize:v,...w}=n,C=Sn(Xn,r),[T,E]=y.useState(null),R=He(l,J=>E(J)),N=y.useRef(null),M=y.useRef(""),z=C.viewport,P=i.content-i.viewport,G=kt(x),k=kt(p),L=pc(v,10);function Y(J){if(N.current){const ne=J.clientX-N.current.left,re=J.clientY-N.current.top;m({x:ne,y:re})}}return y.useEffect(()=>{const J=ne=>{const re=ne.target;T?.contains(re)&&G(ne,P)};return document.addEventListener("wheel",J,{passive:!1}),()=>document.removeEventListener("wheel",J,{passive:!1})},[z,T,P,G]),y.useEffect(k,[i,k]),zr(T,L),zr(C.content,L),g.jsx(YO,{scope:r,scrollbar:T,hasThumb:s,onThumbChange:kt(c),onThumbPointerUp:kt(d),onThumbPositionChange:k,onThumbPointerDown:kt(h),children:g.jsx(Ce.div,{...w,ref:R,style:{position:"absolute",...w.style},onPointerDown:we(n.onPointerDown,J=>{J.button===0&&(J.target.setPointerCapture(J.pointerId),N.current=T.getBoundingClientRect(),M.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",C.viewport&&(C.viewport.style.scrollBehavior="auto"),Y(J))}),onPointerMove:we(n.onPointerMove,Y),onPointerUp:we(n.onPointerUp,J=>{const ne=J.target;ne.hasPointerCapture(J.pointerId)&&ne.releasePointerCapture(J.pointerId),document.body.style.webkitUserSelect=M.current,C.viewport&&(C.viewport.style.scrollBehavior=""),N.current=null})})})}),Fs="ScrollAreaThumb",rx=y.forwardRef((n,l)=>{const{forceMount:r,...i}=n,s=ax(Fs,n.__scopeScrollArea);return g.jsx(xn,{present:r||s.hasThumb,children:g.jsx(qO,{ref:l,...i})})}),qO=y.forwardRef((n,l)=>{const{__scopeScrollArea:r,style:i,...s}=n,c=Sn(Fs,r),d=ax(Fs,r),{onThumbPositionChange:h}=d,p=He(l,v=>d.onThumbChange(v)),m=y.useRef(void 0),x=pc(()=>{m.current&&(m.current(),m.current=void 0)},100);return y.useEffect(()=>{const v=c.viewport;if(v){const w=()=>{if(x(),!m.current){const C=XO(v,h);m.current=C,h()}};return h(),v.addEventListener("scroll",w),()=>v.removeEventListener("scroll",w)}},[c.viewport,x,h]),g.jsx(Ce.div,{"data-state":d.hasThumb?"visible":"hidden",...s,ref:p,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:we(n.onPointerDownCapture,v=>{const C=v.target.getBoundingClientRect(),T=v.clientX-C.left,E=v.clientY-C.top;d.onThumbPointerDown({x:T,y:E})}),onPointerUp:we(n.onPointerUp,d.onThumbPointerUp)})});rx.displayName=Fs;var uh="ScrollAreaCorner",ox=y.forwardRef((n,l)=>{const r=Sn(uh,n.__scopeScrollArea),i=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&i?g.jsx(GO,{...n,ref:l}):null});ox.displayName=uh;var GO=y.forwardRef((n,l)=>{const{__scopeScrollArea:r,...i}=n,s=Sn(uh,r),[c,d]=y.useState(0),[h,p]=y.useState(0),m=!!(c&&h);return zr(s.scrollbarX,()=>{const x=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(x),p(x)}),zr(s.scrollbarY,()=>{const x=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(x),d(x)}),m?g.jsx(Ce.div,{...i,ref:l,style:{width:c,height:h,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function Ks(n){return n?parseInt(n,10):0}function ix(n,l){const r=n/l;return isNaN(r)?0:r}function hc(n){const l=ix(n.viewport,n.content),r=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,i=(n.scrollbar.size-r)*l;return Math.max(i,18)}function $O(n,l,r,i="ltr"){const s=hc(r),c=s/2,d=l||c,h=s-d,p=r.scrollbar.paddingStart+d,m=r.scrollbar.size-r.scrollbar.paddingEnd-h,x=r.content-r.viewport,v=i==="ltr"?[0,x]:[x*-1,0];return sx([p,m],v)(n)}function wy(n,l,r="ltr"){const i=hc(l),s=l.scrollbar.paddingStart+l.scrollbar.paddingEnd,c=l.scrollbar.size-s,d=l.content-l.viewport,h=c-i,p=r==="ltr"?[0,d]:[d*-1,0],m=Nd(n,p);return sx([0,d],[0,h])(m)}function sx(n,l){return r=>{if(n[0]===n[1]||l[0]===l[1])return l[0];const i=(l[1]-l[0])/(n[1]-n[0]);return l[0]+i*(r-n[0])}}function cx(n,l){return n>0&&n<l}var XO=(n,l=()=>{})=>{let r={left:n.scrollLeft,top:n.scrollTop},i=0;return(function s(){const c={left:n.scrollLeft,top:n.scrollTop},d=r.left!==c.left,h=r.top!==c.top;(d||h)&&l(),r=c,i=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(i)};function pc(n,l){const r=kt(n),i=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(i.current),[]),y.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(r,l)},[r,l])}function zr(n,l){const r=kt(l);jt(()=>{let i=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(r)});return s.observe(n),()=>{window.cancelAnimationFrame(i),s.unobserve(n)}}},[n,r])}var FO=Wb,KO=ex,QO=ox;function ZO({className:n,children:l,...r}){return g.jsxs(FO,{"data-slot":"scroll-area",className:je("relative",n),...r,children:[g.jsx(KO,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:l}),g.jsx(WO,{}),g.jsx(QO,{})]})}function WO({className:n,orientation:l="vertical",...r}){return g.jsx(tx,{"data-slot":"scroll-area-scrollbar",orientation:l,className:je("flex touch-none p-px transition-colors select-none",l==="vertical"&&"h-full w-2.5 border-l border-l-transparent",l==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",n),...r,children:g.jsx(rx,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function JO({open:n,onOpenChange:l,history:r,onSelect:i,onClear:s,onDelete:c}){const{t:d}=Qo(),[h,p]=y.useState(""),m=y.useMemo(()=>{if(!h.trim())return r;const x=h.toLowerCase();return r.filter(v=>v.sourceText.toLowerCase().includes(x)||v.translatedText.toLowerCase().includes(x))},[r,h]);return g.jsx(OO,{open:n,onOpenChange:l,children:g.jsxs(_O,{side:"right",className:"w-[300px] sm:w-[400px] flex flex-col gap-0",children:[g.jsxs(MO,{className:"pb-4",children:[g.jsx(LO,{children:d("history")}),g.jsx(kO,{children:r.length===0?d("noHistory"):d("historyDesc")})]}),r.length>0&&g.jsx("div",{className:"px-4 pb-4",children:g.jsxs("div",{className:"relative",children:[g.jsx(V0,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground pointer-events-none"}),g.jsx(yn,{placeholder:d("searchPlaceholder"),className:"pl-8",value:h,onChange:x=>p(x.target.value)})]})}),g.jsx(ZO,{className:"flex-1 px-4 min-h-0",children:g.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[m.map(x=>g.jsxs("div",{className:"relative flex flex-col gap-2 rounded-lg border p-3 hover:bg-accent cursor-pointer transition-colors group",onClick:()=>{i(x),l(!1)},children:[g.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[g.jsxs("span",{children:[x.from," → ",x.to]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-6 w-6 -mr-1 text-muted-foreground hover:text-destructive z-10 opacity-0 group-hover:opacity-100 transition-opacity",onClick:v=>{v.stopPropagation(),c(x.id)},"aria-label":d("delete"),children:g.jsx(IR,{className:"h-3 w-3"})})}),g.jsx(Ot,{children:g.jsx("p",{children:d("delete")})})]})]}),g.jsx("div",{className:"text-sm line-clamp-2 font-medium break-all",children:x.sourceText}),g.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2 break-all",children:x.translatedText})]},x.id)),m.length===0&&h&&g.jsx("div",{className:"text-center text-sm text-muted-foreground py-8",children:d("noResults")})]})}),r.length>0&&g.jsx(zO,{className:"p-4 border-t mt-auto",children:g.jsx(tt,{variant:"destructive",className:"w-full",onClick:s,children:d("clearAll")})})]})})}function Ar({className:n,...l}){return g.jsx("div",{"data-slot":"card",className:je("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",n),...l})}function Bo({className:n,...l}){return g.jsx("div",{"data-slot":"card-header",className:je("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",n),...l})}function Po({className:n,...l}){return g.jsx("div",{"data-slot":"card-title",className:je("leading-none font-semibold",n),...l})}function Nr({className:n,...l}){return g.jsx("div",{"data-slot":"card-content",className:je("px-6",n),...l})}function Cy({className:n,...l}){return g.jsx("textarea",{"data-slot":"textarea",className:je("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),...l})}var ej=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tj=ej.reduce((n,l)=>{const r=Ld(`Primitive.${l}`),i=y.forwardRef((s,c)=>{const{asChild:d,...h}=s,p=d?r:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(p,{...h,ref:c})});return i.displayName=`Primitive.${l}`,{...n,[l]:i}},{}),nj="Label",ux=y.forwardRef((n,l)=>g.jsx(tj.label,{...n,ref:l,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(n.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));ux.displayName=nj;var aj=ux;function Ey({className:n,...l}){return g.jsx(aj,{"data-slot":"label",className:je("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",n),...l})}function lj({className:n,...l}){return g.jsx(P0,{role:"status","aria-label":"Loading",className:je("size-4 animate-spin",n),...l})}function fx(n){const l=y.useRef({value:n,previous:n});return y.useMemo(()=>(l.current.value!==n&&(l.current.previous=l.current.value,l.current.value=n),l.current.previous),[n])}var mc="Switch",[rj]=Gn(mc),[oj,ij]=rj(mc),dx=y.forwardRef((n,l)=>{const{__scopeSwitch:r,name:i,checked:s,defaultChecked:c,required:d,disabled:h,value:p="on",onCheckedChange:m,form:x,...v}=n,[w,C]=y.useState(null),T=He(l,z=>C(z)),E=y.useRef(!1),R=w?x||!!w.closest("form"):!0,[N,M]=qn({prop:s,defaultProp:c??!1,onChange:m,caller:mc});return g.jsxs(oj,{scope:r,checked:N,disabled:h,children:[g.jsx(Ce.button,{type:"button",role:"switch","aria-checked":N,"aria-required":d,"data-state":gx(N),"data-disabled":h?"":void 0,disabled:h,value:p,...v,ref:T,onClick:we(n.onClick,z=>{M(P=>!P),R&&(E.current=z.isPropagationStopped(),E.current||z.stopPropagation())})}),R&&g.jsx(mx,{control:w,bubbles:!E.current,name:i,value:p,checked:N,required:d,disabled:h,form:x,style:{transform:"translateX(-100%)"}})]})});dx.displayName=mc;var hx="SwitchThumb",px=y.forwardRef((n,l)=>{const{__scopeSwitch:r,...i}=n,s=ij(hx,r);return g.jsx(Ce.span,{"data-state":gx(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:l})});px.displayName=hx;var sj="SwitchBubbleInput",mx=y.forwardRef(({__scopeSwitch:n,control:l,checked:r,bubbles:i=!0,...s},c)=>{const d=y.useRef(null),h=He(d,c),p=fx(r),m=y0(l);return y.useEffect(()=>{const x=d.current;if(!x)return;const v=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(v,"checked").set;if(p!==r&&C){const T=new Event("click",{bubbles:i});C.call(x,r),x.dispatchEvent(T)}},[p,r,i]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:h,style:{...s.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});mx.displayName=sj;function gx(n){return n?"checked":"unchecked"}var cj=dx,uj=px;function Cl({className:n,...l}){return g.jsx(cj,{"data-slot":"switch",className:je("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",n),...l,children:g.jsx(uj,{"data-slot":"switch-thumb",className:je("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const ad=768;function fj(){const[n,l]=y.useState(void 0);return y.useEffect(()=>{const r=window.matchMedia(`(max-width: ${ad-1}px)`),i=()=>{l(window.innerWidth<ad)};return r.addEventListener("change",i),l(window.innerWidth<ad),()=>r.removeEventListener("change",i)},[]),!!n}const dj=(n,l)=>{if(!n||n.length===0)return[];let r=null;try{r=new Intl.DisplayNames([l],{type:"language"})}catch(s){console.warn("Intl.DisplayNames not supported or invalid locale",s)}return n.filter(s=>s!=="auto").map(s=>{let c=s;if(r)try{c=r.of(s)||s}catch{}return{code:s,name:c}}).sort((s,c)=>s.name.localeCompare(c.name,l))};function hj({id:n,isPrimary:l,languages:r,loadingLanguages:i,addToHistory:s,onDelete:c,canDelete:d}){const{t:h,i18n:p}=Qo(),m=fj(),x=ae=>`panel_${n}_${ae}`,[v,w]=y.useState(()=>localStorage.getItem(x("sourceLang"))||"auto"),[C,T]=y.useState(()=>localStorage.getItem(x("targetLang"))||"zh-Hans"),[E,R]=y.useState(""),[N,M]=y.useState(""),[z,P]=y.useState(!1),[G,k]=y.useState(()=>localStorage.getItem(x("autoTranslate"))==="true"),[L,Y]=y.useState(!1),[J,ne]=y.useState(!1),[re,K]=y.useState(!1),[ie,ce]=y.useState(!0),[he,D]=y.useState(()=>{try{const ae=localStorage.getItem("recentTranslateLanguages");if(!ae)return[];const xe=JSON.parse(ae);return Array.isArray(xe)?xe:[]}catch{return[]}}),$="firstTranslateTipShown",B=y.useRef(null),ue=y.useRef(null),de=y.useRef(null),A=y.useMemo(()=>dj(r,p.language),[r,p.language]),O=y.useMemo(()=>{const ae=["en","zh-Hans","ja"],xe=new Set(A.map(Ve=>Ve.code));return ae.filter(Ve=>xe.has(Ve))},[A]),U=y.useMemo(()=>{const ae=new Map(A.map(xe=>[xe.code,xe]));return he.flatMap(xe=>{const Ve=ae.get(xe);return Ve?[Ve]:[]})},[he,A]);y.useEffect(()=>{localStorage.setItem(x("sourceLang"),v)},[v,n]),y.useEffect(()=>{localStorage.setItem(x("targetLang"),C)},[C,n]),y.useEffect(()=>{localStorage.setItem(x("autoTranslate"),String(G))},[G,n]),y.useEffect(()=>{if(!l)return;const ae=xe=>{const nt=xe.detail;nt&&(w(nt.from),T(nt.to),R(nt.sourceText),M(nt.translatedText))};return window.addEventListener("loadHistoryItem",ae),()=>{window.removeEventListener("loadHistoryItem",ae)}},[l]);const X=y.useCallback(async(ae,xe=!0)=>{const Ve=ae??E;if(!Ve.trim()){xe&&ut.error(h("enterTextError"));return}localStorage.getItem($)!=="true"&&(localStorage.setItem($,"true"),ut(h("firstTranslationTip"),{position:"bottom-right"})),P(!0),M("");try{const nt={from:v,to:C,text:Ve,html:!1},Ye={"Content-Type":"application/json"},St=localStorage.getItem("apiToken");St&&(Ye.Authorization=`Bearer ${St}`);const at=await fetch("/translate",{method:"POST",headers:Ye,body:JSON.stringify(nt)});if(!at.ok){if(at.status===401)throw new Error(h("apiTokenPlaceholder"));const Fn=await at.json();throw new Error(Fn.error||h("translationFailed"))}const jl=await at.json();M(jl.result),s({from:v,to:C,sourceText:Ve,translatedText:jl.result}),xe&&ut.success(h("translationCompleted"))}catch(nt){console.error("Translation error:",nt),xe&&ut.error(nt instanceof Error?nt.message:h("translationFailed"))}finally{P(!1),setTimeout(()=>{B.current?.focus()},0)}},[v,C,E,h,s]),Q=y.useCallback(ae=>{G&&ae.trim()&&(de.current&&clearTimeout(de.current),de.current=window.setTimeout(()=>{X(ae,!1)},800))},[G,X]),oe=ae=>{R(ae),Q(ae)};y.useEffect(()=>()=>{de.current&&window.clearTimeout(de.current)},[]),y.useEffect(()=>{const ae=window.SpeechRecognition||window.webkitSpeechRecognition;if(!ae){ce(!1);return}const xe=new ae;return xe.continuous=!0,xe.interimResults=!1,xe.onresult=Ve=>{let nt="";for(let Ye=Ve.resultIndex;Ye<Ve.results.length;Ye+=1){const St=Ve.results[Ye];St.isFinal&&(nt+=St[0].transcript)}nt.trim()&&R(Ye=>{const St=nt.trim(),at=Ye?`${Ye}${Ye.endsWith(" ")?"":" "}${St}`:St;return Q(at),at})},xe.onerror=()=>{K(!1),ut.error(h("speechInputFailed"))},xe.onend=()=>{K(!1)},ue.current=xe,()=>{xe.onresult=null,xe.onerror=null,xe.onend=null,xe.stop(),ue.current=null}},[Q,h]);const Z=()=>{w(C),T(v),R(N),M(E)},se=ae=>{if(ae==="auto")return;const xe=[ae,...he.filter(Ve=>Ve!==ae)].slice(0,5);D(xe),localStorage.setItem("recentTranslateLanguages",JSON.stringify(xe))},fe=ae=>ae==="auto"?h("autoDetect"):A.find(Ve=>Ve.code===ae)?.name||ae,be=ae=>{w(ae),se(ae),Y(!1)},Ae=ae=>{T(ae),se(ae),ne(!1)},De=async ae=>{if(ae)try{await navigator.clipboard.writeText(ae),ut.success(h("copied"))}catch{ut.error(h("copyFailed"))}},ft=(ae,xe)=>{if(!ae)return;const Ve=new SpeechSynthesisUtterance(ae);Ve.lang=xe==="auto"?"en-US":xe,window.speechSynthesis.speak(Ve)},it=()=>{R(""),M("")},wn=ae=>{(ae.ctrlKey||ae.metaKey)&&ae.key==="Enter"&&(ae.preventDefault(),X())},on=ae=>{const xe=ae.target.files?.[0];if(!xe)return;const Ve=new FileReader;Ve.onload=nt=>{const Ye=nt.target?.result;typeof Ye=="string"&&R(Ye)},Ve.readAsText(xe)},Qt=()=>{if(!ie){ut.error(h("speechNotSupported"));return}const ae=ue.current;if(!ae){ut.error(h("speechNotSupported"));return}if(re){ae.stop(),K(!1);return}ae.lang=v==="auto"?p.language:v;try{ae.start(),K(!0)}catch{K(!1),ut.error(h("speechInputFailed"))}};return g.jsx(Ar,{className:"shadow-lg h-full flex flex-col",children:g.jsxs(Nr,{className:"pt-1 sm:pt-1 space-y-3 sm:space-y-4 flex-1 flex flex-col",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-3 justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-[280px]",children:[g.jsxs(vd,{open:L,onOpenChange:Y,children:[g.jsx(yd,{asChild:!0,children:g.jsxs(tt,{variant:"outline",className:"w-[110px] sm:w-[140px] justify-between",disabled:i,"aria-label":h("sourceLanguage"),children:[g.jsx("span",{className:"truncate",children:fe(v)}),g.jsx(qs,{className:"h-4 w-4 opacity-50"})]})}),g.jsxs(bd,{className:"w-72 p-2",align:"start",children:[O.length>0&&g.jsx("div",{className:"mb-2",children:g.jsxs(Ad,{type:"single",value:v,onValueChange:ae=>{ae&&be(ae)},variant:"outline",size:"sm",className:"w-full justify-between",children:[g.jsx(Go,{value:"auto",className:"flex-1",children:h("autoDetect")}),O.map(ae=>g.jsx(Go,{value:ae,className:"flex-1",children:fe(ae)},ae))]})}),g.jsxs(wd,{children:[g.jsx(Cd,{placeholder:h("languageSearchPlaceholder"),autoFocus:!0}),g.jsxs(Ed,{children:[g.jsx(Td,{children:h("noResults")}),g.jsx($a,{heading:h("autoDetect"),children:g.jsx(Xa,{value:"auto",onSelect:()=>be("auto"),children:h("autoDetect")})}),U.length>0&&g.jsx($a,{heading:h("languageRecent"),children:U.map(ae=>g.jsx(Xa,{value:`${ae.name} ${ae.code}`,onSelect:()=>be(ae.code),children:ae.name},ae.code))}),g.jsx($a,{heading:h("languageAll"),children:A.map(ae=>g.jsx(Xa,{value:`${ae.name} ${ae.code}`,onSelect:()=>be(ae.code),children:ae.name},ae.code))})]})]})]})]}),g.jsx(tt,{variant:"ghost",size:"icon",onClick:Z,disabled:i||v==="auto",className:"h-9 w-9 flex-shrink-0",children:g.jsx(rR,{className:"h-4 w-4"})}),g.jsxs(vd,{open:J,onOpenChange:ne,children:[g.jsx(yd,{asChild:!0,children:g.jsxs(tt,{variant:"outline",className:"w-[110px] sm:w-[140px] justify-between",disabled:i,"aria-label":h("targetLanguage"),children:[g.jsx("span",{className:"truncate",children:fe(C)}),g.jsx(qs,{className:"h-4 w-4 opacity-50"})]})}),g.jsxs(bd,{className:"w-72 p-2",align:"start",children:[O.length>0&&g.jsx("div",{className:"mb-2",children:g.jsx(Ad,{type:"single",value:C,onValueChange:ae=>{ae&&Ae(ae)},variant:"outline",size:"sm",className:"w-full justify-between",children:O.map(ae=>g.jsx(Go,{value:ae,className:"flex-1",children:fe(ae)},ae))})}),g.jsxs(wd,{children:[g.jsx(Cd,{placeholder:h("languageSearchPlaceholder"),autoFocus:!0}),g.jsxs(Ed,{children:[g.jsx(Td,{children:h("noResults")}),U.length>0&&g.jsx($a,{heading:h("languageRecent"),children:U.map(ae=>g.jsx(Xa,{value:`${ae.name} ${ae.code}`,onSelect:()=>Ae(ae.code),children:ae.name},ae.code))}),g.jsx($a,{heading:h("languageAll"),children:A.map(ae=>g.jsx(Xa,{value:`${ae.name} ${ae.code}`,onSelect:()=>Ae(ae.code),children:ae.name},ae.code))})]})]})]})]})]}),g.jsxs("div",{className:"flex items-center gap-2 justify-end flex-shrink-0 ml-auto sm:ml-0",children:[g.jsx(Cl,{id:`auto-translate-${n}`,checked:G,onCheckedChange:k}),g.jsx(Ey,{htmlFor:`auto-translate-${n}`,className:"text-xs cursor-pointer whitespace-nowrap",children:h("autoTranslate")}),d&&g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:c,className:"text-muted-foreground hover:text-destructive h-8 w-8 ml-2 shrink-0","aria-label":h("closePanel"),children:g.jsx(Gs,{className:"h-4 w-4"})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("closePanel")})})]})]})]}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 sm:gap-4 flex-1",children:[g.jsxs("div",{className:"relative group h-full flex flex-col",children:[g.jsx(Cy,{id:`source-text-${n}`,ref:B,placeholder:h("enterText"),value:E,onChange:ae=>oe(ae.target.value),onKeyDown:wn,className:`${m?"min-h-[200px]":"min-h-[300px]"} h-full resize-none text-base pr-10 pb-10 flex-1`,disabled:z}),E&&g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{variant:"ghost",size:"icon",className:"absolute top-2 right-2 h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",onClick:it,"aria-label":h("clear"),children:g.jsx(Gs,{className:"h-4 w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("clear")})})]}),g.jsx("div",{className:"absolute bottom-2 left-2 text-xs text-muted-foreground pointer-events-none",children:E.length}),g.jsxs("div",{className:"absolute bottom-2 right-2 flex gap-1",children:[g.jsx("input",{type:"file",id:`file-upload-${n}`,className:"hidden",accept:".txt,.md,.json,.js,.ts,.go,.py,.java,.c,.cpp,.h,.hpp",onChange:on}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(Ey,{htmlFor:`file-upload-${n}`,className:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-8 w-8 cursor-pointer","aria-label":h("uploadFile"),children:g.jsx($R,{className:"h-4 w-4"})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("uploadFile")})})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Qt,disabled:z||!ie,"aria-label":h(re?"voiceInputStop":"voiceInputStart"),children:re?g.jsx(AR,{className:"h-4 w-4"}):g.jsx(OR,{className:"h-4 w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:h(re?"voiceInputStop":"voiceInputStart")})})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>ft(E,v),disabled:!E,"aria-label":h("listen"),children:g.jsx(oy,{className:"h-4 w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("listen")})})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>De(E),disabled:!E,"aria-label":h("copy"),children:g.jsx(ry,{className:"h-4 w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("copy")})})]})]})]}),g.jsxs("div",{className:"relative h-full flex flex-col",children:[g.jsx(Cy,{id:`translated-text-${n}`,placeholder:h("translationWillAppear"),value:N,readOnly:!0,className:`${m?"min-h-[200px]":"min-h-[300px]"} h-full resize-none text-base bg-muted pb-10 flex-1`}),g.jsx("div",{className:"absolute bottom-2 left-2 text-xs text-muted-foreground pointer-events-none",children:N.length}),g.jsxs("div",{className:"absolute bottom-2 right-2 flex gap-1",children:[g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>ft(N,C),disabled:!N,"aria-label":h("listen"),children:g.jsx(oy,{className:"h-4 w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("listen")})})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>De(N),disabled:!N,"aria-label":h("copy"),children:g.jsx(ry,{className:"h-4 w-4"})})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("copy")})})]})]})]})]}),!G&&g.jsx("div",{className:"flex justify-center mt-auto pt-2",children:g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("span",{className:"inline-flex",children:g.jsx(tt,{onClick:()=>X(),disabled:z||i||!E.trim(),className:m?"w-full":"min-w-[200px]",size:"lg",children:z?g.jsxs(g.Fragment,{children:[g.jsx(lj,{className:"mr-2 h-4 w-4"}),h("translating")]}):h("translate")})})}),g.jsx(Ot,{children:g.jsx("p",{children:h("translateShortcut")})})]})})]})})}const Os="translation_history",pj=50;function mj(){const[n,l]=y.useState([]);return y.useEffect(()=>{try{const c=localStorage.getItem(Os);c&&l(JSON.parse(c))}catch(c){console.error("Failed to load history",c)}},[]),{history:n,addToHistory:c=>{const d={...c,id:`${Date.now()}-${Math.random().toString(36).substring(2,11)}`,timestamp:Date.now()};l(h=>{const p=h.filter(x=>!(x.sourceText===c.sourceText&&x.from===c.from&&x.to===c.to)),m=[d,...p].slice(0,pj);return localStorage.setItem(Os,JSON.stringify(m)),m})},clearHistory:()=>{l([]),localStorage.removeItem(Os)},deleteItem:c=>{l(d=>{const h=d.filter(p=>p.id!==c);return localStorage.setItem(Os,JSON.stringify(h)),h})}}}function gj(n){const l=vj(n),r=y.forwardRef((i,s)=>{const{children:c,...d}=i,h=y.Children.toArray(c),p=h.find(bj);if(p){const m=p.props.children,x=h.map(v=>v===p?y.Children.count(m)>1?y.Children.only(null):y.isValidElement(m)?m.props.children:null:v);return g.jsx(l,{...d,ref:s,children:y.isValidElement(m)?y.cloneElement(m,void 0,x):null})}return g.jsx(l,{...d,ref:s,children:c})});return r.displayName=`${n}.Slot`,r}function vj(n){const l=y.forwardRef((r,i)=>{const{children:s,...c}=r;if(y.isValidElement(s)){const d=Sj(s),h=xj(c,s.props);return s.type!==y.Fragment&&(h.ref=i?bn(i,d):d),y.cloneElement(s,h)}return y.Children.count(s)>1?y.Children.only(null):null});return l.displayName=`${n}.SlotClone`,l}var yj=Symbol("radix.slottable");function bj(n){return y.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===yj}function xj(n,l){const r={...l};for(const i in l){const s=n[i],c=l[i];/^on[A-Z]/.test(i)?s&&c?r[i]=(...h)=>{const p=c(...h);return s(...h),p}:s&&(r[i]=s):i==="style"?r[i]={...s,...c}:i==="className"&&(r[i]=[s,c].filter(Boolean).join(" "))}return{...n,...r}}function Sj(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning;return r?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,r=l&&"isReactWarning"in l&&l.isReactWarning,r?n.props.ref:n.props.ref||n.ref)}var wj=[" ","Enter","ArrowUp","ArrowDown"],Cj=[" ","Enter"],Nl="Select",[gc,vc,Ej]=Lb(Nl),[Vr]=Gn(Nl,[Ej,Br]),yc=Br(),[Tj,Ja]=Vr(Nl),[Rj,Aj]=Vr(Nl),vx=n=>{const{__scopeSelect:l,children:r,open:i,defaultOpen:s,onOpenChange:c,value:d,defaultValue:h,onValueChange:p,dir:m,name:x,autoComplete:v,disabled:w,required:C,form:T}=n,E=yc(l),[R,N]=y.useState(null),[M,z]=y.useState(null),[P,G]=y.useState(!1),k=dc(m),[L,Y]=qn({prop:i,defaultProp:s??!1,onChange:c,caller:Nl}),[J,ne]=qn({prop:d,defaultProp:h,onChange:p,caller:Nl}),re=y.useRef(null),K=R?T||!!R.closest("form"):!0,[ie,ce]=y.useState(new Set),he=Array.from(ie).map(D=>D.props.value).join(";");return g.jsx(Gd,{...E,children:g.jsxs(Tj,{required:C,scope:l,trigger:R,onTriggerChange:N,valueNode:M,onValueNodeChange:z,valueNodeHasChildren:P,onValueNodeHasChildrenChange:G,contentId:Ut(),value:J,onValueChange:ne,open:L,onOpenChange:Y,dir:k,triggerPointerDownPosRef:re,disabled:w,children:[g.jsx(gc.Provider,{scope:l,children:g.jsx(Rj,{scope:n.__scopeSelect,onNativeOptionAdd:y.useCallback(D=>{ce($=>new Set($).add(D))},[]),onNativeOptionRemove:y.useCallback(D=>{ce($=>{const B=new Set($);return B.delete(D),B})},[]),children:r})}),K?g.jsxs(Bx,{"aria-hidden":!0,required:C,tabIndex:-1,name:x,autoComplete:v,value:J,onChange:D=>ne(D.target.value),disabled:w,form:T,children:[J===void 0?g.jsx("option",{value:""}):null,Array.from(ie)]},he):null]})})};vx.displayName=Nl;var yx="SelectTrigger",bx=y.forwardRef((n,l)=>{const{__scopeSelect:r,disabled:i=!1,...s}=n,c=yc(r),d=Ja(yx,r),h=d.disabled||i,p=He(l,d.onTriggerChange),m=vc(r),x=y.useRef("touch"),[v,w,C]=Vx(E=>{const R=m().filter(z=>!z.disabled),N=R.find(z=>z.value===d.value),M=Ix(R,E,N);M!==void 0&&d.onValueChange(M.value)}),T=E=>{h||(d.onOpenChange(!0),C()),E&&(d.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return g.jsx(ac,{asChild:!0,...c,children:g.jsx(Ce.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":Px(d.value)?"":void 0,...s,ref:p,onClick:we(s.onClick,E=>{E.currentTarget.focus(),x.current!=="mouse"&&T(E)}),onPointerDown:we(s.onPointerDown,E=>{x.current=E.pointerType;const R=E.target;R.hasPointerCapture(E.pointerId)&&R.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(T(E),E.preventDefault())}),onKeyDown:we(s.onKeyDown,E=>{const R=v.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&w(E.key),!(R&&E.key===" ")&&wj.includes(E.key)&&(T(),E.preventDefault())})})})});bx.displayName=yx;var xx="SelectValue",Sx=y.forwardRef((n,l)=>{const{__scopeSelect:r,className:i,style:s,children:c,placeholder:d="",...h}=n,p=Ja(xx,r),{onValueNodeHasChildrenChange:m}=p,x=c!==void 0,v=He(l,p.onValueNodeChange);return jt(()=>{m(x)},[m,x]),g.jsx(Ce.span,{...h,ref:v,style:{pointerEvents:"none"},children:Px(p.value)?g.jsx(g.Fragment,{children:d}):c})});Sx.displayName=xx;var Nj="SelectIcon",wx=y.forwardRef((n,l)=>{const{__scopeSelect:r,children:i,...s}=n;return g.jsx(Ce.span,{"aria-hidden":!0,...s,ref:l,children:i||"▼"})});wx.displayName=Nj;var Oj="SelectPortal",Cx=n=>g.jsx(ei,{asChild:!0,...n});Cx.displayName=Oj;var Ol="SelectContent",Ex=y.forwardRef((n,l)=>{const r=Ja(Ol,n.__scopeSelect),[i,s]=y.useState();if(jt(()=>{s(new DocumentFragment)},[]),!r.open){const c=i;return c?Zo.createPortal(g.jsx(Tx,{scope:n.__scopeSelect,children:g.jsx(gc.Slot,{scope:n.__scopeSelect,children:g.jsx("div",{children:n.children})})}),c):null}return g.jsx(Rx,{...n,ref:l})});Ex.displayName=Ol;var Nn=10,[Tx,el]=Vr(Ol),jj="SelectContentImpl",Dj=gj("SelectContent.RemoveScroll"),Rx=y.forwardRef((n,l)=>{const{__scopeSelect:r,position:i="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:c,onPointerDownOutside:d,side:h,sideOffset:p,align:m,alignOffset:x,arrowPadding:v,collisionBoundary:w,collisionPadding:C,sticky:T,hideWhenDetached:E,avoidCollisions:R,...N}=n,M=Ja(Ol,r),[z,P]=y.useState(null),[G,k]=y.useState(null),L=He(l,Z=>P(Z)),[Y,J]=y.useState(null),[ne,re]=y.useState(null),K=vc(r),[ie,ce]=y.useState(!1),he=y.useRef(!1);y.useEffect(()=>{if(z)return Zd(z)},[z]),Qd();const D=y.useCallback(Z=>{const[se,...fe]=K().map(De=>De.ref.current),[be]=fe.slice(-1),Ae=document.activeElement;for(const De of Z)if(De===Ae||(De?.scrollIntoView({block:"nearest"}),De===se&&G&&(G.scrollTop=0),De===be&&G&&(G.scrollTop=G.scrollHeight),De?.focus(),document.activeElement!==Ae))return},[K,G]),$=y.useCallback(()=>D([Y,z]),[D,Y,z]);y.useEffect(()=>{ie&&$()},[ie,$]);const{onOpenChange:B,triggerPointerDownPosRef:ue}=M;y.useEffect(()=>{if(z){let Z={x:0,y:0};const se=be=>{Z={x:Math.abs(Math.round(be.pageX)-(ue.current?.x??0)),y:Math.abs(Math.round(be.pageY)-(ue.current?.y??0))}},fe=be=>{Z.x<=10&&Z.y<=10?be.preventDefault():z.contains(be.target)||B(!1),document.removeEventListener("pointermove",se),ue.current=null};return ue.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",fe,{capture:!0})}}},[z,B,ue]),y.useEffect(()=>{const Z=()=>B(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[B]);const[de,A]=Vx(Z=>{const se=K().filter(Ae=>!Ae.disabled),fe=se.find(Ae=>Ae.ref.current===document.activeElement),be=Ix(se,Z,fe);be&&setTimeout(()=>be.ref.current.focus())}),O=y.useCallback((Z,se,fe)=>{const be=!he.current&&!fe;(M.value!==void 0&&M.value===se||be)&&(J(Z),be&&(he.current=!0))},[M.value]),U=y.useCallback(()=>z?.focus(),[z]),X=y.useCallback((Z,se,fe)=>{const be=!he.current&&!fe;(M.value!==void 0&&M.value===se||be)&&re(Z)},[M.value]),Q=i==="popper"?Od:Ax,oe=Q===Od?{side:h,sideOffset:p,align:m,alignOffset:x,arrowPadding:v,collisionBoundary:w,collisionPadding:C,sticky:T,hideWhenDetached:E,avoidCollisions:R}:{};return g.jsx(Tx,{scope:r,content:z,viewport:G,onViewportChange:k,itemRefCallback:O,selectedItem:Y,onItemLeave:U,itemTextRefCallback:X,focusSelectedItem:$,selectedItemText:ne,position:i,isPositioned:ie,searchRef:de,children:g.jsx(sc,{as:Dj,allowPinchZoom:!0,children:g.jsx(oc,{asChild:!0,trapped:M.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:we(s,Z=>{M.trigger?.focus({preventScroll:!0}),Z.preventDefault()}),children:g.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>M.onOpenChange(!1),children:g.jsx(Q,{role:"listbox",id:M.contentId,"data-state":M.open?"open":"closed",dir:M.dir,onContextMenu:Z=>Z.preventDefault(),...N,...oe,onPlaced:()=>ce(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:we(N.onKeyDown,Z=>{const se=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!se&&Z.key.length===1&&A(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let be=K().filter(Ae=>!Ae.disabled).map(Ae=>Ae.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(be=be.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const Ae=Z.target,De=be.indexOf(Ae);be=be.slice(De+1)}setTimeout(()=>D(be)),Z.preventDefault()}})})})})})})});Rx.displayName=jj;var _j="SelectItemAlignedPosition",Ax=y.forwardRef((n,l)=>{const{__scopeSelect:r,onPlaced:i,...s}=n,c=Ja(Ol,r),d=el(Ol,r),[h,p]=y.useState(null),[m,x]=y.useState(null),v=He(l,L=>x(L)),w=vc(r),C=y.useRef(!1),T=y.useRef(!0),{viewport:E,selectedItem:R,selectedItemText:N,focusSelectedItem:M}=d,z=y.useCallback(()=>{if(c.trigger&&c.valueNode&&h&&m&&E&&R&&N){const L=c.trigger.getBoundingClientRect(),Y=m.getBoundingClientRect(),J=c.valueNode.getBoundingClientRect(),ne=N.getBoundingClientRect();if(c.dir!=="rtl"){const Ae=ne.left-Y.left,De=J.left-Ae,ft=L.left-De,it=L.width+ft,wn=Math.max(it,Y.width),on=window.innerWidth-Nn,Qt=Nd(De,[Nn,Math.max(Nn,on-wn)]);h.style.minWidth=it+"px",h.style.left=Qt+"px"}else{const Ae=Y.right-ne.right,De=window.innerWidth-J.right-Ae,ft=window.innerWidth-L.right-De,it=L.width+ft,wn=Math.max(it,Y.width),on=window.innerWidth-Nn,Qt=Nd(De,[Nn,Math.max(Nn,on-wn)]);h.style.minWidth=it+"px",h.style.right=Qt+"px"}const re=w(),K=window.innerHeight-Nn*2,ie=E.scrollHeight,ce=window.getComputedStyle(m),he=parseInt(ce.borderTopWidth,10),D=parseInt(ce.paddingTop,10),$=parseInt(ce.borderBottomWidth,10),B=parseInt(ce.paddingBottom,10),ue=he+D+ie+B+$,de=Math.min(R.offsetHeight*5,ue),A=window.getComputedStyle(E),O=parseInt(A.paddingTop,10),U=parseInt(A.paddingBottom,10),X=L.top+L.height/2-Nn,Q=K-X,oe=R.offsetHeight/2,Z=R.offsetTop+oe,se=he+D+Z,fe=ue-se;if(se<=X){const Ae=re.length>0&&R===re[re.length-1].ref.current;h.style.bottom="0px";const De=m.clientHeight-E.offsetTop-E.offsetHeight,ft=Math.max(Q,oe+(Ae?U:0)+De+$),it=se+ft;h.style.height=it+"px"}else{const Ae=re.length>0&&R===re[0].ref.current;h.style.top="0px";const ft=Math.max(X,he+E.offsetTop+(Ae?O:0)+oe)+fe;h.style.height=ft+"px",E.scrollTop=se-X+E.offsetTop}h.style.margin=`${Nn}px 0`,h.style.minHeight=de+"px",h.style.maxHeight=K+"px",i?.(),requestAnimationFrame(()=>C.current=!0)}},[w,c.trigger,c.valueNode,h,m,E,R,N,c.dir,i]);jt(()=>z(),[z]);const[P,G]=y.useState();jt(()=>{m&&G(window.getComputedStyle(m).zIndex)},[m]);const k=y.useCallback(L=>{L&&T.current===!0&&(z(),M?.(),T.current=!1)},[z,M]);return g.jsx(zj,{scope:r,contentWrapper:h,shouldExpandOnScrollRef:C,onScrollButtonChange:k,children:g.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:g.jsx(Ce.div,{...s,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Ax.displayName=_j;var Mj="SelectPopperPosition",Od=y.forwardRef((n,l)=>{const{__scopeSelect:r,align:i="start",collisionPadding:s=Nn,...c}=n,d=yc(r);return g.jsx($d,{...d,...c,ref:l,align:i,collisionPadding:s,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Od.displayName=Mj;var[zj,fh]=Vr(Ol,{}),jd="SelectViewport",Nx=y.forwardRef((n,l)=>{const{__scopeSelect:r,nonce:i,...s}=n,c=el(jd,r),d=fh(jd,r),h=He(l,c.onViewportChange),p=y.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),g.jsx(gc.Slot,{scope:r,children:g.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:we(s.onScroll,m=>{const x=m.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=d;if(w?.current&&v){const C=Math.abs(p.current-x.scrollTop);if(C>0){const T=window.innerHeight-Nn*2,E=parseFloat(v.style.minHeight),R=parseFloat(v.style.height),N=Math.max(E,R);if(N<T){const M=N+C,z=Math.min(T,M),P=M-z;v.style.height=z+"px",v.style.bottom==="0px"&&(x.scrollTop=P>0?P:0,v.style.justifyContent="flex-end")}}}p.current=x.scrollTop})})})]})});Nx.displayName=jd;var Ox="SelectGroup",[Lj,kj]=Vr(Ox),Uj=y.forwardRef((n,l)=>{const{__scopeSelect:r,...i}=n,s=Ut();return g.jsx(Lj,{scope:r,id:s,children:g.jsx(Ce.div,{role:"group","aria-labelledby":s,...i,ref:l})})});Uj.displayName=Ox;var jx="SelectLabel",Hj=y.forwardRef((n,l)=>{const{__scopeSelect:r,...i}=n,s=kj(jx,r);return g.jsx(Ce.div,{id:s.id,...i,ref:l})});Hj.displayName=jx;var Qs="SelectItem",[Bj,Dx]=Vr(Qs),_x=y.forwardRef((n,l)=>{const{__scopeSelect:r,value:i,disabled:s=!1,textValue:c,...d}=n,h=Ja(Qs,r),p=el(Qs,r),m=h.value===i,[x,v]=y.useState(c??""),[w,C]=y.useState(!1),T=He(l,M=>p.itemRefCallback?.(M,i,s)),E=Ut(),R=y.useRef("touch"),N=()=>{s||(h.onValueChange(i),h.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(Bj,{scope:r,value:i,disabled:s,textId:E,isSelected:m,onItemTextChange:y.useCallback(M=>{v(z=>z||(M?.textContent??"").trim())},[]),children:g.jsx(gc.ItemSlot,{scope:r,value:i,disabled:s,textValue:x,children:g.jsx(Ce.div,{role:"option","aria-labelledby":E,"data-highlighted":w?"":void 0,"aria-selected":m&&w,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...d,ref:T,onFocus:we(d.onFocus,()=>C(!0)),onBlur:we(d.onBlur,()=>C(!1)),onClick:we(d.onClick,()=>{R.current!=="mouse"&&N()}),onPointerUp:we(d.onPointerUp,()=>{R.current==="mouse"&&N()}),onPointerDown:we(d.onPointerDown,M=>{R.current=M.pointerType}),onPointerMove:we(d.onPointerMove,M=>{R.current=M.pointerType,s?p.onItemLeave?.():R.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(d.onPointerLeave,M=>{M.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:we(d.onKeyDown,M=>{p.searchRef?.current!==""&&M.key===" "||(Cj.includes(M.key)&&N(),M.key===" "&&M.preventDefault())})})})})});_x.displayName=Qs;var Io="SelectItemText",Mx=y.forwardRef((n,l)=>{const{__scopeSelect:r,className:i,style:s,...c}=n,d=Ja(Io,r),h=el(Io,r),p=Dx(Io,r),m=Aj(Io,r),[x,v]=y.useState(null),w=He(l,N=>v(N),p.onItemTextChange,N=>h.itemTextRefCallback?.(N,p.value,p.disabled)),C=x?.textContent,T=y.useMemo(()=>g.jsx("option",{value:p.value,disabled:p.disabled,children:C},p.value),[p.disabled,p.value,C]),{onNativeOptionAdd:E,onNativeOptionRemove:R}=m;return jt(()=>(E(T),()=>R(T)),[E,R,T]),g.jsxs(g.Fragment,{children:[g.jsx(Ce.span,{id:p.textId,...c,ref:w}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren?Zo.createPortal(c.children,d.valueNode):null]})});Mx.displayName=Io;var zx="SelectItemIndicator",Lx=y.forwardRef((n,l)=>{const{__scopeSelect:r,...i}=n;return Dx(zx,r).isSelected?g.jsx(Ce.span,{"aria-hidden":!0,...i,ref:l}):null});Lx.displayName=zx;var Dd="SelectScrollUpButton",kx=y.forwardRef((n,l)=>{const r=el(Dd,n.__scopeSelect),i=fh(Dd,n.__scopeSelect),[s,c]=y.useState(!1),d=He(l,i.onScrollButtonChange);return jt(()=>{if(r.viewport&&r.isPositioned){let h=function(){const m=p.scrollTop>0;c(m)};const p=r.viewport;return h(),p.addEventListener("scroll",h),()=>p.removeEventListener("scroll",h)}},[r.viewport,r.isPositioned]),s?g.jsx(Hx,{...n,ref:d,onAutoScroll:()=>{const{viewport:h,selectedItem:p}=r;h&&p&&(h.scrollTop=h.scrollTop-p.offsetHeight)}}):null});kx.displayName=Dd;var _d="SelectScrollDownButton",Ux=y.forwardRef((n,l)=>{const r=el(_d,n.__scopeSelect),i=fh(_d,n.__scopeSelect),[s,c]=y.useState(!1),d=He(l,i.onScrollButtonChange);return jt(()=>{if(r.viewport&&r.isPositioned){let h=function(){const m=p.scrollHeight-p.clientHeight,x=Math.ceil(p.scrollTop)<m;c(x)};const p=r.viewport;return h(),p.addEventListener("scroll",h),()=>p.removeEventListener("scroll",h)}},[r.viewport,r.isPositioned]),s?g.jsx(Hx,{...n,ref:d,onAutoScroll:()=>{const{viewport:h,selectedItem:p}=r;h&&p&&(h.scrollTop=h.scrollTop+p.offsetHeight)}}):null});Ux.displayName=_d;var Hx=y.forwardRef((n,l)=>{const{__scopeSelect:r,onAutoScroll:i,...s}=n,c=el("SelectScrollButton",r),d=y.useRef(null),h=vc(r),p=y.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return y.useEffect(()=>()=>p(),[p]),jt(()=>{h().find(x=>x.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[h]),g.jsx(Ce.div,{"aria-hidden":!0,...s,ref:l,style:{flexShrink:0,...s.style},onPointerDown:we(s.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(i,50))}),onPointerMove:we(s.onPointerMove,()=>{c.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(i,50))}),onPointerLeave:we(s.onPointerLeave,()=>{p()})})}),Pj="SelectSeparator",Vj=y.forwardRef((n,l)=>{const{__scopeSelect:r,...i}=n;return g.jsx(Ce.div,{"aria-hidden":!0,...i,ref:l})});Vj.displayName=Pj;var Md="SelectArrow",Ij=y.forwardRef((n,l)=>{const{__scopeSelect:r,...i}=n,s=yc(r),c=Ja(Md,r),d=el(Md,r);return c.open&&d.position==="popper"?g.jsx(Xd,{...s,...i,ref:l}):null});Ij.displayName=Md;var Yj="SelectBubbleInput",Bx=y.forwardRef(({__scopeSelect:n,value:l,...r},i)=>{const s=y.useRef(null),c=He(i,s),d=fx(l);return y.useEffect(()=>{const h=s.current;if(!h)return;const p=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==l&&x){const v=new Event("change",{bubbles:!0});x.call(h,l),h.dispatchEvent(v)}},[d,l]),g.jsx(Ce.select,{...r,style:{...N0,...r.style},ref:c,defaultValue:l})});Bx.displayName=Yj;function Px(n){return n===""||n===void 0}function Vx(n){const l=kt(n),r=y.useRef(""),i=y.useRef(0),s=y.useCallback(d=>{const h=r.current+d;l(h),(function p(m){r.current=m,window.clearTimeout(i.current),m!==""&&(i.current=window.setTimeout(()=>p(""),1e3))})(h)},[l]),c=y.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,s,c]}function Ix(n,l,r){const s=l.length>1&&Array.from(l).every(m=>m===l[0])?l[0]:l,c=r?n.indexOf(r):-1;let d=qj(n,Math.max(c,0));s.length===1&&(d=d.filter(m=>m!==r));const p=d.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return p!==r?p:void 0}function qj(n,l){return n.map((r,i)=>n[(l+i)%n.length])}var Gj=vx,$j=bx,Xj=Sx,Fj=wx,Kj=Cx,Qj=Ex,Zj=Nx,Wj=_x,Jj=Mx,eD=Lx,tD=kx,nD=Ux;function Ty({...n}){return g.jsx(Gj,{"data-slot":"select",...n})}function Ry({...n}){return g.jsx(Xj,{"data-slot":"select-value",...n})}function Ay({className:n,size:l="default",children:r,...i}){return g.jsxs($j,{"data-slot":"select-trigger","data-size":l,className:je("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...i,children:[r,g.jsx(Fj,{asChild:!0,children:g.jsx(qs,{className:"size-4 opacity-50"})})]})}function Ny({className:n,children:l,position:r="popper",align:i="center",...s}){return g.jsx(Kj,{children:g.jsxs(Qj,{"data-slot":"select-content",className:je("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:r,align:i,...s,children:[g.jsx(aD,{}),g.jsx(Zj,{className:je("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:l}),g.jsx(lD,{})]})})}function qa({className:n,children:l,...r}){return g.jsxs(Wj,{"data-slot":"select-item",className:je("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),...r,children:[g.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:g.jsx(eD,{children:g.jsx(_s,{className:"size-4"})})}),g.jsx(Jj,{children:l})]})}function aD({className:n,...l}){return g.jsx(tD,{"data-slot":"select-scroll-up-button",className:je("flex cursor-default items-center justify-center py-1",n),...l,children:g.jsx(fR,{className:"size-4"})})}function lD({className:n,...l}){return g.jsx(nD,{"data-slot":"select-scroll-down-button",className:je("flex cursor-default items-center justify-center py-1",n),...l,children:g.jsx(qs,{className:"size-4"})})}var rD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oD=rD.reduce((n,l)=>{const r=Ld(`Primitive.${l}`),i=y.forwardRef((s,c)=>{const{asChild:d,...h}=s,p=d?r:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(p,{...h,ref:c})});return i.displayName=`Primitive.${l}`,{...n,[l]:i}},{}),iD="Separator",Oy="horizontal",sD=["horizontal","vertical"],Yx=y.forwardRef((n,l)=>{const{decorative:r,orientation:i=Oy,...s}=n,c=cD(i)?i:Oy,h=r?{role:"none"}:{"aria-orientation":c==="vertical"?c:void 0,role:"separator"};return g.jsx(oD.div,{"data-orientation":c,...h,...s,ref:l})});Yx.displayName=iD;function cD(n){return sD.includes(n)}var uD=Yx;function fD({className:n,orientation:l="horizontal",decorative:r=!0,...i}){return g.jsx(uD,{"data-slot":"separator",decorative:r,orientation:l,className:je("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),...i})}const dD=()=>!!window.mtranDesktop?.isDesktop;async function hD(){return window.mtranDesktop?window.mtranDesktop.getConfig():null}async function pD(n){return window.mtranDesktop?window.mtranDesktop.applyConfig(n):null}async function mD(){return window.mtranDesktop?window.mtranDesktop.resetConfig():null}async function gD(){return window.mtranDesktop?window.mtranDesktop.restartServer():null}async function bc(n,l){const r=await fetch(`/ui/api/settings${n}`,{method:l?"POST":"GET",headers:l?{"Content-Type":"application/json"}:void 0,body:l?JSON.stringify(l):void 0});if(!r.ok)throw new Error(`Request failed: ${r.status}`);return r.json()}async function vD(){return bc("")}async function yD(n){return bc("/apply",{config:n})}async function bD(){return bc("/reset",{})}async function xD(){return bc("/restart",{})}function js(n){return{locale:n.locale,server:{host:n.server.host,port:String(n.server.port),logLevel:n.server.logLevel,enableWebUI:n.server.enableWebUI,enableOfflineMode:n.server.enableOfflineMode,workerIdleTimeout:String(n.server.workerIdleTimeout),workersPerLanguage:String(n.server.workersPerLanguage),apiToken:n.server.apiToken,logDir:n.server.logDir,logToFile:n.server.logToFile,logConsole:n.server.logConsole,logRequests:n.server.logRequests,maxSentenceLength:String(n.server.maxSentenceLength),checkUpdate:n.server.checkUpdate,cacheSize:String(n.server.cacheSize),modelDir:n.server.modelDir,configDir:n.server.configDir}}}function Vo(n,l){const r=Number(n);return Number.isFinite(r)?r:l}function SD(){const{t:n}=Qo(),l=dD(),r=l?hD:vD,i=l?pD:yD,s=l?mD:bD,c=l?gD:xD,[d,h]=y.useState(null),[p,m]=y.useState(null),[x,v]=y.useState(""),[w,C]=y.useState(""),[T,E]=y.useState(!0),[R,N]=y.useState(!1);y.useEffect(()=>{r().then(k=>{k&&(h(k.config),m(js(k.config)),v(k.status),C(k.version))}).catch(()=>{ut.error(n("loadingConfigFailed"))}).finally(()=>E(!1))},[r,n]);const M=y.useMemo(()=>x?n(x==="running"?"serverStatusRunning":"serverStatusStopped"):"",[x,n]),z=async()=>{if(!p||!d)return;N(!0);const k={locale:p.locale,server:{...d.server,host:p.server.host,port:Vo(p.server.port,d.server.port),logLevel:p.server.logLevel,enableWebUI:p.server.enableWebUI,enableOfflineMode:p.server.enableOfflineMode,workerIdleTimeout:Vo(p.server.workerIdleTimeout,d.server.workerIdleTimeout),workersPerLanguage:Vo(p.server.workersPerLanguage,d.server.workersPerLanguage),apiToken:p.server.apiToken,logDir:p.server.logDir,logToFile:p.server.logToFile,logConsole:p.server.logConsole,logRequests:p.server.logRequests,maxSentenceLength:Vo(p.server.maxSentenceLength,d.server.maxSentenceLength),checkUpdate:p.server.checkUpdate,cacheSize:Vo(p.server.cacheSize,d.server.cacheSize),modelDir:p.server.modelDir,configDir:p.server.configDir}};try{const L=await i(k);L&&(h(L.config),m(js(L.config)),v(L.status),C(L.version),ut.success(n("settingsApplied")))}catch{ut.error(n("settingsApplyFailed"))}finally{N(!1)}},P=async()=>{N(!0);try{const k=await c();k&&(h(k.config),m(js(k.config)),v(k.status),C(k.version),ut.success(n("serverRestarted")))}catch{ut.error(n("serverRestartFailed"))}finally{N(!1)}},G=async()=>{N(!0);try{const k=await s();k&&(h(k.config),m(js(k.config)),v(k.status),C(k.version),ut.success(n("settingsReset")))}catch{ut.error(n("settingsResetFailed"))}finally{N(!1)}};return T||!p||!d?g.jsx("div",{className:"min-h-screen bg-background p-6",children:g.jsx("div",{className:"mx-auto max-w-3xl text-muted-foreground",children:n("loadingConfig")})}):g.jsx("div",{className:"min-h-screen bg-background p-3 sm:p-4 md:p-6",children:g.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-xl font-semibold text-foreground",children:n("desktopSettings")}),g.jsx("p",{className:"text-xs text-muted-foreground",children:n("desktopSettingsDesc")})]}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[g.jsxs("span",{children:[n("serverStatus"),": ",M]}),w&&g.jsxs("span",{children:[n("version"),": v",w]})]})]}),g.jsxs(Ar,{className:"gap-4 py-4",children:[g.jsx(Bo,{className:"px-4 pb-3",children:g.jsx(Po,{children:n("generalSettings")})}),g.jsxs(Nr,{className:"space-y-3 px-4",children:[g.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("host")}),g.jsx(yn,{value:p.server.host,onChange:k=>m({...p,server:{...p.server,host:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("port")}),g.jsx(yn,{value:p.server.port,onChange:k=>m({...p,server:{...p.server,port:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("logLevel")}),g.jsxs(Ty,{value:p.server.logLevel,onValueChange:k=>m({...p,server:{...p.server,logLevel:k}}),children:[g.jsx(Ay,{children:g.jsx(Ry,{})}),g.jsxs(Ny,{children:[g.jsx(qa,{value:"debug",children:"debug"}),g.jsx(qa,{value:"info",children:"info"}),g.jsx(qa,{value:"warn",children:"warn"}),g.jsx(qa,{value:"error",children:"error"})]})]})]}),l&&g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("locale")}),g.jsxs(Ty,{value:p.locale,onValueChange:k=>m({...p,locale:k}),children:[g.jsx(Ay,{children:g.jsx(Ry,{})}),g.jsxs(Ny,{children:[g.jsx(qa,{value:"system",children:n("system")}),g.jsx(qa,{value:"en",children:"English"}),g.jsx(qa,{value:"zh",children:"中文"}),g.jsx(qa,{value:"ja",children:"日本語"})]})]})]})]}),g.jsx(fD,{}),g.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[g.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border p-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:n("enableWebUI")}),g.jsx("div",{className:"text-xs text-muted-foreground",children:n("enableWebUIDesc")})]}),g.jsx(Cl,{checked:p.server.enableWebUI,onCheckedChange:k=>m({...p,server:{...p.server,enableWebUI:k}})})]}),g.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border p-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:n("enableOfflineMode")}),g.jsx("div",{className:"text-xs text-muted-foreground",children:n("enableOfflineModeDesc")})]}),g.jsx(Cl,{checked:p.server.enableOfflineMode,onCheckedChange:k=>m({...p,server:{...p.server,enableOfflineMode:k}})})]}),g.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border p-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:n("checkUpdate")}),g.jsx("div",{className:"text-xs text-muted-foreground",children:n("checkUpdateDesc")})]}),g.jsx(Cl,{checked:p.server.checkUpdate,onCheckedChange:k=>m({...p,server:{...p.server,checkUpdate:k}})})]})]})]})]}),g.jsxs(Ar,{className:"gap-4 py-4",children:[g.jsx(Bo,{className:"px-4 pb-3",children:g.jsx(Po,{children:n("storageSettings")})}),g.jsx(Nr,{className:"space-y-3 px-4",children:g.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("modelDir")}),g.jsx(yn,{value:p.server.modelDir,onChange:k=>m({...p,server:{...p.server,modelDir:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("configDir")}),g.jsx(yn,{value:p.server.configDir,onChange:k=>m({...p,server:{...p.server,configDir:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("logDir")}),g.jsx(yn,{value:p.server.logDir,onChange:k=>m({...p,server:{...p.server,logDir:k.target.value}})})]})]})})]}),g.jsxs(Ar,{className:"gap-4 py-4",children:[g.jsx(Bo,{className:"px-4 pb-3",children:g.jsx(Po,{children:n("securitySettings")})}),g.jsx(Nr,{className:"space-y-3 px-4",children:g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("apiToken")}),g.jsx(yn,{value:p.server.apiToken,onChange:k=>m({...p,server:{...p.server,apiToken:k.target.value}})})]})})]}),g.jsxs(Ar,{className:"gap-4 py-4",children:[g.jsx(Bo,{className:"px-4 pb-3",children:g.jsx(Po,{children:n("performanceSettings")})}),g.jsx(Nr,{className:"space-y-3 px-4",children:g.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("workerIdleTimeout")}),g.jsx(yn,{value:p.server.workerIdleTimeout,onChange:k=>m({...p,server:{...p.server,workerIdleTimeout:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("workersPerLanguage")}),g.jsx(yn,{value:p.server.workersPerLanguage,onChange:k=>m({...p,server:{...p.server,workersPerLanguage:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("maxSentenceLength")}),g.jsx(yn,{value:p.server.maxSentenceLength,onChange:k=>m({...p,server:{...p.server,maxSentenceLength:k.target.value}})})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{className:"text-sm font-medium",children:n("cacheSize")}),g.jsx(yn,{value:p.server.cacheSize,onChange:k=>m({...p,server:{...p.server,cacheSize:k.target.value}})})]})]})})]}),g.jsxs(Ar,{className:"gap-4 py-4",children:[g.jsx(Bo,{className:"px-4 pb-3",children:g.jsx(Po,{children:n("loggingSettings")})}),g.jsx(Nr,{className:"space-y-3 px-4",children:g.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[g.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border p-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:n("logToFile")}),g.jsx("div",{className:"text-xs text-muted-foreground",children:n("logToFileDesc")})]}),g.jsx(Cl,{checked:p.server.logToFile,onCheckedChange:k=>m({...p,server:{...p.server,logToFile:k}})})]}),g.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border p-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:n("logConsole")}),g.jsx("div",{className:"text-xs text-muted-foreground",children:n("logConsoleDesc")})]}),g.jsx(Cl,{checked:p.server.logConsole,onCheckedChange:k=>m({...p,server:{...p.server,logConsole:k}})})]}),g.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border p-3",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium",children:n("logRequests")}),g.jsx("div",{className:"text-xs text-muted-foreground",children:n("logRequestsDesc")})]}),g.jsx(Cl,{checked:p.server.logRequests,onCheckedChange:k=>m({...p,server:{...p.server,logRequests:k}})})]})]})})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(tt,{variant:"outline",onClick:()=>window.location.href="/ui/",children:n("backToMain")}),g.jsxs("div",{className:"flex flex-wrap gap-2",children:[g.jsx(tt,{variant:"outline",onClick:G,disabled:R,children:n("resetDefaults")}),g.jsx(tt,{variant:"outline",onClick:P,disabled:R,children:n("restart")}),g.jsx(tt,{onClick:z,disabled:R,children:n(R?"saving":"apply")})]})]})]})})}function wD(n){return n.replace(/\/+$/,"").endsWith("/settings")?"settings":"main"}function CD(){const{t:n}=Qo(),[l,r]=y.useState([]),[i,s]=y.useState(!0),[c,d]=y.useState(()=>localStorage.getItem("widescreen")==="true"),[h,p]=y.useState(!1),[m,x]=y.useState(!1),[v,w]=y.useState(""),[C,T]=y.useState(()=>{const L=localStorage.getItem("translationPanels");if(L)try{const Y=JSON.parse(L);if(Array.isArray(Y)&&Y.length>0)return Y}catch(Y){console.error("Failed to parse saved panels",Y)}return["panel-"+Date.now()]}),{history:E,addToHistory:R,clearHistory:N,deleteItem:M}=mj(),z=async()=>{try{const L=await fetch("/version");if(L.ok){const Y=await L.json();Y.version&&w(Y.version)}}catch(L){console.error("Failed to fetch version:",L)}},P=y.useCallback(async()=>{try{const L={},Y=localStorage.getItem("apiToken");Y&&(L.Authorization=`Bearer ${Y}`);const J=await fetch("/languages",{headers:L});if(J.ok){const ne=await J.json();r(["auto",...ne.languages||[]])}else if(J.status===401)p(!0),ut.error(n("apiTokenPlaceholder"));else throw new Error("Failed to fetch languages")}catch(L){console.error("Error fetching languages:",L),ut.error(n("failedToLoadLanguages"))}finally{s(!1)}},[n]);y.useEffect(()=>{localStorage.setItem("widescreen",String(c))},[c]),y.useEffect(()=>{localStorage.setItem("translationPanels",JSON.stringify(C))},[C]),y.useEffect(()=>{const Y=new URLSearchParams(window.location.search).get("token");Y&&localStorage.setItem("apiToken",Y),P(),z()},[P]);const G=()=>{T(L=>[...L,"panel-"+Date.now()])},k=L=>{C.length<=1||T(Y=>Y.filter(J=>J!==L))};return g.jsxs("div",{className:"min-h-screen bg-background p-3 sm:p-4 md:p-8 flex flex-col",children:[g.jsxs("div",{className:`mx-auto flex-1 w-full transition-all duration-300 ${c?"max-w-full":"max-w-[90rem]"}`,children:[g.jsxs("div",{className:"flex justify-between items-center mb-4 sm:mb-6",children:[g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx("h1",{className:"text-xl sm:text-2xl font-bold text-foreground",children:n("title")}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx("a",{href:"/docs",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-9 w-9","aria-label":n("apiDocs"),children:g.jsx(iR,{className:"h-5 w-5 text-muted-foreground"})})}),g.jsx(Ot,{children:g.jsx("p",{children:n("apiDocs")})})]})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:G,"aria-label":n("addPanel"),children:g.jsx(UR,{className:"h-5 w-5"})})}),g.jsx(Ot,{children:g.jsx("p",{children:n("addPanel")})})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:()=>d(!c),"aria-label":n(c?"standardView":"widescreen"),children:c?g.jsx(DR,{className:"h-5 w-5"}):g.jsx(TR,{className:"h-5 w-5"})})}),g.jsx(Ot,{children:g.jsx("p",{children:n(c?"standardView":"widescreen")})})]}),g.jsxs(At,{children:[g.jsx(Nt,{asChild:!0,children:g.jsx(tt,{variant:"ghost",size:"icon",onClick:()=>x(!0),"aria-label":n("history"),children:g.jsx(yR,{className:"h-5 w-5"})})}),g.jsx(Ot,{children:g.jsx("p",{children:n("history")})})]}),g.jsx(NO,{showTokenDialog:h,setShowTokenDialog:p,onTokenSaved:P})]})]}),g.jsx("div",{className:"flex flex-wrap gap-4 items-stretch",children:C.map((L,Y)=>g.jsx("div",{className:C.length===1?`w-full ${c?"sm:w-[90%]":"sm:w-[75%]"} mx-auto`:"flex-1 min-w-[350px] max-w-full",children:g.jsx(hj,{id:L,isPrimary:Y===0,languages:l,loadingLanguages:i,addToHistory:R,onDelete:()=>k(L),canDelete:C.length>1})},L))})]}),g.jsx("footer",{className:"w-full mt-8 py-4 text-center",children:g.jsxs("a",{href:"https://github.com/xxnuo/MTranServer",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[g.jsx("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:g.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})}),g.jsxs("span",{children:["MTranServer ",v&&g.jsxs("span",{className:"text-xs ml-1 opacity-75",children:["v",v]})]})]})}),g.jsx(JO,{open:m,onOpenChange:x,history:E,onSelect:L=>{const Y=new CustomEvent("loadHistoryItem",{detail:L});window.dispatchEvent(Y),x(!1)},onClear:N,onDelete:M})]})}function ED(){return y.useMemo(()=>wD(window.location.pathname),[])==="settings"?g.jsx(SD,{}):g.jsx(CD,{})}var TD=(n,l,r,i,s,c,d,h)=>{let p=document.documentElement,m=["light","dark"];function x(C){(Array.isArray(n)?n:[n]).forEach(T=>{let E=T==="class",R=E&&c?s.map(N=>c[N]||N):s;E?(p.classList.remove(...R),p.classList.add(c&&c[C]?c[C]:C)):p.setAttribute(T,C)}),v(C)}function v(C){h&&m.includes(C)&&(p.style.colorScheme=C)}function w(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(i)x(i);else try{let C=localStorage.getItem(l)||r,T=d&&C==="system"?w():C;x(T)}catch{}},RD=y.createContext(void 0),AD={setTheme:n=>{},themes:[]},ND=()=>{var n;return(n=y.useContext(RD))!=null?n:AD};y.memo(({forcedTheme:n,storageKey:l,attribute:r,enableSystem:i,enableColorScheme:s,defaultTheme:c,value:d,themes:h,nonce:p,scriptProps:m})=>{let x=JSON.stringify([r,l,c,n,h,d,i,s]).slice(1,-1);return y.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${TD.toString()})(${x})`}})});const OD=({...n})=>{const{theme:l="system"}=ND();return g.jsx(W2,{theme:l,className:"toaster group",icons:{success:g.jsx(hR,{className:"size-4"}),info:g.jsx(xR,{className:"size-4"}),warning:g.jsx(qR,{className:"size-4"}),error:g.jsx(LR,{className:"size-4"}),loading:g.jsx(P0,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...n})};uw.createRoot(document.getElementById("root")).render(g.jsx(y.StrictMode,{children:g.jsxs(KR,{children:[g.jsx(ED,{}),g.jsx(OD,{})]})}));
|