diff --git a/@applications/web/dist/assets/index-DmrRcZj9.js b/@applications/web/dist/assets/index-DmrRcZj9.js deleted file mode 100644 index 7a2a570..0000000 --- a/@applications/web/dist/assets/index-DmrRcZj9.js +++ /dev/null @@ -1,283 +0,0 @@ -(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();function vw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var hu={exports:{}},$i={},pu={exports:{}},ue={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var op;function ww(){if(op)return ue;op=1;var t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function S(k){return k===null||typeof k!="object"?null:(k=v&&k[v]||k["@@iterator"],typeof k=="function"?k:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},P=Object.assign,M={};function I(k,V,ie){this.props=k,this.context=V,this.refs=M,this.updater=ie||E}I.prototype.isReactComponent={},I.prototype.setState=function(k,V){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,V,"setState")},I.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function N(){}N.prototype=I.prototype;function L(k,V,ie){this.props=k,this.context=V,this.refs=M,this.updater=ie||E}var R=L.prototype=new N;R.constructor=L,P(R,I.prototype),R.isPureReactComponent=!0;var D=Array.isArray,z=Object.prototype.hasOwnProperty,b={current:null},B={key:!0,ref:!0,__self:!0,__source:!0};function Y(k,V,ie){var oe,he={},de=null,Se=null;if(V!=null)for(oe in V.ref!==void 0&&(Se=V.ref),V.key!==void 0&&(de=""+V.key),V)z.call(V,oe)&&!B.hasOwnProperty(oe)&&(he[oe]=V[oe]);var me=arguments.length-2;if(me===1)he.children=ie;else if(1>>1,V=U[k];if(0>>1;kl(he,K))del(Se,he)?(U[k]=Se,U[de]=K,k=de):(U[k]=he,U[oe]=K,k=oe);else if(del(Se,K))U[k]=Se,U[de]=K,k=de;else break e}}return $}function l(U,$){var K=U.sortIndex-$.sortIndex;return K!==0?K:U.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();t.unstable_now=function(){return d.now()-h}}var m=[],y=[],g=1,v=null,S=3,E=!1,P=!1,M=!1,I=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(U){for(var $=i(y);$!==null;){if($.callback===null)o(y);else if($.startTime<=U)o(y),$.sortIndex=$.expirationTime,n(m,$);else break;$=i(y)}}function D(U){if(M=!1,R(U),!P)if(i(m)!==null)P=!0,Ee(z);else{var $=i(y);$!==null&&Te(D,$.startTime-U)}}function z(U,$){P=!1,M&&(M=!1,N(Y),Y=-1),E=!0;var K=S;try{for(R($),v=i(m);v!==null&&(!(v.expirationTime>$)||U&&!ae());){var k=v.callback;if(typeof k=="function"){v.callback=null,S=v.priorityLevel;var V=k(v.expirationTime<=$);$=t.unstable_now(),typeof V=="function"?v.callback=V:v===i(m)&&o(m),R($)}else o(m);v=i(m)}if(v!==null)var ie=!0;else{var oe=i(y);oe!==null&&Te(D,oe.startTime-$),ie=!1}return ie}finally{v=null,S=K,E=!1}}var b=!1,B=null,Y=-1,se=5,H=-1;function ae(){return!(t.unstable_now()-HU||125k?(U.sortIndex=K,n(y,U),i(m)===null&&U===i(y)&&(M?(N(Y),Y=-1):M=!0,Te(D,K-k))):(U.sortIndex=V,n(m,U),P||E||(P=!0,Ee(z))),U},t.unstable_shouldYield=ae,t.unstable_wrapCallback=function(U){var $=S;return function(){var K=S;S=$;try{return U.apply(this,arguments)}finally{S=K}}}})(yu)),yu}var fp;function kw(){return fp||(fp=1,gu.exports=Cw()),gu.exports}/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var dp;function Ew(){if(dp)return yt;dp=1;var t=Pc(),n=kw();function i(e){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,y=/^[: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]*$/,g={},v={};function S(e){return m.call(v,e)?!0:m.call(g,e)?!1:y.test(e)?v[e]=!0:(g[e]=!0,!1)}function E(e,r,s,a){if(s!==null&&s.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return a?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function P(e,r,s,a){if(r===null||typeof r>"u"||E(e,r,s,a))return!0;if(a)return!1;if(s!==null)switch(s.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function M(e,r,s,a,u,f,p){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=a,this.attributeNamespace=u,this.mustUseProperty=s,this.propertyName=e,this.type=r,this.sanitizeURL=f,this.removeEmptyString=p}var I={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){I[e]=new M(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var r=e[0];I[r]=new M(r,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){I[e]=new M(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){I[e]=new M(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){I[e]=new M(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){I[e]=new M(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){I[e]=new M(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){I[e]=new M(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){I[e]=new M(e,5,!1,e.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function L(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var r=e.replace(N,L);I[r]=new M(r,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var r=e.replace(N,L);I[r]=new M(r,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var r=e.replace(N,L);I[r]=new M(r,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){I[e]=new M(e,1,!1,e.toLowerCase(),null,!1,!1)}),I.xlinkHref=new M("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){I[e]=new M(e,1,!1,e.toLowerCase(),null,!0,!0)});function R(e,r,s,a){var u=I.hasOwnProperty(r)?I[r]:null;(u!==null?u.type!==0:a||!(2w||u[p]!==f[w]){var x=` -`+u[p].replace(" at new "," at ");return e.displayName&&x.includes("")&&(x=x.replace("",e.displayName)),x}while(1<=p&&0<=w);break}}}finally{ie=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?V(e):""}function he(e){switch(e.tag){case 5:return V(e.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return e=oe(e.type,!1),e;case 11:return e=oe(e.type.render,!1),e;case 1:return e=oe(e.type,!0),e;default:return""}}function de(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case B:return"Fragment";case b:return"Portal";case se:return"Profiler";case Y:return"StrictMode";case Ce:return"Suspense";case ke:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ae:return(e.displayName||"Context")+".Consumer";case H:return(e._context.displayName||"Context")+".Provider";case fe:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Be:return r=e.displayName||null,r!==null?r:de(e.type)||"Memo";case Ee:r=e._payload,e=e._init;try{return de(e(r))}catch{}}return null}function Se(e){var r=e.type;switch(e.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=r.render,e=e.displayName||e.name||"",r.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(r);case 8:return r===Y?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function me(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ve(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Xe(e){var r=ve(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),a=""+e[r];if(!e.hasOwnProperty(r)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var u=s.get,f=s.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return u.call(this)},set:function(p){a=""+p,f.call(this,p)}}),Object.defineProperty(e,r,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(p){a=""+p},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function Zt(e){e._valueTracker||(e._valueTracker=Xe(e))}function Tt(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var s=r.getValue(),a="";return e&&(a=ve(e)?e.checked?"true":"false":e.value),e=a,e!==s?(r.setValue(e),!0):!1}function wn(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}}function Sn(e,r){var s=r.checked;return K({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function un(e,r){var s=r.defaultValue==null?"":r.defaultValue,a=r.checked!=null?r.checked:r.defaultChecked;s=me(r.value!=null?r.value:s),e._wrapperState={initialChecked:a,initialValue:s,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function pf(e,r){r=r.checked,r!=null&&R(e,"checked",r,!1)}function xa(e,r){pf(e,r);var s=me(r.value),a=r.type;if(s!=null)a==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}r.hasOwnProperty("value")?Ca(e,r.type,s):r.hasOwnProperty("defaultValue")&&Ca(e,r.type,me(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(e.defaultChecked=!!r.defaultChecked)}function mf(e,r,s){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var a=r.type;if(!(a!=="submit"&&a!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+e._wrapperState.initialValue,s||r===e.value||(e.value=r),e.defaultValue=r}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function Ca(e,r,s){(r!=="number"||wn(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var li=Array.isArray;function yr(e,r,s,a){if(e=e.options,r){r={};for(var u=0;u"+r.valueOf().toString()+"",r=ms.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;r.firstChild;)e.appendChild(r.firstChild)}});function ui(e,r){if(r){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=r;return}}e.textContent=r}var ci={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Cv=["Webkit","ms","Moz","O"];Object.keys(ci).forEach(function(e){Cv.forEach(function(r){r=r+e.charAt(0).toUpperCase()+e.substring(1),ci[r]=ci[e]})});function xf(e,r,s){return r==null||typeof r=="boolean"||r===""?"":s||typeof r!="number"||r===0||ci.hasOwnProperty(e)&&ci[e]?(""+r).trim():r+"px"}function Cf(e,r){e=e.style;for(var s in r)if(r.hasOwnProperty(s)){var a=s.indexOf("--")===0,u=xf(s,r[s],a);s==="float"&&(s="cssFloat"),a?e.setProperty(s,u):e[s]=u}}var kv=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ta(e,r){if(r){if(kv[e]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(i(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(i(61))}if(r.style!=null&&typeof r.style!="object")throw Error(i(62))}}function Aa(e,r){if(e.indexOf("-")===-1)return typeof r.is=="string";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 Pa=null;function _a(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ia=null,vr=null,wr=null;function kf(e){if(e=Di(e)){if(typeof Ia!="function")throw Error(i(280));var r=e.stateNode;r&&(r=bs(r),Ia(e.stateNode,e.type,r))}}function Ef(e){vr?wr?wr.push(e):wr=[e]:vr=e}function Tf(){if(vr){var e=vr,r=wr;if(wr=vr=null,kf(e),r)for(e=0;e>>=0,e===0?32:31-(Vv(e)/Bv|0)|0}var Ss=64,xs=4194304;function pi(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Cs(e,r){var s=e.pendingLanes;if(s===0)return 0;var a=0,u=e.suspendedLanes,f=e.pingedLanes,p=s&268435455;if(p!==0){var w=p&~u;w!==0?a=pi(w):(f&=p,f!==0&&(a=pi(f)))}else p=s&~u,p!==0?a=pi(p):f!==0&&(a=pi(f));if(a===0)return 0;if(r!==0&&r!==a&&(r&u)===0&&(u=a&-a,f=r&-r,u>=f||u===16&&(f&4194240)!==0))return r;if((a&4)!==0&&(a|=s&16),r=e.entangledLanes,r!==0)for(e=e.entanglements,r&=a;0s;s++)r.push(e);return r}function mi(e,r,s){e.pendingLanes|=r,r!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,r=31-Lt(r),e[r]=s}function Fv(e,r){var s=e.pendingLanes&~r;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=r,e.mutableReadLanes&=r,e.entangledLanes&=r,r=e.entanglements;var a=e.eventTimes;for(e=e.expirationTimes;0=ki),Jf=" ",ed=!1;function td(e,r){switch(e){case"keyup":return h0.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cr=!1;function m0(e,r){switch(e){case"compositionend":return nd(r);case"keypress":return r.which!==32?null:(ed=!0,Jf);case"textInput":return e=r.data,e===Jf&&ed?null:e;default:return null}}function g0(e,r){if(Cr)return e==="compositionend"||!$a&&td(e,r)?(e=$f(),Ps=ja=Tn=null,Cr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1=r)return{node:s,offset:r-e};e=a}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=ud(s)}}function fd(e,r){return e&&r?e===r?!0:e&&e.nodeType===3?!1:r&&r.nodeType===3?fd(e,r.parentNode):"contains"in e?e.contains(r):e.compareDocumentPosition?!!(e.compareDocumentPosition(r)&16):!1:!1}function dd(){for(var e=window,r=wn();r instanceof e.HTMLIFrameElement;){try{var s=typeof r.contentWindow.location.href=="string"}catch{s=!1}if(s)e=r.contentWindow;else break;r=wn(e.document)}return r}function Za(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r&&(r==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||r==="textarea"||e.contentEditable==="true")}function T0(e){var r=dd(),s=e.focusedElem,a=e.selectionRange;if(r!==s&&s&&s.ownerDocument&&fd(s.ownerDocument.documentElement,s)){if(a!==null&&Za(s)){if(r=a.start,e=a.end,e===void 0&&(e=r),"selectionStart"in s)s.selectionStart=r,s.selectionEnd=Math.min(e,s.value.length);else if(e=(r=s.ownerDocument||document)&&r.defaultView||window,e.getSelection){e=e.getSelection();var u=s.textContent.length,f=Math.min(a.start,u);a=a.end===void 0?f:Math.min(a.end,u),!e.extend&&f>a&&(u=a,a=f,f=u),u=cd(s,f);var p=cd(s,a);u&&p&&(e.rangeCount!==1||e.anchorNode!==u.node||e.anchorOffset!==u.offset||e.focusNode!==p.node||e.focusOffset!==p.offset)&&(r=r.createRange(),r.setStart(u.node,u.offset),e.removeAllRanges(),f>a?(e.addRange(r),e.extend(p.node,p.offset)):(r.setEnd(p.node,p.offset),e.addRange(r)))}}for(r=[],e=s;e=e.parentNode;)e.nodeType===1&&r.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,kr=null,Qa=null,Pi=null,qa=!1;function hd(e,r,s){var a=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;qa||kr==null||kr!==wn(a)||(a=kr,"selectionStart"in a&&Za(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Pi&&Ai(Pi,a)||(Pi=a,a=Bs(Qa,"onSelect"),0_r||(e.current=cl[_r],cl[_r]=null,_r--)}function Pe(e,r){_r++,cl[_r]=e.current,e.current=r}var In={},rt=_n(In),dt=_n(!1),qn=In;function Ir(e,r){var s=e.type.contextTypes;if(!s)return In;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===r)return a.__reactInternalMemoizedMaskedChildContext;var u={},f;for(f in s)u[f]=r[f];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=u),u}function ht(e){return e=e.childContextTypes,e!=null}function Fs(){Ie(dt),Ie(rt)}function _d(e,r,s){if(rt.current!==In)throw Error(i(168));Pe(rt,r),Pe(dt,s)}function Id(e,r,s){var a=e.stateNode;if(r=r.childContextTypes,typeof a.getChildContext!="function")return s;a=a.getChildContext();for(var u in a)if(!(u in r))throw Error(i(108,Se(e)||"Unknown",u));return K({},s,a)}function zs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||In,qn=rt.current,Pe(rt,e),Pe(dt,dt.current),!0}function Rd(e,r,s){var a=e.stateNode;if(!a)throw Error(i(169));s?(e=Id(e,r,qn),a.__reactInternalMemoizedMergedChildContext=e,Ie(dt),Ie(rt),Pe(rt,e)):Ie(dt),Pe(dt,s)}var fn=null,js=!1,fl=!1;function Md(e){fn===null?fn=[e]:fn.push(e)}function O0(e){js=!0,Md(e)}function Rn(){if(!fl&&fn!==null){fl=!0;var e=0,r=xe;try{var s=fn;for(xe=1;e>=p,u-=p,dn=1<<32-Lt(r)+u|s<re?(qe=ne,ne=null):qe=ne.sibling;var ye=O(T,ne,A[re],W);if(ye===null){ne===null&&(ne=qe);break}e&&ne&&ye.alternate===null&&r(T,ne),C=f(ye,C,re),te===null?ee=ye:te.sibling=ye,te=ye,ne=qe}if(re===A.length)return s(T,ne),De&&er(T,re),ee;if(ne===null){for(;rere?(qe=ne,ne=null):qe=ne.sibling;var Fn=O(T,ne,ye.value,W);if(Fn===null){ne===null&&(ne=qe);break}e&&ne&&Fn.alternate===null&&r(T,ne),C=f(Fn,C,re),te===null?ee=Fn:te.sibling=Fn,te=Fn,ne=qe}if(ye.done)return s(T,ne),De&&er(T,re),ee;if(ne===null){for(;!ye.done;re++,ye=A.next())ye=j(T,ye.value,W),ye!==null&&(C=f(ye,C,re),te===null?ee=ye:te.sibling=ye,te=ye);return De&&er(T,re),ee}for(ne=a(T,ne);!ye.done;re++,ye=A.next())ye=X(ne,T,re,ye.value,W),ye!==null&&(e&&ye.alternate!==null&&ne.delete(ye.key===null?re:ye.key),C=f(ye,C,re),te===null?ee=ye:te.sibling=ye,te=ye);return e&&ne.forEach(function(yw){return r(T,yw)}),De&&er(T,re),ee}function Fe(T,C,A,W){if(typeof A=="object"&&A!==null&&A.type===B&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case z:e:{for(var ee=A.key,te=C;te!==null;){if(te.key===ee){if(ee=A.type,ee===B){if(te.tag===7){s(T,te.sibling),C=u(te,A.props.children),C.return=T,T=C;break e}}else if(te.elementType===ee||typeof ee=="object"&&ee!==null&&ee.$$typeof===Ee&&Od(ee)===te.type){s(T,te.sibling),C=u(te,A.props),C.ref=Ni(T,te,A),C.return=T,T=C;break e}s(T,te);break}else r(T,te);te=te.sibling}A.type===B?(C=lr(A.props.children,T.mode,W,A.key),C.return=T,T=C):(W=go(A.type,A.key,A.props,null,T.mode,W),W.ref=Ni(T,C,A),W.return=T,T=W)}return p(T);case b:e:{for(te=A.key;C!==null;){if(C.key===te)if(C.tag===4&&C.stateNode.containerInfo===A.containerInfo&&C.stateNode.implementation===A.implementation){s(T,C.sibling),C=u(C,A.children||[]),C.return=T,T=C;break e}else{s(T,C);break}else r(T,C);C=C.sibling}C=lu(A,T.mode,W),C.return=T,T=C}return p(T);case Ee:return te=A._init,Fe(T,C,te(A._payload),W)}if(li(A))return Q(T,C,A,W);if($(A))return J(T,C,A,W);Hs(T,A)}return typeof A=="string"&&A!==""||typeof A=="number"?(A=""+A,C!==null&&C.tag===6?(s(T,C.sibling),C=u(C,A),C.return=T,T=C):(s(T,C),C=au(A,T.mode,W),C.return=T,T=C),p(T)):s(T,C)}return Fe}var Nr=bd(!0),Fd=bd(!1),Ks=_n(null),$s=null,Vr=null,yl=null;function vl(){yl=Vr=$s=null}function wl(e){var r=Ks.current;Ie(Ks),e._currentValue=r}function Sl(e,r,s){for(;e!==null;){var a=e.alternate;if((e.childLanes&r)!==r?(e.childLanes|=r,a!==null&&(a.childLanes|=r)):a!==null&&(a.childLanes&r)!==r&&(a.childLanes|=r),e===s)break;e=e.return}}function Br(e,r){$s=e,yl=Vr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&r)!==0&&(pt=!0),e.firstContext=null)}function _t(e){var r=e._currentValue;if(yl!==e)if(e={context:e,memoizedValue:r,next:null},Vr===null){if($s===null)throw Error(i(308));Vr=e,$s.dependencies={lanes:0,firstContext:e}}else Vr=Vr.next=e;return r}var tr=null;function xl(e){tr===null?tr=[e]:tr.push(e)}function zd(e,r,s,a){var u=r.interleaved;return u===null?(s.next=s,xl(r)):(s.next=u.next,u.next=s),r.interleaved=s,pn(e,a)}function pn(e,r){e.lanes|=r;var s=e.alternate;for(s!==null&&(s.lanes|=r),s=e,e=e.return;e!==null;)e.childLanes|=r,s=e.alternate,s!==null&&(s.childLanes|=r),s=e,e=e.return;return s.tag===3?s.stateNode:null}var Mn=!1;function Cl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jd(e,r){e=e.updateQueue,r.updateQueue===e&&(r.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function mn(e,r){return{eventTime:e,lane:r,tag:0,payload:null,callback:null,next:null}}function Dn(e,r,s){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ge&2)!==0){var u=a.pending;return u===null?r.next=r:(r.next=u.next,u.next=r),a.pending=r,pn(e,s)}return u=a.interleaved,u===null?(r.next=r,xl(a)):(r.next=u.next,u.next=r),a.interleaved=r,pn(e,s)}function Ys(e,r,s){if(r=r.updateQueue,r!==null&&(r=r.shared,(s&4194240)!==0)){var a=r.lanes;a&=e.pendingLanes,s|=a,r.lanes=s,La(e,s)}}function Ud(e,r){var s=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,s===a)){var u=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var p={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};f===null?u=f=p:f=f.next=p,s=s.next}while(s!==null);f===null?u=f=r:f=f.next=r}else u=f=r;s={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:a.shared,effects:a.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=r:e.next=r,s.lastBaseUpdate=r}function Xs(e,r,s,a){var u=e.updateQueue;Mn=!1;var f=u.firstBaseUpdate,p=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var x=w,_=x.next;x.next=null,p===null?f=_:p.next=_,p=x;var F=e.alternate;F!==null&&(F=F.updateQueue,w=F.lastBaseUpdate,w!==p&&(w===null?F.firstBaseUpdate=_:w.next=_,F.lastBaseUpdate=x))}if(f!==null){var j=u.baseState;p=0,F=_=x=null,w=f;do{var O=w.lane,X=w.eventTime;if((a&O)===O){F!==null&&(F=F.next={eventTime:X,lane:0,tag:w.tag,payload:w.payload,callback:w.callback,next:null});e:{var Q=e,J=w;switch(O=r,X=s,J.tag){case 1:if(Q=J.payload,typeof Q=="function"){j=Q.call(X,j,O);break e}j=Q;break e;case 3:Q.flags=Q.flags&-65537|128;case 0:if(Q=J.payload,O=typeof Q=="function"?Q.call(X,j,O):Q,O==null)break e;j=K({},j,O);break e;case 2:Mn=!0}}w.callback!==null&&w.lane!==0&&(e.flags|=64,O=u.effects,O===null?u.effects=[w]:O.push(w))}else X={eventTime:X,lane:O,tag:w.tag,payload:w.payload,callback:w.callback,next:null},F===null?(_=F=X,x=j):F=F.next=X,p|=O;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;O=w,w=O.next,O.next=null,u.lastBaseUpdate=O,u.shared.pending=null}}while(!0);if(F===null&&(x=j),u.baseState=x,u.firstBaseUpdate=_,u.lastBaseUpdate=F,r=u.shared.interleaved,r!==null){u=r;do p|=u.lane,u=u.next;while(u!==r)}else f===null&&(u.shared.lanes=0);ir|=p,e.lanes=p,e.memoizedState=j}}function Wd(e,r,s){if(e=r.effects,r.effects=null,e!==null)for(r=0;rs?s:4,e(!0);var a=Pl.transition;Pl.transition={};try{e(!1),r()}finally{xe=s,Pl.transition=a}}function lh(){return It().memoizedState}function j0(e,r,s){var a=Ln(e);if(s={lane:a,action:s,hasEagerState:!1,eagerState:null,next:null},uh(e))ch(r,s);else if(s=zd(e,r,s,a),s!==null){var u=ut();Ut(s,e,a,u),fh(s,r,a)}}function U0(e,r,s){var a=Ln(e),u={lane:a,action:s,hasEagerState:!1,eagerState:null,next:null};if(uh(e))ch(r,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=r.lastRenderedReducer,f!==null))try{var p=r.lastRenderedState,w=f(p,s);if(u.hasEagerState=!0,u.eagerState=w,Ot(w,p)){var x=r.interleaved;x===null?(u.next=u,xl(r)):(u.next=x.next,x.next=u),r.interleaved=u;return}}catch{}finally{}s=zd(e,r,u,a),s!==null&&(u=ut(),Ut(s,e,a,u),fh(s,r,a))}}function uh(e){var r=e.alternate;return e===Ve||r!==null&&r===Ve}function ch(e,r){Oi=qs=!0;var s=e.pending;s===null?r.next=r:(r.next=s.next,s.next=r),e.pending=r}function fh(e,r,s){if((s&4194240)!==0){var a=r.lanes;a&=e.pendingLanes,s|=a,r.lanes=s,La(e,s)}}var to={readContext:_t,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useInsertionEffect:it,useLayoutEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useMutableSource:it,useSyncExternalStore:it,useId:it,unstable_isNewReconciler:!1},W0={readContext:_t,useCallback:function(e,r){return en().memoizedState=[e,r===void 0?null:r],e},useContext:_t,useEffect:eh,useImperativeHandle:function(e,r,s){return s=s!=null?s.concat([e]):null,Js(4194308,4,rh.bind(null,r,e),s)},useLayoutEffect:function(e,r){return Js(4194308,4,e,r)},useInsertionEffect:function(e,r){return Js(4,2,e,r)},useMemo:function(e,r){var s=en();return r=r===void 0?null:r,e=e(),s.memoizedState=[e,r],e},useReducer:function(e,r,s){var a=en();return r=s!==void 0?s(r):r,a.memoizedState=a.baseState=r,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},a.queue=e,e=e.dispatch=j0.bind(null,Ve,e),[a.memoizedState,e]},useRef:function(e){var r=en();return e={current:e},r.memoizedState=e},useState:qd,useDebugValue:Vl,useDeferredValue:function(e){return en().memoizedState=e},useTransition:function(){var e=qd(!1),r=e[0];return e=z0.bind(null,e[1]),en().memoizedState=e,[r,e]},useMutableSource:function(){},useSyncExternalStore:function(e,r,s){var a=Ve,u=en();if(De){if(s===void 0)throw Error(i(407));s=s()}else{if(s=r(),Qe===null)throw Error(i(349));(rr&30)!==0||$d(a,r,s)}u.memoizedState=s;var f={value:s,getSnapshot:r};return u.queue=f,eh(Xd.bind(null,a,f,e),[e]),a.flags|=2048,zi(9,Yd.bind(null,a,f,s,r),void 0,null),s},useId:function(){var e=en(),r=Qe.identifierPrefix;if(De){var s=hn,a=dn;s=(a&~(1<<32-Lt(a)-1)).toString(32)+s,r=":"+r+"R"+s,s=bi++,0<\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=p.createElement(s,{is:a.is}):(e=p.createElement(s),s==="select"&&(p=e,a.multiple?p.multiple=!0:a.size&&(p.size=a.size))):e=p.createElementNS(e,s),e[qt]=r,e[Mi]=a,Mh(e,r,!1,!1),r.stateNode=e;e:{switch(p=Aa(s,a),s){case"dialog":_e("cancel",e),_e("close",e),u=a;break;case"iframe":case"object":case"embed":_e("load",e),u=a;break;case"video":case"audio":for(u=0;u<_i.length;u++)_e(_i[u],e);u=a;break;case"source":_e("error",e),u=a;break;case"img":case"image":case"link":_e("error",e),_e("load",e),u=a;break;case"details":_e("toggle",e),u=a;break;case"input":un(e,a),u=Sn(e,a),_e("invalid",e);break;case"option":u=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},u=K({},a,{value:void 0}),_e("invalid",e);break;case"textarea":gf(e,a),u=ka(e,a),_e("invalid",e);break;default:u=a}Ta(s,u),w=u;for(f in w)if(w.hasOwnProperty(f)){var x=w[f];f==="style"?Cf(e,x):f==="dangerouslySetInnerHTML"?(x=x?x.__html:void 0,x!=null&&Sf(e,x)):f==="children"?typeof x=="string"?(s!=="textarea"||x!=="")&&ui(e,x):typeof x=="number"&&ui(e,""+x):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(l.hasOwnProperty(f)?x!=null&&f==="onScroll"&&_e("scroll",e):x!=null&&R(e,f,x,p))}switch(s){case"input":Zt(e),mf(e,a,!1);break;case"textarea":Zt(e),vf(e);break;case"option":a.value!=null&&e.setAttribute("value",""+me(a.value));break;case"select":e.multiple=!!a.multiple,f=a.value,f!=null?yr(e,!!a.multiple,f,!1):a.defaultValue!=null&&yr(e,!!a.multiple,a.defaultValue,!0);break;default:typeof u.onClick=="function"&&(e.onclick=Os)}switch(s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return st(r),null;case 6:if(e&&r.stateNode!=null)Nh(e,r,e.memoizedProps,a);else{if(typeof a!="string"&&r.stateNode===null)throw Error(i(166));if(s=nr(Li.current),nr(Jt.current),Gs(r)){if(a=r.stateNode,s=r.memoizedProps,a[qt]=r,(f=a.nodeValue!==s)&&(e=wt,e!==null))switch(e.tag){case 3:Ls(a.nodeValue,s,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ls(a.nodeValue,s,(e.mode&1)!==0)}f&&(r.flags|=4)}else a=(s.nodeType===9?s:s.ownerDocument).createTextNode(a),a[qt]=r,r.stateNode=a}return st(r),null;case 13:if(Ie(Ne),a=r.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(De&&St!==null&&(r.mode&1)!==0&&(r.flags&128)===0)Ld(),Dr(),r.flags|=98560,f=!1;else if(f=Gs(r),a!==null&&a.dehydrated!==null){if(e===null){if(!f)throw Error(i(318));if(f=r.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(i(317));f[qt]=r}else Dr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;st(r),f=!1}else bt!==null&&(nu(bt),bt=null),f=!0;if(!f)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=s,r):(a=a!==null,a!==(e!==null&&e.memoizedState!==null)&&a&&(r.child.flags|=8192,(r.mode&1)!==0&&(e===null||(Ne.current&1)!==0?Ke===0&&(Ke=3):su())),r.updateQueue!==null&&(r.flags|=4),st(r),null);case 4:return Lr(),Hl(e,r),e===null&&Ii(r.stateNode.containerInfo),st(r),null;case 10:return wl(r.type._context),st(r),null;case 17:return ht(r.type)&&Fs(),st(r),null;case 19:if(Ie(Ne),f=r.memoizedState,f===null)return st(r),null;if(a=(r.flags&128)!==0,p=f.rendering,p===null)if(a)ji(f,!1);else{if(Ke!==0||e!==null&&(e.flags&128)!==0)for(e=r.child;e!==null;){if(p=Zs(e),p!==null){for(r.flags|=128,ji(f,!1),a=p.updateQueue,a!==null&&(r.updateQueue=a,r.flags|=4),r.subtreeFlags=0,a=s,s=r.child;s!==null;)f=s,e=a,f.flags&=14680066,p=f.alternate,p===null?(f.childLanes=0,f.lanes=e,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=p.childLanes,f.lanes=p.lanes,f.child=p.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=p.memoizedProps,f.memoizedState=p.memoizedState,f.updateQueue=p.updateQueue,f.type=p.type,e=p.dependencies,f.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),s=s.sibling;return Pe(Ne,Ne.current&1|2),r.child}e=e.sibling}f.tail!==null&&be()>zr&&(r.flags|=128,a=!0,ji(f,!1),r.lanes=4194304)}else{if(!a)if(e=Zs(p),e!==null){if(r.flags|=128,a=!0,s=e.updateQueue,s!==null&&(r.updateQueue=s,r.flags|=4),ji(f,!0),f.tail===null&&f.tailMode==="hidden"&&!p.alternate&&!De)return st(r),null}else 2*be()-f.renderingStartTime>zr&&s!==1073741824&&(r.flags|=128,a=!0,ji(f,!1),r.lanes=4194304);f.isBackwards?(p.sibling=r.child,r.child=p):(s=f.last,s!==null?s.sibling=p:r.child=p,f.last=p)}return f.tail!==null?(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=be(),r.sibling=null,s=Ne.current,Pe(Ne,a?s&1|2:s&1),r):(st(r),null);case 22:case 23:return iu(),a=r.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(r.flags|=8192),a&&(r.mode&1)!==0?(xt&1073741824)!==0&&(st(r),r.subtreeFlags&6&&(r.flags|=8192)):st(r),null;case 24:return null;case 25:return null}throw Error(i(156,r.tag))}function Q0(e,r){switch(hl(r),r.tag){case 1:return ht(r.type)&&Fs(),e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 3:return Lr(),Ie(dt),Ie(rt),Al(),e=r.flags,(e&65536)!==0&&(e&128)===0?(r.flags=e&-65537|128,r):null;case 5:return El(r),null;case 13:if(Ie(Ne),e=r.memoizedState,e!==null&&e.dehydrated!==null){if(r.alternate===null)throw Error(i(340));Dr()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 19:return Ie(Ne),null;case 4:return Lr(),null;case 10:return wl(r.type._context),null;case 22:case 23:return iu(),null;case 24:return null;default:return null}}var so=!1,ot=!1,q0=typeof WeakSet=="function"?WeakSet:Set,Z=null;function br(e,r){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(a){Le(e,r,a)}else s.current=null}function Kl(e,r,s){try{s()}catch(a){Le(e,r,a)}}var Vh=!1;function J0(e,r){if(il=Ts,e=dd(),Za(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var a=s.getSelection&&s.getSelection();if(a&&a.rangeCount!==0){s=a.anchorNode;var u=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break e}var p=0,w=-1,x=-1,_=0,F=0,j=e,O=null;t:for(;;){for(var X;j!==s||u!==0&&j.nodeType!==3||(w=p+u),j!==f||a!==0&&j.nodeType!==3||(x=p+a),j.nodeType===3&&(p+=j.nodeValue.length),(X=j.firstChild)!==null;)O=j,j=X;for(;;){if(j===e)break t;if(O===s&&++_===u&&(w=p),O===f&&++F===a&&(x=p),(X=j.nextSibling)!==null)break;j=O,O=j.parentNode}j=X}s=w===-1||x===-1?null:{start:w,end:x}}else s=null}s=s||{start:0,end:0}}else s=null;for(sl={focusedElem:e,selectionRange:s},Ts=!1,Z=r;Z!==null;)if(r=Z,e=r.child,(r.subtreeFlags&1028)!==0&&e!==null)e.return=r,Z=e;else for(;Z!==null;){r=Z;try{var Q=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(Q!==null){var J=Q.memoizedProps,Fe=Q.memoizedState,T=r.stateNode,C=T.getSnapshotBeforeUpdate(r.elementType===r.type?J:Ft(r.type,J),Fe);T.__reactInternalSnapshotBeforeUpdate=C}break;case 3:var A=r.stateNode.containerInfo;A.nodeType===1?A.textContent="":A.nodeType===9&&A.documentElement&&A.removeChild(A.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(W){Le(r,r.return,W)}if(e=r.sibling,e!==null){e.return=r.return,Z=e;break}Z=r.return}return Q=Vh,Vh=!1,Q}function Ui(e,r,s){var a=r.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var u=a=a.next;do{if((u.tag&e)===e){var f=u.destroy;u.destroy=void 0,f!==void 0&&Kl(r,s,f)}u=u.next}while(u!==a)}}function oo(e,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var a=s.create;s.destroy=a()}s=s.next}while(s!==r)}}function $l(e){var r=e.ref;if(r!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof r=="function"?r(e):r.current=e}}function Bh(e){var r=e.alternate;r!==null&&(e.alternate=null,Bh(r)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(r=e.stateNode,r!==null&&(delete r[qt],delete r[Mi],delete r[ul],delete r[B0],delete r[L0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Lh(e){return e.tag===5||e.tag===3||e.tag===4}function Oh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lh(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.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 Yl(e,r,s){var a=e.tag;if(a===5||a===6)e=e.stateNode,r?s.nodeType===8?s.parentNode.insertBefore(e,r):s.insertBefore(e,r):(s.nodeType===8?(r=s.parentNode,r.insertBefore(e,s)):(r=s,r.appendChild(e)),s=s._reactRootContainer,s!=null||r.onclick!==null||(r.onclick=Os));else if(a!==4&&(e=e.child,e!==null))for(Yl(e,r,s),e=e.sibling;e!==null;)Yl(e,r,s),e=e.sibling}function Xl(e,r,s){var a=e.tag;if(a===5||a===6)e=e.stateNode,r?s.insertBefore(e,r):s.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(Xl(e,r,s),e=e.sibling;e!==null;)Xl(e,r,s),e=e.sibling}var Je=null,zt=!1;function Nn(e,r,s){for(s=s.child;s!==null;)bh(e,r,s),s=s.sibling}function bh(e,r,s){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(ws,s)}catch{}switch(s.tag){case 5:ot||br(s,r);case 6:var a=Je,u=zt;Je=null,Nn(e,r,s),Je=a,zt=u,Je!==null&&(zt?(e=Je,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):Je.removeChild(s.stateNode));break;case 18:Je!==null&&(zt?(e=Je,s=s.stateNode,e.nodeType===8?ll(e.parentNode,s):e.nodeType===1&&ll(e,s),Si(e)):ll(Je,s.stateNode));break;case 4:a=Je,u=zt,Je=s.stateNode.containerInfo,zt=!0,Nn(e,r,s),Je=a,zt=u;break;case 0:case 11:case 14:case 15:if(!ot&&(a=s.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){u=a=a.next;do{var f=u,p=f.destroy;f=f.tag,p!==void 0&&((f&2)!==0||(f&4)!==0)&&Kl(s,r,p),u=u.next}while(u!==a)}Nn(e,r,s);break;case 1:if(!ot&&(br(s,r),a=s.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=s.memoizedProps,a.state=s.memoizedState,a.componentWillUnmount()}catch(w){Le(s,r,w)}Nn(e,r,s);break;case 21:Nn(e,r,s);break;case 22:s.mode&1?(ot=(a=ot)||s.memoizedState!==null,Nn(e,r,s),ot=a):Nn(e,r,s);break;default:Nn(e,r,s)}}function Fh(e){var r=e.updateQueue;if(r!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new q0),r.forEach(function(a){var u=lw.bind(null,e,a);s.has(a)||(s.add(a),a.then(u,u))})}}function jt(e,r){var s=r.deletions;if(s!==null)for(var a=0;au&&(u=p),a&=~f}if(a=u,a=be()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*tw(a/1960))-a,10e?16:e,Bn===null)var a=!1;else{if(e=Bn,Bn=null,fo=0,(ge&6)!==0)throw Error(i(331));var u=ge;for(ge|=4,Z=e.current;Z!==null;){var f=Z,p=f.child;if((Z.flags&16)!==0){var w=f.deletions;if(w!==null){for(var x=0;xbe()-ql?or(e,0):Ql|=s),gt(e,r)}function qh(e,r){r===0&&((e.mode&1)===0?r=1:(r=xs,xs<<=1,(xs&130023424)===0&&(xs=4194304)));var s=ut();e=pn(e,r),e!==null&&(mi(e,r,s),gt(e,s))}function aw(e){var r=e.memoizedState,s=0;r!==null&&(s=r.retryLane),qh(e,s)}function lw(e,r){var s=0;switch(e.tag){case 13:var a=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(i(314))}a!==null&&a.delete(r),qh(e,s)}var Jh;Jh=function(e,r,s){if(e!==null)if(e.memoizedProps!==r.pendingProps||dt.current)pt=!0;else{if((e.lanes&s)===0&&(r.flags&128)===0)return pt=!1,X0(e,r,s);pt=(e.flags&131072)!==0}else pt=!1,De&&(r.flags&1048576)!==0&&Dd(r,Ws,r.index);switch(r.lanes=0,r.tag){case 2:var a=r.type;io(e,r),e=r.pendingProps;var u=Ir(r,rt.current);Br(r,s),u=Il(null,r,a,e,u,s);var f=Rl();return r.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,ht(a)?(f=!0,zs(r)):f=!1,r.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Cl(r),u.updater=no,r.stateNode=u,u._reactInternals=r,Ll(r,a,e,s),r=zl(null,r,a,!0,f,s)):(r.tag=0,De&&f&&dl(r),lt(null,r,u,s),r=r.child),r;case 16:a=r.elementType;e:{switch(io(e,r),e=r.pendingProps,u=a._init,a=u(a._payload),r.type=a,u=r.tag=cw(a),e=Ft(a,e),u){case 0:r=Fl(null,r,a,e,s);break e;case 1:r=Th(null,r,a,e,s);break e;case 11:r=Sh(null,r,a,e,s);break e;case 14:r=xh(null,r,a,Ft(a.type,e),s);break e}throw Error(i(306,a,""))}return r;case 0:return a=r.type,u=r.pendingProps,u=r.elementType===a?u:Ft(a,u),Fl(e,r,a,u,s);case 1:return a=r.type,u=r.pendingProps,u=r.elementType===a?u:Ft(a,u),Th(e,r,a,u,s);case 3:e:{if(Ah(r),e===null)throw Error(i(387));a=r.pendingProps,f=r.memoizedState,u=f.element,jd(e,r),Xs(r,a,null,s);var p=r.memoizedState;if(a=p.element,f.isDehydrated)if(f={element:a,isDehydrated:!1,cache:p.cache,pendingSuspenseBoundaries:p.pendingSuspenseBoundaries,transitions:p.transitions},r.updateQueue.baseState=f,r.memoizedState=f,r.flags&256){u=Or(Error(i(423)),r),r=Ph(e,r,a,s,u);break e}else if(a!==u){u=Or(Error(i(424)),r),r=Ph(e,r,a,s,u);break e}else for(St=Pn(r.stateNode.containerInfo.firstChild),wt=r,De=!0,bt=null,s=Fd(r,null,a,s),r.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Dr(),a===u){r=gn(e,r,s);break e}lt(e,r,a,s)}r=r.child}return r;case 5:return Gd(r),e===null&&ml(r),a=r.type,u=r.pendingProps,f=e!==null?e.memoizedProps:null,p=u.children,ol(a,u)?p=null:f!==null&&ol(a,f)&&(r.flags|=32),Eh(e,r),lt(e,r,p,s),r.child;case 6:return e===null&&ml(r),null;case 13:return _h(e,r,s);case 4:return kl(r,r.stateNode.containerInfo),a=r.pendingProps,e===null?r.child=Nr(r,null,a,s):lt(e,r,a,s),r.child;case 11:return a=r.type,u=r.pendingProps,u=r.elementType===a?u:Ft(a,u),Sh(e,r,a,u,s);case 7:return lt(e,r,r.pendingProps,s),r.child;case 8:return lt(e,r,r.pendingProps.children,s),r.child;case 12:return lt(e,r,r.pendingProps.children,s),r.child;case 10:e:{if(a=r.type._context,u=r.pendingProps,f=r.memoizedProps,p=u.value,Pe(Ks,a._currentValue),a._currentValue=p,f!==null)if(Ot(f.value,p)){if(f.children===u.children&&!dt.current){r=gn(e,r,s);break e}}else for(f=r.child,f!==null&&(f.return=r);f!==null;){var w=f.dependencies;if(w!==null){p=f.child;for(var x=w.firstContext;x!==null;){if(x.context===a){if(f.tag===1){x=mn(-1,s&-s),x.tag=2;var _=f.updateQueue;if(_!==null){_=_.shared;var F=_.pending;F===null?x.next=x:(x.next=F.next,F.next=x),_.pending=x}}f.lanes|=s,x=f.alternate,x!==null&&(x.lanes|=s),Sl(f.return,s,r),w.lanes|=s;break}x=x.next}}else if(f.tag===10)p=f.type===r.type?null:f.child;else if(f.tag===18){if(p=f.return,p===null)throw Error(i(341));p.lanes|=s,w=p.alternate,w!==null&&(w.lanes|=s),Sl(p,s,r),p=f.sibling}else p=f.child;if(p!==null)p.return=f;else for(p=f;p!==null;){if(p===r){p=null;break}if(f=p.sibling,f!==null){f.return=p.return,p=f;break}p=p.return}f=p}lt(e,r,u.children,s),r=r.child}return r;case 9:return u=r.type,a=r.pendingProps.children,Br(r,s),u=_t(u),a=a(u),r.flags|=1,lt(e,r,a,s),r.child;case 14:return a=r.type,u=Ft(a,r.pendingProps),u=Ft(a.type,u),xh(e,r,a,u,s);case 15:return Ch(e,r,r.type,r.pendingProps,s);case 17:return a=r.type,u=r.pendingProps,u=r.elementType===a?u:Ft(a,u),io(e,r),r.tag=1,ht(a)?(e=!0,zs(r)):e=!1,Br(r,s),hh(r,a,u),Ll(r,a,u,s),zl(null,r,a,!0,e,s);case 19:return Rh(e,r,s);case 22:return kh(e,r,s)}throw Error(i(156,r.tag))};function ep(e,r){return Nf(e,r)}function uw(e,r,s,a){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mt(e,r,s,a){return new uw(e,r,s,a)}function ou(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cw(e){if(typeof e=="function")return ou(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fe)return 11;if(e===Be)return 14}return 2}function bn(e,r){var s=e.alternate;return s===null?(s=Mt(e.tag,r,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=r,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,r=e.dependencies,s.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function go(e,r,s,a,u,f){var p=2;if(a=e,typeof e=="function")ou(e)&&(p=1);else if(typeof e=="string")p=5;else e:switch(e){case B:return lr(s.children,u,f,r);case Y:p=8,u|=8;break;case se:return e=Mt(12,s,r,u|2),e.elementType=se,e.lanes=f,e;case Ce:return e=Mt(13,s,r,u),e.elementType=Ce,e.lanes=f,e;case ke:return e=Mt(19,s,r,u),e.elementType=ke,e.lanes=f,e;case Te:return yo(s,u,f,r);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:p=10;break e;case ae:p=9;break e;case fe:p=11;break e;case Be:p=14;break e;case Ee:p=16,a=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return r=Mt(p,s,r,u),r.elementType=e,r.type=a,r.lanes=f,r}function lr(e,r,s,a){return e=Mt(7,e,a,r),e.lanes=s,e}function yo(e,r,s,a){return e=Mt(22,e,a,r),e.elementType=Te,e.lanes=s,e.stateNode={isHidden:!1},e}function au(e,r,s){return e=Mt(6,e,null,r),e.lanes=s,e}function lu(e,r,s){return r=Mt(4,e.children!==null?e.children:[],e.key,r),r.lanes=s,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}function fw(e,r,s,a,u){this.tag=r,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ba(0),this.expirationTimes=Ba(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ba(0),this.identifierPrefix=a,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function uu(e,r,s,a,u,f,p,w,x){return e=new fw(e,r,s,w,x),r===1?(r=1,f===!0&&(r|=8)):r=0,f=Mt(3,null,null,r),e.current=f,f.stateNode=e,f.memoizedState={element:a,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cl(f),e}function dw(e,r,s){var a=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),mu.exports=Ew(),mu.exports}var pp;function Aw(){if(pp)return Eo;pp=1;var t=Tw();return Eo.createRoot=t.createRoot,Eo.hydrateRoot=t.hydrateRoot,Eo}var Pw=Aw(),at=function(){return at=Object.assign||function(n){for(var i,o=1,l=arguments.length;o0?Ye(ri,--Bt):0,Qr--,We===10&&(Qr=1,ua--),We}function Yt(){return We=Bt2||is(We)>3?"":" "}function bw(t,n){for(;--n&&Yt()&&!(We<48||We>102||We>57&&We<65||We>70&&We<97););return fa(t,Do()+(n<6&&Un()==32&&Yt()==32))}function Gu(t){for(;Yt();)switch(We){case t:return Bt;case 34:case 39:t!==34&&t!==39&&Gu(We);break;case 40:t===41&&Gu(t);break;case 92:Yt();break}return Bt}function Fw(t,n){for(;Yt()&&t+We!==57;)if(t+We===84&&Un()===47)break;return"/*"+fa(n,Bt-1)+"*"+Ic(t===47?t:Yt())}function zw(t){for(;!is(Un());)Yt();return fa(t,Bt)}function jw(t){return Lw(No("",null,null,null,[""],t=Bw(t),0,[0],t))}function No(t,n,i,o,l,c,d,h,m){for(var y=0,g=0,v=d,S=0,E=0,P=0,M=1,I=1,N=1,L=0,R="",D=l,z=c,b=o,B=R;I;)switch(P=L,L=Yt()){case 40:if(P!=108&&Ye(B,v-1)==58){Mo(B+=le(vu(L),"&","&\f"),"&\f",qm(y?h[y-1]:0))!=-1&&(N=-1);break}case 34:case 39:case 91:B+=vu(L);break;case 9:case 10:case 13:case 32:B+=Ow(P);break;case 92:B+=bw(Do()-1,7);continue;case 47:switch(Un()){case 42:case 47:Zi(Uw(Fw(Yt(),Do()),n,i,m),m),(is(P||1)==5||is(Un()||1)==5)&&Ht(B)&&gr(B,-1,void 0)!==" "&&(B+=" ");break;default:B+="/"}break;case 123*M:h[y++]=Ht(B)*N;case 125*M:case 59:case 0:switch(L){case 0:case 125:I=0;case 59+g:N==-1&&(B=le(B,/\f/g,"")),E>0&&(Ht(B)-v||M===0&&P===47)&&Zi(E>32?yp(B+";",o,i,v-1,m):yp(le(B," ","")+";",o,i,v-2,m),m);break;case 59:B+=";";default:if(Zi(b=gp(B,n,i,y,g,l,h,R,D=[],z=[],v,c),c),L===123)if(g===0)No(B,n,b,b,D,c,v,h,z);else{switch(S){case 99:if(Ye(B,3)===110)break;case 108:if(Ye(B,2)===97)break;default:g=0;case 100:case 109:case 115:}g?No(t,b,b,o&&Zi(gp(t,b,b,0,0,l,h,R,l,D=[],v,z),z),l,z,v,h,o?D:z):No(B,b,b,b,[""],z,0,h,z)}}y=g=E=0,M=N=1,R=B="",v=d;break;case 58:v=1+Ht(B),E=P;default:if(M<1){if(L==123)--M;else if(L==125&&M++==0&&Vw()==125)continue}switch(B+=Ic(L),L*M){case 38:N=g>0?1:(B+="\f",-1);break;case 44:h[y++]=(Ht(B)-1)*N,N=1;break;case 64:Un()===45&&(B+=vu(Yt())),S=Un(),g=v=Ht(R=B+=zw(Do())),L++;break;case 45:P===45&&Ht(B)==2&&(M=0)}}return c}function gp(t,n,i,o,l,c,d,h,m,y,g,v){for(var S=l-1,E=l===0?c:[""],P=eg(E),M=0,I=0,N=0;M0?E[L]+" "+R:le(R,/&\f/g,E[L])))&&(m[N++]=D);return ca(t,n,i,l===0?la:h,m,y,g,v)}function Uw(t,n,i,o){return ca(t,n,i,Zm,Ic(Nw()),gr(t,2,-2),0,o)}function yp(t,n,i,o,l){return ca(t,n,i,_c,gr(t,0,o),gr(t,o+1,-1),o,l)}function ng(t,n,i){switch(Mw(t,n)){case 5103:return we+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return we+t+t;case 4855:return we+t.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+t;case 4789:return Ji+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return we+t+Ji+t+Re+t+t;case 5936:switch(Ye(t,n+11)){case 114:return we+t+Re+le(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return we+t+Re+le(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return we+t+Re+le(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return we+t+Re+t+t;case 6165:return we+t+Re+"flex-"+t+t;case 5187:return we+t+le(t,/(\w+).+(:[^]+)/,we+"box-$1$2"+Re+"flex-$1$2")+t;case 5443:return we+t+Re+"flex-item-"+le(t,/flex-|-self/g,"")+(vn(t,/flex-|baseline/)?"":Re+"grid-row-"+le(t,/flex-|-self/g,""))+t;case 4675:return we+t+Re+"flex-line-pack"+le(t,/align-content|flex-|-self/g,"")+t;case 5548:return we+t+Re+le(t,"shrink","negative")+t;case 5292:return we+t+Re+le(t,"basis","preferred-size")+t;case 6060:return we+"box-"+le(t,"-grow","")+we+t+Re+le(t,"grow","positive")+t;case 4554:return we+le(t,/([^-])(transform)/g,"$1"+we+"$2")+t;case 6187:return le(le(le(t,/(zoom-|grab)/,we+"$1"),/(image-set)/,we+"$1"),t,"")+t;case 5495:case 3959:return le(t,/(image-set\([^]*)/,we+"$1$`$1");case 4968:return le(le(t,/(.+:)(flex-)?(.*)/,we+"box-pack:$3"+Re+"flex-pack:$3"),/space-between/,"justify")+we+t+t;case 4200:if(!vn(t,/flex-|baseline/))return Re+"grid-column-align"+gr(t,n)+t;break;case 2592:case 3360:return Re+le(t,"template-","")+t;case 4384:case 3616:return i&&i.some(function(o,l){return n=l,vn(o.props,/grid-\w+-end/)})?~Mo(t+(i=i[n].value),"span",0)?t:Re+le(t,"-start","")+t+Re+"grid-row-span:"+(~Mo(i,"span",0)?vn(i,/\d+/):+vn(i,/\d+/)-+vn(t,/\d+/))+";":Re+le(t,"-start","")+t;case 4896:case 4128:return i&&i.some(function(o){return vn(o.props,/grid-\w+-start/)})?t:Re+le(le(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return le(t,/(.+)-inline(.+)/,we+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ht(t)-1-n>6)switch(Ye(t,n+1)){case 109:if(Ye(t,n+4)!==45)break;case 102:return le(t,/(.+:)(.+)-([^]+)/,"$1"+we+"$2-$3$1"+Ji+(Ye(t,n+3)==108?"$3":"$2-$3"))+t;case 115:return~Mo(t,"stretch",0)?ng(le(t,"stretch","fill-available"),n,i)+t:t}break;case 5152:case 5920:return le(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(o,l,c,d,h,m,y){return Re+l+":"+c+y+(d?Re+l+"-span:"+(h?m:+m-+c)+y:"")+t});case 4949:if(Ye(t,n+6)===121)return le(t,":",":"+we)+t;break;case 6444:switch(Ye(t,Ye(t,14)===45?18:11)){case 120:return le(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+we+(Ye(t,14)===45?"inline-":"")+"box$3$1"+we+"$2$3$1"+Re+"$2box$3")+t;case 100:return le(t,":",":"+Re)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return le(t,"scroll-","scroll-snap-")+t}return t}function Yo(t,n){for(var i="",o=0;o-1&&!t.return)switch(t.type){case _c:t.return=ng(t.value,t.length,i);return;case Qm:return Yo([zn(t,{value:le(t.value,"@","@"+we)})],o);case la:if(t.length)return Dw(i=t.props,function(l){switch(vn(l,o=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Ur(zn(t,{props:[le(l,/:(read-\w+)/,":"+Ji+"$1")]})),Ur(zn(t,{props:[l]})),Wu(t,{props:mp(i,o)});break;case"::placeholder":Ur(zn(t,{props:[le(l,/:(plac\w+)/,":"+we+"input-$1")]})),Ur(zn(t,{props:[le(l,/:(plac\w+)/,":"+Ji+"$1")]})),Ur(zn(t,{props:[le(l,/:(plac\w+)/,Re+"input-$1")]})),Ur(zn(t,{props:[l]})),Wu(t,{props:mp(i,o)});break}return""})}}var $w={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ct={},qr=typeof process<"u"&&Ct!==void 0&&(Ct.REACT_APP_SC_ATTR||Ct.SC_ATTR)||"data-styled",rg="active",ig="data-styled-version",da="6.3.8",Rc=`/*!sc*/ -`,Xo=typeof window<"u"&&typeof document<"u",Kn=kt.createContext===void 0,Yw=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Ct!==void 0&&Ct.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Ct.REACT_APP_SC_DISABLE_SPEEDY!==""?Ct.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Ct.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Ct!==void 0&&Ct.SC_DISABLE_SPEEDY!==void 0&&Ct.SC_DISABLE_SPEEDY!==""&&Ct.SC_DISABLE_SPEEDY!=="false"&&Ct.SC_DISABLE_SPEEDY),Xw={},ha=Object.freeze([]),Jr=Object.freeze({});function sg(t,n,i){return i===void 0&&(i=Jr),t.theme!==i.theme&&t.theme||n||i.theme}var og=new Set(["a","abbr","address","area","article","aside","audio","b","bdi","bdo","blockquote","body","button","br","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","slot","small","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use"]),Zw=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Qw=/(^-|-$)/g;function vp(t){return t.replace(Zw,"-").replace(Qw,"")}var qw=/(a)(d)/gi,wp=function(t){return String.fromCharCode(t+(t>25?39:97))};function Hu(t){var n,i="";for(n=Math.abs(t);n>52;n=n/52|0)i=wp(n%52)+i;return(wp(n%52)+i).replace(qw,"$1-$2")}var wu,Gr=function(t,n){for(var i=n.length;i;)t=33*t^n.charCodeAt(--i);return t},ag=function(t){return Gr(5381,t)};function Mc(t){return Hu(ag(t)>>>0)}function Jw(t){return t.displayName||t.name||"Component"}function Su(t){return typeof t=="string"&&!0}var lg=typeof Symbol=="function"&&Symbol.for,ug=lg?Symbol.for("react.memo"):60115,e1=lg?Symbol.for("react.forward_ref"):60112,t1={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n1={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},cg={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},r1=((wu={})[e1]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},wu[ug]=cg,wu);function Sp(t){return("type"in(n=t)&&n.type.$$typeof)===ug?cg:"$$typeof"in t?r1[t.$$typeof]:t1;var n}var i1=Object.defineProperty,s1=Object.getOwnPropertyNames,xp=Object.getOwnPropertySymbols,o1=Object.getOwnPropertyDescriptor,a1=Object.getPrototypeOf,Cp=Object.prototype;function fg(t,n,i){if(typeof n!="string"){if(Cp){var o=a1(n);o&&o!==Cp&&fg(t,o,i)}var l=s1(n);xp&&(l=l.concat(xp(n)));for(var c=Sp(t),d=Sp(n),h=0;h0?" Args: ".concat(n.join(", ")):""))}var l1=(function(){function t(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}return t.prototype.indexOfGroup=function(n){for(var i=0,o=0;o=this.groupSizes.length){for(var o=this.groupSizes,l=o.length,c=l;n>=c;)if((c<<=1)<0)throw cs(16,"".concat(n));this.groupSizes=new Uint32Array(c),this.groupSizes.set(o),this.length=c;for(var d=l;d=this.length||this.groupSizes[n]===0)return i;for(var o=this.groupSizes[n],l=this.indexOfGroup(n),c=l+o,d=l;d=0){var o=document.createTextNode(i);return this.element.insertBefore(o,this.nodes[n]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.prototype.getRule=function(n){return n0&&(I+="".concat(N,","))}),m+="".concat(P).concat(M,'{content:"').concat(I,'"}').concat(Rc)},g=0;g0?".".concat(n):S},g=m.slice();g.push(function(S){S.type===la&&S.value.includes("&")&&(S.props[0]=S.props[0].replace(w1,i).replace(o,y))}),d.prefix&&g.push(Kw),g.push(Ww);var v=function(S,E,P,M){E===void 0&&(E=""),P===void 0&&(P=""),M===void 0&&(M="&"),n=M,i=E,o=new RegExp("\\".concat(i,"\\b"),"g");var I=(function(R){if(!Tp(R))return R;for(var D=R.length,z="",b=0,B=0,Y=0,se=!1,H=0;H=3&&(32|R.charCodeAt(B-1))==108&&(32|R.charCodeAt(B-2))==114&&(32|R.charCodeAt(B-3))==117)se=1,B++;else if(se>0)H===41?se--:H===40&&se++,B++;else if(H===Kr&&B+1b&&z.push(R.substring(b,B));B="A"&&t<="Z"};function Ap(t){for(var n="",i=0;i>>0);if(!i.hasNameForId(this.componentId,d)){var h=o(c,".".concat(d),void 0,this.componentId);i.insertRules(this.componentId,d,h)}l=fr(l,d),this.staticRulesId=d}else{for(var m=Gr(this.baseHash,o.hash),y="",g=0;g>>0);if(!i.hasNameForId(this.componentId,E)){var P=o(y,".".concat(E),void 0,this.componentId);i.insertRules(this.componentId,E,P)}l=fr(l,E)}}return{className:l,css:typeof window>"u"?i.getTag().getGroup(Hr(this.componentId)):""}},t})(),Vc=Kn?{Provider:function(t){return t.children},Consumer:function(t){return(0,t.children)(void 0)}}:kt.createContext(void 0);Vc.Consumer;var xu={};function A1(t,n,i){var o=Dc(t),l=t,c=!Su(t),d=n.attrs,h=d===void 0?ha:d,m=n.componentId,y=m===void 0?(function(D,z){var b=typeof D!="string"?"sc":vp(D);xu[b]=(xu[b]||0)+1;var B="".concat(b,"-").concat(Mc(da+b+xu[b]));return z?"".concat(z,"-").concat(B):B})(n.displayName,n.parentComponentId):m,g=n.displayName,v=g===void 0?(function(D){return Su(D)?"styled.".concat(D):"Styled(".concat(Jw(D),")")})(t):g,S=n.displayName&&n.componentId?"".concat(vp(n.displayName),"-").concat(n.componentId):n.componentId||y,E=o&&l.attrs?l.attrs.concat(h).filter(Boolean):h,P=n.shouldForwardProp;if(o&&l.shouldForwardProp){var M=l.shouldForwardProp;if(n.shouldForwardProp){var I=n.shouldForwardProp;P=function(D,z){return M(D,z)&&I(D,z)}}else P=M}var N=new T1(i,S,o?l.componentStyle:void 0);function L(D,z){return(function(b,B,Y){var se=b.attrs,H=b.componentStyle,ae=b.defaultProps,fe=b.foldedComponentIds,Ce=b.styledComponentId,ke=b.target,Be=Kn?void 0:kt.useContext(Vc),Ee=Xu(),Te=b.shouldForwardProp||Ee.shouldForwardProp,U=sg(B,Be,ae)||Jr,$=(function(me,ve,Xe){for(var Zt,Tt=at(at({},ve),{className:void 0,theme:Xe}),wn=0;wn2&&qo.registerId(this.componentId+n);var c=this.componentId+n;this.isStatic?o.hasNameForId(c,c)||this.createStyles(n,i,o,l):(this.removeStyles(n,o),this.createStyles(n,i,o,l))},t})();function _1(t){for(var n=[],i=1;i"u"||!y.styleSheet.server)&&(function(M,I,N,L,R){if(c.isStatic)c.renderStyles(M,Xw,N,R);else{var D=at(at({},I),{theme:sg(I,L,h.defaultProps)});c.renderStyles(M,D,N,R)}})(v,m,y.styleSheet,g,y.stylis),Kn){var S=l+v,E=typeof window>"u"?y.styleSheet.getTag().getGroup(Hr(S)):"";if(E){var P="".concat(l,"-").concat(v);return kt.createElement("style",{key:P,"data-styled-global":l,precedence:"styled-components",href:P,children:E})}}return null};return kt.memo(h)}function pa(t){for(var n=[],i=1;it==="user"?"flex-end":"flex-start"}; - margin: 4px 0; - padding: 0 16px; -`,D1=ze.div` - max-width: 80%; - padding: 10px 14px; - border-radius: 18px; - font-size: 15px; - line-height: 1.5; - word-break: break-word; - - ${({$role:t})=>t==="user"?$t` - background: #2d3748; - color: #e2e8f0; - border-bottom-right-radius: 4px; - `:$t` - background: #1a1a2e; - color: #e2e8f0; - border-bottom-left-radius: 4px; - `} -`,N1=ze.span` - display: inline-block; - width: 8px; - height: 8px; - border-radius: 50%; - background: ${({$emotion:t})=>Ip[t]??Ip.neutral}; - margin-right: 6px; - vertical-align: middle; - flex-shrink: 0; -`,V1=ze.span` - text-decoration: none; - text-decoration-color: transparent; - text-underline-offset: 3px; - - ${({$speaking:t})=>t&&$t` - text-decoration: underline; - text-decoration-thickness: 2px; - animation: ${I1} 120ms ease-out forwards; - `} - - ${({$speaking:t})=>!t&&$t` - animation: ${R1} 120ms ease-in forwards; - `} -`;function B1({message:t}){const n=t.role==="assistant";return ce.jsx(M1,{$role:t.role,children:ce.jsxs(D1,{$role:t.role,children:[n&&t.parts.length>0&&ce.jsx(N1,{$emotion:t.emotion,title:t.emotion}),t.parts.length===0?ce.jsx(O1,{}):t.parts.map((i,o)=>ce.jsxs(V1,{$speaking:t.speakingPartIndex===o,children:[i,ot}; -`;function O1(){return ce.jsxs("span",{"aria-label":"Assistant is typing",children:[ce.jsx(Cu,{$delay:"0s"}),ce.jsx(Cu,{$delay:"0.2s"}),ce.jsx(Cu,{$delay:"0.4s"})]})}const b1=ze.div` - flex: 1; - overflow-y: auto; - overflow-x: hidden; - display: flex; - flex-direction: column; - padding: 8px 0; - /* Smooth momentum scrolling on iOS */ - -webkit-overflow-scrolling: touch; - /* Hide scrollbar on mobile */ - scrollbar-width: none; - &::-webkit-scrollbar { - display: none; - } -`,F1=ze.div` - flex: 1; -`,z1=ze.div` - height: 1px; - flex-shrink: 0; -`;function j1({messages:t}){const n=G.useRef(null),i=G.useRef(null);return G.useEffect(()=>{const o=i.current;if(!o)return;o.scrollHeight-o.scrollTop-o.clientHeight<100&&n.current?.scrollIntoView({behavior:"smooth",block:"end"})},[t]),ce.jsxs(b1,{ref:i,children:[t.length===0&&ce.jsx(F1,{}),t.map(o=>ce.jsx(B1,{message:o},o.id)),ce.jsx(z1,{ref:n})]})}const Sg=G.createContext({});function U1(t){const n=G.useRef(null);return n.current===null&&(n.current=t()),n.current}const W1=typeof window<"u",G1=W1?G.useLayoutEffect:G.useEffect,Bc=G.createContext(null);function Lc(t,n){t.indexOf(n)===-1&&t.push(n)}function Jo(t,n){const i=t.indexOf(n);i>-1&&t.splice(i,1)}const an=(t,n,i)=>i>n?n:i{};const $n={},xg=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Cg(t){return typeof t=="object"&&t!==null}const kg=t=>/^0[^.\s]+$/u.test(t);function Eg(t){let n;return()=>(n===void 0&&(n=t()),n)}const Vt=t=>t,H1=(t,n)=>i=>n(t(i)),fs=(...t)=>t.reduce(H1),os=(t,n,i)=>{const o=n-t;return o===0?1:(i-t)/o};class bc{constructor(){this.subscriptions=[]}add(n){return Lc(this.subscriptions,n),()=>Jo(this.subscriptions,n)}notify(n,i,o){const l=this.subscriptions.length;if(l)if(l===1)this.subscriptions[0](n,i,o);else for(let c=0;ct*1e3,Nt=t=>t/1e3;function Tg(t,n){return n?t*(1e3/n):0}const Ag=(t,n,i)=>(((1-3*i+3*n)*t+(3*i-6*n))*t+3*n)*t,K1=1e-7,$1=12;function Y1(t,n,i,o,l){let c,d,h=0;do d=n+(i-n)/2,c=Ag(d,o,l)-t,c>0?i=d:n=d;while(Math.abs(c)>K1&&++h<$1);return d}function ds(t,n,i,o){if(t===n&&i===o)return Vt;const l=c=>Y1(c,0,1,t,i);return c=>c===0||c===1?c:Ag(l(c),n,o)}const Pg=t=>n=>n<=.5?t(2*n)/2:(2-t(2*(1-n)))/2,_g=t=>n=>1-t(1-n),Ig=ds(.33,1.53,.69,.99),Fc=_g(Ig),Rg=Pg(Fc),Mg=t=>t>=1?1:(t*=2)<1?.5*Fc(t):.5*(2-Math.pow(2,-10*(t-1))),zc=t=>1-Math.sin(Math.acos(t)),Dg=_g(zc),Ng=Pg(zc),X1=ds(.42,0,1,1),Z1=ds(0,0,.58,1),Vg=ds(.42,0,.58,1),Q1=t=>Array.isArray(t)&&typeof t[0]!="number",Bg=t=>Array.isArray(t)&&typeof t[0]=="number",q1={linear:Vt,easeIn:X1,easeInOut:Vg,easeOut:Z1,circIn:zc,circInOut:Ng,circOut:Dg,backIn:Fc,backInOut:Rg,backOut:Ig,anticipate:Mg},J1=t=>typeof t=="string",Rp=t=>{if(Bg(t)){Oc(t.length===4);const[n,i,o,l]=t;return ds(n,i,o,l)}else if(J1(t))return q1[t];return t},To=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function eS(t,n){let i=new Set,o=new Set,l=!1,c=!1;const d=new WeakSet;let h={delta:0,timestamp:0,isProcessing:!1};function m(g){d.has(g)&&(y.schedule(g),t()),g(h)}const y={schedule:(g,v=!1,S=!1)=>{const P=S&&l?i:o;return v&&d.add(g),P.add(g),g},cancel:g=>{o.delete(g),d.delete(g)},process:g=>{if(h=g,l){c=!0;return}l=!0;const v=i;i=o,o=v,i.forEach(m),i.clear(),l=!1,c&&(c=!1,y.process(g))}};return y}const tS=40;function Lg(t,n){let i=!1,o=!0;const l={delta:0,timestamp:0,isProcessing:!1},c=()=>i=!0,d=To.reduce((R,D)=>(R[D]=eS(c),R),{}),{setup:h,read:m,resolveKeyframes:y,preUpdate:g,update:v,preRender:S,render:E,postRender:P}=d,M=()=>{const R=$n.useManualTiming,D=R?l.timestamp:performance.now();i=!1,R||(l.delta=o?1e3/60:Math.max(Math.min(D-l.timestamp,tS),1)),l.timestamp=D,l.isProcessing=!0,h.process(l),m.process(l),y.process(l),g.process(l),v.process(l),S.process(l),E.process(l),P.process(l),l.isProcessing=!1,i&&n&&(o=!1,t(M))},I=()=>{i=!0,o=!0,l.isProcessing||t(M)};return{schedule:To.reduce((R,D)=>{const z=d[D];return R[D]=(b,B=!1,Y=!1)=>(i||I(),z.schedule(b,B,Y)),R},{}),cancel:R=>{for(let D=0;D(Lo===void 0&&ct.set(tt.isProcessing||$n.useManualTiming?tt.timestamp:performance.now()),Lo),set:t=>{Lo=t,queueMicrotask(nS)}},Og=t=>n=>typeof n=="string"&&n.startsWith(t),bg=Og("--"),rS=Og("var(--"),jc=t=>rS(t)?iS.test(t.split("/*")[0].trim()):!1,iS=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Mp(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const ii={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},as={...ii,transform:t=>an(0,1,t)},Ao={...ii,default:1},es=t=>Math.round(t*1e5)/1e5,Uc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function sS(t){return t==null}const oS=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wc=(t,n)=>i=>!!(typeof i=="string"&&oS.test(i)&&i.startsWith(t)||n&&!sS(i)&&Object.prototype.hasOwnProperty.call(i,n)),Fg=(t,n,i)=>o=>{if(typeof o!="string")return o;const[l,c,d,h]=o.match(Uc);return{[t]:parseFloat(l),[n]:parseFloat(c),[i]:parseFloat(d),alpha:h!==void 0?parseFloat(h):1}},aS=t=>an(0,255,t),Eu={...ii,transform:t=>Math.round(aS(t))},dr={test:Wc("rgb","red"),parse:Fg("red","green","blue"),transform:({red:t,green:n,blue:i,alpha:o=1})=>"rgba("+Eu.transform(t)+", "+Eu.transform(n)+", "+Eu.transform(i)+", "+es(as.transform(o))+")"};function lS(t){let n="",i="",o="",l="";return t.length>5?(n=t.substring(1,3),i=t.substring(3,5),o=t.substring(5,7),l=t.substring(7,9)):(n=t.substring(1,2),i=t.substring(2,3),o=t.substring(3,4),l=t.substring(4,5),n+=n,i+=i,o+=o,l+=l),{red:parseInt(n,16),green:parseInt(i,16),blue:parseInt(o,16),alpha:l?parseInt(l,16)/255:1}}const Qu={test:Wc("#"),parse:lS,transform:dr.transform},hs=t=>({test:n=>typeof n=="string"&&n.endsWith(t)&&n.split(" ").length===1,parse:parseFloat,transform:n=>`${n}${t}`}),jn=hs("deg"),sn=hs("%"),q=hs("px"),uS=hs("vh"),cS=hs("vw"),Dp={...sn,parse:t=>sn.parse(t)/100,transform:t=>sn.transform(t*100)},$r={test:Wc("hsl","hue"),parse:Fg("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:i,alpha:o=1})=>"hsla("+Math.round(t)+", "+sn.transform(es(n))+", "+sn.transform(es(i))+", "+es(as.transform(o))+")"},Ue={test:t=>dr.test(t)||Qu.test(t)||$r.test(t),parse:t=>dr.test(t)?dr.parse(t):$r.test(t)?$r.parse(t):Qu.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?dr.transform(t):$r.transform(t),getAnimatableNone:t=>{const n=Ue.parse(t);return n.alpha=0,Ue.transform(n)}},fS=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function dS(t){return isNaN(t)&&typeof t=="string"&&(t.match(Uc)?.length||0)+(t.match(fS)?.length||0)>0}const zg="number",jg="color",hS="var",pS="var(",Np="${}",mS=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ti(t){const n=t.toString(),i=[],o={color:[],number:[],var:[]},l=[];let c=0;const h=n.replace(mS,m=>(Ue.test(m)?(o.color.push(c),l.push(jg),i.push(Ue.parse(m))):m.startsWith(pS)?(o.var.push(c),l.push(hS),i.push(m)):(o.number.push(c),l.push(zg),i.push(parseFloat(m))),++c,Np)).split(Np);return{values:i,split:h,indexes:o,types:l}}function gS(t){return ti(t).values}function Ug({split:t,types:n}){const i=t.length;return o=>{let l="";for(let c=0;ctypeof t=="number"?0:Ue.test(t)?Ue.getAnimatableNone(t):t,wS=(t,n)=>typeof t=="number"?n?.trim().endsWith("/")?t:0:vS(t);function SS(t){const n=ti(t);return Ug(n)(n.values.map((o,l)=>wS(o,n.split[l])))}const Xt={test:dS,parse:gS,createTransformer:yS,getAnimatableNone:SS};function Tu(t,n,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+(n-t)*6*i:i<1/2?n:i<2/3?t+(n-t)*(2/3-i)*6:t}function xS({hue:t,saturation:n,lightness:i,alpha:o}){t/=360,n/=100,i/=100;let l=0,c=0,d=0;if(!n)l=c=d=i;else{const h=i<.5?i*(1+n):i+n-i*n,m=2*i-h;l=Tu(m,h,t+1/3),c=Tu(m,h,t),d=Tu(m,h,t-1/3)}return{red:Math.round(l*255),green:Math.round(c*255),blue:Math.round(d*255),alpha:o}}function ea(t,n){return i=>i>0?n:t}const Me=(t,n,i)=>t+(n-t)*i,Au=(t,n,i)=>{const o=t*t,l=i*(n*n-o)+o;return l<0?0:Math.sqrt(l)},CS=[Qu,dr,$r],kS=t=>CS.find(n=>n.test(t));function Vp(t){const n=kS(t);if(!n)return!1;let i=n.parse(t);return n===$r&&(i=xS(i)),i}const Bp=(t,n)=>{const i=Vp(t),o=Vp(n);if(!i||!o)return ea(t,n);const l={...i};return c=>(l.red=Au(i.red,o.red,c),l.green=Au(i.green,o.green,c),l.blue=Au(i.blue,o.blue,c),l.alpha=Me(i.alpha,o.alpha,c),dr.transform(l))},qu=new Set(["none","hidden"]);function ES(t,n){return qu.has(t)?i=>i<=0?t:n:i=>i>=1?n:t}function TS(t,n){return i=>Me(t,n,i)}function Gc(t){return typeof t=="number"?TS:typeof t=="string"?jc(t)?ea:Ue.test(t)?Bp:_S:Array.isArray(t)?Wg:typeof t=="object"?Ue.test(t)?Bp:AS:ea}function Wg(t,n){const i=[...t],o=i.length,l=t.map((c,d)=>Gc(c)(c,n[d]));return c=>{for(let d=0;d{for(const c in o)i[c]=o[c](l);return i}}function PS(t,n){const i=[],o={color:0,var:0,number:0};for(let l=0;l{const i=Xt.createTransformer(n),o=ti(t),l=ti(n);return o.indexes.var.length===l.indexes.var.length&&o.indexes.color.length===l.indexes.color.length&&o.indexes.number.length>=l.indexes.number.length?qu.has(t)&&!l.values.length||qu.has(n)&&!o.values.length?ES(t,n):fs(Wg(PS(o,l),l.values),i):ea(t,n)};function Gg(t,n,i){return typeof t=="number"&&typeof n=="number"&&typeof i=="number"?Me(t,n,i):Gc(t)(t,n)}const IS=t=>{const n=({timestamp:i})=>t(i);return{start:(i=!0)=>Ae.update(n,i),stop:()=>Yn(n),now:()=>tt.isProcessing?tt.timestamp:ct.now()}},Hg=(t,n,i=10)=>{let o="";const l=Math.max(Math.round(n/i),2);for(let c=0;c=ta?1/0:n}function RS(t,n=100,i){const o=i({...t,keyframes:[0,n]}),l=Math.min(Hc(o),ta);return{type:"keyframes",ease:c=>o.next(l*c).value/n,duration:Nt(l)}}const Oe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ju(t,n){return t*Math.sqrt(1-n*n)}const MS=12;function DS(t,n,i){let o=i;for(let l=1;l{const g=y*d,v=g*t,S=g-i,E=Ju(y,d),P=Math.exp(-v);return Pu-S/E*P},c=y=>{const v=y*d*t,S=v*i+i,E=Math.pow(d,2)*Math.pow(y,2)*t,P=Math.exp(-v),M=Ju(Math.pow(y,2),d);return(-l(y)+Pu>0?-1:1)*((S-E)*P)/M}):(l=y=>{const g=Math.exp(-y*t),v=(y-i)*t+1;return-Pu+g*v},c=y=>{const g=Math.exp(-y*t),v=(i-y)*(t*t);return g*v});const h=5/t,m=DS(l,c,h);if(t=Et(t),isNaN(m))return{stiffness:Oe.stiffness,damping:Oe.damping,duration:t};{const y=Math.pow(m,2)*o;return{stiffness:y,damping:d*2*Math.sqrt(o*y),duration:t}}}const VS=["duration","bounce"],BS=["stiffness","damping","mass"];function Lp(t,n){return n.some(i=>t[i]!==void 0)}function LS(t){let n={velocity:Oe.velocity,stiffness:Oe.stiffness,damping:Oe.damping,mass:Oe.mass,isResolvedFromDuration:!1,...t};if(!Lp(t,BS)&&Lp(t,VS))if(n.velocity=0,t.visualDuration){const i=t.visualDuration,o=2*Math.PI/(i*1.2),l=o*o,c=2*an(.05,1,1-(t.bounce||0))*Math.sqrt(l);n={...n,mass:Oe.mass,stiffness:l,damping:c}}else{const i=NS({...t,velocity:0});n={...n,...i,mass:Oe.mass},n.isResolvedFromDuration=!0}return n}function na(t=Oe.visualDuration,n=Oe.bounce){const i=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:n}:t;let{restSpeed:o,restDelta:l}=i;const c=i.keyframes[0],d=i.keyframes[i.keyframes.length-1],h={done:!1,value:c},{stiffness:m,damping:y,mass:g,duration:v,velocity:S,isResolvedFromDuration:E}=LS({...i,velocity:-Nt(i.velocity||0)}),P=S||0,M=y/(2*Math.sqrt(m*g)),I=d-c,N=Nt(Math.sqrt(m/g)),L=Math.abs(I)<5;o||(o=L?Oe.restSpeed.granular:Oe.restSpeed.default),l||(l=L?Oe.restDelta.granular:Oe.restDelta.default);let R,D,z,b,B,Y;if(M<1)z=Ju(N,M),b=(P+M*N*I)/z,R=H=>{const ae=Math.exp(-M*N*H);return d-ae*(b*Math.sin(z*H)+I*Math.cos(z*H))},B=M*N*b+I*z,Y=M*N*I-b*z,D=H=>Math.exp(-M*N*H)*(B*Math.sin(z*H)+Y*Math.cos(z*H));else if(M===1){R=ae=>d-Math.exp(-N*ae)*(I+(P+N*I)*ae);const H=P+N*I;D=ae=>Math.exp(-N*ae)*(N*H*ae-P)}else{const H=N*Math.sqrt(M*M-1);R=ke=>{const Be=Math.exp(-M*N*ke),Ee=Math.min(H*ke,300);return d-Be*((P+M*N*I)*Math.sinh(Ee)+H*I*Math.cosh(Ee))/H};const ae=(P+M*N*I)/H,fe=M*N*ae-I*H,Ce=M*N*I-ae*H;D=ke=>{const Be=Math.exp(-M*N*ke),Ee=Math.min(H*ke,300);return Be*(fe*Math.sinh(Ee)+Ce*Math.cosh(Ee))}}const se={calculatedDuration:E&&v||null,velocity:H=>Et(D(H)),next:H=>{if(!E&&M<1){const fe=Math.exp(-M*N*H),Ce=Math.sin(z*H),ke=Math.cos(z*H),Be=d-fe*(b*Ce+I*ke),Ee=Et(fe*(B*Ce+Y*ke));return h.done=Math.abs(Ee)<=o&&Math.abs(d-Be)<=l,h.value=h.done?d:Be,h}const ae=R(H);if(E)h.done=H>=v;else{const fe=Et(D(H));h.done=Math.abs(fe)<=o&&Math.abs(d-ae)<=l}return h.value=h.done?d:ae,h},toString:()=>{const H=Math.min(Hc(se),ta),ae=Hg(fe=>se.next(H*fe).value,H,30);return H+"ms "+ae},toTransition:()=>{}};return se}na.applyToOptions=t=>{const n=RS(t,100,na);return t.ease=n.ease,t.duration=Et(n.duration),t.type="keyframes",t};const OS=5;function Kg(t,n,i){const o=Math.max(n-OS,0);return Tg(i-t(o),n-o)}function ec({keyframes:t,velocity:n=0,power:i=.8,timeConstant:o=325,bounceDamping:l=10,bounceStiffness:c=500,modifyTarget:d,min:h,max:m,restDelta:y=.5,restSpeed:g}){const v=t[0],S={done:!1,value:v},E=Y=>h!==void 0&&Ym,P=Y=>h===void 0?m:m===void 0||Math.abs(h-Y)-M*Math.exp(-Y/o),R=Y=>N+L(Y),D=Y=>{const se=L(Y),H=R(Y);S.done=Math.abs(se)<=y,S.value=S.done?N:H};let z,b;const B=Y=>{E(S.value)&&(z=Y,b=na({keyframes:[S.value,P(S.value)],velocity:Kg(R,Y,S.value),damping:l,stiffness:c,restDelta:y,restSpeed:g}))};return B(0),{calculatedDuration:null,next:Y=>{let se=!1;return!b&&z===void 0&&(se=!0,D(Y),B(Y)),z!==void 0&&Y>=z?b.next(Y-z):(!se&&D(Y),S)}}}function bS(t,n,i){const o=[],l=i||$n.mix||Gg,c=t.length-1;for(let d=0;dn[0];if(c===2&&n[0]===n[1])return()=>n[1];const d=t[0]===t[1];t[0]>t[c-1]&&(t=[...t].reverse(),n=[...n].reverse());const h=bS(n,o,l),m=h.length,y=g=>{if(d&&g1)for(;vy(an(t[0],t[c-1],g)):y}function zS(t,n){const i=t[t.length-1];for(let o=1;o<=n;o++){const l=os(0,n,o);t.push(Me(i,1,l))}}function jS(t){const n=[0];return zS(n,t.length-1),n}function US(t,n){return t.map(i=>i*n)}function WS(t,n){return t.map(()=>n||Vg).splice(0,t.length-1)}function ts({duration:t=300,keyframes:n,times:i,ease:o="easeInOut"}){const l=Q1(o)?o.map(Rp):Rp(o),c={done:!1,value:n[0]},d=US(i&&i.length===n.length?i:jS(n),t),h=FS(d,n,{ease:Array.isArray(l)?l:WS(n,l)});return{calculatedDuration:t,next:m=>(c.value=h(m),c.done=m>=t,c)}}const GS=t=>t!==null;function ma(t,{repeat:n,repeatType:i="loop"},o,l=1){const c=t.filter(GS),h=l<0||n&&i!=="loop"&&n%2===1?0:c.length-1;return!h||o===void 0?c[h]:o}const HS={decay:ec,inertia:ec,tween:ts,keyframes:ts,spring:na};function $g(t){typeof t.type=="string"&&(t.type=HS[t.type])}class Kc{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(n=>{this.resolve=n})}notifyFinished(){this.resolve()}then(n,i){return this.finished.then(n,i)}}const KS=t=>t/100;class ra extends Kc{constructor(n){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:i}=this.options;i&&i.updatedAt!==ct.now()&&this.tick(ct.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=n,this.initAnimation(),this.play(),n.autoplay===!1&&this.pause()}initAnimation(){const{options:n}=this;$g(n);const{type:i=ts,repeat:o=0,repeatDelay:l=0,repeatType:c,velocity:d=0}=n;let{keyframes:h}=n;const m=i||ts;m!==ts&&typeof h[0]!="number"&&(this.mixKeyframes=fs(KS,Gg(h[0],h[1])),h=[0,100]);const y=m({...n,keyframes:h});c==="mirror"&&(this.mirroredGenerator=m({...n,keyframes:[...h].reverse(),velocity:-d})),y.calculatedDuration===null&&(y.calculatedDuration=Hc(y));const{calculatedDuration:g}=y;this.calculatedDuration=g,this.resolvedDuration=g+l,this.totalDuration=this.resolvedDuration*(o+1)-l,this.generator=y}updateTime(n){const i=Math.round(n-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=i}tick(n,i=!1){const{generator:o,totalDuration:l,mixKeyframes:c,mirroredGenerator:d,resolvedDuration:h,calculatedDuration:m}=this;if(this.startTime===null)return o.next(0);const{delay:y=0,keyframes:g,repeat:v,repeatType:S,repeatDelay:E,type:P,onUpdate:M,finalKeyframe:I}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,n):this.speed<0&&(this.startTime=Math.min(n-l/this.speed,this.startTime)),i?this.currentTime=n:this.updateTime(n);const N=this.currentTime-y*(this.playbackSpeed>=0?1:-1),L=this.playbackSpeed>=0?N<0:N>l;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=l);let R=this.currentTime,D=o;if(v){const Y=Math.min(this.currentTime,l)/h;let se=Math.floor(Y),H=Y%1;!H&&Y>=1&&(H=1),H===1&&se--,se=Math.min(se,v+1),!!(se%2)&&(S==="reverse"?(H=1-H,E&&(H-=E/h)):S==="mirror"&&(D=d)),R=an(0,1,H)*h}let z;L?(this.delayState.value=g[0],z=this.delayState):z=D.next(R),c&&!L&&(z.value=c(z.value));let{done:b}=z;!L&&m!==null&&(b=this.playbackSpeed>=0?this.currentTime>=l:this.currentTime<=0);const B=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&b);return B&&P!==ec&&(z.value=ma(g,this.options,I,this.speed)),M&&M(z.value),B&&this.finish(),z}then(n,i){return this.finished.then(n,i)}get duration(){return Nt(this.calculatedDuration)}get iterationDuration(){const{delay:n=0}=this.options||{};return this.duration+Nt(n)}get time(){return Nt(this.currentTime)}set time(n){n=Et(n),this.currentTime=n,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=n:this.driver&&(this.startTime=this.driver.now()-n/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=n,this.tick(n))}getGeneratorVelocity(){const n=this.currentTime;if(n<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(n);const i=this.generator.next(n).value;return Kg(o=>this.generator.next(o).value,n,i)}get speed(){return this.playbackSpeed}set speed(n){const i=this.playbackSpeed!==n;i&&this.driver&&this.updateTime(ct.now()),this.playbackSpeed=n,i&&this.driver&&(this.time=Nt(this.currentTime))}play(){if(this.isStopped)return;const{driver:n=IS,startTime:i}=this.options;this.driver||(this.driver=n(l=>this.tick(l))),this.options.onPlay?.();const o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=i??o),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ct.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(n){return this.startTime=0,this.tick(n,!0)}attachTimeline(n){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),n.observe(this)}}function $S(t){for(let n=1;nt*180/Math.PI,tc=t=>{const n=hr(Math.atan2(t[1],t[0]));return nc(n)},YS={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:tc,rotateZ:tc,skewX:t=>hr(Math.atan(t[1])),skewY:t=>hr(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},nc=t=>(t=t%360,t<0&&(t+=360),t),Op=tc,bp=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Fp=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),XS={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bp,scaleY:Fp,scale:t=>(bp(t)+Fp(t))/2,rotateX:t=>nc(hr(Math.atan2(t[6],t[5]))),rotateY:t=>nc(hr(Math.atan2(-t[2],t[0]))),rotateZ:Op,rotate:Op,skewX:t=>hr(Math.atan(t[4])),skewY:t=>hr(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function rc(t){return t.includes("scale")?1:0}function ic(t,n){if(!t||t==="none")return rc(n);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let o,l;if(i)o=XS,l=i;else{const h=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=YS,l=h}if(!l)return rc(n);const c=o[n],d=l[1].split(",").map(QS);return typeof c=="function"?c(d):d[c]}const ZS=(t,n)=>{const{transform:i="none"}=getComputedStyle(t);return ic(i,n)};function QS(t){return parseFloat(t.trim())}const si=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],oi=new Set(si),zp=t=>t===ii||t===q,qS=new Set(["x","y","z"]),JS=si.filter(t=>!qS.has(t));function ex(t){const n=[];return JS.forEach(i=>{const o=t.getValue(i);o!==void 0&&(n.push([i,o.get()]),o.set(i.startsWith("scale")?1:0))}),n}const Wn={width:({x:t},{paddingLeft:n="0",paddingRight:i="0",boxSizing:o})=>{const l=t.max-t.min;return o==="border-box"?l:l-parseFloat(n)-parseFloat(i)},height:({y:t},{paddingTop:n="0",paddingBottom:i="0",boxSizing:o})=>{const l=t.max-t.min;return o==="border-box"?l:l-parseFloat(n)-parseFloat(i)},top:(t,{top:n})=>parseFloat(n),left:(t,{left:n})=>parseFloat(n),bottom:({y:t},{top:n})=>parseFloat(n)+(t.max-t.min),right:({x:t},{left:n})=>parseFloat(n)+(t.max-t.min),x:(t,{transform:n})=>ic(n,"x"),y:(t,{transform:n})=>ic(n,"y")};Wn.translateX=Wn.x;Wn.translateY=Wn.y;const pr=new Set;let sc=!1,oc=!1,ac=!1;function Yg(){if(oc){const t=Array.from(pr).filter(o=>o.needsMeasurement),n=new Set(t.map(o=>o.element)),i=new Map;n.forEach(o=>{const l=ex(o);l.length&&(i.set(o,l),o.render())}),t.forEach(o=>o.measureInitialState()),n.forEach(o=>{o.render();const l=i.get(o);l&&l.forEach(([c,d])=>{o.getValue(c)?.set(d)})}),t.forEach(o=>o.measureEndState()),t.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}oc=!1,sc=!1,pr.forEach(t=>t.complete(ac)),pr.clear()}function Xg(){pr.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(oc=!0)})}function tx(){ac=!0,Xg(),Yg(),ac=!1}class $c{constructor(n,i,o,l,c,d=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...n],this.onComplete=i,this.name=o,this.motionValue=l,this.element=c,this.isAsync=d}scheduleResolve(){this.state="scheduled",this.isAsync?(pr.add(this),sc||(sc=!0,Ae.read(Xg),Ae.resolveKeyframes(Yg))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:n,name:i,element:o,motionValue:l}=this;if(n[0]===null){const c=l?.get(),d=n[n.length-1];if(c!==void 0)n[0]=c;else if(o&&i){const h=o.readValue(i,d);h!=null&&(n[0]=h)}n[0]===void 0&&(n[0]=d),l&&c===void 0&&l.set(n[0])}$S(n)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(n=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,n),pr.delete(this)}cancel(){this.state==="scheduled"&&(pr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const nx=t=>t.startsWith("--");function Zg(t,n,i){nx(n)?t.style.setProperty(n,i):t.style[n]=i}const rx={};function Qg(t,n){const i=Eg(t);return()=>rx[n]??i()}const ix=Qg(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),qg=Qg(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Qi=([t,n,i,o])=>`cubic-bezier(${t}, ${n}, ${i}, ${o})`,jp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qi([0,.65,.55,1]),circOut:Qi([.55,0,1,.45]),backIn:Qi([.31,.01,.66,-.59]),backOut:Qi([.33,1.53,.69,.99])};function Jg(t,n){if(t)return typeof t=="function"?qg()?Hg(t,n):"ease-out":Bg(t)?Qi(t):Array.isArray(t)?t.map(i=>Jg(i,n)||jp.easeOut):jp[t]}function sx(t,n,i,{delay:o=0,duration:l=300,repeat:c=0,repeatType:d="loop",ease:h="easeOut",times:m}={},y=void 0){const g={[n]:i};m&&(g.offset=m);const v=Jg(h,l);Array.isArray(v)&&(g.easing=v);const S={delay:o,duration:l,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:c+1,direction:d==="reverse"?"alternate":"normal"};return y&&(S.pseudoElement=y),t.animate(g,S)}function ey(t){return typeof t=="function"&&"applyToOptions"in t}function ox({type:t,...n}){return ey(t)&&qg()?t.applyToOptions(n):(n.duration??(n.duration=300),n.ease??(n.ease="easeOut"),n)}class ty extends Kc{constructor(n){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!n)return;const{element:i,name:o,keyframes:l,pseudoElement:c,allowFlatten:d=!1,finalKeyframe:h,onComplete:m}=n;this.isPseudoElement=!!c,this.allowFlatten=d,this.options=n,Oc(typeof n.type!="string");const y=ox(n);this.animation=sx(i,o,l,y,c),y.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!c){const g=ma(l,this.options,h,this.speed);this.updateMotionValue&&this.updateMotionValue(g),Zg(i,o,g),this.animation.cancel()}m?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:n}=this;n==="idle"||n==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const n=this.options?.element;!this.isPseudoElement&&n?.isConnected&&this.animation.commitStyles?.()}get duration(){const n=this.animation.effect?.getComputedTiming?.().duration||0;return Nt(Number(n))}get iterationDuration(){const{delay:n=0}=this.options||{};return this.duration+Nt(n)}get time(){return Nt(Number(this.animation.currentTime)||0)}set time(n){const i=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Et(n),i&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(n){n<0&&(this.finishedTime=null),this.animation.playbackRate=n}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(n){this.manualStartTime=this.animation.startTime=n}attachTimeline({timeline:n,rangeStart:i,rangeEnd:o,observe:l}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,n&&ix()?(this.animation.timeline=n,i&&(this.animation.rangeStart=i),o&&(this.animation.rangeEnd=o),Vt):l(this)}}const ny={anticipate:Mg,backInOut:Rg,circInOut:Ng};function ax(t){return t in ny}function lx(t){typeof t.ease=="string"&&ax(t.ease)&&(t.ease=ny[t.ease])}const _u=10;class ux extends ty{constructor(n){lx(n),$g(n),super(n),n.startTime!==void 0&&n.autoplay!==!1&&(this.startTime=n.startTime),this.options=n}updateMotionValue(n){const{motionValue:i,onUpdate:o,onComplete:l,element:c,...d}=this.options;if(!i)return;if(n!==void 0){i.set(n);return}const h=new ra({...d,autoplay:!1}),m=Math.max(_u,ct.now()-this.startTime),y=an(0,_u,m-_u),g=h.sample(m).value,{name:v}=this.options;c&&v&&Zg(c,v,g),i.setWithVelocity(h.sample(Math.max(0,m-y)).value,g,y),h.stop()}}const Up=(t,n)=>n==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Xt.test(t)||t==="0")&&!t.startsWith("url("));function cx(t){const n=t[0];if(t.length===1)return!0;for(let i=0;iObject.hasOwnProperty.call(Element.prototype,"animate"));function gx(t){const{motionValue:n,name:i,repeatDelay:o,repeatType:l,damping:c,type:d,keyframes:h}=t;if(!(n?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:y,transformTemplate:g}=n.owner.getProps();return mx()&&i&&(ry.has(i)||px.has(i)&&hx(h))&&(i!=="transform"||!g)&&!y&&!o&&l!=="mirror"&&c!==0&&d!=="inertia"}const yx=40;class vx extends Kc{constructor({autoplay:n=!0,delay:i=0,type:o="keyframes",repeat:l=0,repeatDelay:c=0,repeatType:d="loop",keyframes:h,name:m,motionValue:y,element:g,...v}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ct.now();const S={autoplay:n,delay:i,type:o,repeat:l,repeatDelay:c,repeatType:d,name:m,motionValue:y,element:g,...v},E=g?.KeyframeResolver||$c;this.keyframeResolver=new E(h,(P,M,I)=>this.onKeyframesResolved(P,M,S,!I),m,y,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(n,i,o,l){this.keyframeResolver=void 0;const{name:c,type:d,velocity:h,delay:m,isHandoff:y,onUpdate:g}=o;this.resolvedAt=ct.now();let v=!0;fx(n,c,d,h)||(v=!1,($n.instantAnimations||!m)&&g?.(ma(n,o,i)),n[0]=n[n.length-1],lc(o),o.repeat=0);const E={startTime:l?this.resolvedAt?this.resolvedAt-this.createdAt>yx?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...o,keyframes:n},P=v&&!y&&gx(E),M=E.motionValue?.owner?.current;let I;if(P)try{I=new ux({...E,element:M})}catch{I=new ra(E)}else I=new ra(E);I.finished.then(()=>{this.notifyFinished()}).catch(Vt),this.pendingTimeline&&(this.stopTimeline=I.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=I}get finished(){return this._animation?this.animation.finished:this._finished}then(n,i){return this.finished.finally(n).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),tx()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(n){this.animation.time=n}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(n){this.animation.speed=n}get startTime(){return this.animation.startTime}attachTimeline(n){return this._animation?this.stopTimeline=this.animation.attachTimeline(n):this.pendingTimeline=n,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function iy(t,n,i,o=0,l=1){const c=Array.from(t).sort((y,g)=>y.sortNodePosition(g)).indexOf(n),d=t.size,h=(d-1)*o;return typeof i=="function"?i(c,d):l===1?c*o:h-c*o}const wx=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Sx(t){const n=wx.exec(t);if(!n)return[,];const[,i,o,l]=n;return[`--${i??o}`,l]}function sy(t,n,i=1){const[o,l]=Sx(t);if(!o)return;const c=window.getComputedStyle(n).getPropertyValue(o);if(c){const d=c.trim();return xg(d)?parseFloat(d):d}return jc(l)?sy(l,n,i+1):l}const xx={type:"spring",stiffness:500,damping:25,restSpeed:10},Cx=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),kx={type:"keyframes",duration:.8},Ex={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Tx=(t,{keyframes:n})=>n.length>2?kx:oi.has(t)?t.startsWith("scale")?Cx(n[1]):xx:Ex;function oy(t,n){if(t?.inherit&&n){const{inherit:i,...o}=t;return{...n,...o}}return t}function Yc(t,n){const i=t?.[n]??t?.default??t;return i!==t?oy(i,t):i}const Ax=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Px(t){for(const n in t)if(!Ax.has(n))return!0;return!1}const Xc=(t,n,i,o={},l,c)=>d=>{const h=Yc(o,t)||{},m=h.delay||o.delay||0;let{elapsed:y=0}=o;y=y-Et(m);const g={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:n.getVelocity(),...h,delay:-y,onUpdate:S=>{n.set(S),h.onUpdate&&h.onUpdate(S)},onComplete:()=>{d(),h.onComplete&&h.onComplete()},name:t,motionValue:n,element:c?void 0:l};Px(h)||Object.assign(g,Tx(t,g)),g.duration&&(g.duration=Et(g.duration)),g.repeatDelay&&(g.repeatDelay=Et(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let v=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(lc(g),g.delay===0&&(v=!0)),($n.instantAnimations||$n.skipAnimations||l?.shouldSkipAnimations)&&(v=!0,lc(g),g.delay=0),g.allowFlatten=!h.type&&!h.ease,v&&!c&&n.get()!==void 0){const S=ma(g.keyframes,h);if(S!==void 0){Ae.update(()=>{g.onUpdate(S),g.onComplete()});return}}return h.isSync?new ra(g):new vx(g)};function Wp(t){const n=[{},{}];return t?.values.forEach((i,o)=>{n[0][o]=i.get(),n[1][o]=i.getVelocity()}),n}function Zc(t,n,i,o){if(typeof n=="function"){const[l,c]=Wp(o);n=n(i!==void 0?i:t.custom,l,c)}if(typeof n=="string"&&(n=t.variants&&t.variants[n]),typeof n=="function"){const[l,c]=Wp(o);n=n(i!==void 0?i:t.custom,l,c)}return n}function mr(t,n,i){const o=t.getProps();return Zc(o,n,i!==void 0?i:o.custom,t)}const ay=new Set(["width","height","top","left","right","bottom",...si]),Gp=30,_x=t=>!isNaN(parseFloat(t));class Ix{constructor(n,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{const l=ct.now();if(this.updatedAt!==l&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const c of this.dependents)c.dirty()},this.hasAnimated=!1,this.setCurrent(n),this.owner=i.owner}setCurrent(n){this.current=n,this.updatedAt=ct.now(),this.canTrackVelocity===null&&n!==void 0&&(this.canTrackVelocity=_x(this.current))}setPrevFrameValue(n=this.current){this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt}onChange(n){return this.on("change",n)}on(n,i){this.events[n]||(this.events[n]=new bc);const o=this.events[n].add(i);return n==="change"?()=>{o(),Ae.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const n in this.events)this.events[n].clear()}attach(n,i){this.passiveEffect=n,this.stopPassiveEffect=i}set(n){this.passiveEffect?this.passiveEffect(n,this.updateAndNotify):this.updateAndNotify(n)}setWithVelocity(n,i,o){this.set(i),this.prev=void 0,this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt-o}jump(n,i=!0){this.updateAndNotify(n),this.prev=n,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(n){this.dependents||(this.dependents=new Set),this.dependents.add(n)}removeDependent(n){this.dependents&&this.dependents.delete(n)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const n=ct.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||n-this.updatedAt>Gp)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,Gp);return Tg(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(n){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=n(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ni(t,n){return new Ix(t,n)}const uc=t=>Array.isArray(t);function Rx(t,n,i){t.hasValue(n)?t.getValue(n).set(i):t.addValue(n,ni(i))}function Mx(t){return uc(t)?t[t.length-1]||0:t}function Dx(t,n){const i=mr(t,n);let{transitionEnd:o={},transition:l={},...c}=i||{};c={...c,...o};for(const d in c){const h=Mx(c[d]);Rx(t,d,h)}}const nt=t=>!!(t&&t.getVelocity);function Nx(t){return!!(nt(t)&&t.add)}function cc(t,n){const i=t.getValue("willChange");if(Nx(i))return i.add(n);if(!i&&$n.WillChange){const o=new $n.WillChange("auto");t.addValue("willChange",o),o.add(n)}}function Qc(t){return t.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}const Vx="framerAppearId",ly="data-"+Qc(Vx);function uy(t){return t.props[ly]}function Bx({protectedKeys:t,needsAnimating:n},i){const o=t.hasOwnProperty(i)&&n[i]!==!0;return n[i]=!1,o}function cy(t,n,{delay:i=0,transitionOverride:o,type:l}={}){let{transition:c,transitionEnd:d,...h}=n;const m=t.getDefaultTransition();c=c?oy(c,m):m;const y=c?.reduceMotion;o&&(c=o);const g=[],v=l&&t.animationState&&t.animationState.getState()[l];for(const S in h){const E=t.getValue(S,t.latestValues[S]??null),P=h[S];if(P===void 0||v&&Bx(v,S))continue;const M={delay:i,...Yc(c||{},S)},I=E.get();if(I!==void 0&&!E.isAnimating()&&!Array.isArray(P)&&P===I&&!M.velocity){Ae.update(()=>E.set(P));continue}let N=!1;if(window.MotionHandoffAnimation){const D=uy(t);if(D){const z=window.MotionHandoffAnimation(D,S,Ae);z!==null&&(M.startTime=z,N=!0)}}cc(t,S);const L=y??t.shouldReduceMotion;E.start(Xc(S,E,P,L&&ay.has(S)?{type:!1}:M,t,N));const R=E.animation;R&&g.push(R)}if(d){const S=()=>Ae.update(()=>{d&&Dx(t,d)});g.length?Promise.all(g).then(S):S()}return g}function fc(t,n,i={}){const o=mr(t,n,i.type==="exit"?t.presenceContext?.custom:void 0);let{transition:l=t.getDefaultTransition()||{}}=o||{};i.transitionOverride&&(l=i.transitionOverride);const c=o?()=>Promise.all(cy(t,o,i)):()=>Promise.resolve(),d=t.variantChildren&&t.variantChildren.size?(m=0)=>{const{delayChildren:y=0,staggerChildren:g,staggerDirection:v}=l;return Lx(t,n,m,y,g,v,i)}:()=>Promise.resolve(),{when:h}=l;if(h){const[m,y]=h==="beforeChildren"?[c,d]:[d,c];return m().then(()=>y())}else return Promise.all([c(),d(i.delay)])}function Lx(t,n,i=0,o=0,l=0,c=1,d){const h=[];for(const m of t.variantChildren)m.notify("AnimationStart",n),h.push(fc(m,n,{...d,delay:i+(typeof o=="function"?0:o)+iy(t.variantChildren,m,o,l,c)}).then(()=>m.notify("AnimationComplete",n)));return Promise.all(h)}function Ox(t,n,i={}){t.notify("AnimationStart",n);let o;if(Array.isArray(n)){const l=n.map(c=>fc(t,c,i));o=Promise.all(l)}else if(typeof n=="string")o=fc(t,n,i);else{const l=typeof n=="function"?mr(t,n,i.custom):n;o=Promise.all(cy(t,l,i))}return o.then(()=>{t.notify("AnimationComplete",n)})}const bx={test:t=>t==="auto",parse:t=>t},fy=t=>n=>n.test(t),dy=[ii,q,sn,jn,cS,uS,bx],Hp=t=>dy.find(fy(t));function Fx(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||kg(t):!0}const zx=new Set(["brightness","contrast","saturate","opacity"]);function jx(t){const[n,i]=t.slice(0,-1).split("(");if(n==="drop-shadow")return t;const[o]=i.match(Uc)||[];if(!o)return t;const l=i.replace(o,"");let c=zx.has(n)?1:0;return o!==i&&(c*=100),n+"("+c+l+")"}const Ux=/\b([a-z-]*)\(.*?\)/gu,dc={...Xt,getAnimatableNone:t=>{const n=t.match(Ux);return n?n.map(jx).join(" "):t}},hc={...Xt,getAnimatableNone:t=>{const n=Xt.parse(t);return Xt.createTransformer(t)(n.map(o=>typeof o=="number"?0:typeof o=="object"?{...o,alpha:1}:o))}},Kp={...ii,transform:Math.round},Wx={rotate:jn,rotateX:jn,rotateY:jn,rotateZ:jn,scale:Ao,scaleX:Ao,scaleY:Ao,scaleZ:Ao,skew:jn,skewX:jn,skewY:jn,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:as,originX:Dp,originY:Dp,originZ:q},qc={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,inset:q,insetBlock:q,insetBlockStart:q,insetBlockEnd:q,insetInline:q,insetInlineStart:q,insetInlineEnd:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,paddingBlock:q,paddingBlockStart:q,paddingBlockEnd:q,paddingInline:q,paddingInlineStart:q,paddingInlineEnd:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,marginBlock:q,marginBlockStart:q,marginBlockEnd:q,marginInline:q,marginInlineStart:q,marginInlineEnd:q,fontSize:q,backgroundPositionX:q,backgroundPositionY:q,...Wx,zIndex:Kp,fillOpacity:as,strokeOpacity:as,numOctaves:Kp},Gx={...qc,color:Ue,backgroundColor:Ue,outlineColor:Ue,fill:Ue,stroke:Ue,borderColor:Ue,borderTopColor:Ue,borderRightColor:Ue,borderBottomColor:Ue,borderLeftColor:Ue,filter:dc,WebkitFilter:dc,mask:hc,WebkitMask:hc},hy=t=>Gx[t],Hx=new Set([dc,hc]);function py(t,n){let i=hy(t);return Hx.has(i)||(i=Xt),i.getAnimatableNone?i.getAnimatableNone(n):void 0}const Kx=new Set(["auto","none","0"]);function $x(t,n,i){let o=0,l;for(;o{n.getValue(h).set(m)}),this.resolveNoneKeyframes()}}function my(t,n,i){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let o=document;const l=i?.[t]??o.querySelectorAll(t);return l?Array.from(l):[]}return Array.from(t).filter(o=>o!=null)}const gy=(t,n)=>n&&typeof t=="number"?n.transform(t):t;function Xx(t){return Cg(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Jc}=Lg(queueMicrotask,!1),Gt={x:!1,y:!1};function yy(){return Gt.x||Gt.y}function Zx(t){return t==="x"||t==="y"?Gt[t]?null:(Gt[t]=!0,()=>{Gt[t]=!1}):Gt.x||Gt.y?null:(Gt.x=Gt.y=!0,()=>{Gt.x=Gt.y=!1})}function vy(t,n){const i=my(t),o=new AbortController,l={passive:!0,...n,signal:o.signal};return[i,l,()=>o.abort()]}function Qx(t){return!(t.pointerType==="touch"||yy())}function qx(t,n,i={}){const[o,l,c]=vy(t,i);return o.forEach(d=>{let h=!1,m=!1,y;const g=()=>{d.removeEventListener("pointerleave",P)},v=I=>{y&&(y(I),y=void 0),g()},S=I=>{h=!1,window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),m&&(m=!1,v(I))},E=()=>{h=!0,window.addEventListener("pointerup",S,l),window.addEventListener("pointercancel",S,l)},P=I=>{if(I.pointerType!=="touch"){if(h){m=!0;return}v(I)}},M=I=>{if(!Qx(I))return;m=!1;const N=n(d,I);typeof N=="function"&&(y=N,d.addEventListener("pointerleave",P,l))};d.addEventListener("pointerenter",M,l),d.addEventListener("pointerdown",E,l)}),c}const wy=(t,n)=>n?t===n?!0:wy(t,n.parentElement):!1,ef=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Jx=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function eC(t){return Jx.has(t.tagName)||t.isContentEditable===!0}const tC=new Set(["INPUT","SELECT","TEXTAREA"]);function nC(t){return tC.has(t.tagName)||t.isContentEditable===!0}const Oo=new WeakSet;function $p(t){return n=>{n.key==="Enter"&&t(n)}}function Iu(t,n){t.dispatchEvent(new PointerEvent("pointer"+n,{isPrimary:!0,bubbles:!0}))}const rC=(t,n)=>{const i=t.currentTarget;if(!i)return;const o=$p(()=>{if(Oo.has(i))return;Iu(i,"down");const l=$p(()=>{Iu(i,"up")}),c=()=>Iu(i,"cancel");i.addEventListener("keyup",l,n),i.addEventListener("blur",c,n)});i.addEventListener("keydown",o,n),i.addEventListener("blur",()=>i.removeEventListener("keydown",o),n)};function Yp(t){return ef(t)&&!yy()}const Xp=new WeakSet;function iC(t,n,i={}){const[o,l,c]=vy(t,i),d=h=>{const m=h.currentTarget;if(!Yp(h)||Xp.has(h))return;Oo.add(m),i.stopPropagation&&Xp.add(h);const y=n(m,h),g=(E,P)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",S),Oo.has(m)&&Oo.delete(m),Yp(E)&&typeof y=="function"&&y(E,{success:P})},v=E=>{g(E,m===window||m===document||i.useGlobalTarget||wy(m,E.target))},S=E=>{g(E,!1)};window.addEventListener("pointerup",v,l),window.addEventListener("pointercancel",S,l)};return o.forEach(h=>{(i.useGlobalTarget?window:h).addEventListener("pointerdown",d,l),Xx(h)&&(h.addEventListener("focus",y=>rC(y,l)),!eC(h)&&!h.hasAttribute("tabindex")&&(h.tabIndex=0))}),c}function tf(t){return Cg(t)&&"ownerSVGElement"in t}const bo=new WeakMap;let Fo;const Sy=(t,n,i)=>(o,l)=>l&&l[0]?l[0][t+"Size"]:tf(o)&&"getBBox"in o?o.getBBox()[n]:o[i],sC=Sy("inline","width","offsetWidth"),oC=Sy("block","height","offsetHeight");function aC({target:t,borderBoxSize:n}){bo.get(t)?.forEach(i=>{i(t,{get width(){return sC(t,n)},get height(){return oC(t,n)}})})}function lC(t){t.forEach(aC)}function uC(){typeof ResizeObserver>"u"||(Fo=new ResizeObserver(lC))}function cC(t,n){Fo||uC();const i=my(t);return i.forEach(o=>{let l=bo.get(o);l||(l=new Set,bo.set(o,l)),l.add(n),Fo?.observe(o)}),()=>{i.forEach(o=>{const l=bo.get(o);l?.delete(n),l?.size||Fo?.unobserve(o)})}}const zo=new Set;let Yr;function fC(){Yr=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};zo.forEach(n=>n(t))},window.addEventListener("resize",Yr)}function dC(t){return zo.add(t),Yr||fC(),()=>{zo.delete(t),!zo.size&&typeof Yr=="function"&&(window.removeEventListener("resize",Yr),Yr=void 0)}}function Zp(t,n){return typeof t=="function"?dC(t):cC(t,n)}function hC(t){return tf(t)&&t.tagName==="svg"}const pC=[...dy,Ue,Xt],mC=t=>pC.find(fy(t)),Qp=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xr=()=>({x:Qp(),y:Qp()}),qp=()=>({min:0,max:0}),$e=()=>({x:qp(),y:qp()}),gC=new WeakMap;function ga(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function ls(t){return typeof t=="string"||Array.isArray(t)}const nf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],rf=["initial",...nf];function ya(t){return ga(t.animate)||rf.some(n=>ls(t[n]))}function xy(t){return!!(ya(t)||t.variants)}function yC(t,n,i){for(const o in n){const l=n[o],c=i[o];if(nt(l))t.addValue(o,l);else if(nt(c))t.addValue(o,ni(l,{owner:t}));else if(c!==l)if(t.hasValue(o)){const d=t.getValue(o);d.liveStyle===!0?d.jump(l):d.hasAnimated||d.set(l)}else{const d=t.getStaticValue(o);t.addValue(o,ni(d!==void 0?d:l,{owner:t}))}}for(const o in i)n[o]===void 0&&t.removeValue(o);return n}const pc={current:null},Cy={current:!1},vC=typeof window<"u";function wC(){if(Cy.current=!0,!!vC)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),n=()=>pc.current=t.matches;t.addEventListener("change",n),n()}else pc.current=!1}const Jp=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ia={};function ky(t){ia=t}function SC(){return ia}class xC{scrapeMotionValuesFromProps(n,i,o){return{}}constructor({parent:n,props:i,presenceContext:o,reducedMotionConfig:l,skipAnimations:c,blockInitialAnimation:d,visualState:h},m={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=$c,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const E=ct.now();this.renderScheduledAtthis.bindToMotionValue(o,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Cy.current||wC(),this.shouldReduceMotion=pc.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Yn(this.notifyUpdate),Yn(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const i=this.features[n];i&&(i.unmount(),i.isMounted=!1)}this.current=null}addChild(n){this.children.add(n),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(n)}removeChild(n){this.children.delete(n),this.enteringChildren&&this.enteringChildren.delete(n)}bindToMotionValue(n,i){if(this.valueSubscriptions.has(n)&&this.valueSubscriptions.get(n)(),i.accelerate&&ry.has(n)&&this.current instanceof HTMLElement){const{factory:d,keyframes:h,times:m,ease:y,duration:g}=i.accelerate,v=new ty({element:this.current,name:n,keyframes:h,times:m,ease:y,duration:Et(g)}),S=d(v);this.valueSubscriptions.set(n,()=>{S(),v.cancel()});return}const o=oi.has(n);o&&this.onBindTransform&&this.onBindTransform();const l=i.on("change",d=>{this.latestValues[n]=d,this.props.onUpdate&&Ae.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let c;typeof window<"u"&&window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,n,i)),this.valueSubscriptions.set(n,()=>{l(),c&&c(),i.owner&&i.stop()})}sortNodePosition(n){return!this.current||!this.sortInstanceNodePosition||this.type!==n.type?0:this.sortInstanceNodePosition(this.current,n.current)}updateFeatures(){let n="animation";for(n in ia){const i=ia[n];if(!i)continue;const{isEnabled:o,Feature:l}=i;if(!this.features[n]&&l&&o(this.props)&&(this.features[n]=new l(this)),this.features[n]){const c=this.features[n];c.isMounted?c.update():(c.mount(),c.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):$e()}getStaticValue(n){return this.latestValues[n]}setStaticValue(n,i){this.latestValues[n]=i}update(n,i){(n.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=n,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let o=0;oi.variantChildren.delete(n)}addValue(n,i){const o=this.values.get(n);i!==o&&(o&&this.removeValue(n),this.bindToMotionValue(n,i),this.values.set(n,i),this.latestValues[n]=i.get())}removeValue(n){this.values.delete(n);const i=this.valueSubscriptions.get(n);i&&(i(),this.valueSubscriptions.delete(n)),delete this.latestValues[n],this.removeValueFromRenderState(n,this.renderState)}hasValue(n){return this.values.has(n)}getValue(n,i){if(this.props.values&&this.props.values[n])return this.props.values[n];let o=this.values.get(n);return o===void 0&&i!==void 0&&(o=ni(i===null?void 0:i,{owner:this}),this.addValue(n,o)),o}readValue(n,i){let o=this.latestValues[n]!==void 0||!this.current?this.latestValues[n]:this.getBaseTargetFromProps(this.props,n)??this.readValueFromInstance(this.current,n,this.options);return o!=null&&(typeof o=="string"&&(xg(o)||kg(o))?o=parseFloat(o):!mC(o)&&Xt.test(i)&&(o=py(n,i)),this.setBaseTarget(n,nt(o)?o.get():o)),nt(o)?o.get():o}setBaseTarget(n,i){this.baseTarget[n]=i}getBaseTarget(n){const{initial:i}=this.props;let o;if(typeof i=="string"||typeof i=="object"){const c=Zc(this.props,i,this.presenceContext?.custom);c&&(o=c[n])}if(i&&o!==void 0)return o;const l=this.getBaseTargetFromProps(this.props,n);return l!==void 0&&!nt(l)?l:this.initialValues[n]!==void 0&&o===void 0?void 0:this.baseTarget[n]}on(n,i){return this.events[n]||(this.events[n]=new bc),this.events[n].add(i)}notify(n,...i){this.events[n]&&this.events[n].notify(...i)}scheduleRenderMicrotask(){Jc.render(this.render)}}class Ey extends xC{constructor(){super(...arguments),this.KeyframeResolver=Yx}sortInstanceNodePosition(n,i){return n.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(n,i){const o=n.style;return o?o[i]:void 0}removeValueFromRenderState(n,{vars:i,style:o}){delete i[n],delete o[n]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:n}=this.props;nt(n)&&(this.childSubscription=n.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}class Xn{constructor(n){this.isMounted=!1,this.node=n}update(){}}function Ty({top:t,left:n,right:i,bottom:o}){return{x:{min:n,max:i},y:{min:t,max:o}}}function CC({x:t,y:n}){return{top:n.min,right:t.max,bottom:n.max,left:t.min}}function kC(t,n){if(!n)return t;const i=n({x:t.left,y:t.top}),o=n({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:o.y,right:o.x}}function Ru(t){return t===void 0||t===1}function mc({scale:t,scaleX:n,scaleY:i}){return!Ru(t)||!Ru(n)||!Ru(i)}function cr(t){return mc(t)||Ay(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ay(t){return em(t.x)||em(t.y)}function em(t){return t&&t!=="0%"}function sa(t,n,i){const o=t-i,l=n*o;return i+l}function tm(t,n,i,o,l){return l!==void 0&&(t=sa(t,l,o)),sa(t,i,o)+n}function gc(t,n=0,i=1,o,l){t.min=tm(t.min,n,i,o,l),t.max=tm(t.max,n,i,o,l)}function Py(t,{x:n,y:i}){gc(t.x,n.translate,n.scale,n.originPoint),gc(t.y,i.translate,i.scale,i.originPoint)}const nm=.999999999999,rm=1.0000000000001;function EC(t,n,i,o=!1){const l=i.length;if(!l)return;n.x=n.y=1;let c,d;for(let h=0;hnm&&(n.x=1),n.ynm&&(n.y=1)}function rn(t,n){t.min+=n,t.max+=n}function im(t,n,i,o,l=.5){const c=Me(t.min,t.max,l);gc(t,n,i,c,o)}function sm(t,n){return typeof t=="string"?parseFloat(t)/100*(n.max-n.min):t}function jo(t,n,i){const o=i??t;im(t.x,sm(n.x,o.x),n.scaleX,n.scale,n.originX),im(t.y,sm(n.y,o.y),n.scaleY,n.scale,n.originY)}function _y(t,n){return Ty(kC(t.getBoundingClientRect(),n))}function TC(t,n,i){const o=_y(t,i),{scroll:l}=n;return l&&(rn(o.x,l.offset.x),rn(o.y,l.offset.y)),o}const AC={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},PC=si.length;function _C(t,n,i){let o="",l=!0;for(let c=0;c{if(!n.target)return t;if(typeof t=="string")if(q.test(t))t=parseFloat(t);else return t;const i=om(t,n.target.x),o=om(t,n.target.y);return`${i}% ${o}%`}},IC={correct:(t,{treeScale:n,projectionDelta:i})=>{const o=t,l=Xt.parse(t);if(l.length>5)return o;const c=Xt.createTransformer(t),d=typeof l[0]!="number"?1:0,h=i.x.scale*n.x,m=i.y.scale*n.y;l[0+d]/=h,l[1+d]/=m;const y=Me(h,m,.5);return typeof l[2+d]=="number"&&(l[2+d]/=y),typeof l[3+d]=="number"&&(l[3+d]/=y),c(l)}},yc={borderRadius:{...Yi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Yi,borderTopRightRadius:Yi,borderBottomLeftRadius:Yi,borderBottomRightRadius:Yi,boxShadow:IC};function Ry(t,{layout:n,layoutId:i}){return oi.has(t)||t.startsWith("origin")||(n||i!==void 0)&&(!!yc[t]||t==="opacity")}function of(t,n,i){const o=t.style,l=n?.style,c={};if(!o)return c;for(const d in o)(nt(o[d])||l&&nt(l[d])||Ry(d,t)||i?.getValue(d)?.liveStyle!==void 0)&&(c[d]=o[d]);return c}function RC(t){return window.getComputedStyle(t)}class MC extends Ey{constructor(){super(...arguments),this.type="html",this.renderInstance=Iy}readValueFromInstance(n,i){if(oi.has(i))return this.projection?.isProjecting?rc(i):ZS(n,i);{const o=RC(n),l=(bg(i)?o.getPropertyValue(i):o[i])||0;return typeof l=="string"?l.trim():l}}measureInstanceViewportBox(n,{transformPagePoint:i}){return _y(n,i)}build(n,i,o){sf(n,i,o.transformTemplate)}scrapeMotionValuesFromProps(n,i,o){return of(n,i,o)}}const DC={offset:"stroke-dashoffset",array:"stroke-dasharray"},NC={offset:"strokeDashoffset",array:"strokeDasharray"};function VC(t,n,i=1,o=0,l=!0){t.pathLength=1;const c=l?DC:NC;t[c.offset]=`${-o}`,t[c.array]=`${n} ${i}`}const BC=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function My(t,{attrX:n,attrY:i,attrScale:o,pathLength:l,pathSpacing:c=1,pathOffset:d=0,...h},m,y,g){if(sf(t,h,y),m){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:v,style:S}=t;v.transform&&(S.transform=v.transform,delete v.transform),(S.transform||v.transformOrigin)&&(S.transformOrigin=v.transformOrigin??"50% 50%",delete v.transformOrigin),S.transform&&(S.transformBox=g?.transformBox??"fill-box",delete v.transformBox);for(const E of BC)v[E]!==void 0&&(S[E]=v[E],delete v[E]);n!==void 0&&(v.x=n),i!==void 0&&(v.y=i),o!==void 0&&(v.scale=o),l!==void 0&&VC(v,l,c,d,!1)}const Dy=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Ny=t=>typeof t=="string"&&t.toLowerCase()==="svg";function LC(t,n,i,o){Iy(t,n,void 0,o);for(const l in n.attrs)t.setAttribute(Dy.has(l)?l:Qc(l),n.attrs[l])}function Vy(t,n,i){const o=of(t,n,i);for(const l in t)if(nt(t[l])||nt(n[l])){const c=si.indexOf(l)!==-1?"attr"+l.charAt(0).toUpperCase()+l.substring(1):l;o[c]=t[l]}return o}class OC extends Ey{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=$e}getBaseTargetFromProps(n,i){return n[i]}readValueFromInstance(n,i){if(oi.has(i)){const o=hy(i);return o&&o.default||0}return i=Dy.has(i)?i:Qc(i),n.getAttribute(i)}scrapeMotionValuesFromProps(n,i,o){return Vy(n,i,o)}build(n,i,o){My(n,i,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(n,i,o,l){LC(n,i,o,l)}mount(n){this.isSVGTag=Ny(n.tagName),super.mount(n)}}const bC=rf.length;function By(t){if(!t)return;if(!t.isControllingVariants){const i=t.parent?By(t.parent)||{}:{};return t.props.initial!==void 0&&(i.initial=t.props.initial),i}const n={};for(let i=0;iPromise.all(n.map(({animation:i,options:o})=>Ox(t,i,o)))}function UC(t){let n=jC(t),i=am(),o=!0,l=!1;const c=y=>(g,v)=>{const S=mr(t,v,y==="exit"?t.presenceContext?.custom:void 0);if(S){const{transition:E,transitionEnd:P,...M}=S;g={...g,...M,...P}}return g};function d(y){n=y(t)}function h(y){const{props:g}=t,v=By(t.parent)||{},S=[],E=new Set;let P={},M=1/0;for(let N=0;NM&&z,H=!1;const ae=Array.isArray(D)?D:[D];let fe=ae.reduce(c(L),{});b===!1&&(fe={});const{prevResolvedValues:Ce={}}=R,ke={...Ce,...fe},Be=U=>{se=!0,E.has(U)&&(H=!0,E.delete(U)),R.needsAnimating[U]=!0;const $=t.getValue(U);$&&($.liveStyle=!1)};for(const U in ke){const $=fe[U],K=Ce[U];if(P.hasOwnProperty(U))continue;let k=!1;uc($)&&uc(K)?k=!Ly($,K):k=$!==K,k?$!=null?Be(U):E.add(U):$!==void 0&&E.has(U)?Be(U):R.protectedKeys[U]=!0}R.prevProp=D,R.prevResolvedValues=fe,R.isActive&&(P={...P,...fe}),(o||l)&&t.blockInitialAnimation&&(se=!1);const Ee=B&&Y;se&&(!Ee||H)&&S.push(...ae.map(U=>{const $={type:L};if(typeof U=="string"&&(o||l)&&!Ee&&t.manuallyAnimateOnMount&&t.parent){const{parent:K}=t,k=mr(K,U);if(K.enteringChildren&&k){const{delayChildren:V}=k.transition||{};$.delay=iy(K.enteringChildren,t,V)}}return{animation:U,options:$}}))}if(E.size){const N={};if(typeof g.initial!="boolean"){const L=mr(t,Array.isArray(g.initial)?g.initial[0]:g.initial);L&&L.transition&&(N.transition=L.transition)}E.forEach(L=>{const R=t.getBaseTarget(L),D=t.getValue(L);D&&(D.liveStyle=!0),N[L]=R??null}),S.push({animation:N})}let I=!!S.length;return o&&(g.initial===!1||g.initial===g.animate)&&!t.manuallyAnimateOnMount&&(I=!1),o=!1,l=!1,I?n(S):Promise.resolve()}function m(y,g){if(i[y].isActive===g)return Promise.resolve();t.variantChildren?.forEach(S=>S.animationState?.setActive(y,g)),i[y].isActive=g;const v=h(y);for(const S in i)i[S].protectedKeys={};return v}return{animateChanges:h,setActive:m,setAnimateFunction:d,getState:()=>i,reset:()=>{i=am(),l=!0}}}function WC(t,n){return typeof n=="string"?n!==t:Array.isArray(n)?!Ly(n,t):!1}function ur(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function am(){return{animate:ur(!0),whileInView:ur(),whileHover:ur(),whileTap:ur(),whileDrag:ur(),whileFocus:ur(),exit:ur()}}function vc(t,n){t.min=n.min,t.max=n.max}function Wt(t,n){vc(t.x,n.x),vc(t.y,n.y)}function lm(t,n){t.translate=n.translate,t.scale=n.scale,t.originPoint=n.originPoint,t.origin=n.origin}const Oy=1e-4,GC=1-Oy,HC=1+Oy,by=.01,KC=0-by,$C=0+by;function ft(t){return t.max-t.min}function YC(t,n,i){return Math.abs(t-n)<=i}function um(t,n,i,o=.5){t.origin=o,t.originPoint=Me(n.min,n.max,t.origin),t.scale=ft(i)/ft(n),t.translate=Me(i.min,i.max,t.origin)-t.originPoint,(t.scale>=GC&&t.scale<=HC||isNaN(t.scale))&&(t.scale=1),(t.translate>=KC&&t.translate<=$C||isNaN(t.translate))&&(t.translate=0)}function ns(t,n,i,o){um(t.x,n.x,i.x,o?o.originX:void 0),um(t.y,n.y,i.y,o?o.originY:void 0)}function cm(t,n,i,o=0){const l=o?Me(i.min,i.max,o):i.min;t.min=l+n.min,t.max=t.min+ft(n)}function XC(t,n,i,o){cm(t.x,n.x,i.x,o?.x),cm(t.y,n.y,i.y,o?.y)}function fm(t,n,i,o=0){const l=o?Me(i.min,i.max,o):i.min;t.min=n.min-l,t.max=t.min+ft(n)}function oa(t,n,i,o){fm(t.x,n.x,i.x,o?.x),fm(t.y,n.y,i.y,o?.y)}function dm(t,n,i,o,l){return t-=n,t=sa(t,1/i,o),l!==void 0&&(t=sa(t,1/l,o)),t}function ZC(t,n=0,i=1,o=.5,l,c=t,d=t){if(sn.test(n)&&(n=parseFloat(n),n=Me(d.min,d.max,n/100)-d.min),typeof n!="number")return;let h=Me(c.min,c.max,o);t===c&&(h-=n),t.min=dm(t.min,n,i,h,l),t.max=dm(t.max,n,i,h,l)}function hm(t,n,[i,o,l],c,d){ZC(t,n[i],n[o],n[l],n.scale,c,d)}const QC=["x","scaleX","originX"],qC=["y","scaleY","originY"];function pm(t,n,i,o){hm(t.x,n,QC,i?i.x:void 0,o?o.x:void 0),hm(t.y,n,qC,i?i.y:void 0,o?o.y:void 0)}function mm(t){return t.translate===0&&t.scale===1}function Fy(t){return mm(t.x)&&mm(t.y)}function gm(t,n){return t.min===n.min&&t.max===n.max}function JC(t,n){return gm(t.x,n.x)&&gm(t.y,n.y)}function ym(t,n){return Math.round(t.min)===Math.round(n.min)&&Math.round(t.max)===Math.round(n.max)}function zy(t,n){return ym(t.x,n.x)&&ym(t.y,n.y)}function vm(t){return ft(t.x)/ft(t.y)}function wm(t,n){return t.translate===n.translate&&t.scale===n.scale&&t.originPoint===n.originPoint}function nn(t){return[t("x"),t("y")]}function ek(t,n,i){let o="";const l=t.x.translate/n.x,c=t.y.translate/n.y,d=i?.z||0;if((l||c||d)&&(o=`translate3d(${l}px, ${c}px, ${d}px) `),(n.x!==1||n.y!==1)&&(o+=`scale(${1/n.x}, ${1/n.y}) `),i){const{transformPerspective:y,rotate:g,rotateX:v,rotateY:S,skewX:E,skewY:P}=i;y&&(o=`perspective(${y}px) ${o}`),g&&(o+=`rotate(${g}deg) `),v&&(o+=`rotateX(${v}deg) `),S&&(o+=`rotateY(${S}deg) `),E&&(o+=`skewX(${E}deg) `),P&&(o+=`skewY(${P}deg) `)}const h=t.x.scale*n.x,m=t.y.scale*n.y;return(h!==1||m!==1)&&(o+=`scale(${h}, ${m})`),o||"none"}const jy=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],tk=jy.length,Sm=t=>typeof t=="string"?parseFloat(t):t,xm=t=>typeof t=="number"||q.test(t);function nk(t,n,i,o,l,c){l?(t.opacity=Me(0,i.opacity??1,rk(o)),t.opacityExit=Me(n.opacity??1,0,ik(o))):c&&(t.opacity=Me(n.opacity??1,i.opacity??1,o));for(let d=0;don?1:i(os(t,n,o))}function sk(t,n,i){const o=nt(t)?t:ni(t);return o.start(Xc("",o,n,i)),o.animation}function us(t,n,i,o={passive:!0}){return t.addEventListener(n,i,o),()=>t.removeEventListener(n,i)}const ok=(t,n)=>t.depth-n.depth;class ak{constructor(){this.children=[],this.isDirty=!1}add(n){Lc(this.children,n),this.isDirty=!0}remove(n){Jo(this.children,n),this.isDirty=!0}forEach(n){this.isDirty&&this.children.sort(ok),this.isDirty=!1,this.children.forEach(n)}}function lk(t,n){const i=ct.now(),o=({timestamp:l})=>{const c=l-i;c>=n&&(Yn(o),t(c-n))};return Ae.setup(o,!0),()=>Yn(o)}function Uo(t){return nt(t)?t.get():t}class uk{constructor(){this.members=[]}add(n){Lc(this.members,n);for(let i=this.members.length-1;i>=0;i--){const o=this.members[i];if(o===n||o===this.lead||o===this.prevLead)continue;const l=o.instance;(!l||l.isConnected===!1)&&!o.snapshot&&(Jo(this.members,o),o.unmount())}n.scheduleRender()}remove(n){if(Jo(this.members,n),n===this.prevLead&&(this.prevLead=void 0),n===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(n){for(let i=this.members.indexOf(n)-1;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1&&o.instance?.isConnected!==!1)return this.promote(o),!0}return!1}promote(n,i){const o=this.lead;if(n!==o&&(this.prevLead=o,this.lead=n,n.show(),o)){o.updateSnapshot(),n.scheduleRender();const{layoutDependency:l}=o.options,{layoutDependency:c}=n.options;(l===void 0||l!==c)&&(n.resumeFrom=o,i&&(o.preserveOpacity=!0),o.snapshot&&(n.snapshot=o.snapshot,n.snapshot.latestValues=o.animationValues||o.latestValues),n.root?.isUpdating&&(n.isLayoutDirty=!0)),n.options.crossfade===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(n=>{n.options.onExitComplete?.(),n.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(n=>n.instance&&n.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Wo={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Mu=["","X","Y","Z"],ck=1e3;let fk=0;function Du(t,n,i,o){const{latestValues:l}=n;l[t]&&(i[t]=l[t],n.setStaticValue(t,0),o&&(o[t]=0))}function Wy(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:n}=t.options;if(!n)return;const i=uy(n);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:l,layoutId:c}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",Ae,!(l||c))}const{parent:o}=t;o&&!o.hasCheckedOptimisedAppear&&Wy(o)}function Gy({attachResizeListener:t,defaultParent:n,measureScroll:i,checkIsScrollRoot:o,resetTransform:l}){return class{constructor(d={},h=n?.()){this.id=fk++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(pk),this.nodes.forEach(Sk),this.nodes.forEach(xk),this.nodes.forEach(mk)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=h?h.root||h:this,this.path=h?[...h.path,h]:[],this.parent=h,this.depth=h?h.depth+1:0;for(let m=0;mthis.root.updateBlockedByResize=!1;Ae.read(()=>{v=window.innerWidth}),t(d,()=>{const E=window.innerWidth;E!==v&&(v=E,this.root.updateBlockedByResize=!0,g&&g(),g=lk(S,250),Wo.hasAnimatedSinceResize&&(Wo.hasAnimatedSinceResize=!1,this.nodes.forEach(Tm)))})}h&&this.root.registerSharedNode(h,this),this.options.animate!==!1&&y&&(h||m)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:v,hasRelativeLayoutChanged:S,layout:E})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const P=this.options.transition||y.getDefaultTransition()||Ak,{onLayoutAnimationStart:M,onLayoutAnimationComplete:I}=y.getProps(),N=!this.targetLayout||!zy(this.targetLayout,E),L=!v&&S;if(this.options.layoutRoot||this.resumeFrom||L||v&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const R={...Yc(P,"layout"),onPlay:M,onComplete:I};(y.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(g,L)}else v||Tm(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=E})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Yn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ck),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Wy(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ft(this.snapshot.measuredBox.x)&&!ft(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m{const z=D/1e3;Am(v.x,d.x,z),Am(v.y,d.y,z),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(oa(S,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ek(this.relativeTarget,this.relativeTargetOrigin,S,z),R&&JC(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=$e()),Wt(R,this.relativeTarget)),M&&(this.animationValues=g,nk(g,y,this.latestValues,z,L,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=z},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Yn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ae.update(()=>{Wo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ni(0)),this.motionValue.jump(0,!1),this.currentAnimation=sk(this.motionValue,[0,1e3],{...d,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),d.onUpdate&&d.onUpdate(h)},onStop:()=>{},onComplete:()=>{d.onComplete&&d.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ck),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:h,target:m,layout:y,latestValues:g}=d;if(!(!h||!m||!y)){if(this!==d&&this.layout&&y&&Hy(this.options.animationType,this.layout.layoutBox,y.layoutBox)){m=this.target||$e();const v=ft(this.layout.layoutBox.x);m.x.min=d.target.x.min,m.x.max=m.x.min+v;const S=ft(this.layout.layoutBox.y);m.y.min=d.target.y.min,m.y.max=m.y.min+S}Wt(h,m),jo(h,g),ns(this.projectionDeltaWithTransform,this.layoutCorrected,h,g)}}registerSharedNode(d,h){this.sharedNodes.has(d)||this.sharedNodes.set(d,new uk),this.sharedNodes.get(d).add(h);const y=h.options.initialPromotionConfig;h.promote({transition:y?y.transition:void 0,preserveFollowOpacity:y&&y.shouldPreserveFollowOpacity?y.shouldPreserveFollowOpacity(h):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){const{layoutId:d}=this.options;return d?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:d}=this.options;return d?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:h,preserveFollowOpacity:m}={}){const y=this.getStack();y&&y.promote(this,m),d&&(this.projectionDelta=void 0,this.needsReset=!0),h&&this.setOptions({transition:h})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let h=!1;const{latestValues:m}=d;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(h=!0),!h)return;const y={};m.z&&Du("z",d,y,this.animationValues);for(let g=0;gd.currentAnimation?.stop()),this.root.nodes.forEach(km),this.root.sharedNodes.clear()}}}function dk(t){t.updateLayout()}function hk(t){const n=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:o}=t.layout,{animationType:l}=t.options,c=n.source!==t.layout.source;if(l==="size")nn(g=>{const v=c?n.measuredBox[g]:n.layoutBox[g],S=ft(v);v.min=i[g].min,v.max=v.min+S});else if(l==="x"||l==="y"){const g=l==="x"?"y":"x";vc(c?n.measuredBox[g]:n.layoutBox[g],i[g])}else Hy(l,n.layoutBox,i)&&nn(g=>{const v=c?n.measuredBox[g]:n.layoutBox[g],S=ft(i[g]);v.max=v.min+S,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[g].max=t.relativeTarget[g].min+S)});const d=Xr();ns(d,i,n.layoutBox);const h=Xr();c?ns(h,t.applyTransform(o,!0),n.measuredBox):ns(h,i,n.layoutBox);const m=!Fy(d);let y=!1;if(!t.resumeFrom){const g=t.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:v,layout:S}=g;if(v&&S){const E=t.options.layoutAnchor||void 0,P=$e();oa(P,n.layoutBox,v.layoutBox,E);const M=$e();oa(M,i,S.layoutBox,E),zy(P,M)||(y=!0),g.options.layoutRoot&&(t.relativeTarget=M,t.relativeTargetOrigin=P,t.relativeParent=g)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:h,layoutDelta:d,hasLayoutChanged:m,hasRelativeLayoutChanged:y})}else if(t.isLead()){const{onExitComplete:i}=t.options;i&&i()}t.options.transition=void 0}function pk(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function mk(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function gk(t){t.clearSnapshot()}function km(t){t.clearMeasurements()}function yk(t){t.isLayoutDirty=!0,t.updateLayout()}function Em(t){t.isLayoutDirty=!1}function vk(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function wk(t){const{visualElement:n}=t.options;n&&n.getProps().onBeforeLayoutMeasure&&n.notify("BeforeLayoutMeasure"),t.resetTransform()}function Tm(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Sk(t){t.resolveTargetDelta()}function xk(t){t.calcProjection()}function Ck(t){t.resetSkewAndRotation()}function kk(t){t.removeLeadSnapshot()}function Am(t,n,i){t.translate=Me(n.translate,0,i),t.scale=Me(n.scale,1,i),t.origin=n.origin,t.originPoint=n.originPoint}function Pm(t,n,i,o){t.min=Me(n.min,i.min,o),t.max=Me(n.max,i.max,o)}function Ek(t,n,i,o){Pm(t.x,n.x,i.x,o),Pm(t.y,n.y,i.y,o)}function Tk(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Ak={duration:.45,ease:[.4,0,.1,1]},_m=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Im=_m("applewebkit/")&&!_m("chrome/")?Math.round:Vt;function Rm(t){t.min=Im(t.min),t.max=Im(t.max)}function Pk(t){Rm(t.x),Rm(t.y)}function Hy(t,n,i){return t==="position"||t==="preserve-aspect"&&!YC(vm(n),vm(i),.2)}function _k(t){return t!==t.root&&t.scroll?.wasRoot}const Ik=Gy({attachResizeListener:(t,n)=>us(t,"resize",n),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Nu={current:void 0},Ky=Gy({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Nu.current){const t=new Ik({});t.mount(window),t.setOptions({layoutScroll:!0}),Nu.current=t}return Nu.current},resetTransform:(t,n)=>{t.style.transform=n!==void 0?n:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),$y=G.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Rk(t=!0){const n=G.useContext(Bc);if(n===null)return[!0,null];const{isPresent:i,onExitComplete:o,register:l}=n,c=G.useId();G.useEffect(()=>{if(t)return l(c)},[t]);const d=G.useCallback(()=>t&&o&&o(c),[c,o,t]);return!i&&o?[!1,d]:[!0]}const Yy=G.createContext({strict:!1}),Mm={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Dm=!1;function Mk(){if(Dm)return;const t={};for(const n in Mm)t[n]={isEnabled:i=>Mm[n].some(o=>!!i[o])};ky(t),Dm=!0}function Xy(){return Mk(),SC()}function Dk(t){const n=Xy();for(const i in t)n[i]={...n[i],...t[i]};ky(n)}const Nk=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function aa(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Nk.has(t)}let Zy=t=>!aa(t);function Vk(t){typeof t=="function"&&(Zy=n=>n.startsWith("on")?!aa(n):t(n))}try{Vk(require("@emotion/is-prop-valid").default)}catch{}function Bk(t,n,i){const o={};for(const l in t)l==="values"&&typeof t.values=="object"||nt(t[l])||(Zy(l)||i===!0&&aa(l)||!n&&!aa(l)||t.draggable&&l.startsWith("onDrag"))&&(o[l]=t[l]);return o}const va=G.createContext({});function Lk(t,n){if(ya(t)){const{initial:i,animate:o}=t;return{initial:i===!1||ls(i)?i:void 0,animate:ls(o)?o:void 0}}return t.inherit!==!1?n:{}}function Ok(t){const{initial:n,animate:i}=Lk(t,G.useContext(va));return G.useMemo(()=>({initial:n,animate:i}),[Nm(n),Nm(i)])}function Nm(t){return Array.isArray(t)?t.join(" "):t}const af=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Qy(t,n,i){for(const o in n)!nt(n[o])&&!Ry(o,i)&&(t[o]=n[o])}function bk({transformTemplate:t},n){return G.useMemo(()=>{const i=af();return sf(i,n,t),Object.assign({},i.vars,i.style)},[n])}function Fk(t,n){const i=t.style||{},o={};return Qy(o,i,t),Object.assign(o,bk(t,n)),o}function zk(t,n){const i={},o=Fk(t,n);return t.drag&&t.dragListener!==!1&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=o,i}const qy=()=>({...af(),attrs:{}});function jk(t,n,i,o){const l=G.useMemo(()=>{const c=qy();return My(c,n,Ny(o),t.transformTemplate,t.style),{...c.attrs,style:{...c.style}}},[n]);if(t.style){const c={};Qy(c,t.style,t),l.style={...c,...l.style}}return l}const Uk=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function lf(t){return typeof t!="string"||t.includes("-")?!1:!!(Uk.indexOf(t)>-1||/[A-Z]/u.test(t))}function Wk(t,n,i,{latestValues:o},l,c=!1,d){const m=(d??lf(t)?jk:zk)(n,o,l,t),y=Bk(n,typeof t=="string",c),g=t!==G.Fragment?{...y,...m,ref:i}:{},{children:v}=n,S=G.useMemo(()=>nt(v)?v.get():v,[v]);return G.createElement(t,{...g,children:S})}function Gk({scrapeMotionValuesFromProps:t,createRenderState:n},i,o,l){return{latestValues:Hk(i,o,l,t),renderState:n()}}function Hk(t,n,i,o){const l={},c=o(t,{});for(const S in c)l[S]=Uo(c[S]);let{initial:d,animate:h}=t;const m=ya(t),y=xy(t);n&&y&&!m&&t.inherit!==!1&&(d===void 0&&(d=n.initial),h===void 0&&(h=n.animate));let g=i?i.initial===!1:!1;g=g||d===!1;const v=g?h:d;if(v&&typeof v!="boolean"&&!ga(v)){const S=Array.isArray(v)?v:[v];for(let E=0;E(n,i)=>{const o=G.useContext(va),l=G.useContext(Bc),c=()=>Gk(t,n,o,l);return i?c():U1(c)},Kk=Jy({scrapeMotionValuesFromProps:of,createRenderState:af}),$k=Jy({scrapeMotionValuesFromProps:Vy,createRenderState:qy}),Yk=Symbol.for("motionComponentSymbol");function Xk(t,n,i){const o=G.useRef(i);G.useInsertionEffect(()=>{o.current=i});const l=G.useRef(null);return G.useCallback(c=>{c&&t.onMount?.(c);const d=o.current;if(typeof d=="function")if(c){const h=d(c);typeof h=="function"&&(l.current=h)}else l.current?(l.current(),l.current=null):d(c);else d&&(d.current=c);n&&(c?n.mount(c):n.unmount())},[n])}const ev=G.createContext({});function Wr(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Zk(t,n,i,o,l,c){const{visualElement:d}=G.useContext(va),h=G.useContext(Yy),m=G.useContext(Bc),y=G.useContext($y),g=y.reducedMotion,v=y.skipAnimations,S=G.useRef(null),E=G.useRef(!1);o=o||h.renderer,!S.current&&o&&(S.current=o(t,{visualState:n,parent:d,props:i,presenceContext:m,blockInitialAnimation:m?m.initial===!1:!1,reducedMotionConfig:g,skipAnimations:v,isSVG:c}),E.current&&S.current&&(S.current.manuallyAnimateOnMount=!0));const P=S.current,M=G.useContext(ev);P&&!P.projection&&l&&(P.type==="html"||P.type==="svg")&&Qk(S.current,i,l,M);const I=G.useRef(!1);G.useInsertionEffect(()=>{P&&I.current&&P.update(i,m)});const N=i[ly],L=G.useRef(!!N&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(N)&&window.MotionHasOptimisedAnimation?.(N));return G1(()=>{E.current=!0,P&&(I.current=!0,window.MotionIsMounted=!0,P.updateFeatures(),P.scheduleRenderMicrotask(),L.current&&P.animationState&&P.animationState.animateChanges())}),G.useEffect(()=>{P&&(!L.current&&P.animationState&&P.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(N)}),L.current=!1),P.enteringChildren=void 0)}),P}function Qk(t,n,i,o){const{layoutId:l,layout:c,drag:d,dragConstraints:h,layoutScroll:m,layoutRoot:y,layoutAnchor:g,layoutCrossfade:v}=n;t.projection=new i(t.latestValues,n["data-framer-portal-id"]?void 0:tv(t.parent)),t.projection.setOptions({layoutId:l,layout:c,alwaysMeasureLayout:!!d||h&&Wr(h),visualElement:t,animationType:typeof c=="string"?c:"both",initialPromotionConfig:o,crossfade:v,layoutScroll:m,layoutRoot:y,layoutAnchor:g})}function tv(t){if(t)return t.options.allowProjection!==!1?t.projection:tv(t.parent)}function Vu(t,{forwardMotionProps:n=!1,type:i}={},o,l){o&&Dk(o);const c=i?i==="svg":lf(t),d=c?$k:Kk;function h(y,g){let v;const S={...G.useContext($y),...y,layoutId:qk(y)},{isStatic:E}=S,P=Ok(y),M=d(y,E);if(!E&&typeof window<"u"){Jk();const I=eE(S);v=I.MeasureLayout,P.visualElement=Zk(t,M,S,l,I.ProjectionNode,c)}return ce.jsxs(va.Provider,{value:P,children:[v&&P.visualElement?ce.jsx(v,{visualElement:P.visualElement,...S}):null,Wk(t,y,Xk(M,P.visualElement,g),M,E,n,c)]})}h.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const m=G.forwardRef(h);return m[Yk]=t,m}function qk({layoutId:t}){const n=G.useContext(Sg).id;return n&&t!==void 0?n+"-"+t:t}function Jk(t,n){G.useContext(Yy).strict}function eE(t){const n=Xy(),{drag:i,layout:o}=n;if(!i&&!o)return{};const l={...i,...o};return{MeasureLayout:i?.isEnabled(t)||o?.isEnabled(t)?l.MeasureLayout:void 0,ProjectionNode:l.ProjectionNode}}function tE(t,n){if(typeof Proxy>"u")return Vu;const i=new Map,o=(c,d)=>Vu(c,d,t,n),l=(c,d)=>o(c,d);return new Proxy(l,{get:(c,d)=>d==="create"?o:(i.has(d)||i.set(d,Vu(d,void 0,t,n)),i.get(d))})}const nE=(t,n)=>n.isSVG??lf(t)?new OC(n):new MC(n,{allowProjection:t!==G.Fragment});class rE extends Xn{constructor(n){super(n),n.animationState||(n.animationState=UC(n))}updateAnimationControlsSubscription(){const{animate:n}=this.node.getProps();ga(n)&&(this.unmountControls=n.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:n}=this.node.getProps(),{animate:i}=this.node.prevProps||{};n!==i&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let iE=0;class sE extends Xn{constructor(){super(...arguments),this.id=iE++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:n,onExitComplete:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||n===o)return;if(n&&o===!1){if(this.isExitComplete){const{initial:c,custom:d}=this.node.getProps();if(typeof c=="string"){const h=mr(this.node,c,d);if(h){const{transition:m,transitionEnd:y,...g}=h;for(const v in g)this.node.getValue(v)?.jump(g[v])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const l=this.node.animationState.setActive("exit",!n);i&&!n&&l.then(()=>{this.isExitComplete=!0,i(this.id)})}mount(){const{register:n,onExitComplete:i}=this.node.presenceContext||{};i&&i(this.id),n&&(this.unmount=n(this.id))}unmount(){}}const oE={animation:{Feature:rE},exit:{Feature:sE}};function ps(t){return{point:{x:t.pageX,y:t.pageY}}}const aE=t=>n=>ef(n)&&t(n,ps(n));function rs(t,n,i,o){return us(t,n,aE(i),o)}const nv=({current:t})=>t?t.ownerDocument.defaultView:null,Vm=(t,n)=>Math.abs(t-n);function lE(t,n){const i=Vm(t.x,n.x),o=Vm(t.y,n.y);return Math.sqrt(i**2+o**2)}const Bm=new Set(["auto","scroll"]);class rv{constructor(n,i,{transformPagePoint:o,contextWindow:l=window,dragSnapToOrigin:c=!1,distanceThreshold:d=3,element:h}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=E=>{this.handleScroll(E.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Po(this.lastRawMoveEventInfo,this.transformPagePoint));const E=Bu(this.lastMoveEventInfo,this.history),P=this.startEvent!==null,M=lE(E.offset,{x:0,y:0})>=this.distanceThreshold;if(!P&&!M)return;const{point:I}=E,{timestamp:N}=tt;this.history.push({...I,timestamp:N});const{onStart:L,onMove:R}=this.handlers;P||(L&&L(this.lastMoveEvent,E),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,E)},this.handlePointerMove=(E,P)=>{this.lastMoveEvent=E,this.lastRawMoveEventInfo=P,this.lastMoveEventInfo=Po(P,this.transformPagePoint),Ae.update(this.updatePoint,!0)},this.handlePointerUp=(E,P)=>{this.end();const{onEnd:M,onSessionEnd:I,resumeAnimation:N}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const L=Bu(E.type==="pointercancel"?this.lastMoveEventInfo:Po(P,this.transformPagePoint),this.history);this.startEvent&&M&&M(E,L),I&&I(E,L)},!ef(n))return;this.dragSnapToOrigin=c,this.handlers=i,this.transformPagePoint=o,this.distanceThreshold=d,this.contextWindow=l||window;const m=ps(n),y=Po(m,this.transformPagePoint),{point:g}=y,{timestamp:v}=tt;this.history=[{...g,timestamp:v}];const{onSessionStart:S}=i;S&&S(n,Bu(y,this.history)),this.removeListeners=fs(rs(this.contextWindow,"pointermove",this.handlePointerMove),rs(this.contextWindow,"pointerup",this.handlePointerUp),rs(this.contextWindow,"pointercancel",this.handlePointerUp)),h&&this.startScrollTracking(h)}startScrollTracking(n){let i=n.parentElement;for(;i;){const o=getComputedStyle(i);(Bm.has(o.overflowX)||Bm.has(o.overflowY))&&this.scrollPositions.set(i,{x:i.scrollLeft,y:i.scrollTop}),i=i.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(n){const i=this.scrollPositions.get(n);if(!i)return;const o=n===window,l=o?{x:window.scrollX,y:window.scrollY}:{x:n.scrollLeft,y:n.scrollTop},c={x:l.x-i.x,y:l.y-i.y};c.x===0&&c.y===0||(o?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=c.x,this.lastMoveEventInfo.point.y+=c.y):this.history.length>0&&(this.history[0].x-=c.x,this.history[0].y-=c.y),this.scrollPositions.set(n,l),Ae.update(this.updatePoint,!0))}updateHandlers(n){this.handlers=n}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Yn(this.updatePoint)}}function Po(t,n){return n?{point:n(t.point)}:t}function Lm(t,n){return{x:t.x-n.x,y:t.y-n.y}}function Bu({point:t},n){return{point:t,delta:Lm(t,iv(n)),offset:Lm(t,uE(n)),velocity:cE(n,.1)}}function uE(t){return t[0]}function iv(t){return t[t.length-1]}function cE(t,n){if(t.length<2)return{x:0,y:0};let i=t.length-1,o=null;const l=iv(t);for(;i>=0&&(o=t[i],!(l.timestamp-o.timestamp>Et(n)));)i--;if(!o)return{x:0,y:0};o===t[0]&&t.length>2&&l.timestamp-o.timestamp>Et(n)*2&&(o=t[1]);const c=Nt(l.timestamp-o.timestamp);if(c===0)return{x:0,y:0};const d={x:(l.x-o.x)/c,y:(l.y-o.y)/c};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}function fE(t,{min:n,max:i},o){return n!==void 0&&ti&&(t=o?Me(i,t,o.max):Math.min(t,i)),t}function Om(t,n,i){return{min:n!==void 0?t.min+n:void 0,max:i!==void 0?t.max+i-(t.max-t.min):void 0}}function dE(t,{top:n,left:i,bottom:o,right:l}){return{x:Om(t.x,i,l),y:Om(t.y,n,o)}}function bm(t,n){let i=n.min-t.min,o=n.max-t.max;return n.max-n.mino?i=os(n.min,n.max-o,t.min):o>l&&(i=os(t.min,t.max-l,n.min)),an(0,1,i)}function mE(t,n){const i={};return n.min!==void 0&&(i.min=n.min-t.min),n.max!==void 0&&(i.max=n.max-t.min),i}const wc=.35;function gE(t=wc){return t===!1?t=0:t===!0&&(t=wc),{x:Fm(t,"left","right"),y:Fm(t,"top","bottom")}}function Fm(t,n,i){return{min:zm(t,n),max:zm(t,i)}}function zm(t,n){return typeof t=="number"?t:t[n]||0}const yE=new WeakMap;class vE{constructor(n){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=$e(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=n}start(n,{snapToCursor:i=!1,distanceThreshold:o}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const c=v=>{i&&this.snapToCursor(ps(v).point),this.stopAnimation()},d=(v,S)=>{const{drag:E,dragPropagation:P,onDragStart:M}=this.getProps();if(E&&!P&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Zx(E),!this.openDragLock))return;this.latestPointerEvent=v,this.latestPanInfo=S,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),nn(N=>{let L=this.getAxisMotionValue(N).get()||0;if(sn.test(L)){const{projection:R}=this.visualElement;if(R&&R.layout){const D=R.layout.layoutBox[N];D&&(L=ft(D)*(parseFloat(L)/100))}}this.originPoint[N]=L}),M&&Ae.update(()=>M(v,S),!1,!0),cc(this.visualElement,"transform");const{animationState:I}=this.visualElement;I&&I.setActive("whileDrag",!0)},h=(v,S)=>{this.latestPointerEvent=v,this.latestPanInfo=S;const{dragPropagation:E,dragDirectionLock:P,onDirectionLock:M,onDrag:I}=this.getProps();if(!E&&!this.openDragLock)return;const{offset:N}=S;if(P&&this.currentDirection===null){this.currentDirection=SE(N),this.currentDirection!==null&&M&&M(this.currentDirection);return}this.updateAxis("x",S.point,N),this.updateAxis("y",S.point,N),this.visualElement.render(),I&&Ae.update(()=>I(v,S),!1,!0)},m=(v,S)=>{this.latestPointerEvent=v,this.latestPanInfo=S,this.stop(v,S),this.latestPointerEvent=null,this.latestPanInfo=null},y=()=>{const{dragSnapToOrigin:v}=this.getProps();(v||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:g}=this.getProps();this.panSession=new rv(n,{onSessionStart:c,onStart:d,onMove:h,onSessionEnd:m,resumeAnimation:y},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:o,contextWindow:nv(this.visualElement),element:this.visualElement.current})}stop(n,i){const o=n||this.latestPointerEvent,l=i||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!l||!o)return;const{velocity:d}=l;this.startAnimation(d);const{onDragEnd:h}=this.getProps();h&&Ae.postRender(()=>h(o,l))}cancel(){this.isDragging=!1;const{projection:n,animationState:i}=this.visualElement;n&&(n.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(n,i,o){const{drag:l}=this.getProps();if(!o||!_o(n,l,this.currentDirection))return;const c=this.getAxisMotionValue(n);let d=this.originPoint[n]+o[n];this.constraints&&this.constraints[n]&&(d=fE(d,this.constraints[n],this.elastic[n])),c.set(d)}resolveConstraints(){const{dragConstraints:n,dragElastic:i}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,l=this.constraints;n&&Wr(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&o?this.constraints=dE(o.layoutBox,n):this.constraints=!1,this.elastic=gE(i),l!==this.constraints&&!Wr(n)&&o&&this.constraints&&!this.hasMutatedConstraints&&nn(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=mE(o.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:n,onMeasureDragConstraints:i}=this.getProps();if(!n||!Wr(n))return!1;const o=n.current,{projection:l}=this.visualElement;if(!l||!l.layout)return!1;const c=TC(o,l.root,this.visualElement.getTransformPagePoint());let d=hE(l.layout.layoutBox,c);if(i){const h=i(CC(d));this.hasMutatedConstraints=!!h,h&&(d=Ty(h))}return d}startAnimation(n){const{drag:i,dragMomentum:o,dragElastic:l,dragTransition:c,dragSnapToOrigin:d,onDragTransitionEnd:h}=this.getProps(),m=this.constraints||{},y=nn(g=>{if(!_o(g,i,this.currentDirection))return;let v=m&&m[g]||{};(d===!0||d===g)&&(v={min:0,max:0});const S=l?200:1e6,E=l?40:1e7,P={type:"inertia",velocity:o?n[g]:0,bounceStiffness:S,bounceDamping:E,timeConstant:750,restDelta:1,restSpeed:10,...c,...v};return this.startAxisValueAnimation(g,P)});return Promise.all(y).then(h)}startAxisValueAnimation(n,i){const o=this.getAxisMotionValue(n);return cc(this.visualElement,n),o.start(Xc(n,o,0,i,this.visualElement,!1))}stopAnimation(){nn(n=>this.getAxisMotionValue(n).stop())}getAxisMotionValue(n){const i=`_drag${n.toUpperCase()}`,o=this.visualElement.getProps(),l=o[i];return l||this.visualElement.getValue(n,(o.initial?o.initial[n]:void 0)||0)}snapToCursor(n){nn(i=>{const{drag:o}=this.getProps();if(!_o(i,o,this.currentDirection))return;const{projection:l}=this.visualElement,c=this.getAxisMotionValue(i);if(l&&l.layout){const{min:d,max:h}=l.layout.layoutBox[i],m=c.get()||0;c.set(n[i]-Me(d,h,.5)+m)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:n,dragConstraints:i}=this.getProps(),{projection:o}=this.visualElement;if(!Wr(i)||!o||!this.constraints)return;this.stopAnimation();const l={x:0,y:0};nn(d=>{const h=this.getAxisMotionValue(d);if(h&&this.constraints!==!1){const m=h.get();l[d]=pE({min:m,max:m},this.constraints[d])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.constraints=!1,this.resolveConstraints(),nn(d=>{if(!_o(d,n,null))return;const h=this.getAxisMotionValue(d),{min:m,max:y}=this.constraints[d];h.set(Me(m,y,l[d]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;yE.set(this.visualElement,this);const n=this.visualElement.current,i=rs(n,"pointerdown",y=>{const{drag:g,dragListener:v=!0}=this.getProps(),S=y.target,E=S!==n&&nC(S);g&&v&&!E&&this.start(y)});let o;const l=()=>{const{dragConstraints:y}=this.getProps();Wr(y)&&y.current&&(this.constraints=this.resolveRefConstraints(),o||(o=wE(n,y.current,()=>this.scalePositionWithinConstraints())))},{projection:c}=this.visualElement,d=c.addEventListener("measure",l);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),Ae.read(l);const h=us(window,"resize",()=>this.scalePositionWithinConstraints()),m=c.addEventListener("didUpdate",(({delta:y,hasLayoutChanged:g})=>{this.isDragging&&g&&(nn(v=>{const S=this.getAxisMotionValue(v);S&&(this.originPoint[v]+=y[v].translate,S.set(S.get()+y[v].translate))}),this.visualElement.render())}));return()=>{h(),i(),d(),m&&m(),o&&o()}}getProps(){const n=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:o=!1,dragPropagation:l=!1,dragConstraints:c=!1,dragElastic:d=wc,dragMomentum:h=!0}=n;return{...n,drag:i,dragDirectionLock:o,dragPropagation:l,dragConstraints:c,dragElastic:d,dragMomentum:h}}}function jm(t){let n=!0;return()=>{if(n){n=!1;return}t()}}function wE(t,n,i){const o=Zp(t,jm(i)),l=Zp(n,jm(i));return()=>{o(),l()}}function _o(t,n,i){return(n===!0||n===t)&&(i===null||i===t)}function SE(t,n=10){let i=null;return Math.abs(t.y)>n?i="y":Math.abs(t.x)>n&&(i="x"),i}class xE extends Xn{constructor(n){super(n),this.removeGroupControls=Vt,this.removeListeners=Vt,this.controls=new vE(n)}mount(){const{dragControls:n}=this.node.getProps();n&&(this.removeGroupControls=n.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Vt}update(){const{dragControls:n}=this.node.getProps(),{dragControls:i}=this.node.prevProps||{};n!==i&&(this.removeGroupControls(),n&&(this.removeGroupControls=n.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Lu=t=>(n,i)=>{t&&Ae.update(()=>t(n,i),!1,!0)};class CE extends Xn{constructor(){super(...arguments),this.removePointerDownListener=Vt}onPointerDown(n){this.session=new rv(n,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nv(this.node)})}createPanHandlers(){const{onPanSessionStart:n,onPanStart:i,onPan:o,onPanEnd:l}=this.node.getProps();return{onSessionStart:Lu(n),onStart:Lu(i),onMove:Lu(o),onEnd:(c,d)=>{delete this.session,l&&Ae.postRender(()=>l(c,d))}}}mount(){this.removePointerDownListener=rs(this.node.current,"pointerdown",n=>this.onPointerDown(n))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Ou=!1;class kE extends G.Component{componentDidMount(){const{visualElement:n,layoutGroup:i,switchLayoutGroup:o,layoutId:l}=this.props,{projection:c}=n;c&&(i.group&&i.group.add(c),o&&o.register&&l&&o.register(c),Ou&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Wo.hasEverUpdated=!0}getSnapshotBeforeUpdate(n){const{layoutDependency:i,visualElement:o,drag:l,isPresent:c}=this.props,{projection:d}=o;return d&&(d.isPresent=c,n.layoutDependency!==i&&d.setOptions({...d.options,layoutDependency:i}),Ou=!0,l||n.layoutDependency!==i||i===void 0||n.isPresent!==c?d.willUpdate():this.safeToRemove(),n.isPresent!==c&&(c?d.promote():d.relegate()||Ae.postRender(()=>{const h=d.getStack();(!h||!h.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:n,layoutAnchor:i}=this.props,{projection:o}=n;o&&(o.options.layoutAnchor=i,o.root.didUpdate(),Jc.postRender(()=>{!o.currentAnimation&&o.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:n,layoutGroup:i,switchLayoutGroup:o}=this.props,{projection:l}=n;Ou=!0,l&&(l.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(l),o&&o.deregister&&o.deregister(l))}safeToRemove(){const{safeToRemove:n}=this.props;n&&n()}render(){return null}}function sv(t){const[n,i]=Rk(),o=G.useContext(Sg);return ce.jsx(kE,{...t,layoutGroup:o,switchLayoutGroup:G.useContext(ev),isPresent:n,safeToRemove:i})}const EE={pan:{Feature:CE},drag:{Feature:xE,ProjectionNode:Ky,MeasureLayout:sv}};function Um(t,n,i){const{props:o}=t;t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",i==="Start");const l="onHover"+i,c=o[l];c&&Ae.postRender(()=>c(n,ps(n)))}class TE extends Xn{mount(){const{current:n}=this.node;n&&(this.unmount=qx(n,(i,o)=>(Um(this.node,o,"Start"),l=>Um(this.node,l,"End"))))}unmount(){}}class AE extends Xn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let n=!1;try{n=this.node.current.matches(":focus-visible")}catch{n=!0}!n||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=fs(us(this.node.current,"focus",()=>this.onFocus()),us(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Wm(t,n,i){const{props:o}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap",i==="Start");const l="onTap"+(i==="End"?"":i),c=o[l];c&&Ae.postRender(()=>c(n,ps(n)))}class PE extends Xn{mount(){const{current:n}=this.node;if(!n)return;const{globalTapTarget:i,propagate:o}=this.node.props;this.unmount=iC(n,(l,c)=>(Wm(this.node,c,"Start"),(d,{success:h})=>Wm(this.node,d,h?"End":"Cancel")),{useGlobalTarget:i,stopPropagation:o?.tap===!1})}unmount(){}}const Sc=new WeakMap,bu=new WeakMap,_E=t=>{const n=Sc.get(t.target);n&&n(t)},IE=t=>{t.forEach(_E)};function RE({root:t,...n}){const i=t||document;bu.has(i)||bu.set(i,{});const o=bu.get(i),l=JSON.stringify(n);return o[l]||(o[l]=new IntersectionObserver(IE,{root:t,...n})),o[l]}function ME(t,n,i){const o=RE(n);return Sc.set(t,i),o.observe(t),()=>{Sc.delete(t),o.unobserve(t)}}const DE={some:0,all:1};class NE extends Xn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:n={}}=this.node.getProps(),{root:i,margin:o,amount:l="some",once:c}=n,d={root:i?i.current:void 0,rootMargin:o,threshold:typeof l=="number"?l:DE[l]},h=m=>{const{isIntersecting:y}=m;if(this.isInView===y||(this.isInView=y,c&&!y&&this.hasEnteredView))return;y&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",y);const{onViewportEnter:g,onViewportLeave:v}=this.node.getProps(),S=y?g:v;S&&S(m)};this.stopObserver=ME(this.node.current,d,h)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:n,prevProps:i}=this.node;["amount","margin","root"].some(VE(n,i))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function VE({viewport:t={}},{viewport:n={}}={}){return i=>t[i]!==n[i]}const BE={inView:{Feature:NE},tap:{Feature:PE},focus:{Feature:AE},hover:{Feature:TE}},LE={layout:{ProjectionNode:Ky,MeasureLayout:sv}},OE={...oE,...BE,...EE,...LE},ov=tE(OE,nE),bE=pa` - 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); } - 50% { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); } -`,FE=ze(ov.button)` - position: relative; - width: 64px; - height: 64px; - border-radius: 50%; - border: none; - cursor: ${({$disabled:t})=>t?"not-allowed":"pointer"}; - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; - outline: none; - -webkit-tap-highlight-color: transparent; - user-select: none; - touch-action: none; - - /* Base colour by state */ - ${({$state:t,$disabled:n})=>{if(n)return $t` - background: #2d3748; - opacity: 0.5; - `;switch(t){case"listening":return $t` - background: #e53e3e; - animation: ${bE} 1.2s ease-in-out infinite; - `;case"processing":return $t` - background: #805ad5; - `;default:return $t` - background: #2d3748; - &:hover { background: #3d4f6a; } - &:active { background: #4a5568; } - `}}} -`,zE=ze.svg` - width: 28px; - height: 28px; - fill: #e2e8f0; - pointer-events: none; -`,jE=ze(ov.div)` - position: absolute; - inset: -4px; - border-radius: 50%; - border: 3px solid transparent; - border-top-color: #9f7aea; - border-right-color: #9f7aea; -`;function UE({state:t,onPressStart:n,onPressEnd:i,disabled:o=!1}){const l=G.useRef(!1),c=G.useCallback(m=>{o||(m.preventDefault(),m.currentTarget.setPointerCapture(m.pointerId),l.current=!0,n())},[o,n]),d=G.useCallback(m=>{l.current&&(l.current=!1,i())},[i]),h=G.useCallback(m=>{l.current&&(l.current=!1,i())},[i]);return ce.jsxs(FE,{$state:t,$disabled:o,onPointerDown:c,onPointerUp:d,onPointerCancel:h,"aria-label":t==="listening"?"Listening — release to send":t==="processing"?"Processing…":"Hold to speak","aria-pressed":t==="listening",whileTap:o?{}:{scale:.92},children:[t==="processing"&&ce.jsx(jE,{animate:{rotate:360},transition:{duration:.9,repeat:1/0,ease:"linear"}}),ce.jsx(zE,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:ce.jsx("path",{d:"M12 14a3 3 0 0 0 3-3V5a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.93V20H9v2h6v-2h-2v-2.07A7 7 0 0 0 19 11h-2z"})})]})}const WE=ze.div` - display: flex; - align-items: flex-end; - gap: 8px; - flex: 1; - min-width: 0; -`,GE=ze.textarea` - flex: 1; - min-height: 40px; - max-height: 120px; - padding: 10px 14px; - border-radius: 20px; - border: 1px solid #2d3748; - background: #1a1a2e; - color: #e2e8f0; - font-size: 15px; - line-height: 1.4; - resize: none; - outline: none; - font-family: inherit; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - - &::placeholder { - color: #4a5568; - } - - &:focus { - border-color: #4a5568; - } - - &:disabled { - opacity: 0.5; - cursor: not-allowed; - } -`,HE=ze.button` - width: 40px; - height: 40px; - border-radius: 50%; - border: none; - background: ${({$active:t})=>t?"#553c9a":"#2d3748"}; - color: #e2e8f0; - cursor: ${({$active:t})=>t?"pointer":"default"}; - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; - transition: background 150ms ease; - outline: none; - -webkit-tap-highlight-color: transparent; - - &:active { - transform: ${({$active:t})=>t?"scale(0.92)":"none"}; - } -`,KE=ze.svg` - width: 18px; - height: 18px; - fill: currentColor; -`;function $E({sessionId:t,apiBaseUrl:n,onTranscript:i,onSegment:o,disabled:l=!1}){const[c,d]=G.useState(""),[h,m]=G.useState(!1),y=G.useRef(null),g=G.useRef(null),v=c.trim().length>0&&!h&&!l,S=G.useCallback(()=>{const I=y.current;I&&(I.style.height="auto",I.style.height=`${Math.min(I.scrollHeight,120)}px`)},[]),E=G.useCallback(I=>{d(I.target.value),S()},[S]),P=G.useCallback(async()=>{const I=c.trim();if(!I||h)return;d(""),m(!0),y.current&&(y.current.style.height="auto"),i(I),g.current?.abort();const N=new AbortController;g.current=N;try{const L=await fetch(`${n}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:t,message:I}),signal:N.signal});if(!L.ok)throw new Error(`Chat request failed: ${L.status}`);if(!L.body)throw new Error("No response body from chat endpoint");await YE(L.body,o,N.signal)}catch(L){if(L instanceof Error&&L.name==="AbortError")return;console.error("Chat send failed:",L)}finally{m(!1)}},[c,h,t,n,i,o]),M=G.useCallback(I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),v&&P())},[v,P]);return ce.jsxs(WE,{children:[ce.jsx(GE,{ref:y,value:c,onChange:E,onKeyDown:M,placeholder:"Type a message…",disabled:l||h,rows:1,"aria-label":"Message input"}),ce.jsx(HE,{$active:v,onClick:()=>{v&&P()},disabled:!v,"aria-label":"Send message",children:ce.jsx(KE,{viewBox:"0 0 24 24","aria-hidden":!0,children:ce.jsx("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})})})]})}async function YE(t,n,i){const o=t.getReader(),l=new TextDecoder;let c="";try{for(;!i.aborted;){const{done:d,value:h}=await o.read();if(d)break;c+=l.decode(h,{stream:!0});const m=c.split(` -`);c=m.pop()??"";let y="",g="";for(const v of m)if(v.startsWith("event:"))y=v.slice(6).trim();else if(v.startsWith("data:"))g=v.slice(5).trim();else if(v===""){if(g&&g!=="[DONE]")try{const S=JSON.parse(g);(y==="segment"||S.type==="segment")&&n(S)}catch{}y="",g=""}}}finally{o.releaseLock()}}class XE{constructor(n){this.onFrame=n}audioContext=null;workletNode=null;mediaStream=null;sourceNode=null;_streaming=!1;_initialized=!1;get streaming(){return this._streaming}async init(n){this._initialized||(this.audioContext=n,await n.audioWorklet.addModule(new URL("data:text/javascript;base64,LyoqCiAqIE1pY1Byb2Nlc3NvciBBdWRpb1dvcmtsZXRQcm9jZXNzb3IKICoKICogQ2FwdHVyZXMgbWljcm9waG9uZSBhdWRpbyBhdCB0aGUgYnJvd3NlcidzIG5hdGl2ZSBzYW1wbGUgcmF0ZSwKICogcmVzYW1wbGVzIHRvIDE2a0h6IG1vbm8gdmlhIGxpbmVhciBpbnRlcnBvbGF0aW9uLCBhbmQgZW1pdHMKICogOTYwLXNhbXBsZSBJbnQxNiBmcmFtZXMgKDMwbXMgYXQgMTZrSHopIHRvIHRoZSBtYWluIHRocmVhZC4KICoKICogV2lyZSBmb3JtYXQgKEFycmF5QnVmZmVyKToKICogICBbMHgwMV1bc2VxOiA0QiBiaWctZW5kaWFuXVtwY206IDk2MCAqIDIgYnl0ZXMgPSAxOTIwIGJ5dGVzIEludDE2XQogKiBUb3RhbCBmcmFtZSBzaXplOiAxOTI1IGJ5dGVzCiAqLwoKY29uc3QgVEFSR0VUX1NBTVBMRV9SQVRFID0gMTYwMDA7CmNvbnN0IEZSQU1FX1NBTVBMRVMgPSA5NjA7IC8vIDMwbXMgYXQgMTZrSHoKY29uc3QgSEVBREVSX0JZVEVTID0gNTsgICAgLy8gMSB0eXBlIGJ5dGUgKyA0IHNlcSBieXRlcwpjb25zdCBGUkFNRV9CWVRFUyA9IEZSQU1FX1NBTVBMRVMgKiAyOyAvLyBJbnQxNiA9IDIgYnl0ZXMgcGVyIHNhbXBsZQpjb25zdCBCVUZGRVJfQllURVMgPSBIRUFERVJfQllURVMgKyBGUkFNRV9CWVRFUzsKCmNsYXNzIE1pY1Byb2Nlc3NvciBleHRlbmRzIEF1ZGlvV29ya2xldFByb2Nlc3NvciB7CiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwoKICAgIC8qKiBSZXNhbXBsZWQgUENNIGFjY3VtdWxhdGlvbiBidWZmZXIgKi8KICAgIHRoaXMuX2FjY3VtdWxhdG9yID0gbmV3IEZsb2F0MzJBcnJheShGUkFNRV9TQU1QTEVTICogMik7CiAgICAvKiogV3JpdGUgcG9zaXRpb24gaW4gYWNjdW11bGF0b3IgKi8KICAgIHRoaXMuX2FjY1BvcyA9IDA7CiAgICAvKiogRnJhY3Rpb25hbCBzYW1wbGUgcG9zaXRpb24gZm9yIGxpbmVhciBpbnRlcnBvbGF0aW9uIHJlc2FtcGxpbmcgKi8KICAgIHRoaXMuX3Jlc2FtcGxlUGhhc2UgPSAwLjA7CiAgICAvKiogUGVyLWZyYW1lIHNlcXVlbmNlIGNvdW50ZXIgKHVpbnQzMiwgd3JhcHMpICovCiAgICB0aGlzLl9zZXEgPSAwOwogICAgLyoqIFJhdGlvOiBpbnB1dCBzYW1wbGVzIHBlciBvdXRwdXQgc2FtcGxlICovCiAgICB0aGlzLl9yYXRpbyA9IDA7CiAgfQoKICAvKioKICAgKiBMaW5lYXIgaW50ZXJwb2xhdGlvbiByZXNhbXBsZXIuCiAgICogVGFrZXMgYSBibG9jayBvZiBmbG9hdDMyIGlucHV0IHNhbXBsZXMgKGF0IG5hdGl2ZSByYXRlKSBhbmQgYXBwZW5kcwogICAqIHJlc2FtcGxlZCBmbG9hdDMyIG91dHB1dCBzYW1wbGVzIChhdCAxNmtIeikgaW50byB0aGUgYWNjdW11bGF0b3IsCiAgICogZmx1c2hpbmcgY29tcGxldGUgOTYwLXNhbXBsZSBmcmFtZXMgdG8gdGhlIG1haW4gdGhyZWFkLgogICAqCiAgICogQHBhcmFtIHtGbG9hdDMyQXJyYXl9IGlucHV0IC0gSW5wdXQgc2FtcGxlcyBhdCBuYXRpdmUgc2FtcGxlIHJhdGUKICAgKi8KICBfcmVzYW1wbGVBbmRBY2N1bXVsYXRlKGlucHV0KSB7CiAgICBjb25zdCBpbnB1dExlbiA9IGlucHV0Lmxlbmd0aDsKICAgIGlmIChpbnB1dExlbiA9PT0gMCkgcmV0dXJuOwoKICAgIC8vIENvbXB1dGUgcmF0aW8gb24gZmlyc3QgcmVhbCBpbnB1dCBibG9jayAoc2FtcGxlUmF0ZSBpcyBhdmFpbGFibGUgaW4gd29ya2xldCkKICAgIGlmICh0aGlzLl9yYXRpbyA9PT0gMCkgewogICAgICB0aGlzLl9yYXRpbyA9IHNhbXBsZVJhdGUgLyBUQVJHRVRfU0FNUExFX1JBVEU7CiAgICB9CgogICAgY29uc3QgcmF0aW8gPSB0aGlzLl9yYXRpbzsKICAgIGxldCBwaGFzZSA9IHRoaXMuX3Jlc2FtcGxlUGhhc2U7CgogICAgd2hpbGUgKHBoYXNlIDwgaW5wdXRMZW4pIHsKICAgICAgY29uc3QgaTAgPSBNYXRoLmZsb29yKHBoYXNlKTsKICAgICAgY29uc3QgaTEgPSBNYXRoLm1pbihpMCArIDEsIGlucHV0TGVuIC0gMSk7CiAgICAgIGNvbnN0IGZyYWMgPSBwaGFzZSAtIGkwOwoKICAgICAgY29uc3QgczAgPSBpbnB1dFtpMF07CiAgICAgIGNvbnN0IHMxID0gaW5wdXRbaTFdOwogICAgICBjb25zdCBzYW1wbGUgPSBzMCArIGZyYWMgKiAoczEgLSBzMCk7CgogICAgICB0aGlzLl9hY2N1bXVsYXRvclt0aGlzLl9hY2NQb3MrK10gPSBzYW1wbGU7CgogICAgICBpZiAodGhpcy5fYWNjUG9zID09PSBGUkFNRV9TQU1QTEVTKSB7CiAgICAgICAgdGhpcy5fZmx1c2hGcmFtZSgpOwogICAgICAgIHRoaXMuX2FjY1BvcyA9IDA7CiAgICAgIH0KCiAgICAgIHBoYXNlICs9IHJhdGlvOwogICAgfQoKICAgIC8vIENhcnJ5IG92ZXIgZnJhY3Rpb25hbCBwaGFzZSAoc3VidHJhY3QgY29uc3VtZWQgaW50ZWdlciBzYW1wbGVzKQogICAgdGhpcy5fcmVzYW1wbGVQaGFzZSA9IHBoYXNlIC0gaW5wdXRMZW47CiAgfQoKICAvKioKICAgKiBFbmNvZGUgYW5kIHBvc3QgYSBjb21wbGV0ZSA5NjAtc2FtcGxlIGZyYW1lLgogICAqLwogIF9mbHVzaEZyYW1lKCkgewogICAgY29uc3QgYnVmZmVyID0gbmV3IEFycmF5QnVmZmVyKEJVRkZFUl9CWVRFUyk7CiAgICBjb25zdCB2aWV3ID0gbmV3IERhdGFWaWV3KGJ1ZmZlcik7CgogICAgLy8gSGVhZGVyCiAgICB2aWV3LnNldFVpbnQ4KDAsIDB4MDEpOwogICAgdmlldy5zZXRVaW50MzIoMSwgdGhpcy5fc2VxLCBmYWxzZSk7IC8vIGJpZy1lbmRpYW4KCiAgICAvLyBQQ006IEZsb2F0MzIg4oaSIEludDE2IHdpdGggY2xhbXBpbmcKICAgIGNvbnN0IHBjbVZpZXcgPSBuZXcgSW50MTZBcnJheShidWZmZXIsIEhFQURFUl9CWVRFUyk7CiAgICBmb3IgKGxldCBpID0gMDsgaSA8IEZSQU1FX1NBTVBMRVM7IGkrKykgewogICAgICBjb25zdCBmID0gdGhpcy5fYWNjdW11bGF0b3JbaV07CiAgICAgIC8vIENsYW1wIHRvIFstMSwgMV0gdGhlbiBzY2FsZSB0byBJbnQxNiByYW5nZQogICAgICBjb25zdCBjbGFtcGVkID0gZiA8IC0xLjAgPyAtMS4wIDogZiA+IDEuMCA/IDEuMCA6IGY7CiAgICAgIHBjbVZpZXdbaV0gPSBNYXRoLnJvdW5kKGNsYW1wZWQgKiAzMjc2Nyk7CiAgICB9CgogICAgdGhpcy5wb3J0LnBvc3RNZXNzYWdlKGJ1ZmZlciwgW2J1ZmZlcl0pOwogICAgdGhpcy5fc2VxID0gKHRoaXMuX3NlcSArIDEpID4+PiAwOyAvLyB1bnNpZ25lZCAzMi1iaXQgaW5jcmVtZW50CiAgfQoKICAvKioKICAgKiBAcGFyYW0ge0Zsb2F0MzJBcnJheVtdW119IGlucHV0cwogICAqIEByZXR1cm5zIHtib29sZWFufQogICAqLwogIHByb2Nlc3MoaW5wdXRzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGlmICghaW5wdXQgfHwgaW5wdXQubGVuZ3RoID09PSAwKSByZXR1cm4gdHJ1ZTsKCiAgICAvLyBNaXggZG93biB0byBtb25vIGlmIHN0ZXJlbwogICAgY29uc3QgY2gwID0gaW5wdXRbMF07CiAgICBpZiAoIWNoMCB8fCBjaDAubGVuZ3RoID09PSAwKSByZXR1cm4gdHJ1ZTsKCiAgICBsZXQgbW9ubzsKICAgIGlmIChpbnB1dC5sZW5ndGggPiAxICYmIGlucHV0WzFdICYmIGlucHV0WzFdLmxlbmd0aCA9PT0gY2gwLmxlbmd0aCkgewogICAgICBtb25vID0gbmV3IEZsb2F0MzJBcnJheShjaDAubGVuZ3RoKTsKICAgICAgY29uc3QgY2gxID0gaW5wdXRbMV07CiAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY2gwLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgbW9ub1tpXSA9IChjaDBbaV0gKyBjaDFbaV0pICogMC41OwogICAgICB9CiAgICB9IGVsc2UgewogICAgICBtb25vID0gY2gwOwogICAgfQoKICAgIHRoaXMuX3Jlc2FtcGxlQW5kQWNjdW11bGF0ZShtb25vKTsKICAgIHJldHVybiB0cnVlOwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ21pYy1wcm9jZXNzb3InLCBNaWNQcm9jZXNzb3IpOwo=",import.meta.url)),this.mediaStream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}),this.sourceNode=n.createMediaStreamSource(this.mediaStream),this.workletNode=new AudioWorkletNode(n,"mic-processor",{numberOfInputs:1,numberOfOutputs:0,channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"}),this.workletNode.port.onmessage=i=>{this._streaming&&this.onFrame(i.data)},this.sourceNode.connect(this.workletNode),this._initialized=!0)}start(){if(!this._initialized)throw new Error("MicCapture.start() called before init()");this._streaming=!0}stop(){this._streaming=!1}dispose(){if(this._streaming=!1,this._initialized=!1,this.sourceNode?.disconnect(),this.workletNode?.disconnect(),this.workletNode?.port.close(),this.mediaStream){for(const n of this.mediaStream.getTracks())n.stop();this.mediaStream=null}this.sourceNode=null,this.workletNode=null,this.audioContext=null}}class ZE{constructor(n={}){this.callbacks=n}audioContext=null;workletNode=null;gainNode=null;_initialized=!1;async init(n){this._initialized||(this.audioContext=n,await n.audioWorklet.addModule(new URL("/assets/pcm-player-sipky5yG.js",import.meta.url)),this.workletNode=new AudioWorkletNode(n,"pcm-player",{numberOfInputs:0,numberOfOutputs:1,outputChannelCount:[1],channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"}),this.gainNode=n.createGain(),this.gainNode.gain.value=1,this.workletNode.connect(this.gainNode),this.gainNode.connect(n.destination),this._registerMediaSession(),this._initialized=!0)}enqueue(n){if(!this._initialized||!this.workletNode)return;const i=n.slice(0);this.workletNode.port.postMessage({type:"enqueue",buffer:i},[i])}flush(){this.workletNode?.port.postMessage({type:"flush"})}setVolume(n){this.gainNode&&(this.gainNode.gain.value=Math.max(0,Math.min(1,n)))}dispose(){this._initialized=!1,this.workletNode?.disconnect(),this.workletNode?.port.close(),this.gainNode?.disconnect(),this.workletNode=null,this.gainNode=null,this.audioContext=null,"mediaSession"in navigator&&(navigator.mediaSession.playbackState="none")}_registerMediaSession(){"mediaSession"in navigator&&(navigator.mediaSession.metadata=new MediaMetadata({title:"Companion",artist:"AI Voice Chat"}),navigator.mediaSession.setActionHandler("pause",()=>{this.callbacks.onLockScreenPause?.()}),navigator.mediaSession.setActionHandler("play",()=>{this.callbacks.onLockScreenPlay?.()}),navigator.mediaSession.playbackState="playing")}}const ln=Object.create(null);ln.open="0";ln.close="1";ln.ping="2";ln.pong="3";ln.message="4";ln.upgrade="5";ln.noop="6";const Go=Object.create(null);Object.keys(ln).forEach(t=>{Go[ln[t]]=t});const xc={type:"error",data:"parser error"},av=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",lv=typeof ArrayBuffer=="function",uv=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,uf=({type:t,data:n},i,o)=>av&&n instanceof Blob?i?o(n):Gm(n,o):lv&&(n instanceof ArrayBuffer||uv(n))?i?o(n):Gm(new Blob([n]),o):o(ln[t]+(n||"")),Gm=(t,n)=>{const i=new FileReader;return i.onload=function(){const o=i.result.split(",")[1];n("b"+(o||""))},i.readAsDataURL(t)};function Hm(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Fu;function QE(t,n){if(av&&t.data instanceof Blob)return t.data.arrayBuffer().then(Hm).then(n);if(lv&&(t.data instanceof ArrayBuffer||uv(t.data)))return n(Hm(t.data));uf(t,!1,i=>{Fu||(Fu=new TextEncoder),n(Fu.encode(i))})}const Km="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qi=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t{let n=t.length*.75,i=t.length,o,l=0,c,d,h,m;t[t.length-1]==="="&&(n--,t[t.length-2]==="="&&n--);const y=new ArrayBuffer(n),g=new Uint8Array(y);for(o=0;o>4,g[l++]=(d&15)<<4|h>>2,g[l++]=(h&3)<<6|m&63;return y},JE=typeof ArrayBuffer=="function",cf=(t,n)=>{if(typeof t!="string")return{type:"message",data:cv(t,n)};const i=t.charAt(0);return i==="b"?{type:"message",data:eT(t.substring(1),n)}:Go[i]?t.length>1?{type:Go[i],data:t.substring(1)}:{type:Go[i]}:xc},eT=(t,n)=>{if(JE){const i=qE(t);return cv(i,n)}else return{base64:!0,data:t}},cv=(t,n)=>{switch(n){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},fv="",tT=(t,n)=>{const i=t.length,o=new Array(i);let l=0;t.forEach((c,d)=>{uf(c,!1,h=>{o[d]=h,++l===i&&n(o.join(fv))})})},nT=(t,n)=>{const i=t.split(fv),o=[];for(let l=0;l{const o=i.length;let l;if(o<126)l=new Uint8Array(1),new DataView(l.buffer).setUint8(0,o);else if(o<65536){l=new Uint8Array(3);const c=new DataView(l.buffer);c.setUint8(0,126),c.setUint16(1,o)}else{l=new Uint8Array(9);const c=new DataView(l.buffer);c.setUint8(0,127),c.setBigUint64(1,BigInt(o))}t.data&&typeof t.data!="string"&&(l[0]|=128),n.enqueue(l),n.enqueue(i)})}})}let zu;function Io(t){return t.reduce((n,i)=>n+i.length,0)}function Ro(t,n){if(t[0].length===n)return t.shift();const i=new Uint8Array(n);let o=0;for(let l=0;lMath.pow(2,21)-1){h.enqueue(xc);break}l=g*Math.pow(2,32)+y.getUint32(4),o=3}else{if(Io(i)t){h.enqueue(xc);break}}}})}const dv=4;function Ge(t){if(t)return sT(t)}function sT(t){for(var n in Ge.prototype)t[n]=Ge.prototype[n];return t}Ge.prototype.on=Ge.prototype.addEventListener=function(t,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(n),this};Ge.prototype.once=function(t,n){function i(){this.off(t,i),n.apply(this,arguments)}return i.fn=n,this.on(t,i),this};Ge.prototype.off=Ge.prototype.removeListener=Ge.prototype.removeAllListeners=Ge.prototype.removeEventListener=function(t,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+t];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var o,l=0;lPromise.resolve().then(n):(n,i)=>i(n,0),Dt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),oT="arraybuffer";function hv(t,...n){return n.reduce((i,o)=>(t.hasOwnProperty(o)&&(i[o]=t[o]),i),{})}const aT=Dt.setTimeout,lT=Dt.clearTimeout;function Sa(t,n){n.useNativeTimers?(t.setTimeoutFn=aT.bind(Dt),t.clearTimeoutFn=lT.bind(Dt)):(t.setTimeoutFn=Dt.setTimeout.bind(Dt),t.clearTimeoutFn=Dt.clearTimeout.bind(Dt))}const uT=1.33;function cT(t){return typeof t=="string"?fT(t):Math.ceil((t.byteLength||t.size)*uT)}function fT(t){let n=0,i=0;for(let o=0,l=t.length;o=57344?i+=3:(o++,i+=4);return i}function pv(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function dT(t){let n="";for(let i in t)t.hasOwnProperty(i)&&(n.length&&(n+="&"),n+=encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return n}function hT(t){let n={},i=t.split("&");for(let o=0,l=i.length;o{this.readyState="paused",n()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||i()})),this.writable||(o++,this.once("drain",function(){--o||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(n){const i=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};nT(n,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const n=()=>{this.write([{type:"close"}])};this.readyState==="open"?n():this.once("open",n)}write(n){this.writable=!1,tT(n,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const n=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=pv()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(n,i)}}let mv=!1;try{mv=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const gT=mv;function yT(){}class vT extends mT{constructor(n){if(super(n),typeof location<"u"){const i=location.protocol==="https:";let o=location.port;o||(o=i?"443":"80"),this.xd=typeof location<"u"&&n.hostname!==location.hostname||o!==n.port}}doWrite(n,i){const o=this.request({method:"POST",data:n});o.on("success",i),o.on("error",(l,c)=>{this.onError("xhr post error",l,c)})}doPoll(){const n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(i,o)=>{this.onError("xhr poll error",i,o)}),this.pollXhr=n}}class on extends Ge{constructor(n,i,o){super(),this.createRequest=n,Sa(this,o),this._opts=o,this._method=o.method||"GET",this._uri=i,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var n;const i=hv(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(i);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let l in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(l)&&o.setRequestHeader(l,this._opts.extraHeaders[l])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(n=this._opts.cookieJar)===null||n===void 0||n.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var l;o.readyState===3&&((l=this._opts.cookieJar)===null||l===void 0||l.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(l){this.setTimeoutFn(()=>{this._onError(l)},0);return}typeof document<"u"&&(this._index=on.requestsCount++,on.requests[this._index]=this)}_onError(n){this.emitReserved("error",n,this._xhr),this._cleanup(!0)}_cleanup(n){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=yT,n)try{this._xhr.abort()}catch{}typeof document<"u"&&delete on.requests[this._index],this._xhr=null}}_onLoad(){const n=this._xhr.responseText;n!==null&&(this.emitReserved("data",n),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}on.requestsCount=0;on.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",$m);else if(typeof addEventListener=="function"){const t="onpagehide"in Dt?"pagehide":"unload";addEventListener(t,$m,!1)}}function $m(){for(let t in on.requests)on.requests.hasOwnProperty(t)&&on.requests[t].abort()}const wT=(function(){const t=gv({xdomain:!1});return t&&t.responseType!==null})();class ST extends vT{constructor(n){super(n);const i=n&&n.forceBase64;this.supportsBinary=wT&&!i}request(n={}){return Object.assign(n,{xd:this.xd},this.opts),new on(gv,this.uri(),n)}}function gv(t){const n=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!n||gT))return new XMLHttpRequest}catch{}if(!n)try{return new Dt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const yv=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class xT extends ff{get name(){return"websocket"}doOpen(){const n=this.uri(),i=this.opts.protocols,o=yv?{}:hv(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(n,i,o)}catch(l){return this.emitReserved("error",l)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=n=>this.onClose({description:"websocket connection closed",context:n}),this.ws.onmessage=n=>this.onData(n.data),this.ws.onerror=n=>this.onError("websocket error",n)}write(n){this.writable=!1;for(let i=0;i{try{this.doWrite(o,c)}catch{}l&&wa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const n=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=pv()),this.supportsBinary||(i.b64=1),this.createUri(n,i)}}const ju=Dt.WebSocket||Dt.MozWebSocket;class CT extends xT{createSocket(n,i,o){return yv?new ju(n,i,o):i?new ju(n,i):new ju(n)}doWrite(n,i){this.ws.send(i)}}class kT extends ff{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(n){return this.emitReserved("error",n)}this._transport.closed.then(()=>{this.onClose()}).catch(n=>{this.onError("webtransport error",n)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(n=>{const i=iT(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=n.readable.pipeThrough(i).getReader(),l=rT();l.readable.pipeTo(n.writable),this._writer=l.writable.getWriter();const c=()=>{o.read().then(({done:h,value:m})=>{h||(this.onPacket(m),c())}).catch(h=>{})};c();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(n){this.writable=!1;for(let i=0;i{l&&wa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;(n=this._transport)===null||n===void 0||n.close()}}const ET={websocket:CT,webtransport:kT,polling:ST},TT=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,AT=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Cc(t){if(t.length>8e3)throw"URI too long";const n=t,i=t.indexOf("["),o=t.indexOf("]");i!=-1&&o!=-1&&(t=t.substring(0,i)+t.substring(i,o).replace(/:/g,";")+t.substring(o,t.length));let l=TT.exec(t||""),c={},d=14;for(;d--;)c[AT[d]]=l[d]||"";return i!=-1&&o!=-1&&(c.source=n,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=PT(c,c.path),c.queryKey=_T(c,c.query),c}function PT(t,n){const i=/\/{2,9}/g,o=n.replace(i,"/").split("/");return(n.slice(0,1)=="/"||n.length===0)&&o.splice(0,1),n.slice(-1)=="/"&&o.splice(o.length-1,1),o}function _T(t,n){const i={};return n.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,l,c){l&&(i[l]=c)}),i}const kc=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ho=[];kc&&addEventListener("offline",()=>{Ho.forEach(t=>t())},!1);class Hn extends Ge{constructor(n,i){if(super(),this.binaryType=oT,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,n&&typeof n=="object"&&(i=n,n=null),n){const o=Cc(n);i.hostname=o.host,i.secure=o.protocol==="https"||o.protocol==="wss",i.port=o.port,o.query&&(i.query=o.query)}else i.host&&(i.hostname=Cc(i.host).host);Sa(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(o=>{const l=o.prototype.name;this.transports.push(l),this._transportsByName[l]=o}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=hT(this.opts.query)),kc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Ho.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(n){const i=Object.assign({},this.opts.query);i.EIO=dv,i.transport=n,this.id&&(i.sid=this.id);const o=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[n]);return new this._transportsByName[n](o)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const n=this.opts.rememberUpgrade&&Hn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(n);i.open(),this.setTransport(i)}setTransport(n){this.transport&&this.transport.removeAllListeners(),this.transport=n,n.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",Hn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",n),this.emitReserved("heartbeat"),n.type){case"open":this.onHandshake(JSON.parse(n.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=n.data,this._onError(i);break;case"message":this.emitReserved("data",n.data),this.emitReserved("message",n.data);break}}onHandshake(n){this.emitReserved("handshake",n),this.id=n.sid,this.transport.query.sid=n.sid,this._pingInterval=n.pingInterval,this._pingTimeout=n.pingTimeout,this._maxPayload=n.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const n=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+n,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},n),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const n=this._getWritablePackets();this.transport.send(n),this._prevBufferLen=n.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let o=0;o0&&i>this._maxPayload)return this.writeBuffer.slice(0,o);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const n=Date.now()>this._pingTimeoutTime;return n&&(this._pingTimeoutTime=0,wa(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),n}write(n,i,o){return this._sendPacket("message",n,i,o),this}send(n,i,o){return this._sendPacket("message",n,i,o),this}_sendPacket(n,i,o,l){if(typeof i=="function"&&(l=i,i=void 0),typeof o=="function"&&(l=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const c={type:n,data:i,options:o};this.emitReserved("packetCreate",c),this.writeBuffer.push(c),l&&this.once("flush",l),this.flush()}close(){const n=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),n()},o=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():n()}):this.upgrading?o():n()),this}_onError(n){if(Hn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",n),this._onClose("transport error",n)}_onClose(n,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),kc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=Ho.indexOf(this._offlineEventListener);o!==-1&&Ho.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",n,i),this.writeBuffer=[],this._prevBufferLen=0}}}Hn.protocol=dv;class IT extends Hn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let n=0;n{o||(i.send([{type:"ping",data:"probe"}]),i.once("packet",v=>{if(!o)if(v.type==="pong"&&v.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;Hn.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(g(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const S=new Error("probe error");S.transport=i.name,this.emitReserved("upgradeError",S)}}))};function c(){o||(o=!0,g(),i.close(),i=null)}const d=v=>{const S=new Error("probe error: "+v);S.transport=i.name,c(),this.emitReserved("upgradeError",S)};function h(){d("transport closed")}function m(){d("socket closed")}function y(v){i&&v.name!==i.name&&c()}const g=()=>{i.removeListener("open",l),i.removeListener("error",d),i.removeListener("close",h),this.off("close",m),this.off("upgrading",y)};i.once("open",l),i.once("error",d),i.once("close",h),this.once("close",m),this.once("upgrading",y),this._upgrades.indexOf("webtransport")!==-1&&n!=="webtransport"?this.setTimeoutFn(()=>{o||i.open()},200):i.open()}onHandshake(n){this._upgrades=this._filterUpgrades(n.upgrades),super.onHandshake(n)}_filterUpgrades(n){const i=[];for(let o=0;oET[l]).filter(l=>!!l)),super(n,o)}};function MT(t,n="",i){let o=t;i=i||typeof location<"u"&&location,t==null&&(t=i.protocol+"//"+i.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=i.protocol+t:t=i.host+t),/^(https?|wss?):\/\//.test(t)||(typeof i<"u"?t=i.protocol+"//"+t:t="https://"+t),o=Cc(t)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const c=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+c+":"+o.port+n,o.href=o.protocol+"://"+c+(i&&i.port===o.port?"":":"+o.port),o}const DT=typeof ArrayBuffer=="function",NT=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,vv=Object.prototype.toString,VT=typeof Blob=="function"||typeof Blob<"u"&&vv.call(Blob)==="[object BlobConstructor]",BT=typeof File=="function"||typeof File<"u"&&vv.call(File)==="[object FileConstructor]";function df(t){return DT&&(t instanceof ArrayBuffer||NT(t))||VT&&t instanceof Blob||BT&&t instanceof File}function Ko(t,n){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let i=0,o=t.length;i=0&&t.numthis.opts.maxAttachments)throw new Error("too many attachments");o.attachments=h}if(n.charAt(i+1)==="/"){const c=i+1;for(;++i&&!(n.charAt(i)===","||i===n.length););o.nsp=n.substring(c,i)}else o.nsp="/";const l=n.charAt(i+1);if(l!==""&&Number(l)==l){const c=i+1;for(;++i;){const d=n.charAt(i);if(d==null||Number(d)!=d){--i;break}if(i===n.length)break}o.id=Number(n.substring(c,i+1))}if(n.charAt(++i)){const c=this.tryParse(n.substr(i));if(hf.isPayloadValid(o.type,c))o.data=c;else throw new Error("invalid payload")}return o}tryParse(n){try{return JSON.parse(n,this.opts.reviver)}catch{return!1}}static isPayloadValid(n,i){switch(n){case pe.CONNECT:return Ym(i);case pe.DISCONNECT:return i===void 0;case pe.CONNECT_ERROR:return typeof i=="string"||Ym(i);case pe.EVENT:case pe.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&bT.indexOf(i[0])===-1);case pe.ACK:case pe.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class zT{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){const i=OT(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const jT=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};function Ym(t){return Object.prototype.toString.call(t)==="[object Object]"}const UT=Object.freeze(Object.defineProperty({__proto__:null,Decoder:hf,Encoder:FT,get PacketType(){return pe}},Symbol.toStringTag,{value:"Module"}));function Kt(t,n,i){return t.on(n,i),function(){t.off(n,i)}}const WT=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class wv extends Ge{constructor(n,i,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=n,this.nsp=i,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const n=this.io;this.subs=[Kt(n,"open",this.onopen.bind(this)),Kt(n,"packet",this.onpacket.bind(this)),Kt(n,"error",this.onerror.bind(this)),Kt(n,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...n){return n.unshift("message"),this.emit.apply(this,n),this}emit(n,...i){var o,l,c;if(WT.hasOwnProperty(n))throw new Error('"'+n.toString()+'" is a reserved event name');if(i.unshift(n),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const d={type:pe.EVENT,data:i};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const g=this.ids++,v=i.pop();this._registerAckCallback(g,v),d.id=g}const h=(l=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||l===void 0?void 0:l.writable,m=this.connected&&!(!((c=this.io.engine)===null||c===void 0)&&c._hasPingExpired());return this.flags.volatile&&!h||(m?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(n,i){var o;const l=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(l===void 0){this.acks[n]=i;return}const c=this.io.setTimeoutFn(()=>{delete this.acks[n];for(let h=0;h{this.io.clearTimeoutFn(c),i.apply(this,h)};d.withError=!0,this.acks[n]=d}emitWithAck(n,...i){return new Promise((o,l)=>{const c=(d,h)=>d?l(d):o(h);c.withError=!0,i.push(c),this.emit(n,...i)})}_addToQueue(n){let i;typeof n[n.length-1]=="function"&&(i=n.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:n,flags:Object.assign({fromQueue:!0},this.flags)};n.push((l,...c)=>(this._queue[0],l!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(l)):(this._queue.shift(),i&&i(null,...c)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(n=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!n||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(n){n.nsp=this.nsp,this.io._packet(n)}onopen(){typeof this.auth=="function"?this.auth(n=>{this._sendConnectPacket(n)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(n){this.packet({type:pe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},n):n})}onerror(n){this.connected||this.emitReserved("connect_error",n)}onclose(n,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",n,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(n=>{if(!this.sendBuffer.some(o=>String(o.id)===n)){const o=this.acks[n];delete this.acks[n],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(n){if(n.nsp===this.nsp)switch(n.type){case pe.CONNECT:n.data&&n.data.sid?this.onconnect(n.data.sid,n.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case pe.EVENT:case pe.BINARY_EVENT:this.onevent(n);break;case pe.ACK:case pe.BINARY_ACK:this.onack(n);break;case pe.DISCONNECT:this.ondisconnect();break;case pe.CONNECT_ERROR:this.destroy();const o=new Error(n.data.message);o.data=n.data.data,this.emitReserved("connect_error",o);break}}onevent(n){const i=n.data||[];n.id!=null&&i.push(this.ack(n.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(n){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const o of i)o.apply(this,n)}super.emit.apply(this,n),this._pid&&n.length&&typeof n[n.length-1]=="string"&&(this._lastOffset=n[n.length-1])}ack(n){const i=this;let o=!1;return function(...l){o||(o=!0,i.packet({type:pe.ACK,id:n,data:l}))}}onack(n){const i=this.acks[n.id];typeof i=="function"&&(delete this.acks[n.id],i.withError&&n.data.unshift(null),i.apply(this,n.data))}onconnect(n,i){this.id=n,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(n=>this.emitEvent(n)),this.receiveBuffer=[],this.sendBuffer.forEach(n=>{this.notifyOutgoingListeners(n),this.packet(n)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(n=>n()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:pe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}timeout(n){return this.flags.timeout=n,this}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){const i=this._anyListeners;for(let o=0;o0&&t.jitter<=1?t.jitter:0,this.attempts=0}ai.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),i=Math.floor(n*this.jitter*t);t=(Math.floor(n*10)&1)==0?t-i:t+i}return Math.min(t,this.max)|0};ai.prototype.reset=function(){this.attempts=0};ai.prototype.setMin=function(t){this.ms=t};ai.prototype.setMax=function(t){this.max=t};ai.prototype.setJitter=function(t){this.jitter=t};class Ac extends Ge{constructor(n,i){var o;super(),this.nsps={},this.subs=[],n&&typeof n=="object"&&(i=n,n=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Sa(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((o=i.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new ai({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=n;const l=i.parser||UT;this.encoder=new l.Encoder,this.decoder=new l.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(n){return arguments.length?(this._reconnection=!!n,n||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(n){return n===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=n,this)}reconnectionDelay(n){var i;return n===void 0?this._reconnectionDelay:(this._reconnectionDelay=n,(i=this.backoff)===null||i===void 0||i.setMin(n),this)}randomizationFactor(n){var i;return n===void 0?this._randomizationFactor:(this._randomizationFactor=n,(i=this.backoff)===null||i===void 0||i.setJitter(n),this)}reconnectionDelayMax(n){var i;return n===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=n,(i=this.backoff)===null||i===void 0||i.setMax(n),this)}timeout(n){return arguments.length?(this._timeout=n,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(n){if(~this._readyState.indexOf("open"))return this;this.engine=new RT(this.uri,this.opts);const i=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const l=Kt(i,"open",function(){o.onopen(),n&&n()}),c=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),n?n(h):this.maybeReconnectOnOpen()},d=Kt(i,"error",c);if(this._timeout!==!1){const h=this._timeout,m=this.setTimeoutFn(()=>{l(),c(new Error("timeout")),i.close()},h);this.opts.autoUnref&&m.unref(),this.subs.push(()=>{this.clearTimeoutFn(m)})}return this.subs.push(l),this.subs.push(d),this}connect(n){return this.open(n)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const n=this.engine;this.subs.push(Kt(n,"ping",this.onping.bind(this)),Kt(n,"data",this.ondata.bind(this)),Kt(n,"error",this.onerror.bind(this)),Kt(n,"close",this.onclose.bind(this)),Kt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(n){try{this.decoder.add(n)}catch(i){this.onclose("parse error",i)}}ondecoded(n){wa(()=>{this.emitReserved("packet",n)},this.setTimeoutFn)}onerror(n){this.emitReserved("error",n)}socket(n,i){let o=this.nsps[n];return o?this._autoConnect&&!o.active&&o.connect():(o=new wv(this,n,i),this.nsps[n]=o),o}_destroy(n){const i=Object.keys(this.nsps);for(const o of i)if(this.nsps[o].active)return;this._close()}_packet(n){const i=this.encoder.encode(n);for(let o=0;on()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(n,i){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",n,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const n=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{n.skipReconnect||(this.emitReserved("reconnect_attempt",n.backoff.attempts),!n.skipReconnect&&n.open(l=>{l?(n._reconnecting=!1,n.reconnect(),this.emitReserved("reconnect_error",l)):n.onreconnect()}))},i);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const n=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",n)}}const Xi={};function $o(t,n){typeof t=="object"&&(n=t,t=void 0),n=n||{};const i=MT(t,n.path||"/socket.io"),o=i.source,l=i.id,c=i.path,d=Xi[l]&&c in Xi[l].nsps,h=n.forceNew||n["force new connection"]||n.multiplex===!1||d;let m;return h?m=new Ac(o,n):(Xi[l]||(Xi[l]=new Ac(o,n)),m=Xi[l]),i.query&&!n.query&&(n.query=i.queryKey),m.socket(i.path,n)}Object.assign($o,{Manager:Ac,Socket:wv,io:$o,connect:$o});var GT=1,Sv=1,Xm=5,HT=21;function KT(t){const n=t.pcm.byteLength,i=new ArrayBuffer(Xm+n),o=new DataView(i);return o.setUint8(0,GT),o.setUint32(1,t.seq,!1),new Int16Array(i,Xm).set(t.pcm),i}function $T(t){const n=new DataView(t),i=n.getUint8(0);if(i!==Sv)throw new Error(`Unknown downstream frame type: 0x${i.toString(16)}`);const o=n.getUint32(1,!1),l=new Uint8Array(t,5,16),c=String.fromCharCode(...l).replace(/\0/g,""),d=HT,h=t.byteLength-d,m=new Int16Array(t.slice(d,d+h));return{seq:o,utterance_id:c,pcm:m}}function YT(t){return t.byteLength<1?!1:new DataView(t).getUint8(0)===Sv}var XT=class{socket=null;state="disconnected";config;constructor(t){this.config={reconnect:!0,maxReconnectAttempts:5,reconnectDelay:1e3,...t}}connect(){this.state==="connecting"||this.state==="connected"||(this.state="connecting",this.openSocket())}disconnect(){this.state="closing",this.socket&&(this.socket.disconnect(),this.socket=null)}isConnected(){return this.state==="connected"}sendAudio(t){if(this.state!=="connected"||!this.socket)return;const n=KT(t);this.socket.emit("message",n)}openSocket(){const t=this.config.baseUrl.replace(/\/$/,""),n=$o(`${t}/voice`,{query:{session_id:this.config.sessionId},transports:["websocket"],reconnection:this.config.reconnect,reconnectionAttempts:this.config.maxReconnectAttempts,reconnectionDelay:this.config.reconnectDelay,reconnectionDelayMax:this.config.reconnectDelay*16});this.socket=n,n.on("connect",()=>{this.state="connected",this.config.onConnected?.()}),n.on("event",i=>{this.config.onEvent?.(i)}),n.on("binary",i=>{if(i instanceof ArrayBuffer)this.handleBinary(i);else{const o=new ArrayBuffer(i.byteLength);new Uint8Array(o).set(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),this.handleBinary(o)}}),n.on("disconnect",i=>{const o=this.state==="closing";this.state="disconnected";const l=i==="io server disconnect"?1001:1006;this.config.onDisconnected?.(l,i),o&&(this.socket=null)}),n.on("connect_error",i=>{this.config.onError?.(i)})}handleBinary(t){if(YT(t))try{const n=$T(t);this.config.onAudioFrame?.(n)}catch{}}};class ZT{constructor(n,i,o){this.apiBaseUrl=n,this.sessionId=i,this.callbacks=o}client=null;_state="disconnected";micCapture=null;pcmPlayer=null;micSeq=0;get state(){return this._state}attachAudio(n,i){this.micCapture=n,this.pcmPlayer=i}connect(){this._state==="connecting"||this._state==="connected"||(this._setState("connecting"),this.client=new XT({baseUrl:this.apiBaseUrl,sessionId:this.sessionId,reconnect:!0,maxReconnectAttempts:5,reconnectDelay:1e3,onConnected:()=>{this._setState("connected")},onDisconnected:(n,i)=>{this._setState("disconnected")},onError:n=>{this._setState("error")},onEvent:n=>{this._handleEvent(n)},onAudioFrame:n=>{if(this.pcmPlayer){const i=new Uint8Array(n.pcm.buffer,n.pcm.byteOffset,n.pcm.byteLength),o=new ArrayBuffer(i.byteLength);new Uint8Array(o).set(i),this.pcmPlayer.enqueue(o)}}}),this.client.connect())}disconnect(){this.micCapture?.stop(),this.client?.disconnect(),this._setState("disconnected")}sendAudioFrame(n){if(!this.client?.isConnected())return;const o=new DataView(n).getUint32(1,!1),l=new Int16Array(n,5,960);this.client.sendAudio({seq:o,pcm:l}),this.micSeq=o}flushAudio(){this.pcmPlayer?.flush()}_setState(n){this._state!==n&&(this._state=n,this.callbacks.onStateChange(n))}_handleEvent(n){switch(n.type){case"stt.final":{const i=n;this.callbacks.onTranscript(i.transcript);break}case"segment":{this.callbacks.onSegment(n);break}case"tts.start":{const i=n;this.callbacks.onTtsStart(i),navigator.mediaSession&&(navigator.mediaSession.playbackState="playing");break}case"tts.end":{const i=n;this.callbacks.onTtsEnd(i);break}case"vad.speech_start":{this.callbacks.onListening();break}case"error":{this._setState("error");break}}}}function QT(t,n){switch(n.type){case"ADD_USER_MESSAGE":{const i={id:n.id,role:"user",emotion:"neutral",parts:[n.text],speakingPartIndex:null};return{...t,messages:[...t.messages,i]}}case"INIT_ASSISTANT_MESSAGE":{const i={id:n.id,role:"assistant",emotion:"neutral",parts:[],speakingPartIndex:null};return{...t,messages:[...t.messages,i],activeAssistantId:n.id}}case"APPEND_SEGMENT":return{...t,messages:t.messages.map(i=>{if(i.id!==n.id)return i;const o=[...i.parts];return o[n.partIndex]=n.text,{...i,parts:o,emotion:n.emotion}})};case"SET_SPEAKING":return{...t,messages:t.messages.map(i=>i.id===n.id?{...i,speakingPartIndex:n.partIndex}:i)};case"CLEAR_SPEAKING":return{...t,messages:t.messages.map(i=>i.id===n.id?{...i,speakingPartIndex:null}:i)}}}const qT={messages:[],activeAssistantId:null},JT=_1` - *, *::before, *::after { - box-sizing: border-box; - margin: 0; - padding: 0; - } - - html, body, #root { - height: 100%; - height: 100dvh; - width: 100%; - overflow: hidden; - background: #0a0a0f; - } - - body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; - -webkit-font-smoothing: antialiased; - overscroll-behavior: none; - } -`,eA=ze.div` - display: flex; - flex-direction: column; - height: 100dvh; - width: 100%; - max-width: 640px; - margin: 0 auto; - background: #0d0d1a; - position: relative; -`,tA=ze.header` - display: flex; - align-items: center; - padding: 12px 16px; - padding-top: max(12px, env(safe-area-inset-top)); - border-bottom: 1px solid #1a1a2e; - flex-shrink: 0; -`,nA=ze.h1` - font-size: 17px; - font-weight: 600; - color: #e2e8f0; - flex: 1; -`,rA=ze.span` - width: 8px; - height: 8px; - border-radius: 50%; - background: ${({$connected:t})=>t?"#68d391":"#4a5568"}; - flex-shrink: 0; -`,iA=ze.div` - display: flex; - align-items: flex-end; - gap: 10px; - padding: 10px 16px; - padding-bottom: max(10px, env(safe-area-inset-bottom)); - border-top: 1px solid #1a1a2e; - flex-shrink: 0; -`,Uu="http://localhost:3850";function sA(){const t=G.useRef(sessionStorage.getItem("companion_session_id")??""),[n,i]=G.useReducer(QT,qT),[o,l]=G.useState("idle"),[c,d]=G.useState(!1),h=G.useRef(null),m=G.useRef(null),y=G.useRef(null),g=G.useRef(null),v=G.useRef(null),S=G.useRef(!1),E=G.useRef(null);G.useEffect(()=>{const D=z=>{z.preventDefault(),E.current=z};return window.addEventListener("beforeinstallprompt",D),()=>window.removeEventListener("beforeinstallprompt",D)},[]);const P=G.useCallback(D=>{const z=new ZT(Uu,D,{onTranscript:b=>{const B=crypto.randomUUID();i({type:"ADD_USER_MESSAGE",id:B,text:b})},onSegment:b=>{if(!v.current){const B=crypto.randomUUID();v.current=B,i({type:"INIT_ASSISTANT_MESSAGE",id:B})}i({type:"APPEND_SEGMENT",id:v.current,partIndex:b.part_index,text:b.text,emotion:b.emotion})},onTtsStart:b=>{v.current&&i({type:"SET_SPEAKING",id:v.current,partIndex:b.part_index})},onTtsEnd:b=>{v.current&&i({type:"CLEAR_SPEAKING",id:v.current})},onListening:()=>{l("listening"),v.current=null},onStateChange:b=>{d(b==="connected"),b==="error"&&l("idle")}});g.current=z,z.connect()},[]);G.useEffect(()=>{let D=!1;async function z(){const b=sessionStorage.getItem("companion_session_id");if(b){t.current=b,P(b);return}const B=await fetch(`${Uu}/session`,{method:"POST"});if(!B.ok)throw new Error(`POST /session failed: ${B.status}`);const{session_id:Y}=await B.json();D||(t.current=Y,sessionStorage.setItem("companion_session_id",Y),P(Y))}return z(),()=>{D=!0,g.current?.disconnect(),m.current?.dispose(),y.current?.dispose()}},[P]);const M=G.useCallback(async()=>{if(S.current)return;S.current=!0;const D=new AudioContext;h.current=D;const z=new XE(B=>{g.current?.sendAudioFrame(B)}),b=new ZE({onLockScreenPause:()=>{z.stop(),l("idle")},onLockScreenPlay:()=>{}});await z.init(D),await b.init(D),m.current=z,y.current=b,g.current?.attachAudio(z,b)},[]),I=G.useCallback(async()=>{await M(),v.current=null,l("listening"),m.current?.start()},[M]),N=G.useCallback(()=>{m.current?.stop(),l("processing")},[]),L=G.useCallback(D=>{const z=crypto.randomUUID();i({type:"ADD_USER_MESSAGE",id:z,text:D}),v.current=null;const b=crypto.randomUUID();v.current=b,i({type:"INIT_ASSISTANT_MESSAGE",id:b})},[]),R=G.useCallback(D=>{v.current&&i({type:"APPEND_SEGMENT",id:v.current,partIndex:D.part_index,text:D.text,emotion:D.emotion})},[]);return ce.jsxs(ce.Fragment,{children:[ce.jsx(JT,{}),ce.jsxs(eA,{children:[ce.jsxs(tA,{children:[ce.jsx(nA,{children:"Companion"}),ce.jsx(rA,{$connected:c,title:c?"Connected":"Disconnected"})]}),ce.jsx(j1,{messages:n.messages}),ce.jsxs(iA,{children:[ce.jsx($E,{sessionId:t.current,apiBaseUrl:Uu,onTranscript:L,onSegment:R,disabled:o==="listening"}),ce.jsx(UE,{state:o,onPressStart:()=>{I()},onPressEnd:N})]})]})]})}const xv=document.getElementById("root");if(!xv)throw new Error("Root element #root not found in DOM");Pw.createRoot(xv).render(ce.jsx(G.StrictMode,{children:ce.jsx(sA,{})}));