@alfatech/livechat 2025.6.0-4.2 → 2025.6.0-4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +2 -2
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -37,7 +37,7 @@ var gg=e=>{throw TypeError(e)};var $E=(e,t)=>()=>(t||e((t={exports:{}}).exports,
37
37
  `+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{Gc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Lo(e):""}function hT(e){switch(e.tag){case 5:return Lo(e.type);case 16:return Lo("Lazy");case 13:return Lo("Suspense");case 19:return Lo("SuspenseList");case 0:case 2:case 15:return e=Qc(e.type,!1),e;case 11:return e=Qc(e.type.render,!1),e;case 1:return e=Qc(e.type,!0),e;default:return""}}function nf(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 vs:return"Fragment";case gs:return"Portal";case Jd:return"Profiler";case lh:return"StrictMode";case ef:return"Suspense";case tf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Kx:return(e.displayName||"Context")+".Consumer";case qx:return(e._context.displayName||"Context")+".Provider";case uh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ch:return t=e.displayName||null,t!==null?t:nf(e.type)||"Memo";case kr:t=e._payload,e=e._init;try{return nf(e(t))}catch{}}return null}function mT(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return nf(t);case 8:return t===lh?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ei(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gT(e){var t=Qx(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ll(e){e._valueTracker||(e._valueTracker=gT(e))}function Yx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Qx(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ou(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 rf(e,t){var n=t.checked;return Ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function kg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ei(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Xx(e,t){t=t.checked,t!=null&&ah(e,"checked",t,!1)}function sf(e,t){Xx(e,t);var n=ei(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?of(e,t.type,n):t.hasOwnProperty("defaultValue")&&of(e,t.type,ei(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Eg(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function of(e,t,n){(t!=="number"||ou(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Io=Array.isArray;function Fs(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ei(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function af(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(N(91));return Ae({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Tg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(N(92));if(Io(n)){if(1<n.length)throw Error(N(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ei(n)}}function Zx(e,t){var n=ei(t.value),r=ei(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Cg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Jx(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function lf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Jx(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ul,e1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ul=ul||document.createElement("div"),ul.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ul.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function la(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wo={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},vT=["Webkit","ms","Moz","O"];Object.keys(Wo).forEach(function(e){vT.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Wo[t]=Wo[e]})});function t1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Wo.hasOwnProperty(e)&&Wo[e]?(""+t).trim():t+"px"}function n1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=t1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var yT=Ae({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 uf(e,t){if(t){if(yT[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function cf(e,t){if(e.indexOf("-")===-1)return typeof t.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 df=null;function dh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ff=null,Ns=null,Ms=null;function _g(e){if(e=qa(e)){if(typeof ff!="function")throw Error(N(280));var t=e.stateNode;t&&(t=ec(t),ff(e.stateNode,e.type,t))}}function r1(e){Ns?Ms?Ms.push(e):Ms=[e]:Ns=e}function i1(){if(Ns){var e=Ns,t=Ms;if(Ms=Ns=null,_g(e),t)for(e=0;e<t.length;e++)_g(t[e])}}function s1(e,t){return e(t)}function o1(){}var Yc=!1;function a1(e,t,n){if(Yc)return e(t,n);Yc=!0;try{return s1(e,t,n)}finally{Yc=!1,(Ns!==null||Ms!==null)&&(o1(),i1())}}function ua(e,t){var n=e.stateNode;if(n===null)return null;var r=ec(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(N(231,t,typeof n));return n}var pf=!1;if(lr)try{var _o={};Object.defineProperty(_o,"passive",{get:function(){pf=!0}}),window.addEventListener("test",_o,_o),window.removeEventListener("test",_o,_o)}catch{pf=!1}function xT(e,t,n,r,i,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var qo=!1,au=null,lu=!1,hf=null,wT={onError:function(e){qo=!0,au=e}};function bT(e,t,n,r,i,s,o,a,l){qo=!1,au=null,xT.apply(wT,arguments)}function ST(e,t,n,r,i,s,o,a,l){if(bT.apply(this,arguments),qo){if(qo){var u=au;qo=!1,au=null}else throw Error(N(198));lu||(lu=!0,hf=u)}}function Xi(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l1(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Pg(e){if(Xi(e)!==e)throw Error(N(188))}function kT(e){var t=e.alternate;if(!t){if(t=Xi(e),t===null)throw Error(N(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Pg(i),e;if(s===r)return Pg(i),t;s=s.sibling}throw Error(N(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(N(189))}}if(n.alternate!==r)throw Error(N(190))}if(n.tag!==3)throw Error(N(188));return n.stateNode.current===n?e:t}function u1(e){return e=kT(e),e!==null?c1(e):null}function c1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=c1(e);if(t!==null)return t;e=e.sibling}return null}var d1=Vt.unstable_scheduleCallback,jg=Vt.unstable_cancelCallback,ET=Vt.unstable_shouldYield,TT=Vt.unstable_requestPaint,Me=Vt.unstable_now,CT=Vt.unstable_getCurrentPriorityLevel,fh=Vt.unstable_ImmediatePriority,f1=Vt.unstable_UserBlockingPriority,uu=Vt.unstable_NormalPriority,_T=Vt.unstable_LowPriority,p1=Vt.unstable_IdlePriority,Yu=null,In=null;function PT(e){if(In&&typeof In.onCommitFiberRoot=="function")try{In.onCommitFiberRoot(Yu,e,void 0,(e.current.flags&128)===128)}catch{}}var Sn=Math.clz32?Math.clz32:RT,jT=Math.log,AT=Math.LN2;function RT(e){return e>>>=0,e===0?32:31-(jT(e)/AT|0)|0}var cl=64,dl=4194304;function $o(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 cu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=$o(a):(s&=o,s!==0&&(r=$o(s)))}else o=n&~i,o!==0?r=$o(o):s!==0&&(r=$o(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Sn(t),i=1<<n,r|=e[n],t&=~i;return r}function OT(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function DT(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Sn(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=OT(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function mf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function h1(){var e=cl;return cl<<=1,!(cl&4194240)&&(cl=64),e}function Xc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ha(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Sn(t),e[t]=n}function FT(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Sn(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function ph(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Sn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var pe=0;function m1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var g1,hh,v1,y1,x1,gf=!1,fl=[],Br=null,Vr=null,Ur=null,ca=new Map,da=new Map,Cr=[],NT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ag(e,t){switch(e){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":Vr=null;break;case"mouseover":case"mouseout":Ur=null;break;case"pointerover":case"pointerout":ca.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":da.delete(t.pointerId)}}function Po(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=qa(t),t!==null&&hh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function MT(e,t,n,r,i){switch(t){case"focusin":return Br=Po(Br,e,t,n,r,i),!0;case"dragenter":return Vr=Po(Vr,e,t,n,r,i),!0;case"mouseover":return Ur=Po(Ur,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return ca.set(s,Po(ca.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,da.set(s,Po(da.get(s)||null,e,t,n,r,i)),!0}return!1}function w1(e){var t=Si(e.target);if(t!==null){var n=Xi(t);if(n!==null){if(t=n.tag,t===13){if(t=l1(n),t!==null){e.blockedOn=t,x1(e.priority,function(){v1(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Il(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=vf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);df=r,n.target.dispatchEvent(r),df=null}else return t=qa(n),t!==null&&hh(t),e.blockedOn=n,!1;t.shift()}return!0}function Rg(e,t,n){Il(e)&&n.delete(t)}function LT(){gf=!1,Br!==null&&Il(Br)&&(Br=null),Vr!==null&&Il(Vr)&&(Vr=null),Ur!==null&&Il(Ur)&&(Ur=null),ca.forEach(Rg),da.forEach(Rg)}function jo(e,t){e.blockedOn===t&&(e.blockedOn=null,gf||(gf=!0,Vt.unstable_scheduleCallback(Vt.unstable_NormalPriority,LT)))}function fa(e){function t(i){return jo(i,e)}if(0<fl.length){jo(fl[0],e);for(var n=1;n<fl.length;n++){var r=fl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Br!==null&&jo(Br,e),Vr!==null&&jo(Vr,e),Ur!==null&&jo(Ur,e),ca.forEach(t),da.forEach(t),n=0;n<Cr.length;n++)r=Cr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Cr.length&&(n=Cr[0],n.blockedOn===null);)w1(n),n.blockedOn===null&&Cr.shift()}var Ls=pr.ReactCurrentBatchConfig,du=!0;function IT(e,t,n,r){var i=pe,s=Ls.transition;Ls.transition=null;try{pe=1,mh(e,t,n,r)}finally{pe=i,Ls.transition=s}}function $T(e,t,n,r){var i=pe,s=Ls.transition;Ls.transition=null;try{pe=4,mh(e,t,n,r)}finally{pe=i,Ls.transition=s}}function mh(e,t,n,r){if(du){var i=vf(e,t,n,r);if(i===null)ad(e,t,r,fu,n),Ag(e,r);else if(MT(i,e,t,n,r))r.stopPropagation();else if(Ag(e,r),t&4&&-1<NT.indexOf(e)){for(;i!==null;){var s=qa(i);if(s!==null&&g1(s),s=vf(e,t,n,r),s===null&&ad(e,t,r,fu,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else ad(e,t,r,null,n)}}var fu=null;function vf(e,t,n,r){if(fu=null,e=dh(r),e=Si(e),e!==null)if(t=Xi(e),t===null)e=null;else if(n=t.tag,n===13){if(e=l1(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return fu=e,null}function b1(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(CT()){case fh:return 1;case f1:return 4;case uu:case _T:return 16;case p1:return 536870912;default:return 16}default:return 16}}var Lr=null,gh=null,$l=null;function S1(){if($l)return $l;var e,t=gh,n=t.length,r,i="value"in Lr?Lr.value:Lr.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return $l=i.slice(e,1<r?1-r:void 0)}function zl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function pl(){return!0}function Og(){return!1}function Ht(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?pl:Og,this.isPropagationStopped=Og,this}return Ae(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=pl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=pl)},persist:function(){},isPersistent:pl}),t}var mo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vh=Ht(mo),Wa=Ae({},mo,{view:0,detail:0}),zT=Ht(Wa),Zc,Jc,Ao,Xu=Ae({},Wa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yh,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ao&&(Ao&&e.type==="mousemove"?(Zc=e.screenX-Ao.screenX,Jc=e.screenY-Ao.screenY):Jc=Zc=0,Ao=e),Zc)},movementY:function(e){return"movementY"in e?e.movementY:Jc}}),Dg=Ht(Xu),BT=Ae({},Xu,{dataTransfer:0}),VT=Ht(BT),UT=Ae({},Wa,{relatedTarget:0}),ed=Ht(UT),HT=Ae({},mo,{animationName:0,elapsedTime:0,pseudoElement:0}),WT=Ht(HT),qT=Ae({},mo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),KT=Ht(qT),GT=Ae({},mo,{data:0}),Fg=Ht(GT),QT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},YT={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},XT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZT(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=XT[e])?!!t[e]:!1}function yh(){return ZT}var JT=Ae({},Wa,{key:function(e){if(e.key){var t=QT[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?YT[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yh,charCode:function(e){return e.type==="keypress"?zl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),eC=Ht(JT),tC=Ae({},Xu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ng=Ht(tC),nC=Ae({},Wa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yh}),rC=Ht(nC),iC=Ae({},mo,{propertyName:0,elapsedTime:0,pseudoElement:0}),sC=Ht(iC),oC=Ae({},Xu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),aC=Ht(oC),lC=[9,13,27,32],xh=lr&&"CompositionEvent"in window,Ko=null;lr&&"documentMode"in document&&(Ko=document.documentMode);var uC=lr&&"TextEvent"in window&&!Ko,k1=lr&&(!xh||Ko&&8<Ko&&11>=Ko),Mg=" ",Lg=!1;function E1(e,t){switch(e){case"keyup":return lC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ys=!1;function cC(e,t){switch(e){case"compositionend":return T1(t);case"keypress":return t.which!==32?null:(Lg=!0,Mg);case"textInput":return e=t.data,e===Mg&&Lg?null:e;default:return null}}function dC(e,t){if(ys)return e==="compositionend"||!xh&&E1(e,t)?(e=S1(),$l=gh=Lr=null,ys=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return k1&&t.locale!=="ko"?null:t.data;default:return null}}var fC={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ig(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fC[e.type]:t==="textarea"}function C1(e,t,n,r){r1(r),t=pu(t,"onChange"),0<t.length&&(n=new vh("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Go=null,pa=null;function pC(e){L1(e,0)}function Zu(e){var t=bs(e);if(Yx(t))return e}function hC(e,t){if(e==="change")return t}var _1=!1;if(lr){var td;if(lr){var nd="oninput"in document;if(!nd){var $g=document.createElement("div");$g.setAttribute("oninput","return;"),nd=typeof $g.oninput=="function"}td=nd}else td=!1;_1=td&&(!document.documentMode||9<document.documentMode)}function zg(){Go&&(Go.detachEvent("onpropertychange",P1),pa=Go=null)}function P1(e){if(e.propertyName==="value"&&Zu(pa)){var t=[];C1(t,pa,e,dh(e)),a1(pC,t)}}function mC(e,t,n){e==="focusin"?(zg(),Go=t,pa=n,Go.attachEvent("onpropertychange",P1)):e==="focusout"&&zg()}function gC(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zu(pa)}function vC(e,t){if(e==="click")return Zu(t)}function yC(e,t){if(e==="input"||e==="change")return Zu(t)}function xC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var En=typeof Object.is=="function"?Object.is:xC;function ha(e,t){if(En(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Zd.call(t,i)||!En(e[i],t[i]))return!1}return!0}function Bg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vg(e,t){var n=Bg(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Bg(n)}}function j1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?j1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function A1(){for(var e=window,t=ou();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ou(e.document)}return t}function wh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function wC(e){var t=A1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&j1(n.ownerDocument.documentElement,n)){if(r!==null&&wh(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Vg(n,s);var o=Vg(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var bC=lr&&"documentMode"in document&&11>=document.documentMode,xs=null,yf=null,Qo=null,xf=!1;function Ug(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xf||xs==null||xs!==ou(r)||(r=xs,"selectionStart"in r&&wh(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Qo&&ha(Qo,r)||(Qo=r,r=pu(yf,"onSelect"),0<r.length&&(t=new vh("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=xs)))}function hl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ws={animationend:hl("Animation","AnimationEnd"),animationiteration:hl("Animation","AnimationIteration"),animationstart:hl("Animation","AnimationStart"),transitionend:hl("Transition","TransitionEnd")},rd={},R1={};lr&&(R1=document.createElement("div").style,"AnimationEvent"in window||(delete ws.animationend.animation,delete ws.animationiteration.animation,delete ws.animationstart.animation),"TransitionEvent"in window||delete ws.transitionend.transition);function Ju(e){if(rd[e])return rd[e];if(!ws[e])return e;var t=ws[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in R1)return rd[e]=t[n];return e}var O1=Ju("animationend"),D1=Ju("animationiteration"),F1=Ju("animationstart"),N1=Ju("transitionend"),M1=new Map,Hg="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function si(e,t){M1.set(e,t),Yi(t,[e])}for(var id=0;id<Hg.length;id++){var sd=Hg[id],SC=sd.toLowerCase(),kC=sd[0].toUpperCase()+sd.slice(1);si(SC,"on"+kC)}si(O1,"onAnimationEnd");si(D1,"onAnimationIteration");si(F1,"onAnimationStart");si("dblclick","onDoubleClick");si("focusin","onFocus");si("focusout","onBlur");si(N1,"onTransitionEnd");to("onMouseEnter",["mouseout","mouseover"]);to("onMouseLeave",["mouseout","mouseover"]);to("onPointerEnter",["pointerout","pointerover"]);to("onPointerLeave",["pointerout","pointerover"]);Yi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Yi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Yi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Yi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Yi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Yi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),EC=new Set("cancel close invalid load scroll toggle".split(" ").concat(zo));function Wg(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,ST(r,t,void 0,e),e.currentTarget=null}function L1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Wg(i,a,u),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Wg(i,a,u),s=l}}}if(lu)throw e=hf,lu=!1,hf=null,e}function be(e,t){var n=t[Ef];n===void 0&&(n=t[Ef]=new Set);var r=e+"__bubble";n.has(r)||(I1(t,e,2,!1),n.add(r))}function od(e,t,n){var r=0;t&&(r|=4),I1(n,e,r,t)}var ml="_reactListening"+Math.random().toString(36).slice(2);function ma(e){if(!e[ml]){e[ml]=!0,Wx.forEach(function(n){n!=="selectionchange"&&(EC.has(n)||od(n,!1,e),od(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ml]||(t[ml]=!0,od("selectionchange",!1,t))}}function I1(e,t,n,r){switch(b1(t)){case 1:var i=IT;break;case 4:i=$T;break;default:i=mh}n=i.bind(null,t,n,e),i=void 0,!pf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function ad(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Si(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}a1(function(){var u=s,d=dh(n),c=[];e:{var f=M1.get(e);if(f!==void 0){var p=vh,h=e;switch(e){case"keypress":if(zl(n)===0)break e;case"keydown":case"keyup":p=eC;break;case"focusin":h="focus",p=ed;break;case"focusout":h="blur",p=ed;break;case"beforeblur":case"afterblur":p=ed;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Dg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=VT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=rC;break;case O1:case D1:case F1:p=WT;break;case N1:p=sC;break;case"scroll":p=zT;break;case"wheel":p=aC;break;case"copy":case"cut":case"paste":p=KT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Ng}var v=(t&4)!==0,b=!v&&e==="scroll",m=v?f!==null?f+"Capture":null:f;v=[];for(var x=u,w;x!==null;){w=x;var E=w.stateNode;if(w.tag===5&&E!==null&&(w=E,m!==null&&(E=ua(x,m),E!=null&&v.push(ga(x,E,w)))),b)break;x=x.return}0<v.length&&(f=new p(f,h,null,n,d),c.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==df&&(h=n.relatedTarget||n.fromElement)&&(Si(h)||h[ur]))break e;if((p||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p?(h=n.relatedTarget||n.toElement,p=u,h=h?Si(h):null,h!==null&&(b=Xi(h),h!==b||h.tag!==5&&h.tag!==6)&&(h=null)):(p=null,h=u),p!==h)){if(v=Dg,E="onMouseLeave",m="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(v=Ng,E="onPointerLeave",m="onPointerEnter",x="pointer"),b=p==null?f:bs(p),w=h==null?f:bs(h),f=new v(E,x+"leave",p,n,d),f.target=b,f.relatedTarget=w,E=null,Si(d)===u&&(v=new v(m,x+"enter",h,n,d),v.target=w,v.relatedTarget=b,E=v),b=E,p&&h)t:{for(v=p,m=h,x=0,w=v;w;w=ps(w))x++;for(w=0,E=m;E;E=ps(E))w++;for(;0<x-w;)v=ps(v),x--;for(;0<w-x;)m=ps(m),w--;for(;x--;){if(v===m||m!==null&&v===m.alternate)break t;v=ps(v),m=ps(m)}v=null}else v=null;p!==null&&qg(c,f,p,v,!1),h!==null&&b!==null&&qg(c,b,h,v,!0)}}e:{if(f=u?bs(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var T=hC;else if(Ig(f))if(_1)T=yC;else{T=gC;var C=mC}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(T=vC);if(T&&(T=T(e,u))){C1(c,T,n,d);break e}C&&C(e,f,u),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&of(f,"number",f.value)}switch(C=u?bs(u):window,e){case"focusin":(Ig(C)||C.contentEditable==="true")&&(xs=C,yf=u,Qo=null);break;case"focusout":Qo=yf=xs=null;break;case"mousedown":xf=!0;break;case"contextmenu":case"mouseup":case"dragend":xf=!1,Ug(c,n,d);break;case"selectionchange":if(bC)break;case"keydown":case"keyup":Ug(c,n,d)}var S;if(xh)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else ys?E1(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(k1&&n.locale!=="ko"&&(ys||_!=="onCompositionStart"?_==="onCompositionEnd"&&ys&&(S=S1()):(Lr=d,gh="value"in Lr?Lr.value:Lr.textContent,ys=!0)),C=pu(u,_),0<C.length&&(_=new Fg(_,e,null,n,d),c.push({event:_,listeners:C}),S?_.data=S:(S=T1(n),S!==null&&(_.data=S)))),(S=uC?cC(e,n):dC(e,n))&&(u=pu(u,"onBeforeInput"),0<u.length&&(d=new Fg("onBeforeInput","beforeinput",null,n,d),c.push({event:d,listeners:u}),d.data=S))}L1(c,t)})}function ga(e,t,n){return{instance:e,listener:t,currentTarget:n}}function pu(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=ua(e,n),s!=null&&r.unshift(ga(e,s,i)),s=ua(e,t),s!=null&&r.push(ga(e,s,i))),e=e.return}return r}function ps(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function qg(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=ua(n,s),l!=null&&o.unshift(ga(n,l,a))):i||(l=ua(n,s),l!=null&&o.push(ga(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var TC=/\r\n?/g,CC=/\u0000|\uFFFD/g;function Kg(e){return(typeof e=="string"?e:""+e).replace(TC,`
38
38
  `).replace(CC,"")}function gl(e,t,n){if(t=Kg(t),Kg(e)!==t&&n)throw Error(N(425))}function hu(){}var wf=null,bf=null;function Sf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var kf=typeof setTimeout=="function"?setTimeout:void 0,_C=typeof clearTimeout=="function"?clearTimeout:void 0,Gg=typeof Promise=="function"?Promise:void 0,PC=typeof queueMicrotask=="function"?queueMicrotask:typeof Gg<"u"?function(e){return Gg.resolve(null).then(e).catch(jC)}:kf;function jC(e){setTimeout(function(){throw e})}function ld(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),fa(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);fa(t)}function Hr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Qg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var go=Math.random().toString(36).slice(2),Ln="__reactFiber$"+go,va="__reactProps$"+go,ur="__reactContainer$"+go,Ef="__reactEvents$"+go,AC="__reactListeners$"+go,RC="__reactHandles$"+go;function Si(e){var t=e[Ln];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ur]||n[Ln]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qg(e);e!==null;){if(n=e[Ln])return n;e=Qg(e)}return t}e=n,n=e.parentNode}return null}function qa(e){return e=e[Ln]||e[ur],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function bs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(N(33))}function ec(e){return e[va]||null}var Tf=[],Ss=-1;function oi(e){return{current:e}}function ke(e){0>Ss||(e.current=Tf[Ss],Tf[Ss]=null,Ss--)}function xe(e,t){Ss++,Tf[Ss]=e.current,e.current=t}var ti={},pt=oi(ti),jt=oi(!1),Bi=ti;function no(e,t){var n=e.type.contextTypes;if(!n)return ti;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function At(e){return e=e.childContextTypes,e!=null}function mu(){ke(jt),ke(pt)}function Yg(e,t,n){if(pt.current!==ti)throw Error(N(168));xe(pt,t),xe(jt,n)}function $1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(N(108,mT(e)||"Unknown",i));return Ae({},n,r)}function gu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ti,Bi=pt.current,xe(pt,e),xe(jt,jt.current),!0}function Xg(e,t,n){var r=e.stateNode;if(!r)throw Error(N(169));n?(e=$1(e,t,Bi),r.__reactInternalMemoizedMergedChildContext=e,ke(jt),ke(pt),xe(pt,e)):ke(jt),xe(jt,n)}var er=null,tc=!1,ud=!1;function z1(e){er===null?er=[e]:er.push(e)}function OC(e){tc=!0,z1(e)}function ai(){if(!ud&&er!==null){ud=!0;var e=0,t=pe;try{var n=er;for(pe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}er=null,tc=!1}catch(i){throw er!==null&&(er=er.slice(e+1)),d1(fh,ai),i}finally{pe=t,ud=!1}}return null}var ks=[],Es=0,vu=null,yu=0,Jt=[],en=0,Vi=null,rr=1,ir="";function gi(e,t){ks[Es++]=yu,ks[Es++]=vu,vu=e,yu=t}function B1(e,t,n){Jt[en++]=rr,Jt[en++]=ir,Jt[en++]=Vi,Vi=e;var r=rr;e=ir;var i=32-Sn(r)-1;r&=~(1<<i),n+=1;var s=32-Sn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,rr=1<<32-Sn(t)+i|n<<i|r,ir=s+e}else rr=1<<s|n<<i|r,ir=e}function bh(e){e.return!==null&&(gi(e,1),B1(e,1,0))}function Sh(e){for(;e===vu;)vu=ks[--Es],ks[Es]=null,yu=ks[--Es],ks[Es]=null;for(;e===Vi;)Vi=Jt[--en],Jt[en]=null,ir=Jt[--en],Jt[en]=null,rr=Jt[--en],Jt[en]=null}var Bt=null,It=null,Ee=!1,wn=null;function V1(e,t){var n=nn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Zg(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Bt=e,It=Hr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Bt=e,It=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Vi!==null?{id:rr,overflow:ir}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=nn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Bt=e,It=null,!0):!1;default:return!1}}function Cf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _f(e){if(Ee){var t=It;if(t){var n=t;if(!Zg(e,t)){if(Cf(e))throw Error(N(418));t=Hr(n.nextSibling);var r=Bt;t&&Zg(e,t)?V1(r,n):(e.flags=e.flags&-4097|2,Ee=!1,Bt=e)}}else{if(Cf(e))throw Error(N(418));e.flags=e.flags&-4097|2,Ee=!1,Bt=e}}}function Jg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Bt=e}function vl(e){if(e!==Bt)return!1;if(!Ee)return Jg(e),Ee=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Sf(e.type,e.memoizedProps)),t&&(t=It)){if(Cf(e))throw U1(),Error(N(418));for(;t;)V1(e,t),t=Hr(t.nextSibling)}if(Jg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){It=Hr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}It=null}}else It=Bt?Hr(e.stateNode.nextSibling):null;return!0}function U1(){for(var e=It;e;)e=Hr(e.nextSibling)}function ro(){It=Bt=null,Ee=!1}function kh(e){wn===null?wn=[e]:wn.push(e)}var DC=pr.ReactCurrentBatchConfig;function Ro(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(N(309));var r=n.stateNode}if(!r)throw Error(N(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(N(284));if(!n._owner)throw Error(N(290,e))}return e}function yl(e,t){throw e=Object.prototype.toString.call(t),Error(N(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ev(e){var t=e._init;return t(e._payload)}function H1(e){function t(m,x){if(e){var w=m.deletions;w===null?(m.deletions=[x],m.flags|=16):w.push(x)}}function n(m,x){if(!e)return null;for(;x!==null;)t(m,x),x=x.sibling;return null}function r(m,x){for(m=new Map;x!==null;)x.key!==null?m.set(x.key,x):m.set(x.index,x),x=x.sibling;return m}function i(m,x){return m=Gr(m,x),m.index=0,m.sibling=null,m}function s(m,x,w){return m.index=w,e?(w=m.alternate,w!==null?(w=w.index,w<x?(m.flags|=2,x):w):(m.flags|=2,x)):(m.flags|=1048576,x)}function o(m){return e&&m.alternate===null&&(m.flags|=2),m}function a(m,x,w,E){return x===null||x.tag!==6?(x=gd(w,m.mode,E),x.return=m,x):(x=i(x,w),x.return=m,x)}function l(m,x,w,E){var T=w.type;return T===vs?d(m,x,w.props.children,E,w.key):x!==null&&(x.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===kr&&ev(T)===x.type)?(E=i(x,w.props),E.ref=Ro(m,x,w),E.return=m,E):(E=Kl(w.type,w.key,w.props,null,m.mode,E),E.ref=Ro(m,x,w),E.return=m,E)}function u(m,x,w,E){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=vd(w,m.mode,E),x.return=m,x):(x=i(x,w.children||[]),x.return=m,x)}function d(m,x,w,E,T){return x===null||x.tag!==7?(x=Li(w,m.mode,E,T),x.return=m,x):(x=i(x,w),x.return=m,x)}function c(m,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=gd(""+x,m.mode,w),x.return=m,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case al:return w=Kl(x.type,x.key,x.props,null,m.mode,w),w.ref=Ro(m,null,x),w.return=m,w;case gs:return x=vd(x,m.mode,w),x.return=m,x;case kr:var E=x._init;return c(m,E(x._payload),w)}if(Io(x)||Co(x))return x=Li(x,m.mode,w,null),x.return=m,x;yl(m,x)}return null}function f(m,x,w,E){var T=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return T!==null?null:a(m,x,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case al:return w.key===T?l(m,x,w,E):null;case gs:return w.key===T?u(m,x,w,E):null;case kr:return T=w._init,f(m,x,T(w._payload),E)}if(Io(w)||Co(w))return T!==null?null:d(m,x,w,E,null);yl(m,w)}return null}function p(m,x,w,E,T){if(typeof E=="string"&&E!==""||typeof E=="number")return m=m.get(w)||null,a(x,m,""+E,T);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case al:return m=m.get(E.key===null?w:E.key)||null,l(x,m,E,T);case gs:return m=m.get(E.key===null?w:E.key)||null,u(x,m,E,T);case kr:var C=E._init;return p(m,x,w,C(E._payload),T)}if(Io(E)||Co(E))return m=m.get(w)||null,d(x,m,E,T,null);yl(x,E)}return null}function h(m,x,w,E){for(var T=null,C=null,S=x,_=x=0,j=null;S!==null&&_<w.length;_++){S.index>_?(j=S,S=null):j=S.sibling;var R=f(m,S,w[_],E);if(R===null){S===null&&(S=j);break}e&&S&&R.alternate===null&&t(m,S),x=s(R,x,_),C===null?T=R:C.sibling=R,C=R,S=j}if(_===w.length)return n(m,S),Ee&&gi(m,_),T;if(S===null){for(;_<w.length;_++)S=c(m,w[_],E),S!==null&&(x=s(S,x,_),C===null?T=S:C.sibling=S,C=S);return Ee&&gi(m,_),T}for(S=r(m,S);_<w.length;_++)j=p(S,m,_,w[_],E),j!==null&&(e&&j.alternate!==null&&S.delete(j.key===null?_:j.key),x=s(j,x,_),C===null?T=j:C.sibling=j,C=j);return e&&S.forEach(function(L){return t(m,L)}),Ee&&gi(m,_),T}function v(m,x,w,E){var T=Co(w);if(typeof T!="function")throw Error(N(150));if(w=T.call(w),w==null)throw Error(N(151));for(var C=T=null,S=x,_=x=0,j=null,R=w.next();S!==null&&!R.done;_++,R=w.next()){S.index>_?(j=S,S=null):j=S.sibling;var L=f(m,S,R.value,E);if(L===null){S===null&&(S=j);break}e&&S&&L.alternate===null&&t(m,S),x=s(L,x,_),C===null?T=L:C.sibling=L,C=L,S=j}if(R.done)return n(m,S),Ee&&gi(m,_),T;if(S===null){for(;!R.done;_++,R=w.next())R=c(m,R.value,E),R!==null&&(x=s(R,x,_),C===null?T=R:C.sibling=R,C=R);return Ee&&gi(m,_),T}for(S=r(m,S);!R.done;_++,R=w.next())R=p(S,m,_,R.value,E),R!==null&&(e&&R.alternate!==null&&S.delete(R.key===null?_:R.key),x=s(R,x,_),C===null?T=R:C.sibling=R,C=R);return e&&S.forEach(function(ne){return t(m,ne)}),Ee&&gi(m,_),T}function b(m,x,w,E){if(typeof w=="object"&&w!==null&&w.type===vs&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case al:e:{for(var T=w.key,C=x;C!==null;){if(C.key===T){if(T=w.type,T===vs){if(C.tag===7){n(m,C.sibling),x=i(C,w.props.children),x.return=m,m=x;break e}}else if(C.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===kr&&ev(T)===C.type){n(m,C.sibling),x=i(C,w.props),x.ref=Ro(m,C,w),x.return=m,m=x;break e}n(m,C);break}else t(m,C);C=C.sibling}w.type===vs?(x=Li(w.props.children,m.mode,E,w.key),x.return=m,m=x):(E=Kl(w.type,w.key,w.props,null,m.mode,E),E.ref=Ro(m,x,w),E.return=m,m=E)}return o(m);case gs:e:{for(C=w.key;x!==null;){if(x.key===C)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(m,x.sibling),x=i(x,w.children||[]),x.return=m,m=x;break e}else{n(m,x);break}else t(m,x);x=x.sibling}x=vd(w,m.mode,E),x.return=m,m=x}return o(m);case kr:return C=w._init,b(m,x,C(w._payload),E)}if(Io(w))return h(m,x,w,E);if(Co(w))return v(m,x,w,E);yl(m,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(m,x.sibling),x=i(x,w),x.return=m,m=x):(n(m,x),x=gd(w,m.mode,E),x.return=m,m=x),o(m)):n(m,x)}return b}var io=H1(!0),W1=H1(!1),xu=oi(null),wu=null,Ts=null,Eh=null;function Th(){Eh=Ts=wu=null}function Ch(e){var t=xu.current;ke(xu),e._currentValue=t}function Pf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Is(e,t){wu=e,Eh=Ts=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Pt=!0),e.firstContext=null)}function an(e){var t=e._currentValue;if(Eh!==e)if(e={context:e,memoizedValue:t,next:null},Ts===null){if(wu===null)throw Error(N(308));Ts=e,wu.dependencies={lanes:0,firstContext:e}}else Ts=Ts.next=e;return t}var ki=null;function _h(e){ki===null?ki=[e]:ki.push(e)}function q1(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,_h(t)):(n.next=i.next,i.next=n),t.interleaved=n,cr(e,r)}function cr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Er=!1;function Ph(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function K1(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function or(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ce&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,cr(e,n)}return i=r.interleaved,i===null?(t.next=t,_h(r)):(t.next=i.next,i.next=t),r.interleaved=t,cr(e,n)}function Bl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ph(e,n)}}function tv(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function bu(e,t,n,r){var i=e.updateQueue;Er=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(s!==null){var c=i.baseState;o=0,d=u=l=null,a=s;do{var f=a.lane,p=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,v=a;switch(f=t,p=n,v.tag){case 1:if(h=v.payload,typeof h=="function"){c=h.call(p,c,f);break e}c=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=v.payload,f=typeof h=="function"?h.call(p,c,f):h,f==null)break e;c=Ae({},c,f);break e;case 2:Er=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=p,l=c):d=d.next=p,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(l=c),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Hi|=o,e.lanes=o,e.memoizedState=c}}function nv(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(N(191,i));i.call(r)}}}var Ka={},$n=oi(Ka),ya=oi(Ka),xa=oi(Ka);function Ei(e){if(e===Ka)throw Error(N(174));return e}function jh(e,t){switch(xe(xa,t),xe(ya,e),xe($n,Ka),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:lf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=lf(t,e)}ke($n),xe($n,t)}function so(){ke($n),ke(ya),ke(xa)}function G1(e){Ei(xa.current);var t=Ei($n.current),n=lf(t,e.type);t!==n&&(xe(ya,e),xe($n,n))}function Ah(e){ya.current===e&&(ke($n),ke(ya))}var _e=oi(0);function Su(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var cd=[];function Rh(){for(var e=0;e<cd.length;e++)cd[e]._workInProgressVersionPrimary=null;cd.length=0}var Vl=pr.ReactCurrentDispatcher,dd=pr.ReactCurrentBatchConfig,Ui=0,je=null,ze=null,Ke=null,ku=!1,Yo=!1,wa=0,FC=0;function at(){throw Error(N(321))}function Oh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!En(e[n],t[n]))return!1;return!0}function Dh(e,t,n,r,i,s){if(Ui=s,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Vl.current=e===null||e.memoizedState===null?IC:$C,e=n(r,i),Yo){s=0;do{if(Yo=!1,wa=0,25<=s)throw Error(N(301));s+=1,Ke=ze=null,t.updateQueue=null,Vl.current=zC,e=n(r,i)}while(Yo)}if(Vl.current=Eu,t=ze!==null&&ze.next!==null,Ui=0,Ke=ze=je=null,ku=!1,t)throw Error(N(300));return e}function Fh(){var e=wa!==0;return wa=0,e}function Rn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?je.memoizedState=Ke=e:Ke=Ke.next=e,Ke}function ln(){if(ze===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=ze.next;var t=Ke===null?je.memoizedState:Ke.next;if(t!==null)Ke=t,ze=e;else{if(e===null)throw Error(N(310));ze=e,e={memoizedState:ze.memoizedState,baseState:ze.baseState,baseQueue:ze.baseQueue,queue:ze.queue,next:null},Ke===null?je.memoizedState=Ke=e:Ke=Ke.next=e}return Ke}function ba(e,t){return typeof t=="function"?t(e):t}function fd(e){var t=ln(),n=t.queue;if(n===null)throw Error(N(311));n.lastRenderedReducer=e;var r=ze,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,u=s;do{var d=u.lane;if((Ui&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=c,o=r):l=l.next=c,je.lanes|=d,Hi|=d}u=u.next}while(u!==null&&u!==s);l===null?o=r:l.next=a,En(r,t.memoizedState)||(Pt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,je.lanes|=s,Hi|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function pd(e){var t=ln(),n=t.queue;if(n===null)throw Error(N(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);En(s,t.memoizedState)||(Pt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Q1(){}function Y1(e,t){var n=je,r=ln(),i=t(),s=!En(r.memoizedState,i);if(s&&(r.memoizedState=i,Pt=!0),r=r.queue,Nh(J1.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Ke!==null&&Ke.memoizedState.tag&1){if(n.flags|=2048,Sa(9,Z1.bind(null,n,r,i,t),void 0,null),Ge===null)throw Error(N(349));Ui&30||X1(n,t,i)}return i}function X1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Z1(e,t,n,r){t.value=n,t.getSnapshot=r,ew(t)&&tw(e)}function J1(e,t,n){return n(function(){ew(t)&&tw(e)})}function ew(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!En(e,n)}catch{return!0}}function tw(e){var t=cr(e,1);t!==null&&kn(t,e,1,-1)}function rv(e){var t=Rn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:e},t.queue=e,e=e.dispatch=LC.bind(null,je,e),[t.memoizedState,e]}function Sa(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=je.updateQueue,t===null?(t={lastEffect:null,stores:null},je.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function nw(){return ln().memoizedState}function Ul(e,t,n,r){var i=Rn();je.flags|=e,i.memoizedState=Sa(1|t,n,void 0,r===void 0?null:r)}function nc(e,t,n,r){var i=ln();r=r===void 0?null:r;var s=void 0;if(ze!==null){var o=ze.memoizedState;if(s=o.destroy,r!==null&&Oh(r,o.deps)){i.memoizedState=Sa(t,n,s,r);return}}je.flags|=e,i.memoizedState=Sa(1|t,n,s,r)}function iv(e,t){return Ul(8390656,8,e,t)}function Nh(e,t){return nc(2048,8,e,t)}function rw(e,t){return nc(4,2,e,t)}function iw(e,t){return nc(4,4,e,t)}function sw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ow(e,t,n){return n=n!=null?n.concat([e]):null,nc(4,4,sw.bind(null,t,e),n)}function Mh(){}function aw(e,t){var n=ln();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Oh(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function lw(e,t){var n=ln();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Oh(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function uw(e,t,n){return Ui&21?(En(n,t)||(n=h1(),je.lanes|=n,Hi|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Pt=!0),e.memoizedState=n)}function NC(e,t){var n=pe;pe=n!==0&&4>n?n:4,e(!0);var r=dd.transition;dd.transition={};try{e(!1),t()}finally{pe=n,dd.transition=r}}function cw(){return ln().memoizedState}function MC(e,t,n){var r=Kr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},dw(e))fw(t,n);else if(n=q1(e,t,n,r),n!==null){var i=yt();kn(n,e,r,i),pw(n,t,r)}}function LC(e,t,n){var r=Kr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(dw(e))fw(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,En(a,o)){var l=t.interleaved;l===null?(i.next=i,_h(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=q1(e,t,i,r),n!==null&&(i=yt(),kn(n,e,r,i),pw(n,t,r))}}function dw(e){var t=e.alternate;return e===je||t!==null&&t===je}function fw(e,t){Yo=ku=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ph(e,n)}}var Eu={readContext:an,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useInsertionEffect:at,useLayoutEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useMutableSource:at,useSyncExternalStore:at,useId:at,unstable_isNewReconciler:!1},IC={readContext:an,useCallback:function(e,t){return Rn().memoizedState=[e,t===void 0?null:t],e},useContext:an,useEffect:iv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ul(4194308,4,sw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ul(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ul(4,2,e,t)},useMemo:function(e,t){var n=Rn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Rn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=MC.bind(null,je,e),[r.memoizedState,e]},useRef:function(e){var t=Rn();return e={current:e},t.memoizedState=e},useState:rv,useDebugValue:Mh,useDeferredValue:function(e){return Rn().memoizedState=e},useTransition:function(){var e=rv(!1),t=e[0];return e=NC.bind(null,e[1]),Rn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=je,i=Rn();if(Ee){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),Ge===null)throw Error(N(349));Ui&30||X1(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,iv(J1.bind(null,r,s,e),[e]),r.flags|=2048,Sa(9,Z1.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Rn(),t=Ge.identifierPrefix;if(Ee){var n=ir,r=rr;n=(r&~(1<<32-Sn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wa++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=FC++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},$C={readContext:an,useCallback:aw,useContext:an,useEffect:Nh,useImperativeHandle:ow,useInsertionEffect:rw,useLayoutEffect:iw,useMemo:lw,useReducer:fd,useRef:nw,useState:function(){return fd(ba)},useDebugValue:Mh,useDeferredValue:function(e){var t=ln();return uw(t,ze.memoizedState,e)},useTransition:function(){var e=fd(ba)[0],t=ln().memoizedState;return[e,t]},useMutableSource:Q1,useSyncExternalStore:Y1,useId:cw,unstable_isNewReconciler:!1},zC={readContext:an,useCallback:aw,useContext:an,useEffect:Nh,useImperativeHandle:ow,useInsertionEffect:rw,useLayoutEffect:iw,useMemo:lw,useReducer:pd,useRef:nw,useState:function(){return pd(ba)},useDebugValue:Mh,useDeferredValue:function(e){var t=ln();return ze===null?t.memoizedState=e:uw(t,ze.memoizedState,e)},useTransition:function(){var e=pd(ba)[0],t=ln().memoizedState;return[e,t]},useMutableSource:Q1,useSyncExternalStore:Y1,useId:cw,unstable_isNewReconciler:!1};function gn(e,t){if(e&&e.defaultProps){t=Ae({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function jf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ae({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var rc={isMounted:function(e){return(e=e._reactInternals)?Xi(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=yt(),i=Kr(e),s=or(r,i);s.payload=t,n!=null&&(s.callback=n),t=Wr(e,s,i),t!==null&&(kn(t,e,i,r),Bl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=yt(),i=Kr(e),s=or(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Wr(e,s,i),t!==null&&(kn(t,e,i,r),Bl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=yt(),r=Kr(e),i=or(n,r);i.tag=2,t!=null&&(i.callback=t),t=Wr(e,i,r),t!==null&&(kn(t,e,r,n),Bl(t,e,r))}};function sv(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!ha(n,r)||!ha(i,s):!0}function hw(e,t,n){var r=!1,i=ti,s=t.contextType;return typeof s=="object"&&s!==null?s=an(s):(i=At(t)?Bi:pt.current,r=t.contextTypes,s=(r=r!=null)?no(e,i):ti),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=rc,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function ov(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&rc.enqueueReplaceState(t,t.state,null)}function Af(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Ph(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=an(s):(s=At(t)?Bi:pt.current,i.context=no(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(jf(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&rc.enqueueReplaceState(i,i.state,null),bu(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function oo(e,t){try{var n="",r=t;do n+=hT(r),r=r.return;while(r);var i=n}catch(s){i=`
39
39
  Error generating stack: `+s.message+`
40
- `+s.stack}return{value:e,source:t,stack:i,digest:null}}function hd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Rf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var BC=typeof WeakMap=="function"?WeakMap:Map;function mw(e,t,n){n=or(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Cu||(Cu=!0,Bf=r),Rf(e,t)},n}function gw(e,t,n){n=or(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Rf(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Rf(e,t),typeof r!="function"&&(qr===null?qr=new Set([this]):qr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function av(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new BC;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=t2.bind(null,e,t,n),t.then(e,e))}function lv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function uv(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=or(-1,1),t.tag=2,Wr(n,t,1))),n.lanes|=1),e)}var VC=pr.ReactCurrentOwner,Pt=!1;function gt(e,t,n,r){t.child=e===null?W1(t,null,n,r):io(t,e.child,n,r)}function cv(e,t,n,r,i){n=n.render;var s=t.ref;return Is(t,i),r=Dh(e,t,n,r,s,i),n=Fh(),e!==null&&!Pt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,dr(e,t,i)):(Ee&&n&&bh(t),t.flags|=1,gt(e,t,r,i),t.child)}function dv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Hh(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,vw(e,t,s,r,i)):(e=Kl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:ha,n(o,r)&&e.ref===t.ref)return dr(e,t,i)}return t.flags|=1,e=Gr(s,r),e.ref=t.ref,e.return=t,t.child=e}function vw(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(ha(s,r)&&e.ref===t.ref)if(Pt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Pt=!0);else return t.lanes=e.lanes,dr(e,t,i)}return Of(e,t,n,r,i)}function yw(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},xe(_s,Lt),Lt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,xe(_s,Lt),Lt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,xe(_s,Lt),Lt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,xe(_s,Lt),Lt|=r;return gt(e,t,i,n),t.child}function xw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Of(e,t,n,r,i){var s=At(n)?Bi:pt.current;return s=no(t,s),Is(t,i),n=Dh(e,t,n,r,s,i),r=Fh(),e!==null&&!Pt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,dr(e,t,i)):(Ee&&r&&bh(t),t.flags|=1,gt(e,t,n,i),t.child)}function fv(e,t,n,r,i){if(At(n)){var s=!0;gu(t)}else s=!1;if(Is(t,i),t.stateNode===null)Hl(e,t),hw(t,n,r),Af(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=an(u):(u=At(n)?Bi:pt.current,u=no(t,u));var d=n.getDerivedStateFromProps,c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&ov(t,o,r,u),Er=!1;var f=t.memoizedState;o.state=f,bu(t,r,o,i),l=t.memoizedState,a!==r||f!==l||jt.current||Er?(typeof d=="function"&&(jf(t,n,d,r),l=t.memoizedState),(a=Er||sv(t,n,a,r,f,l,u))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,K1(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:gn(t.type,a),o.props=u,c=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=an(l):(l=At(n)?Bi:pt.current,l=no(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==c||f!==l)&&ov(t,o,r,l),Er=!1,f=t.memoizedState,o.state=f,bu(t,r,o,i);var h=t.memoizedState;a!==c||f!==h||jt.current||Er?(typeof p=="function"&&(jf(t,n,p,r),h=t.memoizedState),(u=Er||sv(t,n,u,r,f,h,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,h,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,h,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),o.props=r,o.state=h,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Df(e,t,n,r,s,i)}function Df(e,t,n,r,i,s){xw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Xg(t,n,!1),dr(e,t,s);r=t.stateNode,VC.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=io(t,e.child,null,s),t.child=io(t,null,a,s)):gt(e,t,a,s),t.memoizedState=r.state,i&&Xg(t,n,!0),t.child}function ww(e){var t=e.stateNode;t.pendingContext?Yg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Yg(e,t.context,!1),jh(e,t.containerInfo)}function pv(e,t,n,r,i){return ro(),kh(i),t.flags|=256,gt(e,t,n,r),t.child}var Ff={dehydrated:null,treeContext:null,retryLane:0};function Nf(e){return{baseLanes:e,cachePool:null,transitions:null}}function bw(e,t,n){var r=t.pendingProps,i=_e.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),xe(_e,i&1),e===null)return _f(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=oc(o,r,0,null),e=Li(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Nf(n),t.memoizedState=Ff,e):Lh(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return UC(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Gr(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Gr(a,s):(s=Li(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Nf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Ff,r}return s=e.child,e=s.sibling,r=Gr(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Lh(e,t){return t=oc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function xl(e,t,n,r){return r!==null&&kh(r),io(t,e.child,null,n),e=Lh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function UC(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=hd(Error(N(422))),xl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=oc({mode:"visible",children:r.children},i,0,null),s=Li(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&io(t,e.child,null,o),t.child.memoizedState=Nf(o),t.memoizedState=Ff,s);if(!(t.mode&1))return xl(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(N(419)),r=hd(s,r,void 0),xl(e,t,o,r)}if(a=(o&e.childLanes)!==0,Pt||a){if(r=Ge,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,cr(e,i),kn(r,e,i,-1))}return Uh(),r=hd(Error(N(421))),xl(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=n2.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,It=Hr(i.nextSibling),Bt=t,Ee=!0,wn=null,e!==null&&(Jt[en++]=rr,Jt[en++]=ir,Jt[en++]=Vi,rr=e.id,ir=e.overflow,Vi=t),t=Lh(t,r.children),t.flags|=4096,t)}function hv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Pf(e.return,t,n)}function md(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Sw(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(gt(e,t,r.children,n),r=_e.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hv(e,n,t);else if(e.tag===19)hv(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(xe(_e,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Su(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),md(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Su(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}md(t,!0,n,null,s);break;case"together":md(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Hl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function dr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Hi|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(N(153));if(t.child!==null){for(e=t.child,n=Gr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Gr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function HC(e,t,n){switch(t.tag){case 3:ww(t),ro();break;case 5:G1(t);break;case 1:At(t.type)&&gu(t);break;case 4:jh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;xe(xu,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(xe(_e,_e.current&1),t.flags|=128,null):n&t.child.childLanes?bw(e,t,n):(xe(_e,_e.current&1),e=dr(e,t,n),e!==null?e.sibling:null);xe(_e,_e.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Sw(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),xe(_e,_e.current),r)break;return null;case 22:case 23:return t.lanes=0,yw(e,t,n)}return dr(e,t,n)}var kw,Mf,Ew,Tw;kw=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Mf=function(){};Ew=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ei($n.current);var s=null;switch(n){case"input":i=rf(e,i),r=rf(e,r),s=[];break;case"select":i=Ae({},i,{value:void 0}),r=Ae({},r,{value:void 0}),s=[];break;case"textarea":i=af(e,i),r=af(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=hu)}uf(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(aa.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(aa.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&be("scroll",e),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};Tw=function(e,t,n,r){n!==r&&(t.flags|=4)};function Oo(e,t){if(!Ee)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function WC(e,t,n){var r=t.pendingProps;switch(Sh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return At(t.type)&&mu(),lt(t),null;case 3:return r=t.stateNode,so(),ke(jt),ke(pt),Rh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(vl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,wn!==null&&(Hf(wn),wn=null))),Mf(e,t),lt(t),null;case 5:Ah(t);var i=Ei(xa.current);if(n=t.type,e!==null&&t.stateNode!=null)Ew(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(N(166));return lt(t),null}if(e=Ei($n.current),vl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Ln]=t,r[va]=s,e=(t.mode&1)!==0,n){case"dialog":be("cancel",r),be("close",r);break;case"iframe":case"object":case"embed":be("load",r);break;case"video":case"audio":for(i=0;i<zo.length;i++)be(zo[i],r);break;case"source":be("error",r);break;case"img":case"image":case"link":be("error",r),be("load",r);break;case"details":be("toggle",r);break;case"input":kg(r,s),be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},be("invalid",r);break;case"textarea":Tg(r,s),be("invalid",r)}uf(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&gl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&gl(r.textContent,a,e),i=["children",""+a]):aa.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&be("scroll",r)}switch(n){case"input":ll(r),Eg(r,s,!0);break;case"textarea":ll(r),Cg(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=hu)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Jx(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Ln]=t,e[va]=r,kw(e,t,!1,!1),t.stateNode=e;e:{switch(o=cf(n,r),n){case"dialog":be("cancel",e),be("close",e),i=r;break;case"iframe":case"object":case"embed":be("load",e),i=r;break;case"video":case"audio":for(i=0;i<zo.length;i++)be(zo[i],e);i=r;break;case"source":be("error",e),i=r;break;case"img":case"image":case"link":be("error",e),be("load",e),i=r;break;case"details":be("toggle",e),i=r;break;case"input":kg(e,r),i=rf(e,r),be("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ae({},r,{value:void 0}),be("invalid",e);break;case"textarea":Tg(e,r),i=af(e,r),be("invalid",e);break;default:i=r}uf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?n1(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&e1(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&la(e,l):typeof l=="number"&&la(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(aa.hasOwnProperty(s)?l!=null&&s==="onScroll"&&be("scroll",e):l!=null&&ah(e,s,l,o))}switch(n){case"input":ll(e),Eg(e,r,!1);break;case"textarea":ll(e),Cg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ei(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Fs(e,!!r.multiple,s,!1):r.defaultValue!=null&&Fs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=hu)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return lt(t),null;case 6:if(e&&t.stateNode!=null)Tw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(N(166));if(n=Ei(xa.current),Ei($n.current),vl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ln]=t,(s=r.nodeValue!==n)&&(e=Bt,e!==null))switch(e.tag){case 3:gl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&gl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ln]=t,t.stateNode=r}return lt(t),null;case 13:if(ke(_e),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ee&&It!==null&&t.mode&1&&!(t.flags&128))U1(),ro(),t.flags|=98560,s=!1;else if(s=vl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(N(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(N(317));s[Ln]=t}else ro(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lt(t),s=!1}else wn!==null&&(Hf(wn),wn=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||_e.current&1?Ve===0&&(Ve=3):Uh())),t.updateQueue!==null&&(t.flags|=4),lt(t),null);case 4:return so(),Mf(e,t),e===null&&ma(t.stateNode.containerInfo),lt(t),null;case 10:return Ch(t.type._context),lt(t),null;case 17:return At(t.type)&&mu(),lt(t),null;case 19:if(ke(_e),s=t.memoizedState,s===null)return lt(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Oo(s,!1);else{if(Ve!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Su(e),o!==null){for(t.flags|=128,Oo(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return xe(_e,_e.current&1|2),t.child}e=e.sibling}s.tail!==null&&Me()>ao&&(t.flags|=128,r=!0,Oo(s,!1),t.lanes=4194304)}else{if(!r)if(e=Su(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Oo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ee)return lt(t),null}else 2*Me()-s.renderingStartTime>ao&&n!==1073741824&&(t.flags|=128,r=!0,Oo(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Me(),t.sibling=null,n=_e.current,xe(_e,r?n&1|2:n&1),t):(lt(t),null);case 22:case 23:return Vh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Lt&1073741824&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function qC(e,t){switch(Sh(t),t.tag){case 1:return At(t.type)&&mu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return so(),ke(jt),ke(pt),Rh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ah(t),null;case 13:if(ke(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));ro()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(_e),null;case 4:return so(),null;case 10:return Ch(t.type._context),null;case 22:case 23:return Vh(),null;case 24:return null;default:return null}}var wl=!1,dt=!1,KC=typeof WeakSet=="function"?WeakSet:Set,z=null;function Cs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){De(e,t,r)}else n.current=null}function Lf(e,t,n){try{n()}catch(r){De(e,t,r)}}var mv=!1;function GC(e,t){if(wf=du,e=A1(),wh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var p;c!==n||i!==0&&c.nodeType!==3||(a=o+i),c!==s||r!==0&&c.nodeType!==3||(l=o+r),c.nodeType===3&&(o+=c.nodeValue.length),(p=c.firstChild)!==null;)f=c,c=p;for(;;){if(c===e)break t;if(f===n&&++u===i&&(a=o),f===s&&++d===r&&(l=o),(p=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(bf={focusedElem:e,selectionRange:n},du=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var v=h.memoizedProps,b=h.memoizedState,m=t.stateNode,x=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:gn(t.type,v),b);m.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(E){De(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return h=mv,mv=!1,h}function Xo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Lf(t,n,s)}i=i.next}while(i!==r)}}function ic(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function If(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Cw(e){var t=e.alternate;t!==null&&(e.alternate=null,Cw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ln],delete t[va],delete t[Ef],delete t[AC],delete t[RC])),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 _w(e){return e.tag===5||e.tag===3||e.tag===4}function gv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_w(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 $f(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=hu));else if(r!==4&&(e=e.child,e!==null))for($f(e,t,n),e=e.sibling;e!==null;)$f(e,t,n),e=e.sibling}function zf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(zf(e,t,n),e=e.sibling;e!==null;)zf(e,t,n),e=e.sibling}var tt=null,yn=!1;function wr(e,t,n){for(n=n.child;n!==null;)Pw(e,t,n),n=n.sibling}function Pw(e,t,n){if(In&&typeof In.onCommitFiberUnmount=="function")try{In.onCommitFiberUnmount(Yu,n)}catch{}switch(n.tag){case 5:dt||Cs(n,t);case 6:var r=tt,i=yn;tt=null,wr(e,t,n),tt=r,yn=i,tt!==null&&(yn?(e=tt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):tt.removeChild(n.stateNode));break;case 18:tt!==null&&(yn?(e=tt,n=n.stateNode,e.nodeType===8?ld(e.parentNode,n):e.nodeType===1&&ld(e,n),fa(e)):ld(tt,n.stateNode));break;case 4:r=tt,i=yn,tt=n.stateNode.containerInfo,yn=!0,wr(e,t,n),tt=r,yn=i;break;case 0:case 11:case 14:case 15:if(!dt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Lf(n,t,o),i=i.next}while(i!==r)}wr(e,t,n);break;case 1:if(!dt&&(Cs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){De(n,t,a)}wr(e,t,n);break;case 21:wr(e,t,n);break;case 22:n.mode&1?(dt=(r=dt)||n.memoizedState!==null,wr(e,t,n),dt=r):wr(e,t,n);break;default:wr(e,t,n)}}function vv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new KC),t.forEach(function(r){var i=r2.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function pn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:tt=a.stateNode,yn=!1;break e;case 3:tt=a.stateNode.containerInfo,yn=!0;break e;case 4:tt=a.stateNode.containerInfo,yn=!0;break e}a=a.return}if(tt===null)throw Error(N(160));Pw(s,o,i),tt=null,yn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){De(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)jw(t,e),t=t.sibling}function jw(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(pn(t,e),Pn(e),r&4){try{Xo(3,e,e.return),ic(3,e)}catch(v){De(e,e.return,v)}try{Xo(5,e,e.return)}catch(v){De(e,e.return,v)}}break;case 1:pn(t,e),Pn(e),r&512&&n!==null&&Cs(n,n.return);break;case 5:if(pn(t,e),Pn(e),r&512&&n!==null&&Cs(n,n.return),e.flags&32){var i=e.stateNode;try{la(i,"")}catch(v){De(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&Xx(i,s),cf(a,o);var u=cf(a,s);for(o=0;o<l.length;o+=2){var d=l[o],c=l[o+1];d==="style"?n1(i,c):d==="dangerouslySetInnerHTML"?e1(i,c):d==="children"?la(i,c):ah(i,d,c,u)}switch(a){case"input":sf(i,s);break;case"textarea":Zx(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Fs(i,!!s.multiple,p,!1):f!==!!s.multiple&&(s.defaultValue!=null?Fs(i,!!s.multiple,s.defaultValue,!0):Fs(i,!!s.multiple,s.multiple?[]:"",!1))}i[va]=s}catch(v){De(e,e.return,v)}}break;case 6:if(pn(t,e),Pn(e),r&4){if(e.stateNode===null)throw Error(N(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(v){De(e,e.return,v)}}break;case 3:if(pn(t,e),Pn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{fa(t.containerInfo)}catch(v){De(e,e.return,v)}break;case 4:pn(t,e),Pn(e);break;case 13:pn(t,e),Pn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(zh=Me())),r&4&&vv(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(dt=(u=dt)||d,pn(t,e),dt=u):pn(t,e),Pn(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(z=e,d=e.child;d!==null;){for(c=z=d;z!==null;){switch(f=z,p=f.child,f.tag){case 0:case 11:case 14:case 15:Xo(4,f,f.return);break;case 1:Cs(f,f.return);var h=f.stateNode;if(typeof h.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(v){De(r,n,v)}}break;case 5:Cs(f,f.return);break;case 22:if(f.memoizedState!==null){xv(c);continue}}p!==null?(p.return=f,z=p):xv(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{i=c.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=c.stateNode,l=c.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=t1("display",o))}catch(v){De(e,e.return,v)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(v){De(e,e.return,v)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:pn(t,e),Pn(e),r&4&&vv(e);break;case 21:break;default:pn(t,e),Pn(e)}}function Pn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(_w(n)){var r=n;break e}n=n.return}throw Error(N(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(la(i,""),r.flags&=-33);var s=gv(e);zf(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=gv(e);$f(e,a,o);break;default:throw Error(N(161))}}catch(l){De(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function QC(e,t,n){z=e,Aw(e)}function Aw(e,t,n){for(var r=(e.mode&1)!==0;z!==null;){var i=z,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||wl;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||dt;a=wl;var u=dt;if(wl=o,(dt=l)&&!u)for(z=i;z!==null;)o=z,l=o.child,o.tag===22&&o.memoizedState!==null?wv(i):l!==null?(l.return=o,z=l):wv(i);for(;s!==null;)z=s,Aw(s),s=s.sibling;z=i,wl=a,dt=u}yv(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,z=s):yv(e)}}function yv(e){for(;z!==null;){var t=z;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:dt||ic(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!dt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:gn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&nv(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}nv(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&fa(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(N(163))}dt||t.flags&512&&If(t)}catch(f){De(t,t.return,f)}}if(t===e){z=null;break}if(n=t.sibling,n!==null){n.return=t.return,z=n;break}z=t.return}}function xv(e){for(;z!==null;){var t=z;if(t===e){z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,z=n;break}z=t.return}}function wv(e){for(;z!==null;){var t=z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ic(4,t)}catch(l){De(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){De(t,i,l)}}var s=t.return;try{If(t)}catch(l){De(t,s,l)}break;case 5:var o=t.return;try{If(t)}catch(l){De(t,o,l)}}}catch(l){De(t,t.return,l)}if(t===e){z=null;break}var a=t.sibling;if(a!==null){a.return=t.return,z=a;break}z=t.return}}var YC=Math.ceil,Tu=pr.ReactCurrentDispatcher,Ih=pr.ReactCurrentOwner,sn=pr.ReactCurrentBatchConfig,ce=0,Ge=null,Le=null,it=0,Lt=0,_s=oi(0),Ve=0,ka=null,Hi=0,sc=0,$h=0,Zo=null,Ct=null,zh=0,ao=1/0,Jn=null,Cu=!1,Bf=null,qr=null,bl=!1,Ir=null,_u=0,Jo=0,Vf=null,Wl=-1,ql=0;function yt(){return ce&6?Me():Wl!==-1?Wl:Wl=Me()}function Kr(e){return e.mode&1?ce&2&&it!==0?it&-it:DC.transition!==null?(ql===0&&(ql=h1()),ql):(e=pe,e!==0||(e=window.event,e=e===void 0?16:b1(e.type)),e):1}function kn(e,t,n,r){if(50<Jo)throw Jo=0,Vf=null,Error(N(185));Ha(e,n,r),(!(ce&2)||e!==Ge)&&(e===Ge&&(!(ce&2)&&(sc|=n),Ve===4&&_r(e,it)),Rt(e,r),n===1&&ce===0&&!(t.mode&1)&&(ao=Me()+500,tc&&ai()))}function Rt(e,t){var n=e.callbackNode;DT(e,t);var r=cu(e,e===Ge?it:0);if(r===0)n!==null&&jg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&jg(n),t===1)e.tag===0?OC(bv.bind(null,e)):z1(bv.bind(null,e)),PC(function(){!(ce&6)&&ai()}),n=null;else{switch(m1(r)){case 1:n=fh;break;case 4:n=f1;break;case 16:n=uu;break;case 536870912:n=p1;break;default:n=uu}n=Iw(n,Rw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Rw(e,t){if(Wl=-1,ql=0,ce&6)throw Error(N(327));var n=e.callbackNode;if($s()&&e.callbackNode!==n)return null;var r=cu(e,e===Ge?it:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Pu(e,r);else{t=r;var i=ce;ce|=2;var s=Dw();(Ge!==e||it!==t)&&(Jn=null,ao=Me()+500,Mi(e,t));do try{JC();break}catch(a){Ow(e,a)}while(!0);Th(),Tu.current=s,ce=i,Le!==null?t=0:(Ge=null,it=0,t=Ve)}if(t!==0){if(t===2&&(i=mf(e),i!==0&&(r=i,t=Uf(e,i))),t===1)throw n=ka,Mi(e,0),_r(e,r),Rt(e,Me()),n;if(t===6)_r(e,r);else{if(i=e.current.alternate,!(r&30)&&!XC(i)&&(t=Pu(e,r),t===2&&(s=mf(e),s!==0&&(r=s,t=Uf(e,s))),t===1))throw n=ka,Mi(e,0),_r(e,r),Rt(e,Me()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(N(345));case 2:vi(e,Ct,Jn);break;case 3:if(_r(e,r),(r&130023424)===r&&(t=zh+500-Me(),10<t)){if(cu(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){yt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=kf(vi.bind(null,e,Ct,Jn),t);break}vi(e,Ct,Jn);break;case 4:if(_r(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Sn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*YC(r/1960))-r,10<r){e.timeoutHandle=kf(vi.bind(null,e,Ct,Jn),r);break}vi(e,Ct,Jn);break;case 5:vi(e,Ct,Jn);break;default:throw Error(N(329))}}}return Rt(e,Me()),e.callbackNode===n?Rw.bind(null,e):null}function Uf(e,t){var n=Zo;return e.current.memoizedState.isDehydrated&&(Mi(e,t).flags|=256),e=Pu(e,t),e!==2&&(t=Ct,Ct=n,t!==null&&Hf(t)),e}function Hf(e){Ct===null?Ct=e:Ct.push.apply(Ct,e)}function XC(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!En(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _r(e,t){for(t&=~$h,t&=~sc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Sn(t),r=1<<n;e[n]=-1,t&=~r}}function bv(e){if(ce&6)throw Error(N(327));$s();var t=cu(e,0);if(!(t&1))return Rt(e,Me()),null;var n=Pu(e,t);if(e.tag!==0&&n===2){var r=mf(e);r!==0&&(t=r,n=Uf(e,r))}if(n===1)throw n=ka,Mi(e,0),_r(e,t),Rt(e,Me()),n;if(n===6)throw Error(N(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,vi(e,Ct,Jn),Rt(e,Me()),null}function Bh(e,t){var n=ce;ce|=1;try{return e(t)}finally{ce=n,ce===0&&(ao=Me()+500,tc&&ai())}}function Wi(e){Ir!==null&&Ir.tag===0&&!(ce&6)&&$s();var t=ce;ce|=1;var n=sn.transition,r=pe;try{if(sn.transition=null,pe=1,e)return e()}finally{pe=r,sn.transition=n,ce=t,!(ce&6)&&ai()}}function Vh(){Lt=_s.current,ke(_s)}function Mi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,_C(n)),Le!==null)for(n=Le.return;n!==null;){var r=n;switch(Sh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&mu();break;case 3:so(),ke(jt),ke(pt),Rh();break;case 5:Ah(r);break;case 4:so();break;case 13:ke(_e);break;case 19:ke(_e);break;case 10:Ch(r.type._context);break;case 22:case 23:Vh()}n=n.return}if(Ge=e,Le=e=Gr(e.current,null),it=Lt=t,Ve=0,ka=null,$h=sc=Hi=0,Ct=Zo=null,ki!==null){for(t=0;t<ki.length;t++)if(n=ki[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}ki=null}return e}function Ow(e,t){do{var n=Le;try{if(Th(),Vl.current=Eu,ku){for(var r=je.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}ku=!1}if(Ui=0,Ke=ze=je=null,Yo=!1,wa=0,Ih.current=null,n===null||n.return===null){Ve=1,ka=t,Le=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=it,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,c=d.tag;if(!(d.mode&1)&&(c===0||c===11||c===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=lv(o);if(p!==null){p.flags&=-257,uv(p,o,a,s,t),p.mode&1&&av(s,u,t),t=p,l=u;var h=t.updateQueue;if(h===null){var v=new Set;v.add(l),t.updateQueue=v}else h.add(l);break e}else{if(!(t&1)){av(s,u,t),Uh();break e}l=Error(N(426))}}else if(Ee&&a.mode&1){var b=lv(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),uv(b,o,a,s,t),kh(oo(l,a));break e}}s=l=oo(l,a),Ve!==4&&(Ve=2),Zo===null?Zo=[s]:Zo.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var m=mw(s,l,t);tv(s,m);break e;case 1:a=l;var x=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(qr===null||!qr.has(w)))){s.flags|=65536,t&=-t,s.lanes|=t;var E=gw(s,a,t);tv(s,E);break e}}s=s.return}while(s!==null)}Nw(n)}catch(T){t=T,Le===n&&n!==null&&(Le=n=n.return);continue}break}while(!0)}function Dw(){var e=Tu.current;return Tu.current=Eu,e===null?Eu:e}function Uh(){(Ve===0||Ve===3||Ve===2)&&(Ve=4),Ge===null||!(Hi&268435455)&&!(sc&268435455)||_r(Ge,it)}function Pu(e,t){var n=ce;ce|=2;var r=Dw();(Ge!==e||it!==t)&&(Jn=null,Mi(e,t));do try{ZC();break}catch(i){Ow(e,i)}while(!0);if(Th(),ce=n,Tu.current=r,Le!==null)throw Error(N(261));return Ge=null,it=0,Ve}function ZC(){for(;Le!==null;)Fw(Le)}function JC(){for(;Le!==null&&!ET();)Fw(Le)}function Fw(e){var t=Lw(e.alternate,e,Lt);e.memoizedProps=e.pendingProps,t===null?Nw(e):Le=t,Ih.current=null}function Nw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=qC(n,t),n!==null){n.flags&=32767,Le=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ve=6,Le=null;return}}else if(n=WC(n,t,Lt),n!==null){Le=n;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);Ve===0&&(Ve=5)}function vi(e,t,n){var r=pe,i=sn.transition;try{sn.transition=null,pe=1,e2(e,t,n,r)}finally{sn.transition=i,pe=r}return null}function e2(e,t,n,r){do $s();while(Ir!==null);if(ce&6)throw Error(N(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(N(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(FT(e,s),e===Ge&&(Le=Ge=null,it=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||bl||(bl=!0,Iw(uu,function(){return $s(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=sn.transition,sn.transition=null;var o=pe;pe=1;var a=ce;ce|=4,Ih.current=null,GC(e,n),jw(n,e),wC(bf),du=!!wf,bf=wf=null,e.current=n,QC(n),TT(),ce=a,pe=o,sn.transition=s}else e.current=n;if(bl&&(bl=!1,Ir=e,_u=i),s=e.pendingLanes,s===0&&(qr=null),PT(n.stateNode),Rt(e,Me()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Cu)throw Cu=!1,e=Bf,Bf=null,e;return _u&1&&e.tag!==0&&$s(),s=e.pendingLanes,s&1?e===Vf?Jo++:(Jo=0,Vf=e):Jo=0,ai(),null}function $s(){if(Ir!==null){var e=m1(_u),t=sn.transition,n=pe;try{if(sn.transition=null,pe=16>e?16:e,Ir===null)var r=!1;else{if(e=Ir,Ir=null,_u=0,ce&6)throw Error(N(331));var i=ce;for(ce|=4,z=e.current;z!==null;){var s=z,o=s.child;if(z.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(z=u;z!==null;){var d=z;switch(d.tag){case 0:case 11:case 15:Xo(8,d,s)}var c=d.child;if(c!==null)c.return=d,z=c;else for(;z!==null;){d=z;var f=d.sibling,p=d.return;if(Cw(d),d===u){z=null;break}if(f!==null){f.return=p,z=f;break}z=p}}}var h=s.alternate;if(h!==null){var v=h.child;if(v!==null){h.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}z=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,z=o;else e:for(;z!==null;){if(s=z,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Xo(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,z=m;break e}z=s.return}}var x=e.current;for(z=x;z!==null;){o=z;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,z=w;else e:for(o=x;z!==null;){if(a=z,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ic(9,a)}}catch(T){De(a,a.return,T)}if(a===o){z=null;break e}var E=a.sibling;if(E!==null){E.return=a.return,z=E;break e}z=a.return}}if(ce=i,ai(),In&&typeof In.onPostCommitFiberRoot=="function")try{In.onPostCommitFiberRoot(Yu,e)}catch{}r=!0}return r}finally{pe=n,sn.transition=t}}return!1}function Sv(e,t,n){t=oo(n,t),t=mw(e,t,1),e=Wr(e,t,1),t=yt(),e!==null&&(Ha(e,1,t),Rt(e,t))}function De(e,t,n){if(e.tag===3)Sv(e,e,n);else for(;t!==null;){if(t.tag===3){Sv(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(qr===null||!qr.has(r))){e=oo(n,e),e=gw(t,e,1),t=Wr(t,e,1),e=yt(),t!==null&&(Ha(t,1,e),Rt(t,e));break}}t=t.return}}function t2(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=yt(),e.pingedLanes|=e.suspendedLanes&n,Ge===e&&(it&n)===n&&(Ve===4||Ve===3&&(it&130023424)===it&&500>Me()-zh?Mi(e,0):$h|=n),Rt(e,t)}function Mw(e,t){t===0&&(e.mode&1?(t=dl,dl<<=1,!(dl&130023424)&&(dl=4194304)):t=1);var n=yt();e=cr(e,t),e!==null&&(Ha(e,t,n),Rt(e,n))}function n2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mw(e,n)}function r2(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(N(314))}r!==null&&r.delete(t),Mw(e,n)}var Lw;Lw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||jt.current)Pt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Pt=!1,HC(e,t,n);Pt=!!(e.flags&131072)}else Pt=!1,Ee&&t.flags&1048576&&B1(t,yu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hl(e,t),e=t.pendingProps;var i=no(t,pt.current);Is(t,n),i=Dh(null,t,r,e,i,n);var s=Fh();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,At(r)?(s=!0,gu(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ph(t),i.updater=rc,t.stateNode=i,i._reactInternals=t,Af(t,r,e,n),t=Df(null,t,r,!0,s,n)):(t.tag=0,Ee&&s&&bh(t),gt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=s2(r),e=gn(r,e),i){case 0:t=Of(null,t,r,e,n);break e;case 1:t=fv(null,t,r,e,n);break e;case 11:t=cv(null,t,r,e,n);break e;case 14:t=dv(null,t,r,gn(r.type,e),n);break e}throw Error(N(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:gn(r,i),Of(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:gn(r,i),fv(e,t,r,i,n);case 3:e:{if(ww(t),e===null)throw Error(N(387));r=t.pendingProps,s=t.memoizedState,i=s.element,K1(e,t),bu(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=oo(Error(N(423)),t),t=pv(e,t,r,n,i);break e}else if(r!==i){i=oo(Error(N(424)),t),t=pv(e,t,r,n,i);break e}else for(It=Hr(t.stateNode.containerInfo.firstChild),Bt=t,Ee=!0,wn=null,n=W1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ro(),r===i){t=dr(e,t,n);break e}gt(e,t,r,n)}t=t.child}return t;case 5:return G1(t),e===null&&_f(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Sf(r,i)?o=null:s!==null&&Sf(r,s)&&(t.flags|=32),xw(e,t),gt(e,t,o,n),t.child;case 6:return e===null&&_f(t),null;case 13:return bw(e,t,n);case 4:return jh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=io(t,null,r,n):gt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:gn(r,i),cv(e,t,r,i,n);case 7:return gt(e,t,t.pendingProps,n),t.child;case 8:return gt(e,t,t.pendingProps.children,n),t.child;case 12:return gt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,xe(xu,r._currentValue),r._currentValue=o,s!==null)if(En(s.value,o)){if(s.children===i.children&&!jt.current){t=dr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=or(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Pf(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(N(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Pf(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}gt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Is(t,n),i=an(i),r=r(i),t.flags|=1,gt(e,t,r,n),t.child;case 14:return r=t.type,i=gn(r,t.pendingProps),i=gn(r.type,i),dv(e,t,r,i,n);case 15:return vw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:gn(r,i),Hl(e,t),t.tag=1,At(r)?(e=!0,gu(t)):e=!1,Is(t,n),hw(t,r,i),Af(t,r,i,n),Df(null,t,r,!0,e,n);case 19:return Sw(e,t,n);case 22:return yw(e,t,n)}throw Error(N(156,t.tag))};function Iw(e,t){return d1(e,t)}function i2(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(e,t,n,r){return new i2(e,t,n,r)}function Hh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function s2(e){if(typeof e=="function")return Hh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===uh)return 11;if(e===ch)return 14}return 2}function Gr(e,t){var n=e.alternate;return n===null?(n=nn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Kl(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Hh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case vs:return Li(n.children,i,s,t);case lh:o=8,i|=8;break;case Jd:return e=nn(12,n,t,i|2),e.elementType=Jd,e.lanes=s,e;case ef:return e=nn(13,n,t,i),e.elementType=ef,e.lanes=s,e;case tf:return e=nn(19,n,t,i),e.elementType=tf,e.lanes=s,e;case Gx:return oc(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case qx:o=10;break e;case Kx:o=9;break e;case uh:o=11;break e;case ch:o=14;break e;case kr:o=16,r=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=nn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Li(e,t,n,r){return e=nn(7,e,r,t),e.lanes=n,e}function oc(e,t,n,r){return e=nn(22,e,r,t),e.elementType=Gx,e.lanes=n,e.stateNode={isHidden:!1},e}function gd(e,t,n){return e=nn(6,e,null,t),e.lanes=n,e}function vd(e,t,n){return t=nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function o2(e,t,n,r,i){this.tag=t,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=Xc(0),this.expirationTimes=Xc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xc(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Wh(e,t,n,r,i,s,o,a,l){return e=new o2(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=nn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ph(s),e}function a2(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:gs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function $w(e){if(!e)return ti;e=e._reactInternals;e:{if(Xi(e)!==e||e.tag!==1)throw Error(N(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(At(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(N(171))}if(e.tag===1){var n=e.type;if(At(n))return $1(e,n,t)}return t}function zw(e,t,n,r,i,s,o,a,l){return e=Wh(n,r,!0,e,i,s,o,a,l),e.context=$w(null),n=e.current,r=yt(),i=Kr(n),s=or(r,i),s.callback=t??null,Wr(n,s,i),e.current.lanes=i,Ha(e,i,r),Rt(e,r),e}function ac(e,t,n,r){var i=t.current,s=yt(),o=Kr(i);return n=$w(n),t.context===null?t.context=n:t.pendingContext=n,t=or(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Wr(i,t,o),e!==null&&(kn(e,i,o,s),Bl(e,i,o)),o}function ju(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function kv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function qh(e,t){kv(e,t),(e=e.alternate)&&kv(e,t)}function l2(){return null}var Bw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Kh(e){this._internalRoot=e}lc.prototype.render=Kh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(N(409));ac(e,t,null,null)};lc.prototype.unmount=Kh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Wi(function(){ac(null,e,null,null)}),t[ur]=null}};function lc(e){this._internalRoot=e}lc.prototype.unstable_scheduleHydration=function(e){if(e){var t=y1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cr.length&&t!==0&&t<Cr[n].priority;n++);Cr.splice(n,0,e),n===0&&w1(e)}};function Gh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function uc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ev(){}function u2(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=ju(o);s.call(u)}}var o=zw(t,r,e,0,null,!1,!1,"",Ev);return e._reactRootContainer=o,e[ur]=o.current,ma(e.nodeType===8?e.parentNode:e),Wi(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=ju(l);a.call(u)}}var l=Wh(e,0,!1,null,null,!1,!1,"",Ev);return e._reactRootContainer=l,e[ur]=l.current,ma(e.nodeType===8?e.parentNode:e),Wi(function(){ac(t,l,n,r)}),l}function cc(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=ju(o);a.call(l)}}ac(t,o,e,i)}else o=u2(n,t,e,i,r);return ju(o)}g1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=$o(t.pendingLanes);n!==0&&(ph(t,n|1),Rt(t,Me()),!(ce&6)&&(ao=Me()+500,ai()))}break;case 13:Wi(function(){var r=cr(e,1);if(r!==null){var i=yt();kn(r,e,1,i)}}),qh(e,1)}};hh=function(e){if(e.tag===13){var t=cr(e,134217728);if(t!==null){var n=yt();kn(t,e,134217728,n)}qh(e,134217728)}};v1=function(e){if(e.tag===13){var t=Kr(e),n=cr(e,t);if(n!==null){var r=yt();kn(n,e,t,r)}qh(e,t)}};y1=function(){return pe};x1=function(e,t){var n=pe;try{return pe=e,t()}finally{pe=n}};ff=function(e,t,n){switch(t){case"input":if(sf(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ec(r);if(!i)throw Error(N(90));Yx(r),sf(r,i)}}}break;case"textarea":Zx(e,n);break;case"select":t=n.value,t!=null&&Fs(e,!!n.multiple,t,!1)}};s1=Bh;o1=Wi;var c2={usingClientEntryPoint:!1,Events:[qa,bs,ec,r1,i1,Bh]},Do={findFiberByHostInstance:Si,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},d2={bundleType:Do.bundleType,version:Do.version,rendererPackageName:Do.rendererPackageName,rendererConfig:Do.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:pr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=u1(e),e===null?null:e.stateNode},findFiberByHostInstance:Do.findFiberByHostInstance||l2,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sl.isDisabled&&Sl.supportsFiber)try{Yu=Sl.inject(d2),In=Sl}catch{}}Ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=c2;Ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Gh(t))throw Error(N(200));return a2(e,t,null,n)};Ut.createRoot=function(e,t){if(!Gh(e))throw Error(N(299));var n=!1,r="",i=Bw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Wh(e,1,!1,null,null,n,!1,r,i),e[ur]=t.current,ma(e.nodeType===8?e.parentNode:e),new Kh(t)};Ut.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(N(188)):(e=Object.keys(e).join(","),Error(N(268,e)));return e=u1(t),e=e===null?null:e.stateNode,e};Ut.flushSync=function(e){return Wi(e)};Ut.hydrate=function(e,t,n){if(!uc(t))throw Error(N(200));return cc(null,e,t,!0,n)};Ut.hydrateRoot=function(e,t,n){if(!Gh(e))throw Error(N(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=Bw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=zw(t,null,e,1,n??null,i,!1,s,o),e[ur]=t.current,ma(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new lc(t)};Ut.render=function(e,t,n){if(!uc(t))throw Error(N(200));return cc(null,e,t,!1,n)};Ut.unmountComponentAtNode=function(e){if(!uc(e))throw Error(N(40));return e._reactRootContainer?(Wi(function(){cc(null,null,e,!1,function(){e._reactRootContainer=null,e[ur]=null})}),!0):!1};Ut.unstable_batchedUpdates=Bh;Ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!uc(n))throw Error(N(200));if(e==null||e._reactInternals===void 0)throw Error(N(38));return cc(e,t,n,!1,r)};Ut.version="18.3.1-next-f1338f8080-20240426";function Vw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vw)}catch(e){console.error(e)}}Vw(),Vx.exports=Ut;var Uw=Vx.exports;const f2=Qi(Uw);var Hw,Tv=Uw;Hw=Tv.createRoot,Tv.hydrateRoot;const p2="@alfatech/livechat",h2="v2025.06.04.2",m2="module",g2="https://api-live.alfatek.dev",v2="wss://api-live.alfatek.dev",y2=["dist","README.md"],x2="dist/widget.js",w2={dev:"vite",build:"tsc -b && vite build",lint:"biome lint --write",prepare:"husky",format:"biome format --write && yarn lint"},b2={"@headlessui/react":"^2.2.2","@tailwindcss/vite":"^4.1.4","@tanstack/react-query":"^5.59.20",classnames:"^2.5.1",dayjs:"^1.11.13",formik:"^2.4.6","framer-motion":"^12.7.4","lucide-react":"^0.511.0",react:"^18.3.1","react-dom":"^18.3.1","react-dropzone":"^14.3.8","react-router-dom":"^6.26.2","socket.io-client":"^4.8.1",sonner:"^2.0.1",yup:"^1.4.0",zustand:"^4.5.5"},S2={"@biomejs/biome":"^1.8.3","@types/node":"^22.5.4","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","@vitejs/plugin-react-swc":"^3.5.0",globals:"^15.9.0",husky:"^9.1.5",tailwindcss:"^4.1.4",typescript:"^5.5.3",vite:"^5.4.1"},Ww={name:p2,private:!1,version:h2,type:m2,apiURL:g2,wsURL:v2,files:y2,main:x2,scripts:w2,dependencies:b2,devDependencies:S2,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},k2=Ww.apiURL,E2=Ww.wsURL,T2=e=>[{limit:Number.parseInt(e.headers.get("X-Ratelimit-Limit")||"0"),remaining:Number.parseInt(e.headers.get("X-Ratelimit-Remaining")||"0"),reset:Number.parseInt(e.headers.get("X-Ratelimit-Reset")||"0"),retryAfter:Number.parseInt(e.headers.get("Retry-After")||"0")},429],C2=(e,t)=>[{message:"message"in t?t.message:"Not Found"},404],_2={429:T2,404:C2};async function vo(e,t={}){const n={};!(t.body instanceof FormData)&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${k2}/${e}`,{...t,credentials:"include",headers:{...t.headers,...n}}).catch(s=>(console.log("err::",s),new Response(null,{status:500})));if(!r.ok){let s={};try{return s=await r.json(),[s,r.status]}catch{console.log("response: ",r)}const o=_2[r.status];return o?o(r,s):[{},r.status]}const i=r.headers.get("Content-Type");return i&&i.includes("application/json")?[await r.json(),r.status]:[await r.text(),r.status]}const dc=e=>[200,201,204].includes(e),P2=(e,{arrayWithBrackets:t=!1,arrayWithBracketAndIndex:n=!0}={})=>{const r=new FormData;for(const[i,s]of Object.entries(e)){if(Array.isArray(s)){for(const o in s)t?r.append(`${i}[]`,s[o]):n?r.append(`${i}[${o}]`,s[o]):r.append(i,s[o]);continue}typeof s<"u"&&s!==null&&r.append(i,s)}return r};var yo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},qi=typeof window>"u"||"Deno"in globalThis;function Zt(){}function j2(e,t){return typeof e=="function"?e(t):e}function Wf(e){return typeof e=="number"&&e>=0&&e!==1/0}function qw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zs(e,t){return typeof e=="function"?e(t):e}function bn(e,t){return typeof e=="function"?e(t):e}function Cv(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==Qh(o,t.options))return!1}else if(!Ea(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function _v(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Ki(t.options.mutationKey)!==Ki(s))return!1}else if(!Ea(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Qh(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ki)(e)}function Ki(e){return JSON.stringify(e,(t,n)=>qf(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ea(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ea(e[n],t[n])):!1}function Kw(e,t){if(e===t)return e;const n=Pv(e)&&Pv(t);if(n||qf(e)&&qf(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{};let l=0;for(let u=0;u<o;u++){const d=n?u:s[u];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,l++):(a[d]=Kw(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function Au(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Pv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qf(e){if(!jv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!jv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function jv(e){return Object.prototype.toString.call(e)==="[object Object]"}function A2(e){return new Promise(t=>{setTimeout(t,e)})}function Kf(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Kw(e,t):t}function R2(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function O2(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Yh=Symbol();function Gw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Yh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var ji,Pr,Vs,bx,D2=(bx=class extends yo{constructor(){super();q(this,ji);q(this,Pr);q(this,Vs);$(this,Vs,t=>{if(!qi&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){k(this,Pr)||this.setEventListener(k(this,Vs))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Pr))==null||t.call(this),$(this,Pr,void 0))}setEventListener(t){var n;$(this,Vs,t),(n=k(this,Pr))==null||n.call(this),$(this,Pr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){k(this,ji)!==t&&($(this,ji,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof k(this,ji)=="boolean"?k(this,ji):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ji=new WeakMap,Pr=new WeakMap,Vs=new WeakMap,bx),Xh=new D2,Us,jr,Hs,Sx,F2=(Sx=class extends yo{constructor(){super();q(this,Us,!0);q(this,jr);q(this,Hs);$(this,Hs,t=>{if(!qi&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){k(this,jr)||this.setEventListener(k(this,Hs))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,jr))==null||t.call(this),$(this,jr,void 0))}setEventListener(t){var n;$(this,Hs,t),(n=k(this,jr))==null||n.call(this),$(this,jr,t(this.setOnline.bind(this)))}setOnline(t){k(this,Us)!==t&&($(this,Us,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return k(this,Us)}},Us=new WeakMap,jr=new WeakMap,Hs=new WeakMap,Sx),Ru=new F2;function Gf(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function N2(e){return Math.min(1e3*2**e,3e4)}function Qw(e){return(e??"online")==="online"?Ru.isOnline():!0}var Yw=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function yd(e){return e instanceof Yw}function Xw(e){let t=!1,n=0,r=!1,i;const s=Gf(),o=v=>{var b;r||(f(new Yw(v)),(b=e.abort)==null||b.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Xh.isFocused()&&(e.networkMode==="always"||Ru.isOnline())&&e.canRun(),d=()=>Qw(e.networkMode)&&e.canRun(),c=v=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,v),i==null||i(),s.resolve(v))},f=v=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,v),i==null||i(),s.reject(v))},p=()=>new Promise(v=>{var b;i=m=>{(r||u())&&v(m)},(b=e.onPause)==null||b.call(e)}).then(()=>{var v;i=void 0,r||(v=e.onContinue)==null||v.call(e)}),h=()=>{if(r)return;let v;const b=n===0?e.initialPromise:void 0;try{v=b??e.fn()}catch(m){v=Promise.reject(m)}Promise.resolve(v).then(c).catch(m=>{var C;if(r)return;const x=e.retry??(qi?0:3),w=e.retryDelay??N2,E=typeof w=="function"?w(n,m):w,T=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,m);if(t||!T){f(m);return}n++,(C=e.onFail)==null||C.call(e,n,m),A2(E).then(()=>u()?void 0:p()).then(()=>{t?f(m):h()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?h():p().then(h),s)}}function M2(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var Be=M2(),Ai,kx,Zw=(kx=class{constructor(){q(this,Ai)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wf(this.gcTime)&&$(this,Ai,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qi?1/0:5*60*1e3))}clearGcTimeout(){k(this,Ai)&&(clearTimeout(k(this,Ai)),$(this,Ai,void 0))}},Ai=new WeakMap,kx),Ws,qs,Xt,ut,$a,Ri,vn,Zn,Ex,L2=(Ex=class extends Zw{constructor(t){super();q(this,vn);q(this,Ws);q(this,qs);q(this,Xt);q(this,ut);q(this,$a);q(this,Ri);$(this,Ri,!1),$(this,$a,t.defaultOptions),this.setOptions(t.options),this.observers=[],$(this,Xt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,$(this,Ws,I2(this.options)),this.state=t.state??k(this,Ws),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=k(this,ut))==null?void 0:t.promise}setOptions(t){this.options={...k(this,$a),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,Xt).remove(this)}setData(t,n){const r=Kf(this.state.data,t,this.options);return ie(this,vn,Zn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ie(this,vn,Zn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=k(this,ut))==null?void 0:r.promise;return(i=k(this,ut))==null||i.cancel(t),n?n.then(Zt).catch(Zt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(k(this,Ws))}isActive(){return this.observers.some(t=>bn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Yh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!qw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,ut))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,ut))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),k(this,Xt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(k(this,ut)&&(k(this,Ri)?k(this,ut).cancel({revert:!0}):k(this,ut).cancelRetry()),this.scheduleGc()),k(this,Xt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ie(this,vn,Zn).call(this,{type:"invalidate"})}fetch(t,n){var l,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(k(this,ut))return k(this,ut).continueRetry(),k(this,ut).promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>($(this,Ri,!0),r.signal)})},s=()=>{const c=Gw(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),$(this,Ri,!1),this.options.persister?this.options.persister(c,f,this):c(f)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),$(this,qs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&ie(this,vn,Zn).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=c=>{var f,p,h,v;yd(c)&&c.silent||ie(this,vn,Zn).call(this,{type:"error",error:c}),yd(c)||((p=(f=k(this,Xt).config).onError)==null||p.call(f,c,this),(v=(h=k(this,Xt).config).onSettled)==null||v.call(h,this.state.data,c,this)),this.scheduleGc()};return $(this,ut,Xw({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var f,p,h,v;if(c===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(b){a(b);return}(p=(f=k(this,Xt).config).onSuccess)==null||p.call(f,c,this),(v=(h=k(this,Xt).config).onSettled)==null||v.call(h,c,this.state.error,this),this.scheduleGc()},onError:a,onFail:(c,f)=>{ie(this,vn,Zn).call(this,{type:"failed",failureCount:c,error:f})},onPause:()=>{ie(this,vn,Zn).call(this,{type:"pause"})},onContinue:()=>{ie(this,vn,Zn).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),k(this,ut).start()}},Ws=new WeakMap,qs=new WeakMap,Xt=new WeakMap,ut=new WeakMap,$a=new WeakMap,Ri=new WeakMap,vn=new WeakSet,Zn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Jw(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return yd(i)&&i.revert&&k(this,qs)?{...k(this,qs),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Be.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),k(this,Xt).notify({query:this,type:"updated",action:t})})},Ex);function Jw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Qw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function I2(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Dn,Tx,$2=(Tx=class extends yo{constructor(t={}){super();q(this,Dn);this.config=t,$(this,Dn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??Qh(i,n);let o=this.get(s);return o||(o=new L2({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){k(this,Dn).has(t.queryHash)||(k(this,Dn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=k(this,Dn).get(t.queryHash);n&&(t.destroy(),n===t&&k(this,Dn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Be.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return k(this,Dn).get(t)}getAll(){return[...k(this,Dn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Cv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Cv(t,r)):n}notify(t){Be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Be.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Be.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Dn=new WeakMap,Tx),Fn,ht,Oi,Nn,br,Cx,z2=(Cx=class extends Zw{constructor(t){super();q(this,Nn);q(this,Fn);q(this,ht);q(this,Oi);this.mutationId=t.mutationId,$(this,ht,t.mutationCache),$(this,Fn,[]),this.state=t.state||eb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){k(this,Fn).includes(t)||(k(this,Fn).push(t),this.clearGcTimeout(),k(this,ht).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){$(this,Fn,k(this,Fn).filter(n=>n!==t)),this.scheduleGc(),k(this,ht).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){k(this,Fn).length||(this.state.status==="pending"?this.scheduleGc():k(this,ht).remove(this))}continue(){var t;return((t=k(this,Oi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,u,d,c,f,p,h,v,b,m,x,w,E,T,C,S;$(this,Oi,Xw({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(_,j)=>{ie(this,Nn,br).call(this,{type:"failed",failureCount:_,error:j})},onPause:()=>{ie(this,Nn,br).call(this,{type:"pause"})},onContinue:()=>{ie(this,Nn,br).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,ht).canRun(this)}));const n=this.state.status==="pending",r=!k(this,Oi).canStart();try{if(!n){ie(this,Nn,br).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=k(this,ht).config).onMutate)==null?void 0:s.call(i,t,this));const j=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));j!==this.state.context&&ie(this,Nn,br).call(this,{type:"pending",context:j,variables:t,isPaused:r})}const _=await k(this,Oi).start();return await((u=(l=k(this,ht).config).onSuccess)==null?void 0:u.call(l,_,t,this.state.context,this)),await((c=(d=this.options).onSuccess)==null?void 0:c.call(d,_,t,this.state.context)),await((p=(f=k(this,ht).config).onSettled)==null?void 0:p.call(f,_,null,this.state.variables,this.state.context,this)),await((v=(h=this.options).onSettled)==null?void 0:v.call(h,_,null,t,this.state.context)),ie(this,Nn,br).call(this,{type:"success",data:_}),_}catch(_){try{throw await((m=(b=k(this,ht).config).onError)==null?void 0:m.call(b,_,t,this.state.context,this)),await((w=(x=this.options).onError)==null?void 0:w.call(x,_,t,this.state.context)),await((T=(E=k(this,ht).config).onSettled)==null?void 0:T.call(E,void 0,_,this.state.variables,this.state.context,this)),await((S=(C=this.options).onSettled)==null?void 0:S.call(C,void 0,_,t,this.state.context)),_}finally{ie(this,Nn,br).call(this,{type:"error",error:_})}}finally{k(this,ht).runNext(this)}}},Fn=new WeakMap,ht=new WeakMap,Oi=new WeakMap,Nn=new WeakSet,br=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Be.batch(()=>{k(this,Fn).forEach(r=>{r.onMutationUpdate(t)}),k(this,ht).notify({mutation:this,type:"updated",action:t})})},Cx);function eb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Mt,za,_x,B2=(_x=class extends yo{constructor(t={}){super();q(this,Mt);q(this,za);this.config=t,$(this,Mt,new Map),$(this,za,Date.now())}build(t,n,r){const i=new z2({mutationCache:this,mutationId:++sl(this,za)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=kl(t),r=k(this,Mt).get(n)??[];r.push(t),k(this,Mt).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=kl(t);if(k(this,Mt).has(n)){const i=(r=k(this,Mt).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?k(this,Mt).delete(n):k(this,Mt).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=k(this,Mt).get(kl(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=k(this,Mt).get(kl(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Be.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...k(this,Mt).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_v(n,r))}findAll(t={}){return this.getAll().filter(n=>_v(t,n))}notify(t){Be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Be.batch(()=>Promise.all(t.map(n=>n.continue().catch(Zt))))}},Mt=new WeakMap,za=new WeakMap,_x);function kl(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Av(e){return{onFetch:(t,n)=>{var d,c,f,p,h;const r=t.options,i=(f=(c=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],o=((h=t.state.data)==null?void 0:h.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let v=!1;const b=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},m=Gw(t.options,t.fetchOptions),x=async(w,E,T)=>{if(v)return Promise.reject();if(E==null&&w.pages.length)return Promise.resolve(w);const C={queryKey:t.queryKey,pageParam:E,direction:T?"backward":"forward",meta:t.options.meta};b(C);const S=await m(C),{maxPages:_}=t.options,j=T?O2:R2;return{pages:j(w.pages,S,_),pageParams:j(w.pageParams,E,_)}};if(i&&s.length){const w=i==="backward",E=w?V2:Rv,T={pages:s,pageParams:o},C=E(r,T);a=await x(T,C,w)}else{const w=e??s.length;do{const E=l===0?o[0]??r.initialPageParam:Rv(r,a);if(l>0&&E==null)break;a=await x(a,E),l++}while(l<w)}return a};t.options.persister?t.fetchFn=()=>{var v,b;return(b=(v=t.options).persister)==null?void 0:b.call(v,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Rv(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function V2(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Re,Ar,Rr,Ks,Gs,Or,Qs,Ys,Px,U2=(Px=class{constructor(e={}){q(this,Re);q(this,Ar);q(this,Rr);q(this,Ks);q(this,Gs);q(this,Or);q(this,Qs);q(this,Ys);$(this,Re,e.queryCache||new $2),$(this,Ar,e.mutationCache||new B2),$(this,Rr,e.defaultOptions||{}),$(this,Ks,new Map),$(this,Gs,new Map),$(this,Or,0)}mount(){sl(this,Or)._++,k(this,Or)===1&&($(this,Qs,Xh.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,Re).onFocus())})),$(this,Ys,Ru.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,Re).onOnline())})))}unmount(){var e,t;sl(this,Or)._--,k(this,Or)===0&&((e=k(this,Qs))==null||e.call(this),$(this,Qs,void 0),(t=k(this,Ys))==null||t.call(this),$(this,Ys,void 0))}isFetching(e){return k(this,Re).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,Ar).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,Re).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=k(this,Re).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(zs(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return k(this,Re).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=k(this,Re).get(r.queryHash),s=i==null?void 0:i.state.data,o=j2(t,s);if(o!==void 0)return k(this,Re).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Be.batch(()=>k(this,Re).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,Re).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=k(this,Re);Be.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=k(this,Re),r={type:"active",...e};return Be.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Be.batch(()=>k(this,Re).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Zt).catch(Zt)}invalidateQueries(e,t={}){return Be.batch(()=>{if(k(this,Re).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Be.batch(()=>k(this,Re).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Zt)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Zt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=k(this,Re).build(this,t);return n.isStaleByTime(zs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Zt).catch(Zt)}fetchInfiniteQuery(e){return e.behavior=Av(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Zt).catch(Zt)}ensureInfiniteQueryData(e){return e.behavior=Av(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ru.isOnline()?k(this,Ar).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,Re)}getMutationCache(){return k(this,Ar)}getDefaultOptions(){return k(this,Rr)}setDefaultOptions(e){$(this,Rr,e)}setQueryDefaults(e,t){k(this,Ks).set(Ki(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...k(this,Ks).values()],n={};return t.forEach(r=>{Ea(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){k(this,Gs).set(Ki(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...k(this,Gs).values()];let n={};return t.forEach(r=>{Ea(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...k(this,Rr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Qh(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===Yh&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,Rr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,Re).clear(),k(this,Ar).clear()}},Re=new WeakMap,Ar=new WeakMap,Rr=new WeakMap,Ks=new WeakMap,Gs=new WeakMap,Or=new WeakMap,Qs=new WeakMap,Ys=new WeakMap,Px),kt,ae,Ba,mt,Di,Xs,Dr,Mn,Va,Zs,Js,Fi,Ni,Fr,eo,de,Bo,Qf,Yf,Xf,Zf,Jf,ep,tp,tb,jx,H2=(jx=class extends yo{constructor(t,n){super();q(this,de);q(this,kt);q(this,ae);q(this,Ba);q(this,mt);q(this,Di);q(this,Xs);q(this,Dr);q(this,Mn);q(this,Va);q(this,Zs);q(this,Js);q(this,Fi);q(this,Ni);q(this,Fr);q(this,eo,new Set);this.options=n,$(this,kt,t),$(this,Mn,null),$(this,Dr,Gf()),this.options.experimental_prefetchInRender||k(this,Dr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,ae).addObserver(this),Ov(k(this,ae),this.options)?ie(this,de,Bo).call(this):this.updateResult(),ie(this,de,Zf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return np(k(this,ae),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return np(k(this,ae),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ie(this,de,Jf).call(this),ie(this,de,ep).call(this),k(this,ae).removeObserver(this)}setOptions(t,n){const r=this.options,i=k(this,ae);if(this.options=k(this,kt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof bn(this.options.enabled,k(this,ae))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ie(this,de,tp).call(this),k(this,ae).setOptions(this.options),r._defaulted&&!Au(this.options,r)&&k(this,kt).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,ae),observer:this});const s=this.hasListeners();s&&Dv(k(this,ae),i,this.options,r)&&ie(this,de,Bo).call(this),this.updateResult(n),s&&(k(this,ae)!==i||bn(this.options.enabled,k(this,ae))!==bn(r.enabled,k(this,ae))||zs(this.options.staleTime,k(this,ae))!==zs(r.staleTime,k(this,ae)))&&ie(this,de,Qf).call(this);const o=ie(this,de,Yf).call(this);s&&(k(this,ae)!==i||bn(this.options.enabled,k(this,ae))!==bn(r.enabled,k(this,ae))||o!==k(this,Fr))&&ie(this,de,Xf).call(this,o)}getOptimisticResult(t){const n=k(this,kt).getQueryCache().build(k(this,kt),t),r=this.createResult(n,t);return q2(this,r)&&($(this,mt,r),$(this,Xs,this.options),$(this,Di,k(this,ae).state)),r}getCurrentResult(){return k(this,mt)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){k(this,eo).add(t)}getCurrentQuery(){return k(this,ae)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=k(this,kt).defaultQueryOptions(t),r=k(this,kt).getQueryCache().build(k(this,kt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ie(this,de,Bo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,mt)))}createResult(t,n){var _;const r=k(this,ae),i=this.options,s=k(this,mt),o=k(this,Di),a=k(this,Xs),u=t!==r?t.state:k(this,Ba),{state:d}=t;let c={...d},f=!1,p;if(n._optimisticResults){const j=this.hasListeners(),R=!j&&Ov(t,n),L=j&&Dv(t,r,n,i);(R||L)&&(c={...c,...Jw(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:h,errorUpdatedAt:v,status:b}=c;if(n.select&&c.data!==void 0)if(s&&c.data===(o==null?void 0:o.data)&&n.select===k(this,Va))p=k(this,Zs);else try{$(this,Va,n.select),p=n.select(c.data),p=Kf(s==null?void 0:s.data,p,n),$(this,Zs,p),$(this,Mn,null)}catch(j){$(this,Mn,j)}else p=c.data;if(n.placeholderData!==void 0&&p===void 0&&b==="pending"){let j;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))j=s.data;else if(j=typeof n.placeholderData=="function"?n.placeholderData((_=k(this,Js))==null?void 0:_.state.data,k(this,Js)):n.placeholderData,n.select&&j!==void 0)try{j=n.select(j),$(this,Mn,null)}catch(R){$(this,Mn,R)}j!==void 0&&(b="success",p=Kf(s==null?void 0:s.data,j,n),f=!0)}k(this,Mn)&&(h=k(this,Mn),p=k(this,Zs),v=Date.now(),b="error");const m=c.fetchStatus==="fetching",x=b==="pending",w=b==="error",E=x&&m,T=p!==void 0,S={status:b,fetchStatus:c.fetchStatus,isPending:x,isSuccess:b==="success",isError:w,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:c.dataUpdatedAt,error:h,errorUpdatedAt:v,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!x,isLoadingError:w&&!T,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&T,isStale:Zh(t,n),refetch:this.refetch,promise:k(this,Dr)};if(this.options.experimental_prefetchInRender){const j=ne=>{S.status==="error"?ne.reject(S.error):S.data!==void 0&&ne.resolve(S.data)},R=()=>{const ne=$(this,Dr,S.promise=Gf());j(ne)},L=k(this,Dr);switch(L.status){case"pending":t.queryHash===r.queryHash&&j(L);break;case"fulfilled":(S.status==="error"||S.data!==L.value)&&R();break;case"rejected":(S.status!=="error"||S.error!==L.reason)&&R();break}}return S}updateResult(t){const n=k(this,mt),r=this.createResult(k(this,ae),this.options);if($(this,Di,k(this,ae).state),$(this,Xs,this.options),k(this,Di).data!==void 0&&$(this,Js,k(this,ae)),Au(r,n))return;$(this,mt,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!k(this,eo).size)return!0;const l=new Set(a??k(this,eo));return this.options.throwOnError&&l.add("error"),Object.keys(k(this,mt)).some(u=>{const d=u;return k(this,mt)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),ie(this,de,tb).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ie(this,de,Zf).call(this)}},kt=new WeakMap,ae=new WeakMap,Ba=new WeakMap,mt=new WeakMap,Di=new WeakMap,Xs=new WeakMap,Dr=new WeakMap,Mn=new WeakMap,Va=new WeakMap,Zs=new WeakMap,Js=new WeakMap,Fi=new WeakMap,Ni=new WeakMap,Fr=new WeakMap,eo=new WeakMap,de=new WeakSet,Bo=function(t){ie(this,de,tp).call(this);let n=k(this,ae).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Zt)),n},Qf=function(){ie(this,de,Jf).call(this);const t=zs(this.options.staleTime,k(this,ae));if(qi||k(this,mt).isStale||!Wf(t))return;const r=qw(k(this,mt).dataUpdatedAt,t)+1;$(this,Fi,setTimeout(()=>{k(this,mt).isStale||this.updateResult()},r))},Yf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,ae)):this.options.refetchInterval)??!1},Xf=function(t){ie(this,de,ep).call(this),$(this,Fr,t),!(qi||bn(this.options.enabled,k(this,ae))===!1||!Wf(k(this,Fr))||k(this,Fr)===0)&&$(this,Ni,setInterval(()=>{(this.options.refetchIntervalInBackground||Xh.isFocused())&&ie(this,de,Bo).call(this)},k(this,Fr)))},Zf=function(){ie(this,de,Qf).call(this),ie(this,de,Xf).call(this,ie(this,de,Yf).call(this))},Jf=function(){k(this,Fi)&&(clearTimeout(k(this,Fi)),$(this,Fi,void 0))},ep=function(){k(this,Ni)&&(clearInterval(k(this,Ni)),$(this,Ni,void 0))},tp=function(){const t=k(this,kt).getQueryCache().build(k(this,kt),this.options);if(t===k(this,ae))return;const n=k(this,ae);$(this,ae,t),$(this,Ba,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},tb=function(t){Be.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(k(this,mt))}),k(this,kt).getQueryCache().notify({query:k(this,ae),type:"observerResultsUpdated"})})},jx);function W2(e,t){return bn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ov(e,t){return W2(e,t)||e.state.data!==void 0&&np(e,t,t.refetchOnMount)}function np(e,t,n){if(bn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Zh(e,t)}return!1}function Dv(e,t,n,r){return(e!==t||bn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Zh(e,n)}function Zh(e,t){return bn(t.enabled,e)!==!1&&e.isStaleByTime(zs(t.staleTime,e))}function q2(e,t){return!Au(e.getCurrentResult(),t)}var Nr,Mr,Et,nr,ar,Gl,rp,Ax,K2=(Ax=class extends yo{constructor(t,n){super();q(this,ar);q(this,Nr);q(this,Mr);q(this,Et);q(this,nr);$(this,Nr,t),this.setOptions(n),this.bindMethods(),ie(this,ar,Gl).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=k(this,Nr).defaultMutationOptions(t),Au(this.options,n)||k(this,Nr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:k(this,Et),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Ki(n.mutationKey)!==Ki(this.options.mutationKey)?this.reset():((r=k(this,Et))==null?void 0:r.state.status)==="pending"&&k(this,Et).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=k(this,Et))==null||t.removeObserver(this)}onMutationUpdate(t){ie(this,ar,Gl).call(this),ie(this,ar,rp).call(this,t)}getCurrentResult(){return k(this,Mr)}reset(){var t;(t=k(this,Et))==null||t.removeObserver(this),$(this,Et,void 0),ie(this,ar,Gl).call(this),ie(this,ar,rp).call(this)}mutate(t,n){var r;return $(this,nr,n),(r=k(this,Et))==null||r.removeObserver(this),$(this,Et,k(this,Nr).getMutationCache().build(k(this,Nr),this.options)),k(this,Et).addObserver(this),k(this,Et).execute(t)}},Nr=new WeakMap,Mr=new WeakMap,Et=new WeakMap,nr=new WeakMap,ar=new WeakSet,Gl=function(){var n;const t=((n=k(this,Et))==null?void 0:n.state)??eb();$(this,Mr,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},rp=function(t){Be.batch(()=>{var n,r,i,s,o,a,l,u;if(k(this,nr)&&this.hasListeners()){const d=k(this,Mr).variables,c=k(this,Mr).context;(t==null?void 0:t.type)==="success"?((r=(n=k(this,nr)).onSuccess)==null||r.call(n,t.data,d,c),(s=(i=k(this,nr)).onSettled)==null||s.call(i,t.data,null,d,c)):(t==null?void 0:t.type)==="error"&&((a=(o=k(this,nr)).onError)==null||a.call(o,t.error,d,c),(u=(l=k(this,nr)).onSettled)==null||u.call(l,void 0,t.error,d,c))}this.listeners.forEach(d=>{d(k(this,Mr))})})},Ax),nb=g.createContext(void 0),rb=e=>{const t=g.useContext(nb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},G2=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(nb.Provider,{value:e,children:t})),ib=g.createContext(!1),Q2=()=>g.useContext(ib);ib.Provider;function Y2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var X2=g.createContext(Y2()),Z2=()=>g.useContext(X2);function sb(e,t){return typeof e=="function"?e(...t):!!e}function ip(){}var J2=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},e_=e=>{g.useEffect(()=>{e.clearReset()},[e])},t_=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&sb(n,[e.error,r]),n_=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},r_=(e,t)=>e.isLoading&&e.isFetching&&!t,i_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Fv=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function s_(e,t,n){var d,c,f,p,h;const r=rb(),i=Q2(),s=Z2(),o=r.defaultQueryOptions(e);(c=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||c.call(d,o),o._optimisticResults=i?"isRestoring":"optimistic",n_(o),J2(o,s),e_(s);const a=!r.getQueryCache().get(o.queryHash),[l]=g.useState(()=>new t(r,o)),u=l.getOptimisticResult(o);if(g.useSyncExternalStore(g.useCallback(v=>{const b=i?ip:l.subscribe(Be.batchCalls(v));return l.updateResult(),b},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),g.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),i_(o,u))throw Fv(o,l,s);if(t_({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw u.error;if((p=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||p.call(f,o,u),o.experimental_prefetchInRender&&!qi&&r_(u,i)){const v=a?Fv(o,l,s):(h=r.getQueryCache().get(o.queryHash))==null?void 0:h.promise;v==null||v.catch(ip).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?u:l.trackResult(u)}function o_(e,t){return s_(e,H2)}function Jh(e,t){const n=rb(),[r]=g.useState(()=>new K2(n,e));g.useEffect(()=>{r.setOptions(e)},[r,e]);const i=g.useSyncExternalStore(g.useCallback(o=>r.subscribe(Be.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=g.useCallback((o,a)=>{r.mutate(o,a).catch(ip)},[r]);if(i.error&&sb(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const a_=e=>o_({queryKey:["widgets",e],queryFn:()=>l_(e)}),l_=e=>vo(`widgets/with-link/${e}`);var Q=(e=>(e.Border="widget_border",e.Background="widget_background",e.InputBackground="widget_input_background",e.InputText="widget_input_text",e.InputBorder="widget_input_border",e.ButtonBackground="widget_button_background",e.ButtonText="widget_button_text",e.TooltipBackground="widget_tooltip_background",e.TooltipText="widget_tooltip_text",e.TooltipBorder="widget_tooltip_border",e.HeaderBackground="widget_header_background",e.HeaderText="widget_header_text",e.HeaderBorder="widget_header_border",e.FooterBackground="widget_footer_background",e.FooterText="widget_footer_text",e.FooterBorder="widget_footer_border",e.MessageAdminBackground="widget_message_admin_background",e.MessageAdminText="widget_message_admin_text",e.MessageVisitorBackground="widget_message_visitor_background",e.MessageVisitorText="widget_message_visitor_text",e.GreeterTopBackground="widget_greeter_top_background",e.GreeterTopText="widget_greeter_top_text",e.GreeterBackground="widget_greeter_background",e.GreeterText="widget_greeter_text",e.GreeterBorder="widget_greeter_border",e.GreeterButtonBackground="widget_greeter_button_background",e.GreeterButtonText="widget_greeter_button_text",e))(Q||{});function u_(e){return!!e&&typeof e.public_id=="string"&&typeof e.link_id=="string"&&typeof e.name=="string"&&typeof e.is_browser_notification_enabled=="boolean"&&typeof e.is_hidden_on_offline=="boolean"&&typeof e.is_upload_disabled=="boolean"}/**
40
+ `+s.stack}return{value:e,source:t,stack:i,digest:null}}function hd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Rf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var BC=typeof WeakMap=="function"?WeakMap:Map;function mw(e,t,n){n=or(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Cu||(Cu=!0,Bf=r),Rf(e,t)},n}function gw(e,t,n){n=or(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Rf(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Rf(e,t),typeof r!="function"&&(qr===null?qr=new Set([this]):qr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function av(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new BC;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=t2.bind(null,e,t,n),t.then(e,e))}function lv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function uv(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=or(-1,1),t.tag=2,Wr(n,t,1))),n.lanes|=1),e)}var VC=pr.ReactCurrentOwner,Pt=!1;function gt(e,t,n,r){t.child=e===null?W1(t,null,n,r):io(t,e.child,n,r)}function cv(e,t,n,r,i){n=n.render;var s=t.ref;return Is(t,i),r=Dh(e,t,n,r,s,i),n=Fh(),e!==null&&!Pt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,dr(e,t,i)):(Ee&&n&&bh(t),t.flags|=1,gt(e,t,r,i),t.child)}function dv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Hh(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,vw(e,t,s,r,i)):(e=Kl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:ha,n(o,r)&&e.ref===t.ref)return dr(e,t,i)}return t.flags|=1,e=Gr(s,r),e.ref=t.ref,e.return=t,t.child=e}function vw(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(ha(s,r)&&e.ref===t.ref)if(Pt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Pt=!0);else return t.lanes=e.lanes,dr(e,t,i)}return Of(e,t,n,r,i)}function yw(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},xe(_s,Lt),Lt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,xe(_s,Lt),Lt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,xe(_s,Lt),Lt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,xe(_s,Lt),Lt|=r;return gt(e,t,i,n),t.child}function xw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Of(e,t,n,r,i){var s=At(n)?Bi:pt.current;return s=no(t,s),Is(t,i),n=Dh(e,t,n,r,s,i),r=Fh(),e!==null&&!Pt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,dr(e,t,i)):(Ee&&r&&bh(t),t.flags|=1,gt(e,t,n,i),t.child)}function fv(e,t,n,r,i){if(At(n)){var s=!0;gu(t)}else s=!1;if(Is(t,i),t.stateNode===null)Hl(e,t),hw(t,n,r),Af(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=an(u):(u=At(n)?Bi:pt.current,u=no(t,u));var d=n.getDerivedStateFromProps,c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&ov(t,o,r,u),Er=!1;var f=t.memoizedState;o.state=f,bu(t,r,o,i),l=t.memoizedState,a!==r||f!==l||jt.current||Er?(typeof d=="function"&&(jf(t,n,d,r),l=t.memoizedState),(a=Er||sv(t,n,a,r,f,l,u))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,K1(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:gn(t.type,a),o.props=u,c=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=an(l):(l=At(n)?Bi:pt.current,l=no(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==c||f!==l)&&ov(t,o,r,l),Er=!1,f=t.memoizedState,o.state=f,bu(t,r,o,i);var h=t.memoizedState;a!==c||f!==h||jt.current||Er?(typeof p=="function"&&(jf(t,n,p,r),h=t.memoizedState),(u=Er||sv(t,n,u,r,f,h,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,h,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,h,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),o.props=r,o.state=h,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Df(e,t,n,r,s,i)}function Df(e,t,n,r,i,s){xw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Xg(t,n,!1),dr(e,t,s);r=t.stateNode,VC.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=io(t,e.child,null,s),t.child=io(t,null,a,s)):gt(e,t,a,s),t.memoizedState=r.state,i&&Xg(t,n,!0),t.child}function ww(e){var t=e.stateNode;t.pendingContext?Yg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Yg(e,t.context,!1),jh(e,t.containerInfo)}function pv(e,t,n,r,i){return ro(),kh(i),t.flags|=256,gt(e,t,n,r),t.child}var Ff={dehydrated:null,treeContext:null,retryLane:0};function Nf(e){return{baseLanes:e,cachePool:null,transitions:null}}function bw(e,t,n){var r=t.pendingProps,i=_e.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),xe(_e,i&1),e===null)return _f(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=oc(o,r,0,null),e=Li(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Nf(n),t.memoizedState=Ff,e):Lh(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return UC(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Gr(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Gr(a,s):(s=Li(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Nf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Ff,r}return s=e.child,e=s.sibling,r=Gr(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Lh(e,t){return t=oc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function xl(e,t,n,r){return r!==null&&kh(r),io(t,e.child,null,n),e=Lh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function UC(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=hd(Error(N(422))),xl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=oc({mode:"visible",children:r.children},i,0,null),s=Li(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&io(t,e.child,null,o),t.child.memoizedState=Nf(o),t.memoizedState=Ff,s);if(!(t.mode&1))return xl(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(N(419)),r=hd(s,r,void 0),xl(e,t,o,r)}if(a=(o&e.childLanes)!==0,Pt||a){if(r=Ge,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,cr(e,i),kn(r,e,i,-1))}return Uh(),r=hd(Error(N(421))),xl(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=n2.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,It=Hr(i.nextSibling),Bt=t,Ee=!0,wn=null,e!==null&&(Jt[en++]=rr,Jt[en++]=ir,Jt[en++]=Vi,rr=e.id,ir=e.overflow,Vi=t),t=Lh(t,r.children),t.flags|=4096,t)}function hv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Pf(e.return,t,n)}function md(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Sw(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(gt(e,t,r.children,n),r=_e.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hv(e,n,t);else if(e.tag===19)hv(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(xe(_e,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Su(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),md(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Su(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}md(t,!0,n,null,s);break;case"together":md(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Hl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function dr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Hi|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(N(153));if(t.child!==null){for(e=t.child,n=Gr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Gr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function HC(e,t,n){switch(t.tag){case 3:ww(t),ro();break;case 5:G1(t);break;case 1:At(t.type)&&gu(t);break;case 4:jh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;xe(xu,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(xe(_e,_e.current&1),t.flags|=128,null):n&t.child.childLanes?bw(e,t,n):(xe(_e,_e.current&1),e=dr(e,t,n),e!==null?e.sibling:null);xe(_e,_e.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Sw(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),xe(_e,_e.current),r)break;return null;case 22:case 23:return t.lanes=0,yw(e,t,n)}return dr(e,t,n)}var kw,Mf,Ew,Tw;kw=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Mf=function(){};Ew=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ei($n.current);var s=null;switch(n){case"input":i=rf(e,i),r=rf(e,r),s=[];break;case"select":i=Ae({},i,{value:void 0}),r=Ae({},r,{value:void 0}),s=[];break;case"textarea":i=af(e,i),r=af(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=hu)}uf(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(aa.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(aa.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&be("scroll",e),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};Tw=function(e,t,n,r){n!==r&&(t.flags|=4)};function Oo(e,t){if(!Ee)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function WC(e,t,n){var r=t.pendingProps;switch(Sh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return At(t.type)&&mu(),lt(t),null;case 3:return r=t.stateNode,so(),ke(jt),ke(pt),Rh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(vl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,wn!==null&&(Hf(wn),wn=null))),Mf(e,t),lt(t),null;case 5:Ah(t);var i=Ei(xa.current);if(n=t.type,e!==null&&t.stateNode!=null)Ew(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(N(166));return lt(t),null}if(e=Ei($n.current),vl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Ln]=t,r[va]=s,e=(t.mode&1)!==0,n){case"dialog":be("cancel",r),be("close",r);break;case"iframe":case"object":case"embed":be("load",r);break;case"video":case"audio":for(i=0;i<zo.length;i++)be(zo[i],r);break;case"source":be("error",r);break;case"img":case"image":case"link":be("error",r),be("load",r);break;case"details":be("toggle",r);break;case"input":kg(r,s),be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},be("invalid",r);break;case"textarea":Tg(r,s),be("invalid",r)}uf(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&gl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&gl(r.textContent,a,e),i=["children",""+a]):aa.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&be("scroll",r)}switch(n){case"input":ll(r),Eg(r,s,!0);break;case"textarea":ll(r),Cg(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=hu)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Jx(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Ln]=t,e[va]=r,kw(e,t,!1,!1),t.stateNode=e;e:{switch(o=cf(n,r),n){case"dialog":be("cancel",e),be("close",e),i=r;break;case"iframe":case"object":case"embed":be("load",e),i=r;break;case"video":case"audio":for(i=0;i<zo.length;i++)be(zo[i],e);i=r;break;case"source":be("error",e),i=r;break;case"img":case"image":case"link":be("error",e),be("load",e),i=r;break;case"details":be("toggle",e),i=r;break;case"input":kg(e,r),i=rf(e,r),be("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ae({},r,{value:void 0}),be("invalid",e);break;case"textarea":Tg(e,r),i=af(e,r),be("invalid",e);break;default:i=r}uf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?n1(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&e1(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&la(e,l):typeof l=="number"&&la(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(aa.hasOwnProperty(s)?l!=null&&s==="onScroll"&&be("scroll",e):l!=null&&ah(e,s,l,o))}switch(n){case"input":ll(e),Eg(e,r,!1);break;case"textarea":ll(e),Cg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ei(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Fs(e,!!r.multiple,s,!1):r.defaultValue!=null&&Fs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=hu)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return lt(t),null;case 6:if(e&&t.stateNode!=null)Tw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(N(166));if(n=Ei(xa.current),Ei($n.current),vl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ln]=t,(s=r.nodeValue!==n)&&(e=Bt,e!==null))switch(e.tag){case 3:gl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&gl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ln]=t,t.stateNode=r}return lt(t),null;case 13:if(ke(_e),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ee&&It!==null&&t.mode&1&&!(t.flags&128))U1(),ro(),t.flags|=98560,s=!1;else if(s=vl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(N(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(N(317));s[Ln]=t}else ro(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lt(t),s=!1}else wn!==null&&(Hf(wn),wn=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||_e.current&1?Ve===0&&(Ve=3):Uh())),t.updateQueue!==null&&(t.flags|=4),lt(t),null);case 4:return so(),Mf(e,t),e===null&&ma(t.stateNode.containerInfo),lt(t),null;case 10:return Ch(t.type._context),lt(t),null;case 17:return At(t.type)&&mu(),lt(t),null;case 19:if(ke(_e),s=t.memoizedState,s===null)return lt(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Oo(s,!1);else{if(Ve!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Su(e),o!==null){for(t.flags|=128,Oo(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return xe(_e,_e.current&1|2),t.child}e=e.sibling}s.tail!==null&&Me()>ao&&(t.flags|=128,r=!0,Oo(s,!1),t.lanes=4194304)}else{if(!r)if(e=Su(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Oo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ee)return lt(t),null}else 2*Me()-s.renderingStartTime>ao&&n!==1073741824&&(t.flags|=128,r=!0,Oo(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Me(),t.sibling=null,n=_e.current,xe(_e,r?n&1|2:n&1),t):(lt(t),null);case 22:case 23:return Vh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Lt&1073741824&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function qC(e,t){switch(Sh(t),t.tag){case 1:return At(t.type)&&mu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return so(),ke(jt),ke(pt),Rh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ah(t),null;case 13:if(ke(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));ro()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(_e),null;case 4:return so(),null;case 10:return Ch(t.type._context),null;case 22:case 23:return Vh(),null;case 24:return null;default:return null}}var wl=!1,dt=!1,KC=typeof WeakSet=="function"?WeakSet:Set,z=null;function Cs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){De(e,t,r)}else n.current=null}function Lf(e,t,n){try{n()}catch(r){De(e,t,r)}}var mv=!1;function GC(e,t){if(wf=du,e=A1(),wh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var p;c!==n||i!==0&&c.nodeType!==3||(a=o+i),c!==s||r!==0&&c.nodeType!==3||(l=o+r),c.nodeType===3&&(o+=c.nodeValue.length),(p=c.firstChild)!==null;)f=c,c=p;for(;;){if(c===e)break t;if(f===n&&++u===i&&(a=o),f===s&&++d===r&&(l=o),(p=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(bf={focusedElem:e,selectionRange:n},du=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var v=h.memoizedProps,b=h.memoizedState,m=t.stateNode,x=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:gn(t.type,v),b);m.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(E){De(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return h=mv,mv=!1,h}function Xo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Lf(t,n,s)}i=i.next}while(i!==r)}}function ic(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function If(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Cw(e){var t=e.alternate;t!==null&&(e.alternate=null,Cw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ln],delete t[va],delete t[Ef],delete t[AC],delete t[RC])),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 _w(e){return e.tag===5||e.tag===3||e.tag===4}function gv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_w(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 $f(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=hu));else if(r!==4&&(e=e.child,e!==null))for($f(e,t,n),e=e.sibling;e!==null;)$f(e,t,n),e=e.sibling}function zf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(zf(e,t,n),e=e.sibling;e!==null;)zf(e,t,n),e=e.sibling}var tt=null,yn=!1;function wr(e,t,n){for(n=n.child;n!==null;)Pw(e,t,n),n=n.sibling}function Pw(e,t,n){if(In&&typeof In.onCommitFiberUnmount=="function")try{In.onCommitFiberUnmount(Yu,n)}catch{}switch(n.tag){case 5:dt||Cs(n,t);case 6:var r=tt,i=yn;tt=null,wr(e,t,n),tt=r,yn=i,tt!==null&&(yn?(e=tt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):tt.removeChild(n.stateNode));break;case 18:tt!==null&&(yn?(e=tt,n=n.stateNode,e.nodeType===8?ld(e.parentNode,n):e.nodeType===1&&ld(e,n),fa(e)):ld(tt,n.stateNode));break;case 4:r=tt,i=yn,tt=n.stateNode.containerInfo,yn=!0,wr(e,t,n),tt=r,yn=i;break;case 0:case 11:case 14:case 15:if(!dt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Lf(n,t,o),i=i.next}while(i!==r)}wr(e,t,n);break;case 1:if(!dt&&(Cs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){De(n,t,a)}wr(e,t,n);break;case 21:wr(e,t,n);break;case 22:n.mode&1?(dt=(r=dt)||n.memoizedState!==null,wr(e,t,n),dt=r):wr(e,t,n);break;default:wr(e,t,n)}}function vv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new KC),t.forEach(function(r){var i=r2.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function pn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:tt=a.stateNode,yn=!1;break e;case 3:tt=a.stateNode.containerInfo,yn=!0;break e;case 4:tt=a.stateNode.containerInfo,yn=!0;break e}a=a.return}if(tt===null)throw Error(N(160));Pw(s,o,i),tt=null,yn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){De(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)jw(t,e),t=t.sibling}function jw(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(pn(t,e),Pn(e),r&4){try{Xo(3,e,e.return),ic(3,e)}catch(v){De(e,e.return,v)}try{Xo(5,e,e.return)}catch(v){De(e,e.return,v)}}break;case 1:pn(t,e),Pn(e),r&512&&n!==null&&Cs(n,n.return);break;case 5:if(pn(t,e),Pn(e),r&512&&n!==null&&Cs(n,n.return),e.flags&32){var i=e.stateNode;try{la(i,"")}catch(v){De(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&Xx(i,s),cf(a,o);var u=cf(a,s);for(o=0;o<l.length;o+=2){var d=l[o],c=l[o+1];d==="style"?n1(i,c):d==="dangerouslySetInnerHTML"?e1(i,c):d==="children"?la(i,c):ah(i,d,c,u)}switch(a){case"input":sf(i,s);break;case"textarea":Zx(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Fs(i,!!s.multiple,p,!1):f!==!!s.multiple&&(s.defaultValue!=null?Fs(i,!!s.multiple,s.defaultValue,!0):Fs(i,!!s.multiple,s.multiple?[]:"",!1))}i[va]=s}catch(v){De(e,e.return,v)}}break;case 6:if(pn(t,e),Pn(e),r&4){if(e.stateNode===null)throw Error(N(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(v){De(e,e.return,v)}}break;case 3:if(pn(t,e),Pn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{fa(t.containerInfo)}catch(v){De(e,e.return,v)}break;case 4:pn(t,e),Pn(e);break;case 13:pn(t,e),Pn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(zh=Me())),r&4&&vv(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(dt=(u=dt)||d,pn(t,e),dt=u):pn(t,e),Pn(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(z=e,d=e.child;d!==null;){for(c=z=d;z!==null;){switch(f=z,p=f.child,f.tag){case 0:case 11:case 14:case 15:Xo(4,f,f.return);break;case 1:Cs(f,f.return);var h=f.stateNode;if(typeof h.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(v){De(r,n,v)}}break;case 5:Cs(f,f.return);break;case 22:if(f.memoizedState!==null){xv(c);continue}}p!==null?(p.return=f,z=p):xv(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{i=c.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=c.stateNode,l=c.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=t1("display",o))}catch(v){De(e,e.return,v)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(v){De(e,e.return,v)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:pn(t,e),Pn(e),r&4&&vv(e);break;case 21:break;default:pn(t,e),Pn(e)}}function Pn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(_w(n)){var r=n;break e}n=n.return}throw Error(N(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(la(i,""),r.flags&=-33);var s=gv(e);zf(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=gv(e);$f(e,a,o);break;default:throw Error(N(161))}}catch(l){De(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function QC(e,t,n){z=e,Aw(e)}function Aw(e,t,n){for(var r=(e.mode&1)!==0;z!==null;){var i=z,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||wl;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||dt;a=wl;var u=dt;if(wl=o,(dt=l)&&!u)for(z=i;z!==null;)o=z,l=o.child,o.tag===22&&o.memoizedState!==null?wv(i):l!==null?(l.return=o,z=l):wv(i);for(;s!==null;)z=s,Aw(s),s=s.sibling;z=i,wl=a,dt=u}yv(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,z=s):yv(e)}}function yv(e){for(;z!==null;){var t=z;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:dt||ic(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!dt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:gn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&nv(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}nv(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&fa(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(N(163))}dt||t.flags&512&&If(t)}catch(f){De(t,t.return,f)}}if(t===e){z=null;break}if(n=t.sibling,n!==null){n.return=t.return,z=n;break}z=t.return}}function xv(e){for(;z!==null;){var t=z;if(t===e){z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,z=n;break}z=t.return}}function wv(e){for(;z!==null;){var t=z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ic(4,t)}catch(l){De(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){De(t,i,l)}}var s=t.return;try{If(t)}catch(l){De(t,s,l)}break;case 5:var o=t.return;try{If(t)}catch(l){De(t,o,l)}}}catch(l){De(t,t.return,l)}if(t===e){z=null;break}var a=t.sibling;if(a!==null){a.return=t.return,z=a;break}z=t.return}}var YC=Math.ceil,Tu=pr.ReactCurrentDispatcher,Ih=pr.ReactCurrentOwner,sn=pr.ReactCurrentBatchConfig,ce=0,Ge=null,Le=null,it=0,Lt=0,_s=oi(0),Ve=0,ka=null,Hi=0,sc=0,$h=0,Zo=null,Ct=null,zh=0,ao=1/0,Jn=null,Cu=!1,Bf=null,qr=null,bl=!1,Ir=null,_u=0,Jo=0,Vf=null,Wl=-1,ql=0;function yt(){return ce&6?Me():Wl!==-1?Wl:Wl=Me()}function Kr(e){return e.mode&1?ce&2&&it!==0?it&-it:DC.transition!==null?(ql===0&&(ql=h1()),ql):(e=pe,e!==0||(e=window.event,e=e===void 0?16:b1(e.type)),e):1}function kn(e,t,n,r){if(50<Jo)throw Jo=0,Vf=null,Error(N(185));Ha(e,n,r),(!(ce&2)||e!==Ge)&&(e===Ge&&(!(ce&2)&&(sc|=n),Ve===4&&_r(e,it)),Rt(e,r),n===1&&ce===0&&!(t.mode&1)&&(ao=Me()+500,tc&&ai()))}function Rt(e,t){var n=e.callbackNode;DT(e,t);var r=cu(e,e===Ge?it:0);if(r===0)n!==null&&jg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&jg(n),t===1)e.tag===0?OC(bv.bind(null,e)):z1(bv.bind(null,e)),PC(function(){!(ce&6)&&ai()}),n=null;else{switch(m1(r)){case 1:n=fh;break;case 4:n=f1;break;case 16:n=uu;break;case 536870912:n=p1;break;default:n=uu}n=Iw(n,Rw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Rw(e,t){if(Wl=-1,ql=0,ce&6)throw Error(N(327));var n=e.callbackNode;if($s()&&e.callbackNode!==n)return null;var r=cu(e,e===Ge?it:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Pu(e,r);else{t=r;var i=ce;ce|=2;var s=Dw();(Ge!==e||it!==t)&&(Jn=null,ao=Me()+500,Mi(e,t));do try{JC();break}catch(a){Ow(e,a)}while(!0);Th(),Tu.current=s,ce=i,Le!==null?t=0:(Ge=null,it=0,t=Ve)}if(t!==0){if(t===2&&(i=mf(e),i!==0&&(r=i,t=Uf(e,i))),t===1)throw n=ka,Mi(e,0),_r(e,r),Rt(e,Me()),n;if(t===6)_r(e,r);else{if(i=e.current.alternate,!(r&30)&&!XC(i)&&(t=Pu(e,r),t===2&&(s=mf(e),s!==0&&(r=s,t=Uf(e,s))),t===1))throw n=ka,Mi(e,0),_r(e,r),Rt(e,Me()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(N(345));case 2:vi(e,Ct,Jn);break;case 3:if(_r(e,r),(r&130023424)===r&&(t=zh+500-Me(),10<t)){if(cu(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){yt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=kf(vi.bind(null,e,Ct,Jn),t);break}vi(e,Ct,Jn);break;case 4:if(_r(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Sn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*YC(r/1960))-r,10<r){e.timeoutHandle=kf(vi.bind(null,e,Ct,Jn),r);break}vi(e,Ct,Jn);break;case 5:vi(e,Ct,Jn);break;default:throw Error(N(329))}}}return Rt(e,Me()),e.callbackNode===n?Rw.bind(null,e):null}function Uf(e,t){var n=Zo;return e.current.memoizedState.isDehydrated&&(Mi(e,t).flags|=256),e=Pu(e,t),e!==2&&(t=Ct,Ct=n,t!==null&&Hf(t)),e}function Hf(e){Ct===null?Ct=e:Ct.push.apply(Ct,e)}function XC(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!En(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _r(e,t){for(t&=~$h,t&=~sc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Sn(t),r=1<<n;e[n]=-1,t&=~r}}function bv(e){if(ce&6)throw Error(N(327));$s();var t=cu(e,0);if(!(t&1))return Rt(e,Me()),null;var n=Pu(e,t);if(e.tag!==0&&n===2){var r=mf(e);r!==0&&(t=r,n=Uf(e,r))}if(n===1)throw n=ka,Mi(e,0),_r(e,t),Rt(e,Me()),n;if(n===6)throw Error(N(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,vi(e,Ct,Jn),Rt(e,Me()),null}function Bh(e,t){var n=ce;ce|=1;try{return e(t)}finally{ce=n,ce===0&&(ao=Me()+500,tc&&ai())}}function Wi(e){Ir!==null&&Ir.tag===0&&!(ce&6)&&$s();var t=ce;ce|=1;var n=sn.transition,r=pe;try{if(sn.transition=null,pe=1,e)return e()}finally{pe=r,sn.transition=n,ce=t,!(ce&6)&&ai()}}function Vh(){Lt=_s.current,ke(_s)}function Mi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,_C(n)),Le!==null)for(n=Le.return;n!==null;){var r=n;switch(Sh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&mu();break;case 3:so(),ke(jt),ke(pt),Rh();break;case 5:Ah(r);break;case 4:so();break;case 13:ke(_e);break;case 19:ke(_e);break;case 10:Ch(r.type._context);break;case 22:case 23:Vh()}n=n.return}if(Ge=e,Le=e=Gr(e.current,null),it=Lt=t,Ve=0,ka=null,$h=sc=Hi=0,Ct=Zo=null,ki!==null){for(t=0;t<ki.length;t++)if(n=ki[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}ki=null}return e}function Ow(e,t){do{var n=Le;try{if(Th(),Vl.current=Eu,ku){for(var r=je.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}ku=!1}if(Ui=0,Ke=ze=je=null,Yo=!1,wa=0,Ih.current=null,n===null||n.return===null){Ve=1,ka=t,Le=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=it,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,c=d.tag;if(!(d.mode&1)&&(c===0||c===11||c===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=lv(o);if(p!==null){p.flags&=-257,uv(p,o,a,s,t),p.mode&1&&av(s,u,t),t=p,l=u;var h=t.updateQueue;if(h===null){var v=new Set;v.add(l),t.updateQueue=v}else h.add(l);break e}else{if(!(t&1)){av(s,u,t),Uh();break e}l=Error(N(426))}}else if(Ee&&a.mode&1){var b=lv(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),uv(b,o,a,s,t),kh(oo(l,a));break e}}s=l=oo(l,a),Ve!==4&&(Ve=2),Zo===null?Zo=[s]:Zo.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var m=mw(s,l,t);tv(s,m);break e;case 1:a=l;var x=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(qr===null||!qr.has(w)))){s.flags|=65536,t&=-t,s.lanes|=t;var E=gw(s,a,t);tv(s,E);break e}}s=s.return}while(s!==null)}Nw(n)}catch(T){t=T,Le===n&&n!==null&&(Le=n=n.return);continue}break}while(!0)}function Dw(){var e=Tu.current;return Tu.current=Eu,e===null?Eu:e}function Uh(){(Ve===0||Ve===3||Ve===2)&&(Ve=4),Ge===null||!(Hi&268435455)&&!(sc&268435455)||_r(Ge,it)}function Pu(e,t){var n=ce;ce|=2;var r=Dw();(Ge!==e||it!==t)&&(Jn=null,Mi(e,t));do try{ZC();break}catch(i){Ow(e,i)}while(!0);if(Th(),ce=n,Tu.current=r,Le!==null)throw Error(N(261));return Ge=null,it=0,Ve}function ZC(){for(;Le!==null;)Fw(Le)}function JC(){for(;Le!==null&&!ET();)Fw(Le)}function Fw(e){var t=Lw(e.alternate,e,Lt);e.memoizedProps=e.pendingProps,t===null?Nw(e):Le=t,Ih.current=null}function Nw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=qC(n,t),n!==null){n.flags&=32767,Le=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ve=6,Le=null;return}}else if(n=WC(n,t,Lt),n!==null){Le=n;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);Ve===0&&(Ve=5)}function vi(e,t,n){var r=pe,i=sn.transition;try{sn.transition=null,pe=1,e2(e,t,n,r)}finally{sn.transition=i,pe=r}return null}function e2(e,t,n,r){do $s();while(Ir!==null);if(ce&6)throw Error(N(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(N(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(FT(e,s),e===Ge&&(Le=Ge=null,it=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||bl||(bl=!0,Iw(uu,function(){return $s(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=sn.transition,sn.transition=null;var o=pe;pe=1;var a=ce;ce|=4,Ih.current=null,GC(e,n),jw(n,e),wC(bf),du=!!wf,bf=wf=null,e.current=n,QC(n),TT(),ce=a,pe=o,sn.transition=s}else e.current=n;if(bl&&(bl=!1,Ir=e,_u=i),s=e.pendingLanes,s===0&&(qr=null),PT(n.stateNode),Rt(e,Me()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Cu)throw Cu=!1,e=Bf,Bf=null,e;return _u&1&&e.tag!==0&&$s(),s=e.pendingLanes,s&1?e===Vf?Jo++:(Jo=0,Vf=e):Jo=0,ai(),null}function $s(){if(Ir!==null){var e=m1(_u),t=sn.transition,n=pe;try{if(sn.transition=null,pe=16>e?16:e,Ir===null)var r=!1;else{if(e=Ir,Ir=null,_u=0,ce&6)throw Error(N(331));var i=ce;for(ce|=4,z=e.current;z!==null;){var s=z,o=s.child;if(z.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(z=u;z!==null;){var d=z;switch(d.tag){case 0:case 11:case 15:Xo(8,d,s)}var c=d.child;if(c!==null)c.return=d,z=c;else for(;z!==null;){d=z;var f=d.sibling,p=d.return;if(Cw(d),d===u){z=null;break}if(f!==null){f.return=p,z=f;break}z=p}}}var h=s.alternate;if(h!==null){var v=h.child;if(v!==null){h.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}z=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,z=o;else e:for(;z!==null;){if(s=z,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Xo(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,z=m;break e}z=s.return}}var x=e.current;for(z=x;z!==null;){o=z;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,z=w;else e:for(o=x;z!==null;){if(a=z,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ic(9,a)}}catch(T){De(a,a.return,T)}if(a===o){z=null;break e}var E=a.sibling;if(E!==null){E.return=a.return,z=E;break e}z=a.return}}if(ce=i,ai(),In&&typeof In.onPostCommitFiberRoot=="function")try{In.onPostCommitFiberRoot(Yu,e)}catch{}r=!0}return r}finally{pe=n,sn.transition=t}}return!1}function Sv(e,t,n){t=oo(n,t),t=mw(e,t,1),e=Wr(e,t,1),t=yt(),e!==null&&(Ha(e,1,t),Rt(e,t))}function De(e,t,n){if(e.tag===3)Sv(e,e,n);else for(;t!==null;){if(t.tag===3){Sv(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(qr===null||!qr.has(r))){e=oo(n,e),e=gw(t,e,1),t=Wr(t,e,1),e=yt(),t!==null&&(Ha(t,1,e),Rt(t,e));break}}t=t.return}}function t2(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=yt(),e.pingedLanes|=e.suspendedLanes&n,Ge===e&&(it&n)===n&&(Ve===4||Ve===3&&(it&130023424)===it&&500>Me()-zh?Mi(e,0):$h|=n),Rt(e,t)}function Mw(e,t){t===0&&(e.mode&1?(t=dl,dl<<=1,!(dl&130023424)&&(dl=4194304)):t=1);var n=yt();e=cr(e,t),e!==null&&(Ha(e,t,n),Rt(e,n))}function n2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mw(e,n)}function r2(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(N(314))}r!==null&&r.delete(t),Mw(e,n)}var Lw;Lw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||jt.current)Pt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Pt=!1,HC(e,t,n);Pt=!!(e.flags&131072)}else Pt=!1,Ee&&t.flags&1048576&&B1(t,yu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hl(e,t),e=t.pendingProps;var i=no(t,pt.current);Is(t,n),i=Dh(null,t,r,e,i,n);var s=Fh();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,At(r)?(s=!0,gu(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ph(t),i.updater=rc,t.stateNode=i,i._reactInternals=t,Af(t,r,e,n),t=Df(null,t,r,!0,s,n)):(t.tag=0,Ee&&s&&bh(t),gt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=s2(r),e=gn(r,e),i){case 0:t=Of(null,t,r,e,n);break e;case 1:t=fv(null,t,r,e,n);break e;case 11:t=cv(null,t,r,e,n);break e;case 14:t=dv(null,t,r,gn(r.type,e),n);break e}throw Error(N(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:gn(r,i),Of(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:gn(r,i),fv(e,t,r,i,n);case 3:e:{if(ww(t),e===null)throw Error(N(387));r=t.pendingProps,s=t.memoizedState,i=s.element,K1(e,t),bu(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=oo(Error(N(423)),t),t=pv(e,t,r,n,i);break e}else if(r!==i){i=oo(Error(N(424)),t),t=pv(e,t,r,n,i);break e}else for(It=Hr(t.stateNode.containerInfo.firstChild),Bt=t,Ee=!0,wn=null,n=W1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ro(),r===i){t=dr(e,t,n);break e}gt(e,t,r,n)}t=t.child}return t;case 5:return G1(t),e===null&&_f(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Sf(r,i)?o=null:s!==null&&Sf(r,s)&&(t.flags|=32),xw(e,t),gt(e,t,o,n),t.child;case 6:return e===null&&_f(t),null;case 13:return bw(e,t,n);case 4:return jh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=io(t,null,r,n):gt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:gn(r,i),cv(e,t,r,i,n);case 7:return gt(e,t,t.pendingProps,n),t.child;case 8:return gt(e,t,t.pendingProps.children,n),t.child;case 12:return gt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,xe(xu,r._currentValue),r._currentValue=o,s!==null)if(En(s.value,o)){if(s.children===i.children&&!jt.current){t=dr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=or(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Pf(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(N(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Pf(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}gt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Is(t,n),i=an(i),r=r(i),t.flags|=1,gt(e,t,r,n),t.child;case 14:return r=t.type,i=gn(r,t.pendingProps),i=gn(r.type,i),dv(e,t,r,i,n);case 15:return vw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:gn(r,i),Hl(e,t),t.tag=1,At(r)?(e=!0,gu(t)):e=!1,Is(t,n),hw(t,r,i),Af(t,r,i,n),Df(null,t,r,!0,e,n);case 19:return Sw(e,t,n);case 22:return yw(e,t,n)}throw Error(N(156,t.tag))};function Iw(e,t){return d1(e,t)}function i2(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(e,t,n,r){return new i2(e,t,n,r)}function Hh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function s2(e){if(typeof e=="function")return Hh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===uh)return 11;if(e===ch)return 14}return 2}function Gr(e,t){var n=e.alternate;return n===null?(n=nn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Kl(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Hh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case vs:return Li(n.children,i,s,t);case lh:o=8,i|=8;break;case Jd:return e=nn(12,n,t,i|2),e.elementType=Jd,e.lanes=s,e;case ef:return e=nn(13,n,t,i),e.elementType=ef,e.lanes=s,e;case tf:return e=nn(19,n,t,i),e.elementType=tf,e.lanes=s,e;case Gx:return oc(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case qx:o=10;break e;case Kx:o=9;break e;case uh:o=11;break e;case ch:o=14;break e;case kr:o=16,r=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=nn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Li(e,t,n,r){return e=nn(7,e,r,t),e.lanes=n,e}function oc(e,t,n,r){return e=nn(22,e,r,t),e.elementType=Gx,e.lanes=n,e.stateNode={isHidden:!1},e}function gd(e,t,n){return e=nn(6,e,null,t),e.lanes=n,e}function vd(e,t,n){return t=nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function o2(e,t,n,r,i){this.tag=t,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=Xc(0),this.expirationTimes=Xc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xc(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Wh(e,t,n,r,i,s,o,a,l){return e=new o2(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=nn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ph(s),e}function a2(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:gs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function $w(e){if(!e)return ti;e=e._reactInternals;e:{if(Xi(e)!==e||e.tag!==1)throw Error(N(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(At(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(N(171))}if(e.tag===1){var n=e.type;if(At(n))return $1(e,n,t)}return t}function zw(e,t,n,r,i,s,o,a,l){return e=Wh(n,r,!0,e,i,s,o,a,l),e.context=$w(null),n=e.current,r=yt(),i=Kr(n),s=or(r,i),s.callback=t??null,Wr(n,s,i),e.current.lanes=i,Ha(e,i,r),Rt(e,r),e}function ac(e,t,n,r){var i=t.current,s=yt(),o=Kr(i);return n=$w(n),t.context===null?t.context=n:t.pendingContext=n,t=or(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Wr(i,t,o),e!==null&&(kn(e,i,o,s),Bl(e,i,o)),o}function ju(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function kv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function qh(e,t){kv(e,t),(e=e.alternate)&&kv(e,t)}function l2(){return null}var Bw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Kh(e){this._internalRoot=e}lc.prototype.render=Kh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(N(409));ac(e,t,null,null)};lc.prototype.unmount=Kh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Wi(function(){ac(null,e,null,null)}),t[ur]=null}};function lc(e){this._internalRoot=e}lc.prototype.unstable_scheduleHydration=function(e){if(e){var t=y1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cr.length&&t!==0&&t<Cr[n].priority;n++);Cr.splice(n,0,e),n===0&&w1(e)}};function Gh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function uc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ev(){}function u2(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=ju(o);s.call(u)}}var o=zw(t,r,e,0,null,!1,!1,"",Ev);return e._reactRootContainer=o,e[ur]=o.current,ma(e.nodeType===8?e.parentNode:e),Wi(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=ju(l);a.call(u)}}var l=Wh(e,0,!1,null,null,!1,!1,"",Ev);return e._reactRootContainer=l,e[ur]=l.current,ma(e.nodeType===8?e.parentNode:e),Wi(function(){ac(t,l,n,r)}),l}function cc(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=ju(o);a.call(l)}}ac(t,o,e,i)}else o=u2(n,t,e,i,r);return ju(o)}g1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=$o(t.pendingLanes);n!==0&&(ph(t,n|1),Rt(t,Me()),!(ce&6)&&(ao=Me()+500,ai()))}break;case 13:Wi(function(){var r=cr(e,1);if(r!==null){var i=yt();kn(r,e,1,i)}}),qh(e,1)}};hh=function(e){if(e.tag===13){var t=cr(e,134217728);if(t!==null){var n=yt();kn(t,e,134217728,n)}qh(e,134217728)}};v1=function(e){if(e.tag===13){var t=Kr(e),n=cr(e,t);if(n!==null){var r=yt();kn(n,e,t,r)}qh(e,t)}};y1=function(){return pe};x1=function(e,t){var n=pe;try{return pe=e,t()}finally{pe=n}};ff=function(e,t,n){switch(t){case"input":if(sf(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ec(r);if(!i)throw Error(N(90));Yx(r),sf(r,i)}}}break;case"textarea":Zx(e,n);break;case"select":t=n.value,t!=null&&Fs(e,!!n.multiple,t,!1)}};s1=Bh;o1=Wi;var c2={usingClientEntryPoint:!1,Events:[qa,bs,ec,r1,i1,Bh]},Do={findFiberByHostInstance:Si,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},d2={bundleType:Do.bundleType,version:Do.version,rendererPackageName:Do.rendererPackageName,rendererConfig:Do.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:pr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=u1(e),e===null?null:e.stateNode},findFiberByHostInstance:Do.findFiberByHostInstance||l2,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sl.isDisabled&&Sl.supportsFiber)try{Yu=Sl.inject(d2),In=Sl}catch{}}Ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=c2;Ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Gh(t))throw Error(N(200));return a2(e,t,null,n)};Ut.createRoot=function(e,t){if(!Gh(e))throw Error(N(299));var n=!1,r="",i=Bw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Wh(e,1,!1,null,null,n,!1,r,i),e[ur]=t.current,ma(e.nodeType===8?e.parentNode:e),new Kh(t)};Ut.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(N(188)):(e=Object.keys(e).join(","),Error(N(268,e)));return e=u1(t),e=e===null?null:e.stateNode,e};Ut.flushSync=function(e){return Wi(e)};Ut.hydrate=function(e,t,n){if(!uc(t))throw Error(N(200));return cc(null,e,t,!0,n)};Ut.hydrateRoot=function(e,t,n){if(!Gh(e))throw Error(N(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=Bw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=zw(t,null,e,1,n??null,i,!1,s,o),e[ur]=t.current,ma(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new lc(t)};Ut.render=function(e,t,n){if(!uc(t))throw Error(N(200));return cc(null,e,t,!1,n)};Ut.unmountComponentAtNode=function(e){if(!uc(e))throw Error(N(40));return e._reactRootContainer?(Wi(function(){cc(null,null,e,!1,function(){e._reactRootContainer=null,e[ur]=null})}),!0):!1};Ut.unstable_batchedUpdates=Bh;Ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!uc(n))throw Error(N(200));if(e==null||e._reactInternals===void 0)throw Error(N(38));return cc(e,t,n,!1,r)};Ut.version="18.3.1-next-f1338f8080-20240426";function Vw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vw)}catch(e){console.error(e)}}Vw(),Vx.exports=Ut;var Uw=Vx.exports;const f2=Qi(Uw);var Hw,Tv=Uw;Hw=Tv.createRoot,Tv.hydrateRoot;const p2="@alfatech/livechat",h2="v2025.06.04.3",m2="module",g2="https://api-live.alfatek.dev",v2="wss://api-live.alfatek.dev",y2=["dist","README.md"],x2="dist/widget.js",w2={dev:"vite",build:"tsc -b && vite build",lint:"biome lint --write",prepare:"husky",format:"biome format --write && yarn lint"},b2={"@headlessui/react":"^2.2.2","@tailwindcss/vite":"^4.1.4","@tanstack/react-query":"^5.59.20",classnames:"^2.5.1",dayjs:"^1.11.13",formik:"^2.4.6","framer-motion":"^12.7.4","lucide-react":"^0.511.0",react:"^18.3.1","react-dom":"^18.3.1","react-dropzone":"^14.3.8","react-router-dom":"^6.26.2","socket.io-client":"^4.8.1",sonner:"^2.0.1",yup:"^1.4.0",zustand:"^4.5.5"},S2={"@biomejs/biome":"^1.8.3","@types/node":"^22.5.4","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","@vitejs/plugin-react-swc":"^3.5.0",globals:"^15.9.0",husky:"^9.1.5",tailwindcss:"^4.1.4",typescript:"^5.5.3",vite:"^5.4.1"},Ww={name:p2,private:!1,version:h2,type:m2,apiURL:g2,wsURL:v2,files:y2,main:x2,scripts:w2,dependencies:b2,devDependencies:S2,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},k2=Ww.apiURL,E2=Ww.wsURL,T2=e=>[{limit:Number.parseInt(e.headers.get("X-Ratelimit-Limit")||"0"),remaining:Number.parseInt(e.headers.get("X-Ratelimit-Remaining")||"0"),reset:Number.parseInt(e.headers.get("X-Ratelimit-Reset")||"0"),retryAfter:Number.parseInt(e.headers.get("Retry-After")||"0")},429],C2=(e,t)=>[{message:"message"in t?t.message:"Not Found"},404],_2={429:T2,404:C2};async function vo(e,t={}){const n={};!(t.body instanceof FormData)&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${k2}/${e}`,{...t,credentials:"include",headers:{...t.headers,...n}}).catch(s=>(console.log("err::",s),new Response(null,{status:500})));if(!r.ok){let s={};try{return s=await r.json(),[s,r.status]}catch{console.log("response: ",r)}const o=_2[r.status];return o?o(r,s):[{},r.status]}const i=r.headers.get("Content-Type");return i&&i.includes("application/json")?[await r.json(),r.status]:[await r.text(),r.status]}const dc=e=>[200,201,204].includes(e),P2=(e,{arrayWithBrackets:t=!1,arrayWithBracketAndIndex:n=!0}={})=>{const r=new FormData;for(const[i,s]of Object.entries(e)){if(Array.isArray(s)){for(const o in s)t?r.append(`${i}[]`,s[o]):n?r.append(`${i}[${o}]`,s[o]):r.append(i,s[o]);continue}typeof s<"u"&&s!==null&&r.append(i,s)}return r};var yo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},qi=typeof window>"u"||"Deno"in globalThis;function Zt(){}function j2(e,t){return typeof e=="function"?e(t):e}function Wf(e){return typeof e=="number"&&e>=0&&e!==1/0}function qw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zs(e,t){return typeof e=="function"?e(t):e}function bn(e,t){return typeof e=="function"?e(t):e}function Cv(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==Qh(o,t.options))return!1}else if(!Ea(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function _v(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Ki(t.options.mutationKey)!==Ki(s))return!1}else if(!Ea(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Qh(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ki)(e)}function Ki(e){return JSON.stringify(e,(t,n)=>qf(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ea(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ea(e[n],t[n])):!1}function Kw(e,t){if(e===t)return e;const n=Pv(e)&&Pv(t);if(n||qf(e)&&qf(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{};let l=0;for(let u=0;u<o;u++){const d=n?u:s[u];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,l++):(a[d]=Kw(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function Au(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Pv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qf(e){if(!jv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!jv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function jv(e){return Object.prototype.toString.call(e)==="[object Object]"}function A2(e){return new Promise(t=>{setTimeout(t,e)})}function Kf(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Kw(e,t):t}function R2(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function O2(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Yh=Symbol();function Gw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Yh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var ji,Pr,Vs,bx,D2=(bx=class extends yo{constructor(){super();q(this,ji);q(this,Pr);q(this,Vs);$(this,Vs,t=>{if(!qi&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){k(this,Pr)||this.setEventListener(k(this,Vs))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Pr))==null||t.call(this),$(this,Pr,void 0))}setEventListener(t){var n;$(this,Vs,t),(n=k(this,Pr))==null||n.call(this),$(this,Pr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){k(this,ji)!==t&&($(this,ji,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof k(this,ji)=="boolean"?k(this,ji):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ji=new WeakMap,Pr=new WeakMap,Vs=new WeakMap,bx),Xh=new D2,Us,jr,Hs,Sx,F2=(Sx=class extends yo{constructor(){super();q(this,Us,!0);q(this,jr);q(this,Hs);$(this,Hs,t=>{if(!qi&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){k(this,jr)||this.setEventListener(k(this,Hs))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,jr))==null||t.call(this),$(this,jr,void 0))}setEventListener(t){var n;$(this,Hs,t),(n=k(this,jr))==null||n.call(this),$(this,jr,t(this.setOnline.bind(this)))}setOnline(t){k(this,Us)!==t&&($(this,Us,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return k(this,Us)}},Us=new WeakMap,jr=new WeakMap,Hs=new WeakMap,Sx),Ru=new F2;function Gf(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function N2(e){return Math.min(1e3*2**e,3e4)}function Qw(e){return(e??"online")==="online"?Ru.isOnline():!0}var Yw=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function yd(e){return e instanceof Yw}function Xw(e){let t=!1,n=0,r=!1,i;const s=Gf(),o=v=>{var b;r||(f(new Yw(v)),(b=e.abort)==null||b.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Xh.isFocused()&&(e.networkMode==="always"||Ru.isOnline())&&e.canRun(),d=()=>Qw(e.networkMode)&&e.canRun(),c=v=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,v),i==null||i(),s.resolve(v))},f=v=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,v),i==null||i(),s.reject(v))},p=()=>new Promise(v=>{var b;i=m=>{(r||u())&&v(m)},(b=e.onPause)==null||b.call(e)}).then(()=>{var v;i=void 0,r||(v=e.onContinue)==null||v.call(e)}),h=()=>{if(r)return;let v;const b=n===0?e.initialPromise:void 0;try{v=b??e.fn()}catch(m){v=Promise.reject(m)}Promise.resolve(v).then(c).catch(m=>{var C;if(r)return;const x=e.retry??(qi?0:3),w=e.retryDelay??N2,E=typeof w=="function"?w(n,m):w,T=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,m);if(t||!T){f(m);return}n++,(C=e.onFail)==null||C.call(e,n,m),A2(E).then(()=>u()?void 0:p()).then(()=>{t?f(m):h()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?h():p().then(h),s)}}function M2(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var Be=M2(),Ai,kx,Zw=(kx=class{constructor(){q(this,Ai)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wf(this.gcTime)&&$(this,Ai,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qi?1/0:5*60*1e3))}clearGcTimeout(){k(this,Ai)&&(clearTimeout(k(this,Ai)),$(this,Ai,void 0))}},Ai=new WeakMap,kx),Ws,qs,Xt,ut,$a,Ri,vn,Zn,Ex,L2=(Ex=class extends Zw{constructor(t){super();q(this,vn);q(this,Ws);q(this,qs);q(this,Xt);q(this,ut);q(this,$a);q(this,Ri);$(this,Ri,!1),$(this,$a,t.defaultOptions),this.setOptions(t.options),this.observers=[],$(this,Xt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,$(this,Ws,I2(this.options)),this.state=t.state??k(this,Ws),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=k(this,ut))==null?void 0:t.promise}setOptions(t){this.options={...k(this,$a),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,Xt).remove(this)}setData(t,n){const r=Kf(this.state.data,t,this.options);return ie(this,vn,Zn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ie(this,vn,Zn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=k(this,ut))==null?void 0:r.promise;return(i=k(this,ut))==null||i.cancel(t),n?n.then(Zt).catch(Zt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(k(this,Ws))}isActive(){return this.observers.some(t=>bn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Yh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!qw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,ut))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,ut))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),k(this,Xt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(k(this,ut)&&(k(this,Ri)?k(this,ut).cancel({revert:!0}):k(this,ut).cancelRetry()),this.scheduleGc()),k(this,Xt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ie(this,vn,Zn).call(this,{type:"invalidate"})}fetch(t,n){var l,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(k(this,ut))return k(this,ut).continueRetry(),k(this,ut).promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>($(this,Ri,!0),r.signal)})},s=()=>{const c=Gw(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),$(this,Ri,!1),this.options.persister?this.options.persister(c,f,this):c(f)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),$(this,qs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&ie(this,vn,Zn).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=c=>{var f,p,h,v;yd(c)&&c.silent||ie(this,vn,Zn).call(this,{type:"error",error:c}),yd(c)||((p=(f=k(this,Xt).config).onError)==null||p.call(f,c,this),(v=(h=k(this,Xt).config).onSettled)==null||v.call(h,this.state.data,c,this)),this.scheduleGc()};return $(this,ut,Xw({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var f,p,h,v;if(c===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(b){a(b);return}(p=(f=k(this,Xt).config).onSuccess)==null||p.call(f,c,this),(v=(h=k(this,Xt).config).onSettled)==null||v.call(h,c,this.state.error,this),this.scheduleGc()},onError:a,onFail:(c,f)=>{ie(this,vn,Zn).call(this,{type:"failed",failureCount:c,error:f})},onPause:()=>{ie(this,vn,Zn).call(this,{type:"pause"})},onContinue:()=>{ie(this,vn,Zn).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),k(this,ut).start()}},Ws=new WeakMap,qs=new WeakMap,Xt=new WeakMap,ut=new WeakMap,$a=new WeakMap,Ri=new WeakMap,vn=new WeakSet,Zn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Jw(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return yd(i)&&i.revert&&k(this,qs)?{...k(this,qs),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Be.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),k(this,Xt).notify({query:this,type:"updated",action:t})})},Ex);function Jw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Qw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function I2(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Dn,Tx,$2=(Tx=class extends yo{constructor(t={}){super();q(this,Dn);this.config=t,$(this,Dn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??Qh(i,n);let o=this.get(s);return o||(o=new L2({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){k(this,Dn).has(t.queryHash)||(k(this,Dn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=k(this,Dn).get(t.queryHash);n&&(t.destroy(),n===t&&k(this,Dn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Be.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return k(this,Dn).get(t)}getAll(){return[...k(this,Dn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Cv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Cv(t,r)):n}notify(t){Be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Be.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Be.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Dn=new WeakMap,Tx),Fn,ht,Oi,Nn,br,Cx,z2=(Cx=class extends Zw{constructor(t){super();q(this,Nn);q(this,Fn);q(this,ht);q(this,Oi);this.mutationId=t.mutationId,$(this,ht,t.mutationCache),$(this,Fn,[]),this.state=t.state||eb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){k(this,Fn).includes(t)||(k(this,Fn).push(t),this.clearGcTimeout(),k(this,ht).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){$(this,Fn,k(this,Fn).filter(n=>n!==t)),this.scheduleGc(),k(this,ht).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){k(this,Fn).length||(this.state.status==="pending"?this.scheduleGc():k(this,ht).remove(this))}continue(){var t;return((t=k(this,Oi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,u,d,c,f,p,h,v,b,m,x,w,E,T,C,S;$(this,Oi,Xw({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(_,j)=>{ie(this,Nn,br).call(this,{type:"failed",failureCount:_,error:j})},onPause:()=>{ie(this,Nn,br).call(this,{type:"pause"})},onContinue:()=>{ie(this,Nn,br).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,ht).canRun(this)}));const n=this.state.status==="pending",r=!k(this,Oi).canStart();try{if(!n){ie(this,Nn,br).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=k(this,ht).config).onMutate)==null?void 0:s.call(i,t,this));const j=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));j!==this.state.context&&ie(this,Nn,br).call(this,{type:"pending",context:j,variables:t,isPaused:r})}const _=await k(this,Oi).start();return await((u=(l=k(this,ht).config).onSuccess)==null?void 0:u.call(l,_,t,this.state.context,this)),await((c=(d=this.options).onSuccess)==null?void 0:c.call(d,_,t,this.state.context)),await((p=(f=k(this,ht).config).onSettled)==null?void 0:p.call(f,_,null,this.state.variables,this.state.context,this)),await((v=(h=this.options).onSettled)==null?void 0:v.call(h,_,null,t,this.state.context)),ie(this,Nn,br).call(this,{type:"success",data:_}),_}catch(_){try{throw await((m=(b=k(this,ht).config).onError)==null?void 0:m.call(b,_,t,this.state.context,this)),await((w=(x=this.options).onError)==null?void 0:w.call(x,_,t,this.state.context)),await((T=(E=k(this,ht).config).onSettled)==null?void 0:T.call(E,void 0,_,this.state.variables,this.state.context,this)),await((S=(C=this.options).onSettled)==null?void 0:S.call(C,void 0,_,t,this.state.context)),_}finally{ie(this,Nn,br).call(this,{type:"error",error:_})}}finally{k(this,ht).runNext(this)}}},Fn=new WeakMap,ht=new WeakMap,Oi=new WeakMap,Nn=new WeakSet,br=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Be.batch(()=>{k(this,Fn).forEach(r=>{r.onMutationUpdate(t)}),k(this,ht).notify({mutation:this,type:"updated",action:t})})},Cx);function eb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Mt,za,_x,B2=(_x=class extends yo{constructor(t={}){super();q(this,Mt);q(this,za);this.config=t,$(this,Mt,new Map),$(this,za,Date.now())}build(t,n,r){const i=new z2({mutationCache:this,mutationId:++sl(this,za)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=kl(t),r=k(this,Mt).get(n)??[];r.push(t),k(this,Mt).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=kl(t);if(k(this,Mt).has(n)){const i=(r=k(this,Mt).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?k(this,Mt).delete(n):k(this,Mt).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=k(this,Mt).get(kl(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=k(this,Mt).get(kl(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Be.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...k(this,Mt).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_v(n,r))}findAll(t={}){return this.getAll().filter(n=>_v(t,n))}notify(t){Be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Be.batch(()=>Promise.all(t.map(n=>n.continue().catch(Zt))))}},Mt=new WeakMap,za=new WeakMap,_x);function kl(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Av(e){return{onFetch:(t,n)=>{var d,c,f,p,h;const r=t.options,i=(f=(c=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],o=((h=t.state.data)==null?void 0:h.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let v=!1;const b=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},m=Gw(t.options,t.fetchOptions),x=async(w,E,T)=>{if(v)return Promise.reject();if(E==null&&w.pages.length)return Promise.resolve(w);const C={queryKey:t.queryKey,pageParam:E,direction:T?"backward":"forward",meta:t.options.meta};b(C);const S=await m(C),{maxPages:_}=t.options,j=T?O2:R2;return{pages:j(w.pages,S,_),pageParams:j(w.pageParams,E,_)}};if(i&&s.length){const w=i==="backward",E=w?V2:Rv,T={pages:s,pageParams:o},C=E(r,T);a=await x(T,C,w)}else{const w=e??s.length;do{const E=l===0?o[0]??r.initialPageParam:Rv(r,a);if(l>0&&E==null)break;a=await x(a,E),l++}while(l<w)}return a};t.options.persister?t.fetchFn=()=>{var v,b;return(b=(v=t.options).persister)==null?void 0:b.call(v,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Rv(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function V2(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Re,Ar,Rr,Ks,Gs,Or,Qs,Ys,Px,U2=(Px=class{constructor(e={}){q(this,Re);q(this,Ar);q(this,Rr);q(this,Ks);q(this,Gs);q(this,Or);q(this,Qs);q(this,Ys);$(this,Re,e.queryCache||new $2),$(this,Ar,e.mutationCache||new B2),$(this,Rr,e.defaultOptions||{}),$(this,Ks,new Map),$(this,Gs,new Map),$(this,Or,0)}mount(){sl(this,Or)._++,k(this,Or)===1&&($(this,Qs,Xh.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,Re).onFocus())})),$(this,Ys,Ru.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,Re).onOnline())})))}unmount(){var e,t;sl(this,Or)._--,k(this,Or)===0&&((e=k(this,Qs))==null||e.call(this),$(this,Qs,void 0),(t=k(this,Ys))==null||t.call(this),$(this,Ys,void 0))}isFetching(e){return k(this,Re).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,Ar).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,Re).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=k(this,Re).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(zs(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return k(this,Re).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=k(this,Re).get(r.queryHash),s=i==null?void 0:i.state.data,o=j2(t,s);if(o!==void 0)return k(this,Re).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Be.batch(()=>k(this,Re).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,Re).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=k(this,Re);Be.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=k(this,Re),r={type:"active",...e};return Be.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Be.batch(()=>k(this,Re).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Zt).catch(Zt)}invalidateQueries(e,t={}){return Be.batch(()=>{if(k(this,Re).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Be.batch(()=>k(this,Re).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Zt)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Zt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=k(this,Re).build(this,t);return n.isStaleByTime(zs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Zt).catch(Zt)}fetchInfiniteQuery(e){return e.behavior=Av(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Zt).catch(Zt)}ensureInfiniteQueryData(e){return e.behavior=Av(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ru.isOnline()?k(this,Ar).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,Re)}getMutationCache(){return k(this,Ar)}getDefaultOptions(){return k(this,Rr)}setDefaultOptions(e){$(this,Rr,e)}setQueryDefaults(e,t){k(this,Ks).set(Ki(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...k(this,Ks).values()],n={};return t.forEach(r=>{Ea(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){k(this,Gs).set(Ki(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...k(this,Gs).values()];let n={};return t.forEach(r=>{Ea(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...k(this,Rr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Qh(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===Yh&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,Rr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,Re).clear(),k(this,Ar).clear()}},Re=new WeakMap,Ar=new WeakMap,Rr=new WeakMap,Ks=new WeakMap,Gs=new WeakMap,Or=new WeakMap,Qs=new WeakMap,Ys=new WeakMap,Px),kt,ae,Ba,mt,Di,Xs,Dr,Mn,Va,Zs,Js,Fi,Ni,Fr,eo,de,Bo,Qf,Yf,Xf,Zf,Jf,ep,tp,tb,jx,H2=(jx=class extends yo{constructor(t,n){super();q(this,de);q(this,kt);q(this,ae);q(this,Ba);q(this,mt);q(this,Di);q(this,Xs);q(this,Dr);q(this,Mn);q(this,Va);q(this,Zs);q(this,Js);q(this,Fi);q(this,Ni);q(this,Fr);q(this,eo,new Set);this.options=n,$(this,kt,t),$(this,Mn,null),$(this,Dr,Gf()),this.options.experimental_prefetchInRender||k(this,Dr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,ae).addObserver(this),Ov(k(this,ae),this.options)?ie(this,de,Bo).call(this):this.updateResult(),ie(this,de,Zf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return np(k(this,ae),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return np(k(this,ae),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ie(this,de,Jf).call(this),ie(this,de,ep).call(this),k(this,ae).removeObserver(this)}setOptions(t,n){const r=this.options,i=k(this,ae);if(this.options=k(this,kt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof bn(this.options.enabled,k(this,ae))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ie(this,de,tp).call(this),k(this,ae).setOptions(this.options),r._defaulted&&!Au(this.options,r)&&k(this,kt).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,ae),observer:this});const s=this.hasListeners();s&&Dv(k(this,ae),i,this.options,r)&&ie(this,de,Bo).call(this),this.updateResult(n),s&&(k(this,ae)!==i||bn(this.options.enabled,k(this,ae))!==bn(r.enabled,k(this,ae))||zs(this.options.staleTime,k(this,ae))!==zs(r.staleTime,k(this,ae)))&&ie(this,de,Qf).call(this);const o=ie(this,de,Yf).call(this);s&&(k(this,ae)!==i||bn(this.options.enabled,k(this,ae))!==bn(r.enabled,k(this,ae))||o!==k(this,Fr))&&ie(this,de,Xf).call(this,o)}getOptimisticResult(t){const n=k(this,kt).getQueryCache().build(k(this,kt),t),r=this.createResult(n,t);return q2(this,r)&&($(this,mt,r),$(this,Xs,this.options),$(this,Di,k(this,ae).state)),r}getCurrentResult(){return k(this,mt)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){k(this,eo).add(t)}getCurrentQuery(){return k(this,ae)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=k(this,kt).defaultQueryOptions(t),r=k(this,kt).getQueryCache().build(k(this,kt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ie(this,de,Bo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,mt)))}createResult(t,n){var _;const r=k(this,ae),i=this.options,s=k(this,mt),o=k(this,Di),a=k(this,Xs),u=t!==r?t.state:k(this,Ba),{state:d}=t;let c={...d},f=!1,p;if(n._optimisticResults){const j=this.hasListeners(),R=!j&&Ov(t,n),L=j&&Dv(t,r,n,i);(R||L)&&(c={...c,...Jw(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:h,errorUpdatedAt:v,status:b}=c;if(n.select&&c.data!==void 0)if(s&&c.data===(o==null?void 0:o.data)&&n.select===k(this,Va))p=k(this,Zs);else try{$(this,Va,n.select),p=n.select(c.data),p=Kf(s==null?void 0:s.data,p,n),$(this,Zs,p),$(this,Mn,null)}catch(j){$(this,Mn,j)}else p=c.data;if(n.placeholderData!==void 0&&p===void 0&&b==="pending"){let j;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))j=s.data;else if(j=typeof n.placeholderData=="function"?n.placeholderData((_=k(this,Js))==null?void 0:_.state.data,k(this,Js)):n.placeholderData,n.select&&j!==void 0)try{j=n.select(j),$(this,Mn,null)}catch(R){$(this,Mn,R)}j!==void 0&&(b="success",p=Kf(s==null?void 0:s.data,j,n),f=!0)}k(this,Mn)&&(h=k(this,Mn),p=k(this,Zs),v=Date.now(),b="error");const m=c.fetchStatus==="fetching",x=b==="pending",w=b==="error",E=x&&m,T=p!==void 0,S={status:b,fetchStatus:c.fetchStatus,isPending:x,isSuccess:b==="success",isError:w,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:c.dataUpdatedAt,error:h,errorUpdatedAt:v,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!x,isLoadingError:w&&!T,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&T,isStale:Zh(t,n),refetch:this.refetch,promise:k(this,Dr)};if(this.options.experimental_prefetchInRender){const j=ne=>{S.status==="error"?ne.reject(S.error):S.data!==void 0&&ne.resolve(S.data)},R=()=>{const ne=$(this,Dr,S.promise=Gf());j(ne)},L=k(this,Dr);switch(L.status){case"pending":t.queryHash===r.queryHash&&j(L);break;case"fulfilled":(S.status==="error"||S.data!==L.value)&&R();break;case"rejected":(S.status!=="error"||S.error!==L.reason)&&R();break}}return S}updateResult(t){const n=k(this,mt),r=this.createResult(k(this,ae),this.options);if($(this,Di,k(this,ae).state),$(this,Xs,this.options),k(this,Di).data!==void 0&&$(this,Js,k(this,ae)),Au(r,n))return;$(this,mt,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!k(this,eo).size)return!0;const l=new Set(a??k(this,eo));return this.options.throwOnError&&l.add("error"),Object.keys(k(this,mt)).some(u=>{const d=u;return k(this,mt)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),ie(this,de,tb).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ie(this,de,Zf).call(this)}},kt=new WeakMap,ae=new WeakMap,Ba=new WeakMap,mt=new WeakMap,Di=new WeakMap,Xs=new WeakMap,Dr=new WeakMap,Mn=new WeakMap,Va=new WeakMap,Zs=new WeakMap,Js=new WeakMap,Fi=new WeakMap,Ni=new WeakMap,Fr=new WeakMap,eo=new WeakMap,de=new WeakSet,Bo=function(t){ie(this,de,tp).call(this);let n=k(this,ae).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Zt)),n},Qf=function(){ie(this,de,Jf).call(this);const t=zs(this.options.staleTime,k(this,ae));if(qi||k(this,mt).isStale||!Wf(t))return;const r=qw(k(this,mt).dataUpdatedAt,t)+1;$(this,Fi,setTimeout(()=>{k(this,mt).isStale||this.updateResult()},r))},Yf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,ae)):this.options.refetchInterval)??!1},Xf=function(t){ie(this,de,ep).call(this),$(this,Fr,t),!(qi||bn(this.options.enabled,k(this,ae))===!1||!Wf(k(this,Fr))||k(this,Fr)===0)&&$(this,Ni,setInterval(()=>{(this.options.refetchIntervalInBackground||Xh.isFocused())&&ie(this,de,Bo).call(this)},k(this,Fr)))},Zf=function(){ie(this,de,Qf).call(this),ie(this,de,Xf).call(this,ie(this,de,Yf).call(this))},Jf=function(){k(this,Fi)&&(clearTimeout(k(this,Fi)),$(this,Fi,void 0))},ep=function(){k(this,Ni)&&(clearInterval(k(this,Ni)),$(this,Ni,void 0))},tp=function(){const t=k(this,kt).getQueryCache().build(k(this,kt),this.options);if(t===k(this,ae))return;const n=k(this,ae);$(this,ae,t),$(this,Ba,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},tb=function(t){Be.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(k(this,mt))}),k(this,kt).getQueryCache().notify({query:k(this,ae),type:"observerResultsUpdated"})})},jx);function W2(e,t){return bn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ov(e,t){return W2(e,t)||e.state.data!==void 0&&np(e,t,t.refetchOnMount)}function np(e,t,n){if(bn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Zh(e,t)}return!1}function Dv(e,t,n,r){return(e!==t||bn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Zh(e,n)}function Zh(e,t){return bn(t.enabled,e)!==!1&&e.isStaleByTime(zs(t.staleTime,e))}function q2(e,t){return!Au(e.getCurrentResult(),t)}var Nr,Mr,Et,nr,ar,Gl,rp,Ax,K2=(Ax=class extends yo{constructor(t,n){super();q(this,ar);q(this,Nr);q(this,Mr);q(this,Et);q(this,nr);$(this,Nr,t),this.setOptions(n),this.bindMethods(),ie(this,ar,Gl).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=k(this,Nr).defaultMutationOptions(t),Au(this.options,n)||k(this,Nr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:k(this,Et),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Ki(n.mutationKey)!==Ki(this.options.mutationKey)?this.reset():((r=k(this,Et))==null?void 0:r.state.status)==="pending"&&k(this,Et).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=k(this,Et))==null||t.removeObserver(this)}onMutationUpdate(t){ie(this,ar,Gl).call(this),ie(this,ar,rp).call(this,t)}getCurrentResult(){return k(this,Mr)}reset(){var t;(t=k(this,Et))==null||t.removeObserver(this),$(this,Et,void 0),ie(this,ar,Gl).call(this),ie(this,ar,rp).call(this)}mutate(t,n){var r;return $(this,nr,n),(r=k(this,Et))==null||r.removeObserver(this),$(this,Et,k(this,Nr).getMutationCache().build(k(this,Nr),this.options)),k(this,Et).addObserver(this),k(this,Et).execute(t)}},Nr=new WeakMap,Mr=new WeakMap,Et=new WeakMap,nr=new WeakMap,ar=new WeakSet,Gl=function(){var n;const t=((n=k(this,Et))==null?void 0:n.state)??eb();$(this,Mr,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},rp=function(t){Be.batch(()=>{var n,r,i,s,o,a,l,u;if(k(this,nr)&&this.hasListeners()){const d=k(this,Mr).variables,c=k(this,Mr).context;(t==null?void 0:t.type)==="success"?((r=(n=k(this,nr)).onSuccess)==null||r.call(n,t.data,d,c),(s=(i=k(this,nr)).onSettled)==null||s.call(i,t.data,null,d,c)):(t==null?void 0:t.type)==="error"&&((a=(o=k(this,nr)).onError)==null||a.call(o,t.error,d,c),(u=(l=k(this,nr)).onSettled)==null||u.call(l,void 0,t.error,d,c))}this.listeners.forEach(d=>{d(k(this,Mr))})})},Ax),nb=g.createContext(void 0),rb=e=>{const t=g.useContext(nb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},G2=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(nb.Provider,{value:e,children:t})),ib=g.createContext(!1),Q2=()=>g.useContext(ib);ib.Provider;function Y2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var X2=g.createContext(Y2()),Z2=()=>g.useContext(X2);function sb(e,t){return typeof e=="function"?e(...t):!!e}function ip(){}var J2=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},e_=e=>{g.useEffect(()=>{e.clearReset()},[e])},t_=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&sb(n,[e.error,r]),n_=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},r_=(e,t)=>e.isLoading&&e.isFetching&&!t,i_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Fv=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function s_(e,t,n){var d,c,f,p,h;const r=rb(),i=Q2(),s=Z2(),o=r.defaultQueryOptions(e);(c=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||c.call(d,o),o._optimisticResults=i?"isRestoring":"optimistic",n_(o),J2(o,s),e_(s);const a=!r.getQueryCache().get(o.queryHash),[l]=g.useState(()=>new t(r,o)),u=l.getOptimisticResult(o);if(g.useSyncExternalStore(g.useCallback(v=>{const b=i?ip:l.subscribe(Be.batchCalls(v));return l.updateResult(),b},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),g.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),i_(o,u))throw Fv(o,l,s);if(t_({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw u.error;if((p=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||p.call(f,o,u),o.experimental_prefetchInRender&&!qi&&r_(u,i)){const v=a?Fv(o,l,s):(h=r.getQueryCache().get(o.queryHash))==null?void 0:h.promise;v==null||v.catch(ip).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?u:l.trackResult(u)}function o_(e,t){return s_(e,H2)}function Jh(e,t){const n=rb(),[r]=g.useState(()=>new K2(n,e));g.useEffect(()=>{r.setOptions(e)},[r,e]);const i=g.useSyncExternalStore(g.useCallback(o=>r.subscribe(Be.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=g.useCallback((o,a)=>{r.mutate(o,a).catch(ip)},[r]);if(i.error&&sb(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const a_=e=>o_({queryKey:["widgets",e],queryFn:()=>l_(e)}),l_=e=>vo(`widgets/with-link/${e}`);var Q=(e=>(e.Border="widget_border",e.Background="widget_background",e.InputBackground="widget_input_background",e.InputText="widget_input_text",e.InputBorder="widget_input_border",e.ButtonBackground="widget_button_background",e.ButtonText="widget_button_text",e.TooltipBackground="widget_tooltip_background",e.TooltipText="widget_tooltip_text",e.TooltipBorder="widget_tooltip_border",e.HeaderBackground="widget_header_background",e.HeaderText="widget_header_text",e.HeaderBorder="widget_header_border",e.FooterBackground="widget_footer_background",e.FooterText="widget_footer_text",e.FooterBorder="widget_footer_border",e.MessageAdminBackground="widget_message_admin_background",e.MessageAdminText="widget_message_admin_text",e.MessageVisitorBackground="widget_message_visitor_background",e.MessageVisitorText="widget_message_visitor_text",e.GreeterTopBackground="widget_greeter_top_background",e.GreeterTopText="widget_greeter_top_text",e.GreeterBackground="widget_greeter_background",e.GreeterText="widget_greeter_text",e.GreeterBorder="widget_greeter_border",e.GreeterButtonBackground="widget_greeter_button_background",e.GreeterButtonText="widget_greeter_button_text",e))(Q||{});function u_(e){return!!e&&typeof e.public_id=="string"&&typeof e.link_id=="string"&&typeof e.name=="string"&&typeof e.is_browser_notification_enabled=="boolean"&&typeof e.is_hidden_on_offline=="boolean"&&typeof e.is_upload_disabled=="boolean"}/**
41
41
  * @remix-run/router v1.21.0
42
42
  *
43
43
  * Copyright (c) Remix Software Inc.
@@ -92,7 +92,7 @@ Error generating stack: `+s.message+`
92
92
  ${f}px !important;
93
93
  top: ${u}px !important;
94
94
  }
95
- `),()=>{document.head.removeChild(p)}},[t]),y.jsx(zP,{isPresent:t,childRef:i,sizeRef:s,children:g.cloneElement(e,{ref:i})})}const VP=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a})=>{const l=hc(UP),u=g.useId();let d=!0,c=g.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:f=>{l.set(f,!0);for(const p of l.values())if(!p)return;r&&r()},register:f=>(l.set(f,!1),()=>l.delete(f))}),[n,l,r]);return s&&d&&(c={...c}),g.useMemo(()=>{l.forEach((f,p)=>l.set(p,!1))},[n]),g.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=y.jsx(BP,{isPresent:n,anchorX:a,children:e})),y.jsx(mc.Provider,{value:c,children:e})};function UP(){return new Map}function Eb(e=!0){const t=g.useContext(mc);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=g.useId();g.useEffect(()=>{if(e)return i(s)},[e]);const o=g.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const El=e=>e.key||"";function Kv(e){const t=[];return g.Children.forEach(e,n=>{g.isValidElement(n)&&t.push(n)}),t}const Yr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,u]=Eb(o),d=g.useMemo(()=>Kv(e),[e]),c=o&&!l?[]:d.map(El),f=g.useRef(!0),p=g.useRef(d),h=hc(()=>new Map),[v,b]=g.useState(d),[m,x]=g.useState(d);kb(()=>{f.current=!1,p.current=d;for(let T=0;T<m.length;T++){const C=El(m[T]);c.includes(C)?h.delete(C):h.get(C)!==!0&&h.set(C,!1)}},[m,c.length,c.join("-")]);const w=[];if(d!==v){let T=[...d];for(let C=0;C<m.length;C++){const S=m[C],_=El(S);c.includes(_)||(T.splice(C,0,S),w.push(S))}return s==="wait"&&w.length&&(T=w),x(Kv(T)),b(d),null}const{forceRender:E}=g.useContext(rm);return y.jsx(y.Fragment,{children:m.map(T=>{const C=El(T),S=o&&!l?!1:d===m||c.includes(C),_=()=>{if(h.has(C))h.set(C,!0);else return;let j=!0;h.forEach(R=>{R||(j=!1)}),j&&(E==null||E(),x(p.current),o&&(u==null||u()),r&&r())};return y.jsx(VP,{isPresent:S,initial:!f.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:S?void 0:_,anchorX:a,children:T},C)})})};function om(e,t){e.indexOf(t)===-1&&e.push(t)}function am(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let up=()=>{};const cp={skipAnimations:!1,useManualTiming:!1};function lm(e){let t;return()=>(t===void 0&&(t=e()),t)}const on=e=>e,Ca=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class um{constructor(){this.subscriptions=[]}add(t){return om(this.subscriptions,t),()=>am(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const zn=e=>e*1e3,Bn=e=>e/1e3;function Tb(e,t){return t?e*(1e3/t):0}const HP=lm(()=>window.ScrollTimeline!==void 0);class WP{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(HP()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class qP extends WP{then(t,n){return this.finished.finally(t).then(()=>{})}}const Gv={value:null,addProjectionMetrics:null},cm=e=>Array.isArray(e)&&typeof e[0]=="number",KP={};function GP(e,t){const n=lm(e);return()=>KP[t]??n()}const _a=GP(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Cb=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(s/(i-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Vo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,dp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vo([0,.65,.55,1]),circOut:Vo([.55,0,1,.45]),backIn:Vo([.31,.01,.66,-.59]),backOut:Vo([.33,1.53,.69,.99])};function _b(e,t){if(e)return typeof e=="function"&&_a()?Cb(e,t):cm(e)?Vo(e):Array.isArray(e)?e.map(n=>_b(n,t)||dp.easeOut):dp[e]}function QP(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},u=void 0){const d={[t]:n};l&&(d.offset=l);const c=_b(a,i);return Array.isArray(c)&&(d.easing=c),e.animate(d,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal",pseudoElement:u})}function dm(e){return typeof e=="function"&&"applyToOptions"in e}function fm(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Fu=2e4;function pm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Fu;)t+=n,r=e.next(t);return t>=Fu?1/0:t}function YP(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(pm(r),Fu);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:Bn(i)}}function Pb(e){return!!(typeof e=="function"&&_a()||!e||typeof e=="string"&&(e in dp||_a())||cm(e)||Array.isArray(e)&&e.every(Pb))}function Qv(e,t){e.timeline=t,e.onfinish=null}const Tl=["read","resolveKeyframes","update","preRender","render","postRender"];function XP(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(c){o.has(c)&&(d.schedule(c),e()),l++,c(a)}const d={schedule:(c,f=!1,p=!1)=>{const v=p&&i?n:r;return f&&o.add(c),v.has(c)||v.add(c),c},cancel:c=>{r.delete(c),o.delete(c)},process:c=>{if(a=c,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(u),t&&Gv.value&&Gv.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(c))}};return d}const ZP=40;function jb(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Tl.reduce((m,x)=>(m[x]=XP(s,t?x:void 0),m),{}),{read:a,resolveKeyframes:l,update:u,preRender:d,render:c,postRender:f}=o,p=()=>{const m=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(m-i.timestamp,ZP),1),i.timestamp=m,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),d.process(i),c.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},h=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Tl.reduce((m,x)=>{const w=o[x];return m[x]=(E,T=!1,C=!1)=>(n||h(),w.schedule(E,T,C)),m},{}),cancel:m=>{for(let x=0;x<Tl.length;x++)o[Tl[x]].cancel(m)},state:i,steps:o}}const{schedule:hm,cancel:G$}=jb(queueMicrotask,!1),{schedule:we,cancel:ni,state:nt,steps:bd}=jb(typeof requestAnimationFrame<"u"?requestAnimationFrame:on,!0);let Ql;function JP(){Ql=void 0}const Vn={now:()=>(Ql===void 0&&Vn.set(nt.isProcessing||cp.useManualTiming?nt.timestamp:performance.now()),Ql),set:e=>{Ql=e,queueMicrotask(JP)}},mn={x:!1,y:!1};function Ab(){return mn.x||mn.y}function ej(e){return e==="x"||e==="y"?mn[e]?null:(mn[e]=!0,()=>{mn[e]=!1}):mn.x||mn.y?null:(mn.x=mn.y=!0,()=>{mn.x=mn.y=!1})}function tj(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Rb(e,t){const n=tj(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Yv(e){return!(e.pointerType==="touch"||Ab())}function nj(e,t,n={}){const[r,i,s]=Rb(e,n),o=a=>{if(!Yv(a))return;const{target:l}=a,u=t(l,a);if(typeof u!="function"||!l)return;const d=c=>{Yv(c)&&(u(c),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Ob=(e,t)=>t?e===t?!0:Ob(e,t.parentElement):!1,mm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,rj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ij(e){return rj.has(e.tagName)||e.tabIndex!==-1}const Uo=new WeakSet;function Xv(e){return t=>{t.key==="Enter"&&e(t)}}function Sd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const sj=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Xv(()=>{if(Uo.has(n))return;Sd(n,"down");const i=Xv(()=>{Sd(n,"up")}),s=()=>Sd(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Zv(e){return mm(e)&&!Ab()}function oj(e,t,n={}){const[r,i,s]=Rb(e,n),o=a=>{const l=a.currentTarget;if(!Zv(a)||Uo.has(l))return;Uo.add(l);const u=t(l,a),d=(p,h)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",f),!(!Zv(p)||!Uo.has(l))&&(Uo.delete(l),typeof u=="function"&&u(p,{success:h}))},c=p=>{d(p,l===window||l===document||n.useGlobalTarget||Ob(l,p.target))},f=p=>{d(p,!1)};window.addEventListener("pointerup",c,i),window.addEventListener("pointercancel",f,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a instanceof HTMLElement&&(a.addEventListener("focus",u=>sj(u,i)),!ij(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}const Jv=30,aj=e=>!isNaN(parseFloat(e));class lj{constructor(t,n={}){this.version="12.7.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Vn.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Vn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=aj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new um);const r=this.events[t].add(n);return t==="change"?()=>{r(),we.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Vn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Jv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Jv);return Tb(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pa(e,t){return new lj(e,t)}const Db=g.createContext({strict:!1}),e0={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"]},uo={};for(const e in e0)uo[e]={isEnabled:t=>e0[e].some(n=>!!t[n])};function uj(e){for(const t in e)uo[t]={...uo[t],...e[t]}}const cj=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","ignoreStrict","viewport"]);function Nu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||cj.has(e)}let Fb=e=>!Nu(e);function dj(e){e&&(Fb=t=>t.startsWith("on")?!Nu(t):e(t))}try{dj(require("@emotion/is-prop-valid").default)}catch{}function fj(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Fb(i)||n===!0&&Nu(i)||!t&&!Nu(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function pj(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const gc=g.createContext({});function vc(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ja(e){return typeof e=="string"||Array.isArray(e)}const gm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vm=["initial",...gm];function yc(e){return vc(e.animate)||vm.some(t=>ja(e[t]))}function Nb(e){return!!(yc(e)||e.variants)}function hj(e,t){if(yc(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ja(n)?n:void 0,animate:ja(r)?r:void 0}}return e.inherit!==!1?t:{}}function mj(e){const{initial:t,animate:n}=hj(e,g.useContext(gc));return g.useMemo(()=>({initial:t,animate:n}),[t0(t),t0(n)])}function t0(e){return Array.isArray(e)?e.join(" "):e}const gj=Symbol.for("motionComponentSymbol");function Ps(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function vj(e,t,n){return g.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ps(n)&&(n.current=r))},[t])}const ym=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),yj="framerAppearId",Mb="data-"+ym(yj),Lb=g.createContext({});function xj(e,t,n,r,i){var v,b;const{visualElement:s}=g.useContext(gc),o=g.useContext(Db),a=g.useContext(mc),l=g.useContext(sm).reducedMotion,u=g.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=u.current,c=g.useContext(Lb);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&wj(u.current,n,i,c);const f=g.useRef(!1);g.useInsertionEffect(()=>{d&&f.current&&d.update(n,a)});const p=n[Mb],h=g.useRef(!!p&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,p))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,p)));return kb(()=>{d&&(f.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),hm.render(d.render),h.current&&d.animationState&&d.animationState.animateChanges())}),g.useEffect(()=>{d&&(!h.current&&d.animationState&&d.animationState.animateChanges(),h.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)==null||m.call(window,p)}),h.current=!1))}),d}function wj(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ib(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Ps(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:u})}function Ib(e){if(e)return e.options.allowProjection!==!1?e.projection:Ib(e.parent)}function bj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&uj(e);function s(a,l){let u;const d={...g.useContext(sm),...a,layoutId:Sj(a)},{isStatic:c}=d,f=mj(a),p=r(a,c);if(!c&&im){kj();const h=Ej(d);u=h.MeasureLayout,f.visualElement=xj(i,p,d,t,h.ProjectionNode)}return y.jsxs(gc.Provider,{value:f,children:[u&&f.visualElement?y.jsx(u,{visualElement:f.visualElement,...d}):null,n(i,a,vj(p,f.visualElement,l),p,c,f.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const o=g.forwardRef(s);return o[gj]=i,o}function Sj({layoutId:e}){const t=g.useContext(rm).id;return t&&e!==void 0?t+"-"+e:e}function kj(e,t){g.useContext(Db).strict}function Ej(e){const{drag:t,layout:n}=uo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const $b=e=>t=>typeof t=="string"&&t.startsWith(e),xm=$b("--"),Tj=$b("var(--"),wm=e=>Tj(e)?Cj.test(e.split("/*")[0].trim()):!1,Cj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Aa={};function _j(e){for(const t in e)Aa[t]=e[t],xm(t)&&(Aa[t].isCSSVariable=!0)}const xo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ts=new Set(xo);function zb(e,{layout:t,layoutId:n}){return ts.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Aa[e]||e==="opacity")}const ft=e=>!!(e&&e.getVelocity),Bb=(e,t)=>t&&typeof e=="number"?t.transform(e):e,fr=(e,t,n)=>n>t?t:n<e?e:n,wo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ra={...wo,transform:e=>fr(0,1,e)},Cl={...wo,default:1},Ya=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Sr=Ya("deg"),Un=Ya("%"),G=Ya("px"),Pj=Ya("vh"),jj=Ya("vw"),n0={...Un,parse:e=>Un.parse(e)/100,transform:e=>Un.transform(e*100)},Aj={borderWidth:G,borderTopWidth:G,borderRightWidth:G,borderBottomWidth:G,borderLeftWidth:G,borderRadius:G,radius:G,borderTopLeftRadius:G,borderTopRightRadius:G,borderBottomRightRadius:G,borderBottomLeftRadius:G,width:G,maxWidth:G,height:G,maxHeight:G,top:G,right:G,bottom:G,left:G,padding:G,paddingTop:G,paddingRight:G,paddingBottom:G,paddingLeft:G,margin:G,marginTop:G,marginRight:G,marginBottom:G,marginLeft:G,backgroundPositionX:G,backgroundPositionY:G},Rj={rotate:Sr,rotateX:Sr,rotateY:Sr,rotateZ:Sr,scale:Cl,scaleX:Cl,scaleY:Cl,scaleZ:Cl,skew:Sr,skewX:Sr,skewY:Sr,distance:G,translateX:G,translateY:G,translateZ:G,x:G,y:G,z:G,perspective:G,transformPerspective:G,opacity:Ra,originX:n0,originY:n0,originZ:G},r0={...wo,transform:Math.round},bm={...Aj,...Rj,zIndex:r0,size:G,fillOpacity:Ra,strokeOpacity:Ra,numOctaves:r0},Oj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Dj=xo.length;function Fj(e,t,n){let r="",i=!0;for(let s=0;s<Dj;s++){const o=xo[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Bb(a,bm[o]);if(!l){i=!1;const d=Oj[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Sm(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(ts.has(l)){o=!0;continue}else if(xm(l)){i[l]=u;continue}else{const d=Bb(u,bm[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=Fj(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${u} ${d}`}}const km=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Vb(e,t,n){for(const r in t)!ft(t[r])&&!zb(r,n)&&(e[r]=t[r])}function Nj({transformTemplate:e},t){return g.useMemo(()=>{const n=km();return Sm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Mj(e,t){const n=e.style||{},r={};return Vb(r,n,e),Object.assign(r,Nj(e,t)),r}function Lj(e,t){const n={},r=Mj(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Ij=["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 Em(e){return typeof e!="string"||e.includes("-")?!1:!!(Ij.indexOf(e)>-1||/[A-Z]/u.test(e))}const $j={offset:"stroke-dashoffset",array:"stroke-dasharray"},zj={offset:"strokeDashoffset",array:"strokeDasharray"};function Bj(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?$j:zj;e[s.offset]=G.transform(-r);const o=G.transform(t),a=G.transform(n);e[s.array]=`${o} ${a}`}function i0(e,t,n){return typeof e=="string"?e:G.transform(t+n*e)}function Vj(e,t,n){const r=i0(t,e.x,e.width),i=i0(n,e.y,e.height);return`${r} ${i}`}function Tm(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},d,c){if(Sm(e,u,c),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:h}=e;f.transform&&(h&&(p.transform=f.transform),delete f.transform),h&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=Vj(h,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&Bj(f,o,a,l,!1)}const Ub=()=>({...km(),attrs:{}}),Cm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Uj(e,t,n,r){const i=g.useMemo(()=>{const s=Ub();return Tm(s,t,Cm(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Vb(s,e.style,e),i.style={...s,...i.style}}return i}function Hj(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Em(n)?Uj:Lj)(r,s,o,n),u=fj(r,typeof n=="string",e),d=n!==g.Fragment?{...u,...l,ref:i}:{},{children:c}=r,f=g.useMemo(()=>ft(c)?c.get():c,[c]);return g.createElement(n,{...d,children:f})}}function s0(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function _m(e,t,n,r){if(typeof t=="function"){const[i,s]=s0(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=s0(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const fp=e=>Array.isArray(e),Wj=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),qj=e=>fp(e)?e[e.length-1]||0:e;function Yl(e){const t=ft(e)?e.get():e;return Wj(t)?t.toValue():t}function Kj({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:Gj(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const Hb=e=>(t,n)=>{const r=g.useContext(gc),i=g.useContext(mc),s=()=>Kj(e,t,r,i);return n?s():hc(s)};function Gj(e,t,n,r){const i={},s=r(e,{});for(const f in s)i[f]=Yl(s[f]);let{initial:o,animate:a}=e;const l=yc(e),u=Nb(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const c=d?a:o;if(c&&typeof c!="boolean"&&!vc(c)){const f=Array.isArray(c)?c:[c];for(let p=0;p<f.length;p++){const h=_m(e,f[p]);if(h){const{transitionEnd:v,transition:b,...m}=h;for(const x in m){let w=m[x];if(Array.isArray(w)){const E=d?w.length-1:0;w=w[E]}w!==null&&(i[x]=w)}for(const x in v)i[x]=v[x]}}}return i}function Pm(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(ft(r[o])||t.style&&ft(t.style[o])||zb(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const Qj={useVisualState:Hb({scrapeMotionValuesFromProps:Pm,createRenderState:km})};function Wb(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function qb(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const Kb=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"]);function Gb(e,t,n,r){qb(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Kb.has(i)?i:ym(i),t.attrs[i])}function Qb(e,t,n){const r=Pm(e,t,n);for(const i in e)if(ft(e[i])||ft(t[i])){const s=xo.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const o0=["x","y","width","height","cx","cy","r"],Yj={useVisualState:Hb({scrapeMotionValuesFromProps:Qb,createRenderState:Ub,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in i)if(ts.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<o0.length;a++){const l=o0[a];e[l]!==t[l]&&(o=!0)}o&&we.read(()=>{Wb(n,r),we.render(()=>{Tm(r,i,Cm(n.tagName),e.transformTemplate),Gb(n,r)})})}})};function Xj(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Em(r)?Yj:Qj,preloadedFeatures:e,useRender:Hj(i),createVisualElement:t,Component:r};return bj(o)}}function Oa(e,t,n){const r=e.getProps();return _m(r,t,n!==void 0?n:r.custom,e)}const Yb=new Set(["width","height","top","left","right","bottom",...xo]);function Zj(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pa(n))}function Jj(e,t){const n=Oa(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=qj(s[o]);Zj(e,o,a)}}function eA(e){return!!(ft(e)&&e.add)}function pp(e,t){const n=e.getValue("willChange");if(eA(n))return n.add(t);if(!n&&cp.WillChange){const r=new cp.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Xb(e){return e.props[Mb]}const Zb=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,tA=1e-7,nA=12;function rA(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=Zb(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>tA&&++a<nA);return o}function Xa(e,t,n,r){if(e===t&&n===r)return on;const i=s=>rA(s,0,1,e,n);return s=>s===0||s===1?s:Zb(i(s),t,r)}const Jb=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,eS=e=>t=>1-e(1-t),tS=Xa(.33,1.53,.69,.99),jm=eS(tS),nS=Jb(jm),rS=e=>(e*=2)<1?.5*jm(e):.5*(2-Math.pow(2,-10*(e-1))),Am=e=>1-Math.sin(Math.acos(e)),iS=eS(Am),sS=Jb(Am),oS=e=>/^0[^.\s]+$/u.test(e);function iA(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||oS(e):!0}const ea=e=>Math.round(e*1e5)/1e5,Rm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function sA(e){return e==null}const oA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Om=(e,t)=>n=>!!(typeof n=="string"&&oA.test(n)&&n.startsWith(e)||t&&!sA(n)&&Object.prototype.hasOwnProperty.call(n,t)),aS=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Rm);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},aA=e=>fr(0,255,e),kd={...wo,transform:e=>Math.round(aA(e))},Ti={test:Om("rgb","red"),parse:aS("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+kd.transform(e)+", "+kd.transform(t)+", "+kd.transform(n)+", "+ea(Ra.transform(r))+")"};function lA(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const hp={test:Om("#"),parse:lA,transform:Ti.transform},js={test:Om("hsl","hue"),parse:aS("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Un.transform(ea(t))+", "+Un.transform(ea(n))+", "+ea(Ra.transform(r))+")"},ct={test:e=>Ti.test(e)||hp.test(e)||js.test(e),parse:e=>Ti.test(e)?Ti.parse(e):js.test(e)?js.parse(e):hp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ti.transform(e):js.transform(e)},uA=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function cA(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Rm))==null?void 0:t.length)||0)+(((n=e.match(uA))==null?void 0:n.length)||0)>0}const lS="number",uS="color",dA="var",fA="var(",a0="${}",pA=/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 Da(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(pA,l=>(ct.test(l)?(r.color.push(s),i.push(uS),n.push(ct.parse(l))):l.startsWith(fA)?(r.var.push(s),i.push(dA),n.push(l)):(r.number.push(s),i.push(lS),n.push(parseFloat(l))),++s,a0)).split(a0);return{values:n,split:a,indexes:r,types:i}}function cS(e){return Da(e).values}function dS(e){const{split:t,types:n}=Da(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===lS?s+=ea(i[o]):a===uS?s+=ct.transform(i[o]):s+=i[o]}return s}}const hA=e=>typeof e=="number"?0:e;function mA(e){const t=cS(e);return dS(e)(t.map(hA))}const ri={test:cA,parse:cS,createTransformer:dS,getAnimatableNone:mA},gA=new Set(["brightness","contrast","saturate","opacity"]);function vA(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Rm)||[];if(!r)return e;const i=n.replace(r,"");let s=gA.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const yA=/\b([a-z-]*)\(.*?\)/gu,mp={...ri,getAnimatableNone:e=>{const t=e.match(yA);return t?t.map(vA).join(" "):e}},xA={...bm,color:ct,backgroundColor:ct,outlineColor:ct,fill:ct,stroke:ct,borderColor:ct,borderTopColor:ct,borderRightColor:ct,borderBottomColor:ct,borderLeftColor:ct,filter:mp,WebkitFilter:mp},fS=e=>xA[e];function pS(e,t){let n=fS(e);return n!==mp&&(n=ri),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const wA=new Set(["auto","none","0"]);function bA(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!wA.has(s)&&Da(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=pS(n,i)}const Ci=e=>e*180/Math.PI,gp=e=>{const t=Ci(Math.atan2(e[1],e[0]));return vp(t)},SA={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gp,rotateZ:gp,skewX:e=>Ci(Math.atan(e[1])),skewY:e=>Ci(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vp=e=>(e=e%360,e<0&&(e+=360),e),l0=gp,u0=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),c0=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),kA={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:u0,scaleY:c0,scale:e=>(u0(e)+c0(e))/2,rotateX:e=>vp(Ci(Math.atan2(e[6],e[5]))),rotateY:e=>vp(Ci(Math.atan2(-e[2],e[0]))),rotateZ:l0,rotate:l0,skewX:e=>Ci(Math.atan(e[4])),skewY:e=>Ci(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function d0(e){return e.includes("scale")?1:0}function yp(e,t){if(!e||e==="none")return d0(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=kA,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=SA,i=a}if(!i)return d0(t);const s=r[t],o=i[1].split(",").map(TA);return typeof s=="function"?s(o):o[s]}const EA=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return yp(n,t)};function TA(e){return parseFloat(e.trim())}const f0=e=>e===wo||e===G,CA=new Set(["x","y","z"]),_A=xo.filter(e=>!CA.has(e));function PA(e){const t=[];return _A.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const co={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>yp(t,"x"),y:(e,{transform:t})=>yp(t,"y")};co.translateX=co.x;co.translateY=co.y;const Ii=new Set;let xp=!1,wp=!1;function hS(){if(wp){const e=Array.from(Ii).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=PA(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}wp=!1,xp=!1,Ii.forEach(e=>e.complete()),Ii.clear()}function mS(){Ii.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(wp=!0)})}function jA(){mS(),hS()}class Dm{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ii.add(this),xp||(xp=!0,we.read(mS),we.resolveKeyframes(hS))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ii.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ii.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const gS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),AA=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function RA(e){const t=AA.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function vS(e,t,n=1){const[r,i]=RA(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return gS(o)?parseFloat(o):o}return wm(i)?vS(i,t,n+1):i}const yS=e=>t=>t.test(e),OA={test:e=>e==="auto",parse:e=>e},xS=[wo,G,Un,Sr,jj,Pj,OA],p0=e=>xS.find(yS(e));class wS extends Dm{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),wm(u))){const d=vS(u,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Yb.has(r)||t.length!==2)return;const[i,s]=t,o=p0(i),a=p0(s);if(o!==a)if(f0(o)&&f0(a))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)iA(t[i])&&r.push(i);r.length&&bA(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=co[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=co[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const h0=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ri.test(e)||e==="0")&&!e.startsWith("url("));function DA(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function FA(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=h0(i,t),a=h0(s,t);return!o||!a?!1:DA(e)||(n==="spring"||dm(n))&&r}const NA=e=>e!==null;function xc(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(NA),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const MA=40;class bS{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Vn.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>MA?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&jA(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Vn.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!FA(t,r,i,s))if(o)this.options.duration=0;else{l&&l(xc(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Pe=(e,t,n)=>e+(t-e)*n;function Ed(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function LA({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Ed(l,a,e+1/3),s=Ed(l,a,e),o=Ed(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Mu(e,t){return n=>n>0?t:e}const Td=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},IA=[hp,Ti,js],$A=e=>IA.find(t=>t.test(e));function m0(e){const t=$A(e);if(!t)return!1;let n=t.parse(e);return t===js&&(n=LA(n)),n}const g0=(e,t)=>{const n=m0(e),r=m0(t);if(!n||!r)return Mu(e,t);const i={...n};return s=>(i.red=Td(n.red,r.red,s),i.green=Td(n.green,r.green,s),i.blue=Td(n.blue,r.blue,s),i.alpha=Pe(n.alpha,r.alpha,s),Ti.transform(i))},zA=(e,t)=>n=>t(e(n)),Za=(...e)=>e.reduce(zA),bp=new Set(["none","hidden"]);function BA(e,t){return bp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function VA(e,t){return n=>Pe(e,t,n)}function Fm(e){return typeof e=="number"?VA:typeof e=="string"?wm(e)?Mu:ct.test(e)?g0:WA:Array.isArray(e)?SS:typeof e=="object"?ct.test(e)?g0:UA:Mu}function SS(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Fm(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function UA(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Fm(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function HA(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const WA=(e,t)=>{const n=ri.createTransformer(t),r=Da(e),i=Da(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?bp.has(e)&&!i.values.length||bp.has(t)&&!r.values.length?BA(e,t):Za(SS(HA(r,i),i.values),n):Mu(e,t)};function kS(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Pe(e,t,n):Fm(e)(e,t)}const qA=5;function ES(e,t,n){const r=Math.max(t-qA,0);return Tb(n-e(r),t-r)}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},Cd=.001;function KA({duration:e=Oe.duration,bounce:t=Oe.bounce,velocity:n=Oe.velocity,mass:r=Oe.mass}){let i,s,o=1-t;o=fr(Oe.minDamping,Oe.maxDamping,o),e=fr(Oe.minDuration,Oe.maxDuration,Bn(e)),o<1?(i=u=>{const d=u*o,c=d*e,f=d-n,p=Sp(u,o),h=Math.exp(-c);return Cd-f/p*h},s=u=>{const c=u*o*e,f=c*n+n,p=Math.pow(o,2)*Math.pow(u,2)*e,h=Math.exp(-c),v=Sp(Math.pow(u,2),o);return(-i(u)+Cd>0?-1:1)*((f-p)*h)/v}):(i=u=>{const d=Math.exp(-u*e),c=(u-n)*e+1;return-Cd+d*c},s=u=>{const d=Math.exp(-u*e),c=(n-u)*(e*e);return d*c});const a=5/e,l=QA(i,s,a);if(e=zn(e),isNaN(l))return{stiffness:Oe.stiffness,damping:Oe.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const GA=12;function QA(e,t,n){let r=n;for(let i=1;i<GA;i++)r=r-e(r)/t(r);return r}function Sp(e,t){return e*Math.sqrt(1-t*t)}const YA=["duration","bounce"],XA=["stiffness","damping","mass"];function v0(e,t){return t.some(n=>e[n]!==void 0)}function ZA(e){let t={velocity:Oe.velocity,stiffness:Oe.stiffness,damping:Oe.damping,mass:Oe.mass,isResolvedFromDuration:!1,...e};if(!v0(e,XA)&&v0(e,YA))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*fr(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Oe.mass,stiffness:i,damping:s}}else{const n=KA(e);t={...t,...n,mass:Oe.mass},t.isResolvedFromDuration=!0}return t}function Lu(e=Oe.visualDuration,t=Oe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:d,duration:c,velocity:f,isResolvedFromDuration:p}=ZA({...n,velocity:-Bn(n.velocity||0)}),h=f||0,v=u/(2*Math.sqrt(l*d)),b=o-s,m=Bn(Math.sqrt(l/d)),x=Math.abs(b)<5;r||(r=x?Oe.restSpeed.granular:Oe.restSpeed.default),i||(i=x?Oe.restDelta.granular:Oe.restDelta.default);let w;if(v<1){const T=Sp(m,v);w=C=>{const S=Math.exp(-v*m*C);return o-S*((h+v*m*b)/T*Math.sin(T*C)+b*Math.cos(T*C))}}else if(v===1)w=T=>o-Math.exp(-m*T)*(b+(h+m*b)*T);else{const T=m*Math.sqrt(v*v-1);w=C=>{const S=Math.exp(-v*m*C),_=Math.min(T*C,300);return o-S*((h+v*m*b)*Math.sinh(_)+T*b*Math.cosh(_))/T}}const E={calculatedDuration:p&&c||null,next:T=>{const C=w(T);if(p)a.done=T>=c;else{let S=0;v<1&&(S=T===0?zn(h):ES(w,T,C));const _=Math.abs(S)<=r,j=Math.abs(o-C)<=i;a.done=_&&j}return a.value=a.done?o:C,a},toString:()=>{const T=Math.min(pm(E),Fu),C=Cb(S=>E.next(T*S).value,T,30);return T+"ms "+C},toTransition:()=>{}};return E}Lu.applyToOptions=e=>{const t=YP(e,100,Lu);return e.ease=_a()?t.ease:"easeOut",e.duration=zn(t.duration),e.type="keyframes",e};function y0({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:d}){const c=e[0],f={done:!1,value:c},p=_=>a!==void 0&&_<a||l!==void 0&&_>l,h=_=>a===void 0?l:l===void 0||Math.abs(a-_)<Math.abs(l-_)?a:l;let v=n*t;const b=c+v,m=o===void 0?b:o(b);m!==b&&(v=m-c);const x=_=>-v*Math.exp(-_/r),w=_=>m+x(_),E=_=>{const j=x(_),R=w(_);f.done=Math.abs(j)<=u,f.value=f.done?m:R};let T,C;const S=_=>{p(f.value)&&(T=_,C=Lu({keyframes:[f.value,h(f.value)],velocity:ES(w,_,f.value),damping:i,stiffness:s,restDelta:u,restSpeed:d}))};return S(0),{calculatedDuration:null,next:_=>{let j=!1;return!C&&T===void 0&&(j=!0,E(_),S(_)),T!==void 0&&_>=T?C.next(_-T):(!j&&E(_),f)}}}const JA=Xa(.42,0,1,1),eR=Xa(0,0,.58,1),TS=Xa(.42,0,.58,1),tR=e=>Array.isArray(e)&&typeof e[0]!="number",x0={linear:on,easeIn:JA,easeInOut:TS,easeOut:eR,circIn:Am,circInOut:sS,circOut:iS,backIn:jm,backInOut:nS,backOut:tS,anticipate:rS},w0=e=>{if(cm(e)){up(e.length===4);const[t,n,r,i]=e;return Xa(t,n,r,i)}else if(typeof e=="string")return up(x0[e]!==void 0),x0[e];return e};function nR(e,t,n){const r=[],i=n||kS,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||on:t;a=Za(l,a)}r.push(a)}return r}function rR(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(up(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=nR(t,r,i),l=a.length,u=d=>{if(o&&d<e[0])return t[0];let c=0;if(l>1)for(;c<e.length-2&&!(d<e[c+1]);c++);const f=Ca(e[c],e[c+1],d);return a[c](f)};return n?d=>u(fr(e[0],e[s-1],d)):u}function iR(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Ca(0,t,r);e.push(Pe(n,1,i))}}function sR(e){const t=[0];return iR(t,e.length-1),t}function oR(e,t){return e.map(n=>n*t)}function aR(e,t){return e.map(()=>t||TS).splice(0,e.length-1)}function Iu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=tR(r)?r.map(w0):w0(r),s={done:!1,value:t[0]},o=oR(n&&n.length===t.length?n:sR(t),e),a=rR(o,t,{ease:Array.isArray(i)?i:aR(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const lR=e=>{const t=({timestamp:n})=>e(n);return{start:()=>we.update(t,!0),stop:()=>ni(t),now:()=>nt.isProcessing?nt.timestamp:Vn.now()}},uR={decay:y0,inertia:y0,tween:Iu,keyframes:Iu,spring:Lu},cR=e=>e/100;class Nm extends bS{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Dm,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=dm(n)?n:uR[n]||Iu;let l,u;a!==Iu&&typeof t[0]!="number"&&(l=Za(cR,kS(t[0],t[1])),t=[0,100]);const d=a({...this.options,keyframes:t});s==="mirror"&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=pm(d));const{calculatedDuration:c}=d,f=c+i,p=f*(r+1)-i;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:c,resolvedDuration:f,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:_}=this.options;return{done:!0,value:_[_.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:c}=r;if(this.startTime===null)return s.next(0);const{delay:f,repeat:p,repeatType:h,repeatDelay:v,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const m=this.currentTime-f*(this.speed>=0?1:-1),x=this.speed>=0?m<0:m>d;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let w=this.currentTime,E=s;if(p){const _=Math.min(this.currentTime,d)/c;let j=Math.floor(_),R=_%1;!R&&_>=1&&(R=1),R===1&&j--,j=Math.min(j,p+1),!!(j%2)&&(h==="reverse"?(R=1-R,v&&(R-=v/c)):h==="mirror"&&(E=o)),w=fr(0,1,R)*c}const T=x?{done:!1,value:l[0]}:E.next(w);a&&(T.value=a(T.value));let{done:C}=T;!x&&u!==null&&(C=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return S&&i!==void 0&&(T.value=xc(l,this.options,i)),b&&b(T.value),S&&this.finish(),T}get duration(){const{resolved:t}=this;return t?Bn(t.calculatedDuration):0}get time(){return Bn(this.currentTime)}set time(t){t=zn(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Bn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=lR,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}get finished(){return this.currentFinishedPromise}}const dR=new Set(["opacity","clipPath","filter","transform"]),fR=lm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),$u=10,pR=2e4;function hR(e){return dm(e.type)||e.type==="spring"||!Pb(e.ease)}function mR(e,t){const n=new Nm({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<pR;)r=n.sample(s),i.push(r.value),s+=$u;return{times:void 0,keyframes:i,duration:s-$u,ease:"linear"}}const CS={anticipate:rS,backInOut:nS,circInOut:sS};function gR(e){return e in CS}class b0 extends bS{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new wS(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&_a()&&gR(s)&&(s=CS[s]),hR(this.options)){const{onComplete:c,onUpdate:f,motionValue:p,element:h,...v}=this.options,b=mR(t,v);t=b.keyframes,t.length===1&&(t[1]=t[0]),r=b.duration,i=b.times,s=b.ease,o="keyframes"}const d=QP(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Qv(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:c}=this.options;a.set(xc(t,this.options,n)),c&&c(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Bn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Bn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=zn(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return on;const{animation:r}=n;Qv(r,t)}return on}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:c,element:f,...p}=this.options,h=new Nm({...p,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),v=zn(this.time);u.setWithVelocity(h.sample(v-$u).value,h.sample(v).value,$u)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return fR()&&r&&dR.has(r)&&(r!=="transform"||!u)&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const vR={type:"spring",stiffness:500,damping:25,restSpeed:10},yR=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xR={type:"keyframes",duration:.8},wR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bR=(e,{keyframes:t})=>t.length>2?xR:ts.has(e)?e.startsWith("scale")?yR(t[1]):vR:wR;function SR({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const Mm=(e,t,n,r={},i,s)=>o=>{const a=fm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-zn(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};SR(a)||(d={...d,...bR(e,d)}),d.duration&&(d.duration=zn(d.duration)),d.repeatDelay&&(d.repeatDelay=zn(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let c=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(c=!0)),d.allowFlatten=!a.type&&!a.ease,c&&!s&&t.get()!==void 0){const f=xc(d.keyframes,a);if(f!==void 0)return we.update(()=>{d.onUpdate(f),d.onComplete()}),new qP([])}return!s&&b0.supports(d)?new b0(d):new Nm(d)};function kR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function _S(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=t;r&&(s=r);const l=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in a){const c=e.getValue(d,e.latestValues[d]??null),f=a[d];if(f===void 0||u&&kR(u,d))continue;const p={delay:n,...fm(s||{},d)};let h=!1;if(window.MotionHandoffAnimation){const b=Xb(e);if(b){const m=window.MotionHandoffAnimation(b,d,we);m!==null&&(p.startTime=m,h=!0)}}pp(e,d),c.start(Mm(d,c,f,e.shouldReduceMotion&&Yb.has(d)?{type:!1}:p,e,h));const v=c.animation;v&&l.push(v)}return o&&Promise.all(l).then(()=>{we.update(()=>{o&&Jj(e,o)})}),l}function kp(e,t,n={}){var l;const r=Oa(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(_S(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:c,staggerDirection:f}=i;return ER(e,t,d+u,c,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,d]=a==="beforeChildren"?[s,o]:[o,s];return u().then(()=>d())}else return Promise.all([s(),o(n.delay)])}function ER(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(TR).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(kp(u,t,{...s,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function TR(e,t){return e.sortNodePosition(t)}function CR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>kp(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=kp(e,t,n);else{const i=typeof t=="function"?Oa(e,t,n.custom):t;r=Promise.all(_S(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function PS(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const _R=vm.length;function jS(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?jS(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<_R;n++){const r=vm[n],i=e.props[r];(ja(i)||i===!1)&&(t[r]=i)}return t}const PR=[...gm].reverse(),jR=gm.length;function AR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>CR(e,n,r)))}function RR(e){let t=AR(e),n=S0(),r=!0;const i=l=>(u,d)=>{var f;const c=Oa(e,d,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(c){const{transition:p,transitionEnd:h,...v}=c;u={...u,...v,...h}}return u};function s(l){t=l(e)}function o(l){const{props:u}=e,d=jS(e.parent)||{},c=[],f=new Set;let p={},h=1/0;for(let b=0;b<jR;b++){const m=PR[b],x=n[m],w=u[m]!==void 0?u[m]:d[m],E=ja(w),T=m===l?x.isActive:null;T===!1&&(h=b);let C=w===d[m]&&w!==u[m]&&E;if(C&&r&&e.manuallyAnimateOnMount&&(C=!1),x.protectedKeys={...p},!x.isActive&&T===null||!w&&!x.prevProp||vc(w)||typeof w=="boolean")continue;const S=OR(x.prevProp,w);let _=S||m===l&&x.isActive&&!C&&E||b>h&&E,j=!1;const R=Array.isArray(w)?w:[w];let L=R.reduce(i(m),{});T===!1&&(L={});const{prevResolvedValues:ne={}}=x,ee={...ne,...L},J=X=>{_=!0,f.has(X)&&(j=!0,f.delete(X)),x.needsAnimating[X]=!0;const O=e.getValue(X);O&&(O.liveStyle=!1)};for(const X in ee){const O=L[X],M=ne[X];if(p.hasOwnProperty(X))continue;let V=!1;fp(O)&&fp(M)?V=!PS(O,M):V=O!==M,V?O!=null?J(X):f.add(X):O!==void 0&&f.has(X)?J(X):x.protectedKeys[X]=!0}x.prevProp=w,x.prevResolvedValues=L,x.isActive&&(p={...p,...L}),r&&e.blockInitialAnimation&&(_=!1),_&&(!(C&&S)||j)&&c.push(...R.map(X=>({animation:X,options:{type:m}})))}if(f.size){const b={};if(typeof u.initial!="boolean"){const m=Oa(e,Array.isArray(u.initial)?u.initial[0]:u.initial);m&&m.transition&&(b.transition=m.transition)}f.forEach(m=>{const x=e.getBaseTarget(m),w=e.getValue(m);w&&(w.liveStyle=!0),b[m]=x??null}),c.push({animation:b})}let v=!!c.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,v?t(c):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=e.variantChildren)==null||c.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=o(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=S0(),r=!0}}}function OR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!PS(t,e):!1}function hi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function S0(){return{animate:hi(!0),whileInView:hi(),whileHover:hi(),whileTap:hi(),whileDrag:hi(),whileFocus:hi(),exit:hi()}}class li{constructor(t){this.isMounted=!1,this.node=t}update(){}}class DR extends li{constructor(t){super(t),t.animationState||(t.animationState=RR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();vc(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let FR=0;class NR extends li{constructor(){super(...arguments),this.id=FR++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const MR={animation:{Feature:DR},exit:{Feature:NR}};function Fa(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ja(e){return{point:{x:e.pageX,y:e.pageY}}}const LR=e=>t=>mm(t)&&e(t,Ja(t));function ta(e,t,n,r){return Fa(e,t,LR(n),r)}function AS({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function IR({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function $R(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const RS=1e-4,zR=1-RS,BR=1+RS,OS=.01,VR=0-OS,UR=0+OS;function vt(e){return e.max-e.min}function HR(e,t,n){return Math.abs(e-t)<=n}function k0(e,t,n,r=.5){e.origin=r,e.originPoint=Pe(t.min,t.max,e.origin),e.scale=vt(n)/vt(t),e.translate=Pe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=zR&&e.scale<=BR||isNaN(e.scale))&&(e.scale=1),(e.translate>=VR&&e.translate<=UR||isNaN(e.translate))&&(e.translate=0)}function na(e,t,n,r){k0(e.x,t.x,n.x,r?r.originX:void 0),k0(e.y,t.y,n.y,r?r.originY:void 0)}function E0(e,t,n){e.min=n.min+t.min,e.max=e.min+vt(t)}function WR(e,t,n){E0(e.x,t.x,n.x),E0(e.y,t.y,n.y)}function T0(e,t,n){e.min=t.min-n.min,e.max=e.min+vt(t)}function ra(e,t,n){T0(e.x,t.x,n.x),T0(e.y,t.y,n.y)}const C0=()=>({translate:0,scale:1,origin:0,originPoint:0}),As=()=>({x:C0(),y:C0()}),_0=()=>({min:0,max:0}),Ne=()=>({x:_0(),y:_0()});function Yt(e){return[e("x"),e("y")]}function _d(e){return e===void 0||e===1}function Ep({scale:e,scaleX:t,scaleY:n}){return!_d(e)||!_d(t)||!_d(n)}function yi(e){return Ep(e)||DS(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function DS(e){return P0(e.x)||P0(e.y)}function P0(e){return e&&e!=="0%"}function zu(e,t,n){const r=e-n,i=t*r;return n+i}function j0(e,t,n,r,i){return i!==void 0&&(e=zu(e,i,r)),zu(e,n,r)+t}function Tp(e,t=0,n=1,r,i){e.min=j0(e.min,t,n,r,i),e.max=j0(e.max,t,n,r,i)}function FS(e,{x:t,y:n}){Tp(e.x,t.translate,t.scale,t.originPoint),Tp(e.y,n.translate,n.scale,n.originPoint)}const A0=.999999999999,R0=1.0000000000001;function qR(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Os(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,FS(e,o)),r&&yi(s.latestValues)&&Os(e,s.latestValues))}t.x<R0&&t.x>A0&&(t.x=1),t.y<R0&&t.y>A0&&(t.y=1)}function Rs(e,t){e.min=e.min+t,e.max=e.max+t}function O0(e,t,n,r,i=.5){const s=Pe(e.min,e.max,i);Tp(e,t,n,s,r)}function Os(e,t){O0(e.x,t.x,t.scaleX,t.scale,t.originX),O0(e.y,t.y,t.scaleY,t.scale,t.originY)}function NS(e,t){return AS($R(e.getBoundingClientRect(),t))}function KR(e,t,n){const r=NS(e,n),{scroll:i}=t;return i&&(Rs(r.x,i.offset.x),Rs(r.y,i.offset.y)),r}const MS=({current:e})=>e?e.ownerDocument.defaultView:null,D0=(e,t)=>Math.abs(e-t);function GR(e,t){const n=D0(e.x,t.x),r=D0(e.y,t.y);return Math.sqrt(n**2+r**2)}class LS{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const c=jd(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=GR(c.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:h}=c,{timestamp:v}=nt;this.history.push({...h,timestamp:v});const{onStart:b,onMove:m}=this.handlers;f||(b&&b(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=Pd(f,this.transformPagePoint),we.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{this.end();const{onEnd:p,onSessionEnd:h,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=jd(c.type==="pointercancel"?this.lastMoveEventInfo:Pd(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(c,b),h&&h(c,b)},!mm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=Ja(t),a=Pd(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=nt;this.history=[{...l,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,jd(a,this.history)),this.removeListeners=Za(ta(this.contextWindow,"pointermove",this.handlePointerMove),ta(this.contextWindow,"pointerup",this.handlePointerUp),ta(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ni(this.updatePoint)}}function Pd(e,t){return t?{point:t(e.point)}:e}function F0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function jd({point:e},t){return{point:e,delta:F0(e,IS(t)),offset:F0(e,QR(t)),velocity:YR(t,.1)}}function QR(e){return e[0]}function IS(e){return e[e.length-1]}function YR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=IS(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>zn(t)));)n--;if(!r)return{x:0,y:0};const s=Bn(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function XR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Pe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Pe(n,e,r.max):Math.min(e,n)),e}function N0(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function ZR(e,{top:t,left:n,bottom:r,right:i}){return{x:N0(e.x,n,i),y:N0(e.y,t,r)}}function M0(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function JR(e,t){return{x:M0(e.x,t.x),y:M0(e.y,t.y)}}function eO(e,t){let n=.5;const r=vt(e),i=vt(t);return i>r?n=Ca(t.min,t.max-r,e.min):r>i&&(n=Ca(e.min,e.max-i,t.min)),fr(0,1,n)}function tO(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Cp=.35;function nO(e=Cp){return e===!1?e=0:e===!0&&(e=Cp),{x:L0(e,"left","right"),y:L0(e,"top","bottom")}}function L0(e,t,n){return{min:I0(e,t),max:I0(e,n)}}function I0(e,t){return typeof e=="number"?e:e[t]||0}const rO=new WeakMap;class iO{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ne(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:c}=this.getProps();c?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ja(d).point)},s=(d,c)=>{const{drag:f,dragPropagation:p,onDragStart:h}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ej(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Yt(b=>{let m=this.getAxisMotionValue(b).get()||0;if(Un.test(m)){const{projection:x}=this.visualElement;if(x&&x.layout){const w=x.layout.layoutBox[b];w&&(m=vt(w)*(parseFloat(m)/100))}}this.originPoint[b]=m}),h&&we.postRender(()=>h(d,c)),pp(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},o=(d,c)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:h,onDrag:v}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:b}=c;if(p&&this.currentDirection===null){this.currentDirection=sO(b),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",c.point,b),this.updateAxis("y",c.point,b),this.visualElement.render(),v&&v(d,c)},a=(d,c)=>this.stop(d,c),l=()=>Yt(d=>{var c;return this.getAnimationState(d)==="paused"&&((c=this.getAxisMotionValue(d).animation)==null?void 0:c.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new LS(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:MS(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&we.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!_l(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=XR(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Ps(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=ZR(r.layoutBox,t):this.constraints=!1,this.elastic=nO(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Yt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=tO(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ps(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=KR(r,i.root,this.visualElement.getTransformPagePoint());let o=JR(i.layout.layoutBox,s);if(n){const a=n(IR(o));this.hasMutatedConstraints=!!a,a&&(o=AS(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Yt(d=>{if(!_l(d,n,this.currentDirection))return;let c=l&&l[d]||{};o&&(c={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,h={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...c};return this.startAxisValueAnimation(d,h)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return pp(this.visualElement,t),r.start(Mm(t,r,0,n,this.visualElement,!1))}stopAnimation(){Yt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Yt(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Yt(n=>{const{drag:r}=this.getProps();if(!_l(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-Pe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ps(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Yt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=eO({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Yt(o=>{if(!_l(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Pe(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;rO.set(this.visualElement,this);const t=this.visualElement.current,n=ta(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ps(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),we.read(r);const o=Fa(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Yt(d=>{const c=this.getAxisMotionValue(d);c&&(this.originPoint[d]+=l[d].translate,c.set(c.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Cp,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function _l(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function sO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class oO extends li{constructor(t){super(t),this.removeGroupControls=on,this.removeListeners=on,this.controls=new iO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||on}unmount(){this.removeGroupControls(),this.removeListeners()}}const $0=e=>(t,n)=>{e&&we.postRender(()=>e(t,n))};class aO extends li{constructor(){super(...arguments),this.removePointerDownListener=on}onPointerDown(t){this.session=new LS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:MS(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:$0(t),onStart:$0(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&we.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=ta(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Xl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function z0(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Fo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(G.test(e))e=parseFloat(e);else return e;const n=z0(e,t.target.x),r=z0(e,t.target.y);return`${n}% ${r}%`}},lO={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=ri.parse(e);if(i.length>5)return r;const s=ri.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=Pe(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};class uO extends g.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;_j(cO),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Xl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||we.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),hm.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function $S(e){const[t,n]=Eb(),r=g.useContext(rm);return y.jsx(uO,{...e,layoutGroup:r,switchLayoutGroup:g.useContext(Lb),isPresent:t,safeToRemove:n})}const cO={borderRadius:{...Fo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fo,borderTopRightRadius:Fo,borderBottomLeftRadius:Fo,borderBottomRightRadius:Fo,boxShadow:lO};function dO(e,t,n){const r=ft(e)?e:Pa(e);return r.start(Mm("",r,t,n)),r.animation}function fO(e){return e instanceof SVGElement&&e.tagName!=="svg"}const pO=(e,t)=>e.depth-t.depth;class hO{constructor(){this.children=[],this.isDirty=!1}add(t){om(this.children,t),this.isDirty=!0}remove(t){am(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(pO),this.isDirty=!1,this.children.forEach(t)}}function mO(e,t){const n=Vn.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(ni(r),e(s-t))};return we.read(r,!0),()=>ni(r)}const zS=["TopLeft","TopRight","BottomLeft","BottomRight"],gO=zS.length,B0=e=>typeof e=="string"?parseFloat(e):e,V0=e=>typeof e=="number"||G.test(e);function vO(e,t,n,r,i,s){i?(e.opacity=Pe(0,n.opacity??1,yO(r)),e.opacityExit=Pe(t.opacity??1,0,xO(r))):s&&(e.opacity=Pe(t.opacity??1,n.opacity??1,r));for(let o=0;o<gO;o++){const a=`border${zS[o]}Radius`;let l=U0(t,a),u=U0(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||V0(l)===V0(u)?(e[a]=Math.max(Pe(B0(l),B0(u),r),0),(Un.test(u)||Un.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=Pe(t.rotate||0,n.rotate||0,r))}function U0(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const yO=BS(0,.5,iS),xO=BS(.5,.95,on);function BS(e,t,n){return r=>r<e?0:r>t?1:n(Ca(e,t,r))}function H0(e,t){e.min=t.min,e.max=t.max}function Gt(e,t){H0(e.x,t.x),H0(e.y,t.y)}function W0(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function q0(e,t,n,r,i){return e-=t,e=zu(e,1/n,r),i!==void 0&&(e=zu(e,1/i,r)),e}function wO(e,t=0,n=1,r=.5,i,s=e,o=e){if(Un.test(t)&&(t=parseFloat(t),t=Pe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Pe(s.min,s.max,r);e===s&&(a-=t),e.min=q0(e.min,t,n,a,i),e.max=q0(e.max,t,n,a,i)}function K0(e,t,[n,r,i],s,o){wO(e,t[n],t[r],t[i],t.scale,s,o)}const bO=["x","scaleX","originX"],SO=["y","scaleY","originY"];function G0(e,t,n,r){K0(e.x,t,bO,n?n.x:void 0,r?r.x:void 0),K0(e.y,t,SO,n?n.y:void 0,r?r.y:void 0)}function Q0(e){return e.translate===0&&e.scale===1}function VS(e){return Q0(e.x)&&Q0(e.y)}function Y0(e,t){return e.min===t.min&&e.max===t.max}function kO(e,t){return Y0(e.x,t.x)&&Y0(e.y,t.y)}function X0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function US(e,t){return X0(e.x,t.x)&&X0(e.y,t.y)}function Z0(e){return vt(e.x)/vt(e.y)}function J0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class EO{constructor(){this.members=[]}add(t){om(this.members,t),t.scheduleRender()}remove(t){if(am(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function TO(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:c,rotateY:f,skewX:p,skewY:h}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),c&&(r+=`rotateX(${c}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),h&&(r+=`skewY(${h}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Ad=["","X","Y","Z"],CO={visibility:"hidden"},ey=1e3;let _O=0;function Rd(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function HS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Xb(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",we,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&HS(r)}function WS({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=_O++,this.animationId=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.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(AO),this.nodes.forEach(NO),this.nodes.forEach(MO),this.nodes.forEach(RO)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new hO)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new um),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=fO(o),this.instance=o;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),e){let c;const f=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,c&&c(),c=mO(f,250),Xl.hasAnimatedSinceResize&&(Xl.hasAnimatedSinceResize=!1,this.nodes.forEach(ny))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:p,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||d.getDefaultTransition()||BO,{onLayoutAnimationStart:b,onLayoutAnimationComplete:m}=d.getProps(),x=!this.targetLayout||!US(this.targetLayout,h),w=!f&&p;if(this.options.layoutRoot||this.resumeFrom||w||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(c,w);const E={...fm(v,"layout"),onPlay:b,onComplete:m};(d.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else f||ny(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ni(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(LO),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&HS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const c=this.path[d];c.shouldResetTransform=!0,c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ty);return}this.isUpdating||this.nodes.forEach(DO),this.isUpdating=!1,this.nodes.forEach(FO),this.nodes.forEach(PO),this.nodes.forEach(jO),this.clearAllSnapshots();const a=Vn.now();nt.delta=fr(0,1e3/60,a-nt.timestamp),nt.timestamp=a,nt.isProcessing=!0,bd.update.process(nt),bd.preRender.process(nt),bd.render.process(nt),nt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(OO),this.sharedNodes.forEach(IO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,we.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){we.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!vt(this.snapshot.measuredBox.x)&&!vt(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ne(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!VS(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&(a||yi(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),VO(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return Ne();const a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(UO))){const{scroll:d}=this.root;d&&(Rs(a.x,d.offset.x),Rs(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=Ne();if(Gt(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:c,options:f}=d;d!==this.root&&c&&f.layoutScroll&&(c.wasRoot&&Gt(a,o),Rs(a.x,c.offset.x),Rs(a.y,c.offset.y))}return a}applyTransform(o,a=!1){const l=Ne();Gt(l,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Os(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),yi(d.latestValues)&&Os(l,d.latestValues)}return yi(this.latestValues)&&Os(l,this.latestValues),l}removeTransform(o){const a=Ne();Gt(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!yi(u.latestValues))continue;Ep(u.latestValues)&&u.updateSnapshot();const d=Ne(),c=u.measurePageBox();Gt(d,c),G0(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return yi(this.latestValues)&&G0(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==nt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var f;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:c}=this.options;if(!(!this.layout||!(d||c))){if(this.resolvedRelativeTargetAt=nt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ne(),this.relativeTargetOrigin=Ne(),ra(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Gt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ne(),this.targetWithTransforms=Ne()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),WR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Gt(this.target,this.layout.layoutBox),FS(this.target,this.targetDelta)):Gt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ne(),this.relativeTargetOrigin=Ne(),ra(this.relativeTargetOrigin,this.target,p.target),Gt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Ep(this.parent.latestValues)||DS(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var h;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===nt.timestamp&&(l=!1),l)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Gt(this.layoutCorrected,this.layout.layoutBox);const c=this.treeScale.x,f=this.treeScale.y;qR(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Ne());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(W0(this.prevProjectionDelta.x,this.projectionDelta.x),W0(this.prevProjectionDelta.y,this.projectionDelta.y)),na(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==c||this.treeScale.y!==f||!J0(this.projectionDelta.x,this.prevProjectionDelta.x)||!J0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=As(),this.projectionDelta=As(),this.projectionDeltaWithTransform=As()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},c=As();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Ne(),p=l?l.source:void 0,h=this.layout?this.layout.source:void 0,v=p!==h,b=this.getStack(),m=!b||b.members.length<=1,x=!!(v&&!m&&this.options.crossfade===!0&&!this.path.some(zO));this.animationProgress=0;let w;this.mixTargetDelta=E=>{const T=E/1e3;ry(c.x,o.x,T),ry(c.y,o.y,T),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ra(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),$O(this.relativeTarget,this.relativeTargetOrigin,f,T),w&&kO(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Ne()),Gt(w,this.relativeTarget)),v&&(this.animationValues=d,vO(d,u,this.latestValues,T,x,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ni(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=we.update(()=>{Xl.hasAnimatedSinceResize=!0,this.currentAnimation=dO(0,ey,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ey),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:d}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&qS(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Ne();const c=vt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+c;const f=vt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}Gt(a,l),Os(a,d),na(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new EO),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Rd("z",o,u,this.animationValues);for(let d=0;d<Ad.length;d++)Rd(`rotate${Ad[d]}`,o,u,this.animationValues),Rd(`skew${Ad[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}getProjectionStyles(o){if(!this.instance||this.isSVG)return;if(!this.isVisible)return CO;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=Yl(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=Yl(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!yi(this.latestValues)&&(p.transform=l?l({},""):"none",this.hasProjected=!1),p}const d=u.animationValues||u.latestValues;this.applyTransformsToTarget(),a.transform=TO(this.projectionDeltaWithTransform,this.treeScale,d),l&&(a.transform=l(d,a.transform));const{x:c,y:f}=this.projectionDelta;a.transformOrigin=`${c.origin*100}% ${f.origin*100}% 0`,u.animationValues?a.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const p in Aa){if(d[p]===void 0)continue;const{correct:h,applyTo:v,isCSSVariable:b}=Aa[p],m=a.transform==="none"?d[p]:h(d[p],u);if(v){const x=v.length;for(let w=0;w<x;w++)a[v[w]]=m}else b?this.options.visualElement.renderState.vars[p]=m:a[p]=m}return this.options.layoutId&&(a.pointerEvents=u===this?Yl(o==null?void 0:o.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(ty),this.root.sharedNodes.clear()}}}function PO(e){e.updateLayout()}function jO(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?Yt(c=>{const f=o?t.measuredBox[c]:t.layoutBox[c],p=vt(f);f.min=r[c].min,f.max=f.min+p}):qS(s,t.layoutBox,r)&&Yt(c=>{const f=o?t.measuredBox[c]:t.layoutBox[c],p=vt(r[c]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+p)});const a=As();na(a,r,t.layoutBox);const l=As();o?na(l,e.applyTransform(i,!0),t.measuredBox):na(l,r,t.layoutBox);const u=!VS(a);let d=!1;if(!e.resumeFrom){const c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:f,layout:p}=c;if(f&&p){const h=Ne();ra(h,t.layoutBox,f.layoutBox);const v=Ne();ra(v,r,p.layoutBox),US(h,v)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=h,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function AO(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function RO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function OO(e){e.clearSnapshot()}function ty(e){e.clearMeasurements()}function DO(e){e.isLayoutDirty=!1}function FO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ny(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function NO(e){e.resolveTargetDelta()}function MO(e){e.calcProjection()}function LO(e){e.resetSkewAndRotation()}function IO(e){e.removeLeadSnapshot()}function ry(e,t,n){e.translate=Pe(t.translate,0,n),e.scale=Pe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function iy(e,t,n,r){e.min=Pe(t.min,n.min,r),e.max=Pe(t.max,n.max,r)}function $O(e,t,n,r){iy(e.x,t.x,n.x,r),iy(e.y,t.y,n.y,r)}function zO(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const BO={duration:.45,ease:[.4,0,.1,1]},sy=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),oy=sy("applewebkit/")&&!sy("chrome/")?Math.round:on;function ay(e){e.min=oy(e.min),e.max=oy(e.max)}function VO(e){ay(e.x),ay(e.y)}function qS(e,t,n){return e==="position"||e==="preserve-aspect"&&!HR(Z0(t),Z0(n),.2)}function UO(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const HO=WS({attachResizeListener:(e,t)=>Fa(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Od={current:void 0},KS=WS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Od.current){const e=new HO({});e.mount(window),e.setOptions({layoutScroll:!0}),Od.current=e}return Od.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),WO={pan:{Feature:aO},drag:{Feature:oO,ProjectionNode:KS,MeasureLayout:$S}};function ly(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&we.postRender(()=>s(t,Ja(t)))}class qO extends li{mount(){const{current:t}=this.node;t&&(this.unmount=nj(t,(n,r)=>(ly(this.node,r,"Start"),i=>ly(this.node,i,"End"))))}unmount(){}}class KO extends li{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Za(Fa(this.node.current,"focus",()=>this.onFocus()),Fa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function uy(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&we.postRender(()=>s(t,Ja(t)))}class GO extends li{mount(){const{current:t}=this.node;t&&(this.unmount=oj(t,(n,r)=>(uy(this.node,r,"Start"),(i,{success:s})=>uy(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const _p=new WeakMap,Dd=new WeakMap,QO=e=>{const t=_p.get(e.target);t&&t(e)},YO=e=>{e.forEach(QO)};function XO({root:e,...t}){const n=e||document;Dd.has(n)||Dd.set(n,{});const r=Dd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(YO,{root:e,...t})),r[i]}function ZO(e,t,n){const r=XO(t);return _p.set(e,n),r.observe(e),()=>{_p.delete(e),r.unobserve(e)}}const JO={some:0,all:1};class e3 extends li{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:JO[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:c}=this.node.getProps(),f=u?d:c;f&&f(l)};return ZO(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(t3(t,n))&&this.startObserver()}unmount(){}}function t3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const n3={inView:{Feature:e3},tap:{Feature:GO},focus:{Feature:KO},hover:{Feature:qO}},r3={layout:{ProjectionNode:KS,MeasureLayout:$S}},Pp={current:null},GS={current:!1};function i3(){if(GS.current=!0,!!im)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Pp.current=e.matches;e.addListener(t),t()}else Pp.current=!1}const s3=[...xS,ct,ri],o3=e=>s3.find(yS(e)),a3=new WeakMap;function l3(e,t,n){for(const r in t){const i=t[r],s=n[r];if(ft(i))e.addValue(r,i);else if(ft(s))e.addValue(r,Pa(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,Pa(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const cy=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class u3{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Dm,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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 p=Vn.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,we.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:d}=o;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=yc(n),this.isVariantNode=Nb(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const h=f[p];l[p]!==void 0&&ft(h)&&h.set(l[p],!1)}}mount(t){this.current=t,a3.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),GS.current||i3(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Pp.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ni(this.notifyUpdate),ni(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ts.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&we.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in uo){const n=uo[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ne()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<cy.length;r++){const i=cy[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=l3(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pa(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(gS(r)||oS(r))?r=parseFloat(r):!o3(r)&&ri.test(n)&&(r=pS(t,n)),this.setBaseTarget(t,ft(r)?r.get():r)),ft(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=_m(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ft(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new um),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class QS extends u3{constructor(){super(...arguments),this.KeyframeResolver=wS}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ft(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function c3(e){return window.getComputedStyle(e)}class d3 extends QS{constructor(){super(...arguments),this.type="html",this.renderInstance=qb}readValueFromInstance(t,n){if(ts.has(n))return EA(t,n);{const r=c3(t),i=(xm(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return NS(t,n)}build(t,n,r){Sm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Pm(t,n,r)}}class f3 extends QS{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ne,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Wb(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ts.has(n)){const r=fS(n);return r&&r.default||0}return n=Kb.has(n)?n:ym(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Qb(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&we.postRender(this.updateDimensions)}build(t,n,r){Tm(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){Gb(t,n,r,i)}mount(t){this.isSVGTag=Cm(t.tagName),super.mount(t)}}const p3=(e,t)=>Em(e)?new f3(t):new d3(t,{allowProjection:e!==g.Fragment}),h3=Xj({...MR,...n3,...WO,...r3},p3),Te=pj(h3);class m3{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(r=>{r.start(t.nativeEvent||t,n)})}}const g3=()=>new m3;function v3(){return hc(g3)}const y3=e=>["zink","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"].includes(e),Ft=e=>{const[t,n]=e.split("-");return y3(t)?n?`var(--color-${t}-${n})`:`var(--color-${e}-500)`:`var(--color-${e})`};var Tr=(e=>(e.None="none",e.Sm="sm",e.Md="md",e.Lg="lg",e.Xl="xl",e.Full="full",e))(Tr||{});const YS=g.createContext({}),x3={[Q.Background]:"",[Q.Border]:"initial",[Q.TooltipText]:Ft("blue-700"),[Q.TooltipBackground]:Ft("blue-100"),[Q.TooltipBorder]:Ft("blue-500"),[Q.HeaderBackground]:Ft("blue-600"),[Q.HeaderBorder]:"initial",[Q.HeaderText]:"white",[Q.FooterBackground]:"",[Q.FooterBorder]:"",[Q.FooterText]:"",[Q.MessageAdminBackground]:"",[Q.MessageAdminText]:"",[Q.MessageVisitorBackground]:"",[Q.MessageVisitorText]:"",[Q.GreeterBackground]:"white",[Q.GreeterText]:Ft("slate-700"),[Q.GreeterBorder]:Ft("slate-200"),[Q.GreeterTopBackground]:"linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%)",[Q.GreeterTopText]:"white",[Q.GreeterButtonBackground]:Ft("indigo-600"),[Q.GreeterButtonText]:Ft("white"),[Q.ButtonBackground]:Ft("indigo-600"),[Q.ButtonText]:Ft("white"),[Q.InputBackground]:Ft("white"),[Q.InputText]:Ft("slate-800"),[Q.InputBorder]:Ft("slate-200")},w3={[Tr.None]:"0px",[Tr.Sm]:"var(--radius-xs)",[Tr.Md]:"var(--radius-sm)",[Tr.Lg]:"var(--radius-md)",[Tr.Xl]:"var(--radius-lg)",[Tr.Full]:"calc(infinity * 1px)"},b3=e=>{const t={...x3};if(!e||!e.appearance||!e.appearance.design||!e.appearance.design.colors)return t;for(const n in e.appearance.design.colors){const r=n;e.appearance.design.colors[r]&&(t[r]=e.appearance.design.colors[r])}return t};function S3({children:e,widget:t}){const n=b3(t),r=t&&t.appearance&&t.appearance.design&&t.appearance.design.border_radius?t.appearance.design.border_radius:Tr.Md,i=o=>n[o],s=()=>w3[r];return y.jsx(YS.Provider,{value:{colors:n,getColor:i,getRadius:s},children:e})}const hr=()=>g.useContext(YS);function rn({children:e,type:t="button",variant:n="primary",kind:r="solid",size:i="md",disabled:s=!1,rounded:o=!1,className:a,textKey:l=Q.ButtonText,bgKey:u=Q.ButtonBackground,animations:d={},withoutTheming:c,...f}){const p=hr();return y.jsx(Te.button,{type:t,className:fe("flex items-center justify-center focus:!ring-0 font-medium",{"rounded-full":o&&i!=="xs","rounded-lg":!o},a,qv[n]&&qv[n][r],IP[i][o?"rounded":"default"]),disabled:s,style:!c&&{color:p.getColor(l),backgroundColor:p.getColor(u),...o?{}:{borderRadius:p.getRadius()}},...d,...f,children:e})}function ve(){}ve.Home=function(t){return y.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:y.jsx("path",{d:"M3 13h1v7c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-7h1a1 1 0 00.707-1.707l-9-9a.999.999 0 00-1.414 0l-9 9A1 1 0 003 13zm7 7v-5h4v5h-4zm2-15.586l6 6V15l.001 5H16v-5c0-1.103-.897-2-2-2h-4c-1.103 0-2 .897-2 2v5H6v-9.586l6-6z"})})};ve.Chat=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});ve.Menu=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})});ve.MessageTyping=({className:e="size-5",...t})=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 9.75a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 0 1 .778-.332 48.294 48.294 0 0 0 5.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});ve.Check=function(t){return y.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",height:"1em",width:"1em",...t,children:y.jsx("path",{d:"M12.736 3.97a.733.733 0 011.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 01-1.065.02L3.217 8.384a.757.757 0 010-1.06.733.733 0 011.047 0l3.052 3.093 5.4-6.425a.247.247 0 01.02-.022z"})})};ve.Website=function(t){return y.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:[y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14 7a1 1 0 00-1 1v8a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1h-4zm3 2h-2v6h2V9z",clipRule:"evenodd"}),y.jsx("path",{fill:"currentColor",d:"M6 7a1 1 0 000 2h4a1 1 0 100-2H6zM6 11a1 1 0 100 2h4a1 1 0 100-2H6zM5 16a1 1 0 011-1h4a1 1 0 110 2H6a1 1 0 01-1-1z"}),y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 3a3 3 0 00-3 3v12a3 3 0 003 3h16a3 3 0 003-3V6a3 3 0 00-3-3H4zm16 2H4a1 1 0 00-1 1v12a1 1 0 001 1h16a1 1 0 001-1V6a1 1 0 00-1-1z",clipRule:"evenodd"})]})};ve.ArrowDown=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"})});ve.XCircle=({className:e="e-5",...t})=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});ve.X=({className:e="e-5",...t})=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})});ve.PaperAirplane=({className:e="e-5",...t})=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})});ve.Spin=function(t){return y.jsx("svg",{"data-name":"Layer 1",viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:y.jsx("path",{d:"M6.804 15a1 1 0 00-1.366-.366l-1.732 1a1 1 0 001 1.732l1.732-1A1 1 0 006.804 15zM3.706 8.366l1.732 1a1 1 0 101-1.732l-1.732-1a1 1 0 00-1 1.732zM6 12a1 1 0 00-1-1H3a1 1 0 000 2h2a1 1 0 001-1zm11.196-3a1 1 0 001.366.366l1.732-1a1 1 0 10-1-1.732l-1.732 1A1 1 0 0017.196 9zM15 6.804a1 1 0 001.366-.366l1-1.732a1 1 0 10-1.732-1l-1 1.732A1 1 0 0015 6.804zm5.294 8.83l-1.732-1a1 1 0 10-1 1.732l1.732 1a1 1 0 001-1.732zm-3.928 1.928a1 1 0 10-1.732 1l1 1.732a1 1 0 101.732-1zM21 11h-2a1 1 0 000 2h2a1 1 0 000-2zm-9 7a1 1 0 00-1 1v2a1 1 0 002 0v-2a1 1 0 00-1-1zm-3-.804a1 1 0 00-1.366.366l-1 1.732a1 1 0 001.732 1l1-1.732A1 1 0 009 17.196zM12 2a1 1 0 00-1 1v2a1 1 0 002 0V3a1 1 0 00-1-1z"})})};const qn=Object.create(null);qn.open="0";qn.close="1";qn.ping="2";qn.pong="3";qn.message="4";qn.upgrade="5";qn.noop="6";const Zl=Object.create(null);Object.keys(qn).forEach(e=>{Zl[qn[e]]=e});const jp={type:"error",data:"parser error"},XS=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ZS=typeof ArrayBuffer=="function",JS=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Lm=({type:e,data:t},n,r)=>XS&&t instanceof Blob?n?r(t):dy(t,r):ZS&&(t instanceof ArrayBuffer||JS(t))?n?r(t):dy(new Blob([t]),r):r(qn[e]+(t||"")),dy=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function fy(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Fd;function k3(e,t){if(XS&&e.data instanceof Blob)return e.data.arrayBuffer().then(fy).then(t);if(ZS&&(e.data instanceof ArrayBuffer||JS(e.data)))return t(fy(e.data));Lm(e,!1,n=>{Fd||(Fd=new TextEncoder),t(Fd.encode(n))})}const py="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ho=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<py.length;e++)Ho[py.charCodeAt(e)]=e;const E3=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r<n;r+=4)s=Ho[e.charCodeAt(r)],o=Ho[e.charCodeAt(r+1)],a=Ho[e.charCodeAt(r+2)],l=Ho[e.charCodeAt(r+3)],d[i++]=s<<2|o>>4,d[i++]=(o&15)<<4|a>>2,d[i++]=(a&3)<<6|l&63;return u},T3=typeof ArrayBuffer=="function",Im=(e,t)=>{if(typeof e!="string")return{type:"message",data:ek(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:C3(e.substring(1),t)}:Zl[n]?e.length>1?{type:Zl[n],data:e.substring(1)}:{type:Zl[n]}:jp},C3=(e,t)=>{if(T3){const n=E3(e);return ek(n,t)}else return{base64:!0,data:e}},ek=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},tk="",_3=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{Lm(s,!1,a=>{r[o]=a,++i===n&&t(r.join(tk))})})},P3=(e,t)=>{const n=e.split(tk),r=[];for(let i=0;i<n.length;i++){const s=Im(n[i],t);if(r.push(s),s.type==="error")break}return r};function j3(){return new TransformStream({transform(e,t){k3(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Nd;function Pl(e){return e.reduce((t,n)=>t+n.length,0)}function jl(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function A3(e,t){Nd||(Nd=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(Pl(n)<1)break;const l=jl(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Pl(n)<2)break;const l=jl(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Pl(n)<8)break;const l=jl(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(jp);break}i=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Pl(n)<i)break;const l=jl(n,i);a.enqueue(Im(s?l:Nd.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(jp);break}}}})}const nk=4;function Ie(e){if(e)return R3(e)}function R3(e){for(var t in Ie.prototype)e[t]=Ie.prototype[t];return e}Ie.prototype.on=Ie.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Ie.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Ie.prototype.off=Ie.prototype.removeListener=Ie.prototype.removeAllListeners=Ie.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Ie.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Ie.prototype.emitReserved=Ie.prototype.emit;Ie.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Ie.prototype.hasListeners=function(e){return!!this.listeners(e).length};const wc=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),tn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),O3="arraybuffer";function rk(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const D3=tn.setTimeout,F3=tn.clearTimeout;function bc(e,t){t.useNativeTimers?(e.setTimeoutFn=D3.bind(tn),e.clearTimeoutFn=F3.bind(tn)):(e.setTimeoutFn=tn.setTimeout.bind(tn),e.clearTimeoutFn=tn.clearTimeout.bind(tn))}const N3=1.33;function M3(e){return typeof e=="string"?L3(e):Math.ceil((e.byteLength||e.size)*N3)}function L3(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function ik(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function I3(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function $3(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class z3 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class $m extends Ie{constructor(t){super(),this.writable=!1,bc(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new z3(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Im(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=I3(t);return n.length?"?"+n:""}}class B3 extends $m{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};P3(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,_3(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=ik()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let sk=!1;try{sk=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const V3=sk;function U3(){}class H3 extends B3{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Hn extends Ie{constructor(t,n,r){super(),this.createRequest=t,bc(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=rk(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Hn.requestsCount++,Hn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=U3,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Hn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Hn.requestsCount=0;Hn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",hy);else if(typeof addEventListener=="function"){const e="onpagehide"in tn?"pagehide":"unload";addEventListener(e,hy,!1)}}function hy(){for(let e in Hn.requests)Hn.requests.hasOwnProperty(e)&&Hn.requests[e].abort()}const W3=function(){const e=ok({xdomain:!1});return e&&e.responseType!==null}();class q3 extends H3{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=W3&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Hn(ok,this.uri(),t)}}function ok(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||V3))return new XMLHttpRequest}catch{}if(!t)try{return new tn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ak=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class K3 extends $m{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=ak?{}:rk(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Lm(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&wc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=ik()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Md=tn.WebSocket||tn.MozWebSocket;class G3 extends K3{createSocket(t,n,r){return ak?new Md(t,n,r):n?new Md(t,n):new Md(t)}doWrite(t,n){this.ws.send(n)}}class Q3 extends $m{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=A3(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=j3();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&wc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Y3={websocket:G3,webtransport:Q3,polling:q3},X3=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Z3=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ap(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=X3.exec(e||""),s={},o=14;for(;o--;)s[Z3[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=J3(s,s.path),s.queryKey=eD(s,s.query),s}function J3(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function eD(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Rp=typeof addEventListener=="function"&&typeof removeEventListener=="function",Jl=[];Rp&&addEventListener("offline",()=>{Jl.forEach(e=>e())},!1);class Xr extends Ie{constructor(t,n){if(super(),this.binaryType=O3,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Ap(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Ap(n.host).host);bc(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),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},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=$3(this.opts.query)),Rp&&(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"})},Jl.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=nk,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Xr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Xr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),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 t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=M3(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,wc(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Xr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){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(),Rp&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Jl.indexOf(this._offlineEventListener);r!==-1&&Jl.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Xr.protocol=nk;class tD extends Xr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Xr.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",c=>{if(!r)if(c.type==="pong"&&c.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Xr.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const o=c=>{const f=new Error("probe error: "+c);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};function a(){o("transport closed")}function l(){o("socket closed")}function u(c){n&&c.name!==n.name&&s()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let nD=class extends tD{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>Y3[i]).filter(i=>!!i)),super(t,r)}};function rD(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Ap(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const iD=typeof ArrayBuffer=="function",sD=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,lk=Object.prototype.toString,oD=typeof Blob=="function"||typeof Blob<"u"&&lk.call(Blob)==="[object BlobConstructor]",aD=typeof File=="function"||typeof File<"u"&&lk.call(File)==="[object FileConstructor]";function zm(e){return iD&&(e instanceof ArrayBuffer||sD(e))||oD&&e instanceof Blob||aD&&e instanceof File}function eu(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(eu(e[n]))return!0;return!1}if(zm(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return eu(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&eu(e[n]))return!0;return!1}function lD(e){const t=[],n=e.data,r=e;return r.data=Op(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Op(e,t){if(!e)return e;if(zm(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Op(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Op(e[r],t));return n}return e}function uD(e,t){return e.data=Dp(e.data,t),delete e.attachments,e}function Dp(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Dp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Dp(e[n],t));return e}const cD=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],dD=5;var le;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(le||(le={}));class fD{constructor(t){this.replacer=t}encode(t){return(t.type===le.EVENT||t.type===le.ACK)&&eu(t)?this.encodeAsBinary({type:t.type===le.EVENT?le.BINARY_EVENT:le.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===le.BINARY_EVENT||t.type===le.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=lD(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function my(e){return Object.prototype.toString.call(e)==="[object Object]"}class Bm extends Ie{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===le.BINARY_EVENT;r||n.type===le.BINARY_ACK?(n.type=r?le.EVENT:le.ACK,this.reconstructor=new pD(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(zm(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(le[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===le.BINARY_EVENT||r.type===le.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(s,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(Bm.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case le.CONNECT:return my(n);case le.DISCONNECT:return n===void 0;case le.CONNECT_ERROR:return typeof n=="string"||my(n);case le.EVENT:case le.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&cD.indexOf(n[0])===-1);case le.ACK:case le.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class pD{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=uD(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const hD=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Bm,Encoder:fD,get PacketType(){return le},protocol:dD},Symbol.toStringTag,{value:"Module"}));function xn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const mD=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class uk extends Ie{constructor(t,n,r){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=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[xn(t,"open",this.onopen.bind(this)),xn(t,"packet",this.onpacket.bind(this)),xn(t,"error",this.onerror.bind(this)),xn(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,s;if(mD.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:le.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,c=n.pop();this._registerAckCallback(d,c),o.id=d}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:le.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case le.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 le.EVENT:case le.BINARY_EVENT:this.onevent(t);break;case le.ACK:case le.BINARY_ACK:this.onack(t);break;case le.DISCONNECT:this.ondisconnect();break;case le.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:le.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:le.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function bo(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}bo.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};bo.prototype.reset=function(){this.attempts=0};bo.prototype.setMin=function(e){this.ms=e};bo.prototype.setMax=function(e){this.max=e};bo.prototype.setJitter=function(e){this.jitter=e};class Fp extends Ie{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,bc(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new bo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||hD;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new nD(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=xn(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=xn(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(xn(t,"ping",this.onping.bind(this)),xn(t,"data",this.ondata.bind(this)),xn(t,"error",this.onerror.bind(this)),xn(t,"close",this.onclose.bind(this)),xn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){wc(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new uk(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const No={};function tu(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=rD(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=No[i]&&s in No[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Fp(r,t):(No[i]||(No[i]=new Fp(r,t)),l=No[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(tu,{Manager:Fp,Socket:uk,io:tu,connect:tu});const nu=e=>{const t=document.cookie.split(";").find(n=>n.includes(e));return t?t.split("=")[1]:null};var Wn=(e=>(e.CustomerToken="lc:customer:token",e.CustomerRefreshToken="lc:customer:refresh_token",e.DeviceId="lc:device:id",e))(Wn||{});const Ld=(e,t)=>{localStorage.setItem(e,t)},Bs=e=>localStorage.getItem(e),gy=()=>{localStorage.removeItem("lc:customer:token"),localStorage.removeItem("lc:customer:refresh_token"),localStorage.removeItem("lc:device:id")},ck=g.createContext(null),ns=()=>g.useContext(ck),gD=({children:e})=>{const[t,n]=g.useState(null),[r,i]=g.useState(!1),s=()=>{const c=tu(E2,{transports:["websocket"],auth:{customer_token:Bs(Wn.CustomerToken)||nu("customer_token"),device_id:Bs(Wn.DeviceId)||nu("device_id"),customer_refresh_token:Bs(Wn.CustomerRefreshToken)||nu("customer_refresh_token")}});c.on("error",f=>{console.error("Websocket error",f)}),c.on("connect",()=>{n(c),i(!0)})},o=()=>{t&&(t.connect(),i(!0))},a=()=>{t&&(t.disconnect(),i(!1))},l=(c,f)=>{t&&t.on(c,f)},u=(c,f)=>{t&&t.off(c,f)},d=(c,f,p)=>{t&&t.emit(c,f,p)};return y.jsx(ck.Provider,{value:{socket:t,connected:r,connect:s,reconnect:o,disconnect:a,on:l,off:u,emit:d},children:e})};var Kn=(e=>(e.ChatView="chat:user:view",e.ChatClose="chat:user:close",e.MessageList="message:list",e.MessageCreate="message:create",e.MessageTyping="message:typing",e.WidgetOpen="widget:open",e.WidgetClose="widget:close",e.PageChange="page-change",e))(Kn||{}),rt=(e=>(e.MessageAgentCreate="message:agent:create",e.MessageAgentTyping="message:agent:typing",e.Banned="banned",e.ChatUserClose="chat:user:close",e.ChatUserAssignee="chat:user:assignee",e.ChatToggleUpload="chat:user:upload:toggle",e))(rt||{});const Vm=e=>{const t=pb(),n=(r,i)=>{var o;const s=((o=z$.find(a=>a.name===r))==null?void 0:o.path)??"/";return typeof i=="object"&&s.includes(":")?Object.entries(i).reduce((a,[l,u])=>a.replace(`:${l}`,u),s):i?`${s}?${i}`:s};return{push:(r,i)=>{t(n(r,i),e)},path:n}};function vD(e){return e&&typeof e=="object"&&"customer_token"in e&&"customer_refresh_token"in e}const yD=()=>Jh({mutationFn:e=>vo(`clients/${e.client_id}/chats`,{method:"POST",body:JSON.stringify({inputs:e.inputs,client_id:void 0,widget_id:e.widget_id,history:e.history})})}),xD=e=>vo(`clients/${e}/chats`),Np=e=>vo(`clients/${e}/chats`,{method:"DELETE"}),wD=(e,t)=>vo("review",{method:"POST",body:JSON.stringify({rating:e,comment:t||void 0}),headers:{"X-Customer-Token":Bs(Wn.CustomerToken)||"","X-Customer-Refresh-Token":Bs(Wn.CustomerRefreshToken)||"","X-Device-Id":Bs(Wn.DeviceId)||""}}),bD=()=>Jh({mutationFn:e=>wD(e.rating,e.comment)}),SD=e=>Jh({mutationFn:t=>vo(`clients/${e}/chats/files`,{method:"POST",body:P2({files:t},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})});function kD(e){return e&&typeof e=="object"&&"file_urls"in e}const Bu=(e,t,n)=>{const r=typeof window<"u"?window:void 0;g.useEffect(()=>(r.addEventListener(e,t),()=>{r.removeEventListener(e,t,!1)}),[e,t,r])},So=()=>typeof window<"u"?/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent):!1;function Mp({text:e}){var o,a,l,u;const{widget:t,isHaveChat:n}=un(),r=hr(),[i,s]=g.useState(!0);return i?y.jsxs(Te.div,{initial:{opacity:0,scale:.8,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:10},transition:{type:"spring",damping:20,stiffness:300},className:fe("absolute bottom-full mb-3 p-3 shadow-lg whitespace-nowrap","w-auto right-0"),style:{borderRadius:r.getRadius(),backgroundColor:r.getColor(Q.TooltipBackground),color:r.getColor(Q.TooltipText)},children:[y.jsx("button",{onClick:()=>s(!1),className:"absolute top-2 right-2 p-1 rounded-full hover:bg-black/10 transition-colors","aria-label":"Kapat",children:y.jsx(ve.X,{className:"size-3"})}),y.jsx(Te.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.1,duration:.3},className:"text-sm font-medium pr-5",style:{color:r.getColor(Q.TooltipText)},children:e||(n?(a=(o=t==null?void 0:t.appearance)==null?void 0:o.design)==null?void 0:a.tooltip_message_active:(u=(l=t==null?void 0:t.appearance)==null?void 0:l.design)==null?void 0:u.tooltip_message)||"Bizimle sohbet edin!"}),y.jsx("div",{className:fe("absolute bottom-0 right-4 w-3 h-3 transform rotate-45 translate-y-1.5 bg-blue-100")})]}):null}const ED="/notify.mp3",TD=async e=>{await new Audio(e||ED).play()};function vy({fallback:e,fallbackOpen:t}){const[n]=g.useState(window.document.title),r=ns(),{isHaveChat:i,open:s,soundPath:o}=un(),[a,l]=g.useState(!0),[u,d]=g.useState(0),[c,f]=g.useState(null),p=()=>{TD(o)},h=(v,b)=>{if(c&&clearInterval(c),v||!i||b===0||Number.isNaN(b)){window.document.title=n,f(null);return}const m=setInterval(()=>{if(v||!i||b===0||Number.isNaN(b)){window.document.title=n,clearInterval(m),f(null);return}const x=`${b} Yeni mesajınız var! - ${n}`;window.document.title!==x?window.document.title=x:window.document.title=n},1e3);return f(m),()=>{clearInterval(m),f(null)}};return g.useEffect(()=>h(s&&a,u),[u,s,a]),g.useEffect(()=>{const v=()=>{l(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",v,!1),()=>{document.removeEventListener("visibilitychange",v)}},[]),g.useEffect(()=>{if(i&&s&&a&&d(0),!r||!i||s&&a)return;const v=()=>{!i||s&&a||(d(b=>b+1),p())};return r.on(rt.MessageAgentCreate,v),r.on(rt.ChatUserAssignee,p),()=>{r.off(rt.MessageAgentCreate,v),r.off(rt.ChatUserAssignee,p)}},[r,i,s,a]),s?null:!i||u===0?t?e:null:y.jsx(Mp,{text:"Yeni mesajlar var!"})}function CD({children:e,defaultOpen:t,border:n}){var L,ne,ee,J;const r=ns(),{open:i,setOpen:s,setIsHaveChat:o,isHaveChat:a,widget:l}=un(),[u]=g.useState(!0),d=Vm(),c=Qa(),f=hr(),p=So(),[h,v]=g.useState({x:0,y:0}),b=v3(),m=g.useRef(null),x=g.useRef(null),[w,E]=g.useState(!1);g.useEffect(()=>((()=>{E("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{E(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{E(!0)})}),[]),g.useEffect(()=>{a&&c.pathname==="/"&&d.push("chat")},[a]);const T=te=>{if(!m.current||!x.current)return te;const H=m.current.getBoundingClientRect(),X={width:window.innerWidth,height:window.innerHeight},O={top:20,right:20,bottom:40,left:20};let M=te.x,V=te.y;return H.right+M-h.x>X.width-O.right&&(M=X.width-O.right-H.width-(H.left-h.x)),H.left+M-h.x<O.left&&(M=O.left-(H.left-h.x)),H.bottom+V-h.y>X.height-O.bottom&&(V=X.height-O.bottom-H.height-(H.top-h.y)),H.top+V-h.y<O.top&&(V=O.top-(H.top-h.y)),{x:M,y:V}},C=()=>{s(!0),r&&r.emit(Kn.WidgetOpen,{})},S=()=>{s(!1),r&&r.emit(Kn.WidgetClose,{})},_=()=>{s(!1),o(!1),Np(l.client_id),d.push("registration")};g.useEffect(()=>{if(t&&!p&&s(!0),!(!r||!l))return r.on(rt.Banned,_),()=>{r.off(rt.Banned,_)}},[]),g.useEffect(()=>(p&&i?document.body.style.overflow="hidden":document.body.style.overflow="auto",()=>{document.body.style.overflow="auto"}),[p,i]);function j(te){w&&b.start(te)}const R=()=>{document.documentElement.style.setProperty("--app-height",`${window.innerHeight}px`)};return Bu("resize",R),Bu("orientationchange",R),y.jsx("section",{className:"relative w-full h-full",ref:x,children:y.jsxs(Yr,{children:[i&&y.jsx(Te.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{type:"spring",damping:25,stiffness:300,duration:.3},style:{width:p?"100%":((ne=(L=l==null?void 0:l.appearance)==null?void 0:L.design)==null?void 0:ne.width)||"21rem",height:p?"var(--app-height, 100dvh)":((J=(ee=l==null?void 0:l.appearance)==null?void 0:ee.design)==null?void 0:J.height)||"30rem",left:p?"0":"",right:p?"0px !important":"",maxHeight:p?"var(--app-height, 100dvh)":"",borderColor:f.getColor(Q.Border),boxShadow:"0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05)"},className:fe("fixed z-300 overflow-hidden rounded-xl",{"border border-solid dark:border-zink-500":n,"bottom-12 right-12":!p,"!bottom-0 !right-0":p}),children:e}),!w&&y.jsx("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:y.jsxs(Yr,{children:[y.jsx(vy,{fallback:y.jsx(Mp,{}),fallbackOpen:u}),!i&&y.jsxs(rn,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:C,children:[y.jsx(Te.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:fe("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:f.getColor(Q.ButtonBackground)}}),y.jsx(ve.Chat,{className:"size-7"})]}),i&&!p&&y.jsx(rn,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:S,children:y.jsx(ve.X,{className:"size-7"})})]})}),w&&y.jsx(Te.div,{ref:m,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:h.x,y:h.y},drag:w,dragControls:b,dragMomentum:!1,dragElastic:0,onDragEnd:(te,H)=>{const X={x:h.x+H.offset.x,y:h.y+H.offset.y},O=T(X);v(O)},children:y.jsxs(Yr,{children:[y.jsx(vy,{fallback:y.jsx(Mp,{}),fallbackOpen:u}),!i&&y.jsx("div",{className:"cursor-move",onPointerDown:j,children:y.jsxs(rn,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:C,children:[y.jsx(Te.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:fe("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:f.getColor(Q.ButtonBackground)}}),y.jsx(ve.Chat,{className:"size-7"})]})}),i&&!p&&y.jsx(rn,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:S,children:y.jsx(ve.X,{className:"size-7"})})]})})]})})}function dk(e){const{widget:t}=un();return y.jsx(S3,{widget:t,children:y.jsx(CD,{...e})})}function rs(e){this._maxSize=e,this.clear()}rs.prototype.clear=function(){this._size=0,this._values=Object.create(null)};rs.prototype.get=function(e){return this._values[e]};rs.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var _D=/[^.^\]^[]+|(?=\[\]|\.\.)/g,fk=/^\d+$/,PD=/^\d/,jD=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,AD=/^\s*(['"]?)(.*?)(\1)\s*$/,Um=512,yy=new rs(Um),xy=new rs(Um),wy=new rs(Um),$i={Cache:rs,split:Lp,normalizePath:Id,setter:function(e){var t=Id(e);return xy.get(e)||xy.set(e,function(r,i){for(var s=0,o=t.length,a=r;s<o-1;){var l=t[s];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;a=a[t[s++]]}a[t[s]]=i})},getter:function(e,t){var n=Id(e);return wy.get(e)||wy.set(e,function(i){for(var s=0,o=n.length;s<o;)if(i!=null||!t)i=i[n[s++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(Hm(n)||fk.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){RD(Array.isArray(e)?e:Lp(e),t,n)}};function Id(e){return yy.get(e)||yy.set(e,Lp(e).map(function(t){return t.replace(AD,"$2")}))}function Lp(e){return e.match(_D)||[""]}function RD(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(FD(i)&&(i='"'+i+'"'),a=Hm(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function Hm(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function OD(e){return e.match(PD)&&!e.match(fk)}function DD(e){return jD.test(e)}function FD(e){return!Hm(e)&&(OD(e)||DD(e))}const ND=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Sc=e=>e.match(ND)||[],kc=e=>e[0].toUpperCase()+e.slice(1),Wm=(e,t)=>Sc(e).join(t).toLowerCase(),pk=e=>Sc(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),MD=e=>kc(pk(e)),LD=e=>Wm(e,"_"),ID=e=>Wm(e,"-"),$D=e=>kc(Wm(e," ")),zD=e=>Sc(e).map(kc).join(" ");var $d={words:Sc,upperFirst:kc,camelCase:pk,pascalCase:MD,snakeCase:LD,kebabCase:ID,sentenceCase:$D,titleCase:zD},qm={exports:{}};qm.exports=function(e){return hk(BD(e),e)};qm.exports.array=hk;function hk(e,t){var n=e.length,r=new Array(n),i={},s=n,o=VD(t),a=UD(e);for(t.forEach(function(u){if(!a.has(u[0])||!a.has(u[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||l(e[s],s,new Set);return r;function l(u,d,c){if(c.has(u)){var f;try{f=", node was:"+JSON.stringify(u)}catch{f=""}throw new Error("Cyclic dependency"+f)}if(!a.has(u))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(u));if(!i[d]){i[d]=!0;var p=o.get(u)||new Set;if(p=Array.from(p),d=p.length){c.add(u);do{var h=p[--d];l(h,a.get(h),c)}while(d);c.delete(u)}r[--n]=u}}}function BD(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function VD(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function UD(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var HD=qm.exports;const WD=Qi(HD),qD=Object.prototype.toString,KD=Error.prototype.toString,GD=RegExp.prototype.toString,QD=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",YD=/^Symbol\((.*)\)(.*)$/;function XD(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function by(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return XD(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return QD.call(e).replace(YD,"Symbol($1)");const r=qD.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+KD.call(e)+"]":r==="RegExp"?GD.call(e):null}function Zr(e,t){let n=by(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=by(this[r],t);return s!==null?s:i},2)}function mk(e){return e==null?[]:[].concat(e)}let gk,vk,yk,ZD=/\$\{\s*(\w+)\s*\}/g;gk=Symbol.toStringTag;class Sy{constructor(t,n,r,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[gk]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],mk(t).forEach(s=>{if(_t.isError(s)){this.errors.push(...s.errors);const o=s.inner.length?s.inner:[s];this.inner.push(...o)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}vk=Symbol.hasInstance;yk=Symbol.toStringTag;class _t extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(ZD,(i,s)=>Zr(n[s])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i,s){const o=new Sy(t,n,r,i);if(s)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[yk]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,_t)}static[vk](t){return Sy[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let On={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${Zr(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Zr(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${Zr(n,!0)}\``+i}},St={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},JD={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Ip={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},eF={isValue:"${path} field must be ${value}"},ru={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},tF={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},nF={notType:e=>{const{path:t,value:n,spec:r}=e,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${Zr(n,!0)}\``;if(n.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${Zr(n,!0)}\``}return _t.formatError(On.notType,e)}};Object.assign(Object.create(null),{mixed:On,string:St,number:JD,date:Ip,object:ru,array:tF,boolean:eF,tuple:nF});const Km=e=>e&&e.__isYupSchema__;class Vu{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:s}=n,o=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new Vu(t,(a,l)=>{var u;let d=o(...a)?i:s;return(u=d==null?void 0:d(l))!=null?u:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(s=>s.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!Km(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const Al={context:"$",value:"."};class is{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Al.context,this.isValue=this.key[0]===Al.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Al.context:this.isValue?Al.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&$i.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}is.prototype.__isYupRef=!0;const _i=e=>e==null;function hs(e){function t({value:n,path:r="",options:i,originalValue:s,schema:o},a,l){const{name:u,test:d,params:c,message:f,skipAbsent:p}=e;let{parent:h,context:v,abortEarly:b=o.spec.abortEarly,disableStackTrace:m=o.spec.disableStackTrace}=i;function x(L){return is.isRef(L)?L.getValue(n,h,v):L}function w(L={}){const ne=Object.assign({value:n,originalValue:s,label:o.spec.label,path:L.path||r,spec:o.spec,disableStackTrace:L.disableStackTrace||m},c,L.params);for(const J of Object.keys(ne))ne[J]=x(ne[J]);const ee=new _t(_t.formatError(L.message||f,ne),n,ne.path,L.type||u,ne.disableStackTrace);return ee.params=ne,ee}const E=b?a:l;let T={path:r,parent:h,type:u,from:i.from,createError:w,resolve:x,options:i,originalValue:s,schema:o};const C=L=>{_t.isError(L)?E(L):L?l(null):E(w())},S=L=>{_t.isError(L)?E(L):a(L)};if(p&&_i(n))return C(!0);let j;try{var R;if(j=d.call(T,n,T),typeof((R=j)==null?void 0:R.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${T.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(j).then(C,S)}}catch(L){S(L);return}C(j)}return t.OPTIONS=e,t}function rF(e,t,n,r=n){let i,s,o;return t?($i.forEach(t,(a,l,u)=>{let d=l?a.slice(1,a.length-1):a;e=e.resolve({context:r,parent:i,value:n});let c=e.type==="tuple",f=u?parseInt(d,10):0;if(e.innerType||c){if(c&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&f>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[f],e=c?e.spec.types[f]:e.innerType}if(!u){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);i=n,n=n&&n[d],e=e.fields[d]}s=d,o=l?"["+a+"]":"."+a}),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}class Uu extends Set{describe(){const t=[];for(const n of this.values())t.push(is.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new Uu(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Ds(e,t=new Map){if(Km(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Ds(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,i]of e.entries())n.set(r,Ds(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Ds(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Ds(i,t)}else throw Error(`Unable to clone ${e}`);return n}class Gn{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Uu,this._blacklist=new Uu,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(On.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Ds(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(s=>{t.tests.forEach(o=>{s.test(o.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,s)=>s.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i,s;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(s=t.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",s=r._cast(t,n);if(n.assert!==!1&&!r.isType(s)){if(i&&_i(s))return s;let o=Zr(t),a=Zr(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
95
+ `),()=>{document.head.removeChild(p)}},[t]),y.jsx(zP,{isPresent:t,childRef:i,sizeRef:s,children:g.cloneElement(e,{ref:i})})}const VP=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a})=>{const l=hc(UP),u=g.useId();let d=!0,c=g.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:f=>{l.set(f,!0);for(const p of l.values())if(!p)return;r&&r()},register:f=>(l.set(f,!1),()=>l.delete(f))}),[n,l,r]);return s&&d&&(c={...c}),g.useMemo(()=>{l.forEach((f,p)=>l.set(p,!1))},[n]),g.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=y.jsx(BP,{isPresent:n,anchorX:a,children:e})),y.jsx(mc.Provider,{value:c,children:e})};function UP(){return new Map}function Eb(e=!0){const t=g.useContext(mc);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=g.useId();g.useEffect(()=>{if(e)return i(s)},[e]);const o=g.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const El=e=>e.key||"";function Kv(e){const t=[];return g.Children.forEach(e,n=>{g.isValidElement(n)&&t.push(n)}),t}const Yr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,u]=Eb(o),d=g.useMemo(()=>Kv(e),[e]),c=o&&!l?[]:d.map(El),f=g.useRef(!0),p=g.useRef(d),h=hc(()=>new Map),[v,b]=g.useState(d),[m,x]=g.useState(d);kb(()=>{f.current=!1,p.current=d;for(let T=0;T<m.length;T++){const C=El(m[T]);c.includes(C)?h.delete(C):h.get(C)!==!0&&h.set(C,!1)}},[m,c.length,c.join("-")]);const w=[];if(d!==v){let T=[...d];for(let C=0;C<m.length;C++){const S=m[C],_=El(S);c.includes(_)||(T.splice(C,0,S),w.push(S))}return s==="wait"&&w.length&&(T=w),x(Kv(T)),b(d),null}const{forceRender:E}=g.useContext(rm);return y.jsx(y.Fragment,{children:m.map(T=>{const C=El(T),S=o&&!l?!1:d===m||c.includes(C),_=()=>{if(h.has(C))h.set(C,!0);else return;let j=!0;h.forEach(R=>{R||(j=!1)}),j&&(E==null||E(),x(p.current),o&&(u==null||u()),r&&r())};return y.jsx(VP,{isPresent:S,initial:!f.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:S?void 0:_,anchorX:a,children:T},C)})})};function om(e,t){e.indexOf(t)===-1&&e.push(t)}function am(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let up=()=>{};const cp={skipAnimations:!1,useManualTiming:!1};function lm(e){let t;return()=>(t===void 0&&(t=e()),t)}const on=e=>e,Ca=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class um{constructor(){this.subscriptions=[]}add(t){return om(this.subscriptions,t),()=>am(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const zn=e=>e*1e3,Bn=e=>e/1e3;function Tb(e,t){return t?e*(1e3/t):0}const HP=lm(()=>window.ScrollTimeline!==void 0);class WP{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(HP()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class qP extends WP{then(t,n){return this.finished.finally(t).then(()=>{})}}const Gv={value:null,addProjectionMetrics:null},cm=e=>Array.isArray(e)&&typeof e[0]=="number",KP={};function GP(e,t){const n=lm(e);return()=>KP[t]??n()}const _a=GP(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Cb=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(s/(i-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Vo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,dp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vo([0,.65,.55,1]),circOut:Vo([.55,0,1,.45]),backIn:Vo([.31,.01,.66,-.59]),backOut:Vo([.33,1.53,.69,.99])};function _b(e,t){if(e)return typeof e=="function"&&_a()?Cb(e,t):cm(e)?Vo(e):Array.isArray(e)?e.map(n=>_b(n,t)||dp.easeOut):dp[e]}function QP(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},u=void 0){const d={[t]:n};l&&(d.offset=l);const c=_b(a,i);return Array.isArray(c)&&(d.easing=c),e.animate(d,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal",pseudoElement:u})}function dm(e){return typeof e=="function"&&"applyToOptions"in e}function fm(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Fu=2e4;function pm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Fu;)t+=n,r=e.next(t);return t>=Fu?1/0:t}function YP(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(pm(r),Fu);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:Bn(i)}}function Pb(e){return!!(typeof e=="function"&&_a()||!e||typeof e=="string"&&(e in dp||_a())||cm(e)||Array.isArray(e)&&e.every(Pb))}function Qv(e,t){e.timeline=t,e.onfinish=null}const Tl=["read","resolveKeyframes","update","preRender","render","postRender"];function XP(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(c){o.has(c)&&(d.schedule(c),e()),l++,c(a)}const d={schedule:(c,f=!1,p=!1)=>{const v=p&&i?n:r;return f&&o.add(c),v.has(c)||v.add(c),c},cancel:c=>{r.delete(c),o.delete(c)},process:c=>{if(a=c,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(u),t&&Gv.value&&Gv.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(c))}};return d}const ZP=40;function jb(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Tl.reduce((m,x)=>(m[x]=XP(s,t?x:void 0),m),{}),{read:a,resolveKeyframes:l,update:u,preRender:d,render:c,postRender:f}=o,p=()=>{const m=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(m-i.timestamp,ZP),1),i.timestamp=m,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),d.process(i),c.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},h=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Tl.reduce((m,x)=>{const w=o[x];return m[x]=(E,T=!1,C=!1)=>(n||h(),w.schedule(E,T,C)),m},{}),cancel:m=>{for(let x=0;x<Tl.length;x++)o[Tl[x]].cancel(m)},state:i,steps:o}}const{schedule:hm,cancel:G$}=jb(queueMicrotask,!1),{schedule:we,cancel:ni,state:nt,steps:bd}=jb(typeof requestAnimationFrame<"u"?requestAnimationFrame:on,!0);let Ql;function JP(){Ql=void 0}const Vn={now:()=>(Ql===void 0&&Vn.set(nt.isProcessing||cp.useManualTiming?nt.timestamp:performance.now()),Ql),set:e=>{Ql=e,queueMicrotask(JP)}},mn={x:!1,y:!1};function Ab(){return mn.x||mn.y}function ej(e){return e==="x"||e==="y"?mn[e]?null:(mn[e]=!0,()=>{mn[e]=!1}):mn.x||mn.y?null:(mn.x=mn.y=!0,()=>{mn.x=mn.y=!1})}function tj(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Rb(e,t){const n=tj(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Yv(e){return!(e.pointerType==="touch"||Ab())}function nj(e,t,n={}){const[r,i,s]=Rb(e,n),o=a=>{if(!Yv(a))return;const{target:l}=a,u=t(l,a);if(typeof u!="function"||!l)return;const d=c=>{Yv(c)&&(u(c),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Ob=(e,t)=>t?e===t?!0:Ob(e,t.parentElement):!1,mm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,rj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ij(e){return rj.has(e.tagName)||e.tabIndex!==-1}const Uo=new WeakSet;function Xv(e){return t=>{t.key==="Enter"&&e(t)}}function Sd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const sj=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Xv(()=>{if(Uo.has(n))return;Sd(n,"down");const i=Xv(()=>{Sd(n,"up")}),s=()=>Sd(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Zv(e){return mm(e)&&!Ab()}function oj(e,t,n={}){const[r,i,s]=Rb(e,n),o=a=>{const l=a.currentTarget;if(!Zv(a)||Uo.has(l))return;Uo.add(l);const u=t(l,a),d=(p,h)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",f),!(!Zv(p)||!Uo.has(l))&&(Uo.delete(l),typeof u=="function"&&u(p,{success:h}))},c=p=>{d(p,l===window||l===document||n.useGlobalTarget||Ob(l,p.target))},f=p=>{d(p,!1)};window.addEventListener("pointerup",c,i),window.addEventListener("pointercancel",f,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a instanceof HTMLElement&&(a.addEventListener("focus",u=>sj(u,i)),!ij(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}const Jv=30,aj=e=>!isNaN(parseFloat(e));class lj{constructor(t,n={}){this.version="12.7.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Vn.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Vn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=aj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new um);const r=this.events[t].add(n);return t==="change"?()=>{r(),we.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Vn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Jv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Jv);return Tb(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pa(e,t){return new lj(e,t)}const Db=g.createContext({strict:!1}),e0={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"]},uo={};for(const e in e0)uo[e]={isEnabled:t=>e0[e].some(n=>!!t[n])};function uj(e){for(const t in e)uo[t]={...uo[t],...e[t]}}const cj=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","ignoreStrict","viewport"]);function Nu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||cj.has(e)}let Fb=e=>!Nu(e);function dj(e){e&&(Fb=t=>t.startsWith("on")?!Nu(t):e(t))}try{dj(require("@emotion/is-prop-valid").default)}catch{}function fj(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Fb(i)||n===!0&&Nu(i)||!t&&!Nu(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function pj(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const gc=g.createContext({});function vc(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ja(e){return typeof e=="string"||Array.isArray(e)}const gm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vm=["initial",...gm];function yc(e){return vc(e.animate)||vm.some(t=>ja(e[t]))}function Nb(e){return!!(yc(e)||e.variants)}function hj(e,t){if(yc(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ja(n)?n:void 0,animate:ja(r)?r:void 0}}return e.inherit!==!1?t:{}}function mj(e){const{initial:t,animate:n}=hj(e,g.useContext(gc));return g.useMemo(()=>({initial:t,animate:n}),[t0(t),t0(n)])}function t0(e){return Array.isArray(e)?e.join(" "):e}const gj=Symbol.for("motionComponentSymbol");function Ps(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function vj(e,t,n){return g.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ps(n)&&(n.current=r))},[t])}const ym=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),yj="framerAppearId",Mb="data-"+ym(yj),Lb=g.createContext({});function xj(e,t,n,r,i){var v,b;const{visualElement:s}=g.useContext(gc),o=g.useContext(Db),a=g.useContext(mc),l=g.useContext(sm).reducedMotion,u=g.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=u.current,c=g.useContext(Lb);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&wj(u.current,n,i,c);const f=g.useRef(!1);g.useInsertionEffect(()=>{d&&f.current&&d.update(n,a)});const p=n[Mb],h=g.useRef(!!p&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,p))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,p)));return kb(()=>{d&&(f.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),hm.render(d.render),h.current&&d.animationState&&d.animationState.animateChanges())}),g.useEffect(()=>{d&&(!h.current&&d.animationState&&d.animationState.animateChanges(),h.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)==null||m.call(window,p)}),h.current=!1))}),d}function wj(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ib(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Ps(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:u})}function Ib(e){if(e)return e.options.allowProjection!==!1?e.projection:Ib(e.parent)}function bj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&uj(e);function s(a,l){let u;const d={...g.useContext(sm),...a,layoutId:Sj(a)},{isStatic:c}=d,f=mj(a),p=r(a,c);if(!c&&im){kj();const h=Ej(d);u=h.MeasureLayout,f.visualElement=xj(i,p,d,t,h.ProjectionNode)}return y.jsxs(gc.Provider,{value:f,children:[u&&f.visualElement?y.jsx(u,{visualElement:f.visualElement,...d}):null,n(i,a,vj(p,f.visualElement,l),p,c,f.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const o=g.forwardRef(s);return o[gj]=i,o}function Sj({layoutId:e}){const t=g.useContext(rm).id;return t&&e!==void 0?t+"-"+e:e}function kj(e,t){g.useContext(Db).strict}function Ej(e){const{drag:t,layout:n}=uo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const $b=e=>t=>typeof t=="string"&&t.startsWith(e),xm=$b("--"),Tj=$b("var(--"),wm=e=>Tj(e)?Cj.test(e.split("/*")[0].trim()):!1,Cj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Aa={};function _j(e){for(const t in e)Aa[t]=e[t],xm(t)&&(Aa[t].isCSSVariable=!0)}const xo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ts=new Set(xo);function zb(e,{layout:t,layoutId:n}){return ts.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Aa[e]||e==="opacity")}const ft=e=>!!(e&&e.getVelocity),Bb=(e,t)=>t&&typeof e=="number"?t.transform(e):e,fr=(e,t,n)=>n>t?t:n<e?e:n,wo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ra={...wo,transform:e=>fr(0,1,e)},Cl={...wo,default:1},Ya=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Sr=Ya("deg"),Un=Ya("%"),G=Ya("px"),Pj=Ya("vh"),jj=Ya("vw"),n0={...Un,parse:e=>Un.parse(e)/100,transform:e=>Un.transform(e*100)},Aj={borderWidth:G,borderTopWidth:G,borderRightWidth:G,borderBottomWidth:G,borderLeftWidth:G,borderRadius:G,radius:G,borderTopLeftRadius:G,borderTopRightRadius:G,borderBottomRightRadius:G,borderBottomLeftRadius:G,width:G,maxWidth:G,height:G,maxHeight:G,top:G,right:G,bottom:G,left:G,padding:G,paddingTop:G,paddingRight:G,paddingBottom:G,paddingLeft:G,margin:G,marginTop:G,marginRight:G,marginBottom:G,marginLeft:G,backgroundPositionX:G,backgroundPositionY:G},Rj={rotate:Sr,rotateX:Sr,rotateY:Sr,rotateZ:Sr,scale:Cl,scaleX:Cl,scaleY:Cl,scaleZ:Cl,skew:Sr,skewX:Sr,skewY:Sr,distance:G,translateX:G,translateY:G,translateZ:G,x:G,y:G,z:G,perspective:G,transformPerspective:G,opacity:Ra,originX:n0,originY:n0,originZ:G},r0={...wo,transform:Math.round},bm={...Aj,...Rj,zIndex:r0,size:G,fillOpacity:Ra,strokeOpacity:Ra,numOctaves:r0},Oj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Dj=xo.length;function Fj(e,t,n){let r="",i=!0;for(let s=0;s<Dj;s++){const o=xo[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Bb(a,bm[o]);if(!l){i=!1;const d=Oj[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Sm(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(ts.has(l)){o=!0;continue}else if(xm(l)){i[l]=u;continue}else{const d=Bb(u,bm[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=Fj(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${u} ${d}`}}const km=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Vb(e,t,n){for(const r in t)!ft(t[r])&&!zb(r,n)&&(e[r]=t[r])}function Nj({transformTemplate:e},t){return g.useMemo(()=>{const n=km();return Sm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Mj(e,t){const n=e.style||{},r={};return Vb(r,n,e),Object.assign(r,Nj(e,t)),r}function Lj(e,t){const n={},r=Mj(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Ij=["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 Em(e){return typeof e!="string"||e.includes("-")?!1:!!(Ij.indexOf(e)>-1||/[A-Z]/u.test(e))}const $j={offset:"stroke-dashoffset",array:"stroke-dasharray"},zj={offset:"strokeDashoffset",array:"strokeDasharray"};function Bj(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?$j:zj;e[s.offset]=G.transform(-r);const o=G.transform(t),a=G.transform(n);e[s.array]=`${o} ${a}`}function i0(e,t,n){return typeof e=="string"?e:G.transform(t+n*e)}function Vj(e,t,n){const r=i0(t,e.x,e.width),i=i0(n,e.y,e.height);return`${r} ${i}`}function Tm(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},d,c){if(Sm(e,u,c),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:h}=e;f.transform&&(h&&(p.transform=f.transform),delete f.transform),h&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=Vj(h,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&Bj(f,o,a,l,!1)}const Ub=()=>({...km(),attrs:{}}),Cm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Uj(e,t,n,r){const i=g.useMemo(()=>{const s=Ub();return Tm(s,t,Cm(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Vb(s,e.style,e),i.style={...s,...i.style}}return i}function Hj(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Em(n)?Uj:Lj)(r,s,o,n),u=fj(r,typeof n=="string",e),d=n!==g.Fragment?{...u,...l,ref:i}:{},{children:c}=r,f=g.useMemo(()=>ft(c)?c.get():c,[c]);return g.createElement(n,{...d,children:f})}}function s0(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function _m(e,t,n,r){if(typeof t=="function"){const[i,s]=s0(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=s0(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const fp=e=>Array.isArray(e),Wj=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),qj=e=>fp(e)?e[e.length-1]||0:e;function Yl(e){const t=ft(e)?e.get():e;return Wj(t)?t.toValue():t}function Kj({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:Gj(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const Hb=e=>(t,n)=>{const r=g.useContext(gc),i=g.useContext(mc),s=()=>Kj(e,t,r,i);return n?s():hc(s)};function Gj(e,t,n,r){const i={},s=r(e,{});for(const f in s)i[f]=Yl(s[f]);let{initial:o,animate:a}=e;const l=yc(e),u=Nb(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const c=d?a:o;if(c&&typeof c!="boolean"&&!vc(c)){const f=Array.isArray(c)?c:[c];for(let p=0;p<f.length;p++){const h=_m(e,f[p]);if(h){const{transitionEnd:v,transition:b,...m}=h;for(const x in m){let w=m[x];if(Array.isArray(w)){const E=d?w.length-1:0;w=w[E]}w!==null&&(i[x]=w)}for(const x in v)i[x]=v[x]}}}return i}function Pm(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(ft(r[o])||t.style&&ft(t.style[o])||zb(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const Qj={useVisualState:Hb({scrapeMotionValuesFromProps:Pm,createRenderState:km})};function Wb(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function qb(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const Kb=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"]);function Gb(e,t,n,r){qb(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Kb.has(i)?i:ym(i),t.attrs[i])}function Qb(e,t,n){const r=Pm(e,t,n);for(const i in e)if(ft(e[i])||ft(t[i])){const s=xo.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const o0=["x","y","width","height","cx","cy","r"],Yj={useVisualState:Hb({scrapeMotionValuesFromProps:Qb,createRenderState:Ub,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in i)if(ts.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<o0.length;a++){const l=o0[a];e[l]!==t[l]&&(o=!0)}o&&we.read(()=>{Wb(n,r),we.render(()=>{Tm(r,i,Cm(n.tagName),e.transformTemplate),Gb(n,r)})})}})};function Xj(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Em(r)?Yj:Qj,preloadedFeatures:e,useRender:Hj(i),createVisualElement:t,Component:r};return bj(o)}}function Oa(e,t,n){const r=e.getProps();return _m(r,t,n!==void 0?n:r.custom,e)}const Yb=new Set(["width","height","top","left","right","bottom",...xo]);function Zj(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pa(n))}function Jj(e,t){const n=Oa(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=qj(s[o]);Zj(e,o,a)}}function eA(e){return!!(ft(e)&&e.add)}function pp(e,t){const n=e.getValue("willChange");if(eA(n))return n.add(t);if(!n&&cp.WillChange){const r=new cp.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Xb(e){return e.props[Mb]}const Zb=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,tA=1e-7,nA=12;function rA(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=Zb(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>tA&&++a<nA);return o}function Xa(e,t,n,r){if(e===t&&n===r)return on;const i=s=>rA(s,0,1,e,n);return s=>s===0||s===1?s:Zb(i(s),t,r)}const Jb=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,eS=e=>t=>1-e(1-t),tS=Xa(.33,1.53,.69,.99),jm=eS(tS),nS=Jb(jm),rS=e=>(e*=2)<1?.5*jm(e):.5*(2-Math.pow(2,-10*(e-1))),Am=e=>1-Math.sin(Math.acos(e)),iS=eS(Am),sS=Jb(Am),oS=e=>/^0[^.\s]+$/u.test(e);function iA(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||oS(e):!0}const ea=e=>Math.round(e*1e5)/1e5,Rm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function sA(e){return e==null}const oA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Om=(e,t)=>n=>!!(typeof n=="string"&&oA.test(n)&&n.startsWith(e)||t&&!sA(n)&&Object.prototype.hasOwnProperty.call(n,t)),aS=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Rm);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},aA=e=>fr(0,255,e),kd={...wo,transform:e=>Math.round(aA(e))},Ti={test:Om("rgb","red"),parse:aS("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+kd.transform(e)+", "+kd.transform(t)+", "+kd.transform(n)+", "+ea(Ra.transform(r))+")"};function lA(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const hp={test:Om("#"),parse:lA,transform:Ti.transform},js={test:Om("hsl","hue"),parse:aS("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Un.transform(ea(t))+", "+Un.transform(ea(n))+", "+ea(Ra.transform(r))+")"},ct={test:e=>Ti.test(e)||hp.test(e)||js.test(e),parse:e=>Ti.test(e)?Ti.parse(e):js.test(e)?js.parse(e):hp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ti.transform(e):js.transform(e)},uA=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function cA(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Rm))==null?void 0:t.length)||0)+(((n=e.match(uA))==null?void 0:n.length)||0)>0}const lS="number",uS="color",dA="var",fA="var(",a0="${}",pA=/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 Da(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(pA,l=>(ct.test(l)?(r.color.push(s),i.push(uS),n.push(ct.parse(l))):l.startsWith(fA)?(r.var.push(s),i.push(dA),n.push(l)):(r.number.push(s),i.push(lS),n.push(parseFloat(l))),++s,a0)).split(a0);return{values:n,split:a,indexes:r,types:i}}function cS(e){return Da(e).values}function dS(e){const{split:t,types:n}=Da(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===lS?s+=ea(i[o]):a===uS?s+=ct.transform(i[o]):s+=i[o]}return s}}const hA=e=>typeof e=="number"?0:e;function mA(e){const t=cS(e);return dS(e)(t.map(hA))}const ri={test:cA,parse:cS,createTransformer:dS,getAnimatableNone:mA},gA=new Set(["brightness","contrast","saturate","opacity"]);function vA(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Rm)||[];if(!r)return e;const i=n.replace(r,"");let s=gA.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const yA=/\b([a-z-]*)\(.*?\)/gu,mp={...ri,getAnimatableNone:e=>{const t=e.match(yA);return t?t.map(vA).join(" "):e}},xA={...bm,color:ct,backgroundColor:ct,outlineColor:ct,fill:ct,stroke:ct,borderColor:ct,borderTopColor:ct,borderRightColor:ct,borderBottomColor:ct,borderLeftColor:ct,filter:mp,WebkitFilter:mp},fS=e=>xA[e];function pS(e,t){let n=fS(e);return n!==mp&&(n=ri),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const wA=new Set(["auto","none","0"]);function bA(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!wA.has(s)&&Da(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=pS(n,i)}const Ci=e=>e*180/Math.PI,gp=e=>{const t=Ci(Math.atan2(e[1],e[0]));return vp(t)},SA={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gp,rotateZ:gp,skewX:e=>Ci(Math.atan(e[1])),skewY:e=>Ci(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vp=e=>(e=e%360,e<0&&(e+=360),e),l0=gp,u0=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),c0=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),kA={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:u0,scaleY:c0,scale:e=>(u0(e)+c0(e))/2,rotateX:e=>vp(Ci(Math.atan2(e[6],e[5]))),rotateY:e=>vp(Ci(Math.atan2(-e[2],e[0]))),rotateZ:l0,rotate:l0,skewX:e=>Ci(Math.atan(e[4])),skewY:e=>Ci(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function d0(e){return e.includes("scale")?1:0}function yp(e,t){if(!e||e==="none")return d0(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=kA,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=SA,i=a}if(!i)return d0(t);const s=r[t],o=i[1].split(",").map(TA);return typeof s=="function"?s(o):o[s]}const EA=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return yp(n,t)};function TA(e){return parseFloat(e.trim())}const f0=e=>e===wo||e===G,CA=new Set(["x","y","z"]),_A=xo.filter(e=>!CA.has(e));function PA(e){const t=[];return _A.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const co={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>yp(t,"x"),y:(e,{transform:t})=>yp(t,"y")};co.translateX=co.x;co.translateY=co.y;const Ii=new Set;let xp=!1,wp=!1;function hS(){if(wp){const e=Array.from(Ii).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=PA(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}wp=!1,xp=!1,Ii.forEach(e=>e.complete()),Ii.clear()}function mS(){Ii.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(wp=!0)})}function jA(){mS(),hS()}class Dm{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ii.add(this),xp||(xp=!0,we.read(mS),we.resolveKeyframes(hS))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ii.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ii.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const gS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),AA=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function RA(e){const t=AA.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function vS(e,t,n=1){const[r,i]=RA(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return gS(o)?parseFloat(o):o}return wm(i)?vS(i,t,n+1):i}const yS=e=>t=>t.test(e),OA={test:e=>e==="auto",parse:e=>e},xS=[wo,G,Un,Sr,jj,Pj,OA],p0=e=>xS.find(yS(e));class wS extends Dm{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),wm(u))){const d=vS(u,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Yb.has(r)||t.length!==2)return;const[i,s]=t,o=p0(i),a=p0(s);if(o!==a)if(f0(o)&&f0(a))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)iA(t[i])&&r.push(i);r.length&&bA(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=co[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=co[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const h0=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ri.test(e)||e==="0")&&!e.startsWith("url("));function DA(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function FA(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=h0(i,t),a=h0(s,t);return!o||!a?!1:DA(e)||(n==="spring"||dm(n))&&r}const NA=e=>e!==null;function xc(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(NA),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const MA=40;class bS{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Vn.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>MA?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&jA(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Vn.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!FA(t,r,i,s))if(o)this.options.duration=0;else{l&&l(xc(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Pe=(e,t,n)=>e+(t-e)*n;function Ed(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function LA({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Ed(l,a,e+1/3),s=Ed(l,a,e),o=Ed(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Mu(e,t){return n=>n>0?t:e}const Td=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},IA=[hp,Ti,js],$A=e=>IA.find(t=>t.test(e));function m0(e){const t=$A(e);if(!t)return!1;let n=t.parse(e);return t===js&&(n=LA(n)),n}const g0=(e,t)=>{const n=m0(e),r=m0(t);if(!n||!r)return Mu(e,t);const i={...n};return s=>(i.red=Td(n.red,r.red,s),i.green=Td(n.green,r.green,s),i.blue=Td(n.blue,r.blue,s),i.alpha=Pe(n.alpha,r.alpha,s),Ti.transform(i))},zA=(e,t)=>n=>t(e(n)),Za=(...e)=>e.reduce(zA),bp=new Set(["none","hidden"]);function BA(e,t){return bp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function VA(e,t){return n=>Pe(e,t,n)}function Fm(e){return typeof e=="number"?VA:typeof e=="string"?wm(e)?Mu:ct.test(e)?g0:WA:Array.isArray(e)?SS:typeof e=="object"?ct.test(e)?g0:UA:Mu}function SS(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Fm(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function UA(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Fm(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function HA(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const WA=(e,t)=>{const n=ri.createTransformer(t),r=Da(e),i=Da(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?bp.has(e)&&!i.values.length||bp.has(t)&&!r.values.length?BA(e,t):Za(SS(HA(r,i),i.values),n):Mu(e,t)};function kS(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Pe(e,t,n):Fm(e)(e,t)}const qA=5;function ES(e,t,n){const r=Math.max(t-qA,0);return Tb(n-e(r),t-r)}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},Cd=.001;function KA({duration:e=Oe.duration,bounce:t=Oe.bounce,velocity:n=Oe.velocity,mass:r=Oe.mass}){let i,s,o=1-t;o=fr(Oe.minDamping,Oe.maxDamping,o),e=fr(Oe.minDuration,Oe.maxDuration,Bn(e)),o<1?(i=u=>{const d=u*o,c=d*e,f=d-n,p=Sp(u,o),h=Math.exp(-c);return Cd-f/p*h},s=u=>{const c=u*o*e,f=c*n+n,p=Math.pow(o,2)*Math.pow(u,2)*e,h=Math.exp(-c),v=Sp(Math.pow(u,2),o);return(-i(u)+Cd>0?-1:1)*((f-p)*h)/v}):(i=u=>{const d=Math.exp(-u*e),c=(u-n)*e+1;return-Cd+d*c},s=u=>{const d=Math.exp(-u*e),c=(n-u)*(e*e);return d*c});const a=5/e,l=QA(i,s,a);if(e=zn(e),isNaN(l))return{stiffness:Oe.stiffness,damping:Oe.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const GA=12;function QA(e,t,n){let r=n;for(let i=1;i<GA;i++)r=r-e(r)/t(r);return r}function Sp(e,t){return e*Math.sqrt(1-t*t)}const YA=["duration","bounce"],XA=["stiffness","damping","mass"];function v0(e,t){return t.some(n=>e[n]!==void 0)}function ZA(e){let t={velocity:Oe.velocity,stiffness:Oe.stiffness,damping:Oe.damping,mass:Oe.mass,isResolvedFromDuration:!1,...e};if(!v0(e,XA)&&v0(e,YA))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*fr(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Oe.mass,stiffness:i,damping:s}}else{const n=KA(e);t={...t,...n,mass:Oe.mass},t.isResolvedFromDuration=!0}return t}function Lu(e=Oe.visualDuration,t=Oe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:d,duration:c,velocity:f,isResolvedFromDuration:p}=ZA({...n,velocity:-Bn(n.velocity||0)}),h=f||0,v=u/(2*Math.sqrt(l*d)),b=o-s,m=Bn(Math.sqrt(l/d)),x=Math.abs(b)<5;r||(r=x?Oe.restSpeed.granular:Oe.restSpeed.default),i||(i=x?Oe.restDelta.granular:Oe.restDelta.default);let w;if(v<1){const T=Sp(m,v);w=C=>{const S=Math.exp(-v*m*C);return o-S*((h+v*m*b)/T*Math.sin(T*C)+b*Math.cos(T*C))}}else if(v===1)w=T=>o-Math.exp(-m*T)*(b+(h+m*b)*T);else{const T=m*Math.sqrt(v*v-1);w=C=>{const S=Math.exp(-v*m*C),_=Math.min(T*C,300);return o-S*((h+v*m*b)*Math.sinh(_)+T*b*Math.cosh(_))/T}}const E={calculatedDuration:p&&c||null,next:T=>{const C=w(T);if(p)a.done=T>=c;else{let S=0;v<1&&(S=T===0?zn(h):ES(w,T,C));const _=Math.abs(S)<=r,j=Math.abs(o-C)<=i;a.done=_&&j}return a.value=a.done?o:C,a},toString:()=>{const T=Math.min(pm(E),Fu),C=Cb(S=>E.next(T*S).value,T,30);return T+"ms "+C},toTransition:()=>{}};return E}Lu.applyToOptions=e=>{const t=YP(e,100,Lu);return e.ease=_a()?t.ease:"easeOut",e.duration=zn(t.duration),e.type="keyframes",e};function y0({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:d}){const c=e[0],f={done:!1,value:c},p=_=>a!==void 0&&_<a||l!==void 0&&_>l,h=_=>a===void 0?l:l===void 0||Math.abs(a-_)<Math.abs(l-_)?a:l;let v=n*t;const b=c+v,m=o===void 0?b:o(b);m!==b&&(v=m-c);const x=_=>-v*Math.exp(-_/r),w=_=>m+x(_),E=_=>{const j=x(_),R=w(_);f.done=Math.abs(j)<=u,f.value=f.done?m:R};let T,C;const S=_=>{p(f.value)&&(T=_,C=Lu({keyframes:[f.value,h(f.value)],velocity:ES(w,_,f.value),damping:i,stiffness:s,restDelta:u,restSpeed:d}))};return S(0),{calculatedDuration:null,next:_=>{let j=!1;return!C&&T===void 0&&(j=!0,E(_),S(_)),T!==void 0&&_>=T?C.next(_-T):(!j&&E(_),f)}}}const JA=Xa(.42,0,1,1),eR=Xa(0,0,.58,1),TS=Xa(.42,0,.58,1),tR=e=>Array.isArray(e)&&typeof e[0]!="number",x0={linear:on,easeIn:JA,easeInOut:TS,easeOut:eR,circIn:Am,circInOut:sS,circOut:iS,backIn:jm,backInOut:nS,backOut:tS,anticipate:rS},w0=e=>{if(cm(e)){up(e.length===4);const[t,n,r,i]=e;return Xa(t,n,r,i)}else if(typeof e=="string")return up(x0[e]!==void 0),x0[e];return e};function nR(e,t,n){const r=[],i=n||kS,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||on:t;a=Za(l,a)}r.push(a)}return r}function rR(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(up(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=nR(t,r,i),l=a.length,u=d=>{if(o&&d<e[0])return t[0];let c=0;if(l>1)for(;c<e.length-2&&!(d<e[c+1]);c++);const f=Ca(e[c],e[c+1],d);return a[c](f)};return n?d=>u(fr(e[0],e[s-1],d)):u}function iR(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Ca(0,t,r);e.push(Pe(n,1,i))}}function sR(e){const t=[0];return iR(t,e.length-1),t}function oR(e,t){return e.map(n=>n*t)}function aR(e,t){return e.map(()=>t||TS).splice(0,e.length-1)}function Iu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=tR(r)?r.map(w0):w0(r),s={done:!1,value:t[0]},o=oR(n&&n.length===t.length?n:sR(t),e),a=rR(o,t,{ease:Array.isArray(i)?i:aR(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const lR=e=>{const t=({timestamp:n})=>e(n);return{start:()=>we.update(t,!0),stop:()=>ni(t),now:()=>nt.isProcessing?nt.timestamp:Vn.now()}},uR={decay:y0,inertia:y0,tween:Iu,keyframes:Iu,spring:Lu},cR=e=>e/100;class Nm extends bS{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Dm,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=dm(n)?n:uR[n]||Iu;let l,u;a!==Iu&&typeof t[0]!="number"&&(l=Za(cR,kS(t[0],t[1])),t=[0,100]);const d=a({...this.options,keyframes:t});s==="mirror"&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=pm(d));const{calculatedDuration:c}=d,f=c+i,p=f*(r+1)-i;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:c,resolvedDuration:f,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:_}=this.options;return{done:!0,value:_[_.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:c}=r;if(this.startTime===null)return s.next(0);const{delay:f,repeat:p,repeatType:h,repeatDelay:v,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const m=this.currentTime-f*(this.speed>=0?1:-1),x=this.speed>=0?m<0:m>d;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let w=this.currentTime,E=s;if(p){const _=Math.min(this.currentTime,d)/c;let j=Math.floor(_),R=_%1;!R&&_>=1&&(R=1),R===1&&j--,j=Math.min(j,p+1),!!(j%2)&&(h==="reverse"?(R=1-R,v&&(R-=v/c)):h==="mirror"&&(E=o)),w=fr(0,1,R)*c}const T=x?{done:!1,value:l[0]}:E.next(w);a&&(T.value=a(T.value));let{done:C}=T;!x&&u!==null&&(C=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return S&&i!==void 0&&(T.value=xc(l,this.options,i)),b&&b(T.value),S&&this.finish(),T}get duration(){const{resolved:t}=this;return t?Bn(t.calculatedDuration):0}get time(){return Bn(this.currentTime)}set time(t){t=zn(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Bn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=lR,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}get finished(){return this.currentFinishedPromise}}const dR=new Set(["opacity","clipPath","filter","transform"]),fR=lm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),$u=10,pR=2e4;function hR(e){return dm(e.type)||e.type==="spring"||!Pb(e.ease)}function mR(e,t){const n=new Nm({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<pR;)r=n.sample(s),i.push(r.value),s+=$u;return{times:void 0,keyframes:i,duration:s-$u,ease:"linear"}}const CS={anticipate:rS,backInOut:nS,circInOut:sS};function gR(e){return e in CS}class b0 extends bS{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new wS(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&_a()&&gR(s)&&(s=CS[s]),hR(this.options)){const{onComplete:c,onUpdate:f,motionValue:p,element:h,...v}=this.options,b=mR(t,v);t=b.keyframes,t.length===1&&(t[1]=t[0]),r=b.duration,i=b.times,s=b.ease,o="keyframes"}const d=QP(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Qv(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:c}=this.options;a.set(xc(t,this.options,n)),c&&c(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Bn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Bn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=zn(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return on;const{animation:r}=n;Qv(r,t)}return on}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:c,element:f,...p}=this.options,h=new Nm({...p,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),v=zn(this.time);u.setWithVelocity(h.sample(v-$u).value,h.sample(v).value,$u)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return fR()&&r&&dR.has(r)&&(r!=="transform"||!u)&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const vR={type:"spring",stiffness:500,damping:25,restSpeed:10},yR=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xR={type:"keyframes",duration:.8},wR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bR=(e,{keyframes:t})=>t.length>2?xR:ts.has(e)?e.startsWith("scale")?yR(t[1]):vR:wR;function SR({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const Mm=(e,t,n,r={},i,s)=>o=>{const a=fm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-zn(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};SR(a)||(d={...d,...bR(e,d)}),d.duration&&(d.duration=zn(d.duration)),d.repeatDelay&&(d.repeatDelay=zn(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let c=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(c=!0)),d.allowFlatten=!a.type&&!a.ease,c&&!s&&t.get()!==void 0){const f=xc(d.keyframes,a);if(f!==void 0)return we.update(()=>{d.onUpdate(f),d.onComplete()}),new qP([])}return!s&&b0.supports(d)?new b0(d):new Nm(d)};function kR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function _S(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=t;r&&(s=r);const l=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in a){const c=e.getValue(d,e.latestValues[d]??null),f=a[d];if(f===void 0||u&&kR(u,d))continue;const p={delay:n,...fm(s||{},d)};let h=!1;if(window.MotionHandoffAnimation){const b=Xb(e);if(b){const m=window.MotionHandoffAnimation(b,d,we);m!==null&&(p.startTime=m,h=!0)}}pp(e,d),c.start(Mm(d,c,f,e.shouldReduceMotion&&Yb.has(d)?{type:!1}:p,e,h));const v=c.animation;v&&l.push(v)}return o&&Promise.all(l).then(()=>{we.update(()=>{o&&Jj(e,o)})}),l}function kp(e,t,n={}){var l;const r=Oa(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(_S(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:c,staggerDirection:f}=i;return ER(e,t,d+u,c,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,d]=a==="beforeChildren"?[s,o]:[o,s];return u().then(()=>d())}else return Promise.all([s(),o(n.delay)])}function ER(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(TR).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(kp(u,t,{...s,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function TR(e,t){return e.sortNodePosition(t)}function CR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>kp(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=kp(e,t,n);else{const i=typeof t=="function"?Oa(e,t,n.custom):t;r=Promise.all(_S(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function PS(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const _R=vm.length;function jS(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?jS(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<_R;n++){const r=vm[n],i=e.props[r];(ja(i)||i===!1)&&(t[r]=i)}return t}const PR=[...gm].reverse(),jR=gm.length;function AR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>CR(e,n,r)))}function RR(e){let t=AR(e),n=S0(),r=!0;const i=l=>(u,d)=>{var f;const c=Oa(e,d,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(c){const{transition:p,transitionEnd:h,...v}=c;u={...u,...v,...h}}return u};function s(l){t=l(e)}function o(l){const{props:u}=e,d=jS(e.parent)||{},c=[],f=new Set;let p={},h=1/0;for(let b=0;b<jR;b++){const m=PR[b],x=n[m],w=u[m]!==void 0?u[m]:d[m],E=ja(w),T=m===l?x.isActive:null;T===!1&&(h=b);let C=w===d[m]&&w!==u[m]&&E;if(C&&r&&e.manuallyAnimateOnMount&&(C=!1),x.protectedKeys={...p},!x.isActive&&T===null||!w&&!x.prevProp||vc(w)||typeof w=="boolean")continue;const S=OR(x.prevProp,w);let _=S||m===l&&x.isActive&&!C&&E||b>h&&E,j=!1;const R=Array.isArray(w)?w:[w];let L=R.reduce(i(m),{});T===!1&&(L={});const{prevResolvedValues:ne={}}=x,ee={...ne,...L},J=X=>{_=!0,f.has(X)&&(j=!0,f.delete(X)),x.needsAnimating[X]=!0;const O=e.getValue(X);O&&(O.liveStyle=!1)};for(const X in ee){const O=L[X],M=ne[X];if(p.hasOwnProperty(X))continue;let V=!1;fp(O)&&fp(M)?V=!PS(O,M):V=O!==M,V?O!=null?J(X):f.add(X):O!==void 0&&f.has(X)?J(X):x.protectedKeys[X]=!0}x.prevProp=w,x.prevResolvedValues=L,x.isActive&&(p={...p,...L}),r&&e.blockInitialAnimation&&(_=!1),_&&(!(C&&S)||j)&&c.push(...R.map(X=>({animation:X,options:{type:m}})))}if(f.size){const b={};if(typeof u.initial!="boolean"){const m=Oa(e,Array.isArray(u.initial)?u.initial[0]:u.initial);m&&m.transition&&(b.transition=m.transition)}f.forEach(m=>{const x=e.getBaseTarget(m),w=e.getValue(m);w&&(w.liveStyle=!0),b[m]=x??null}),c.push({animation:b})}let v=!!c.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,v?t(c):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=e.variantChildren)==null||c.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=o(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=S0(),r=!0}}}function OR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!PS(t,e):!1}function hi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function S0(){return{animate:hi(!0),whileInView:hi(),whileHover:hi(),whileTap:hi(),whileDrag:hi(),whileFocus:hi(),exit:hi()}}class li{constructor(t){this.isMounted=!1,this.node=t}update(){}}class DR extends li{constructor(t){super(t),t.animationState||(t.animationState=RR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();vc(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let FR=0;class NR extends li{constructor(){super(...arguments),this.id=FR++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const MR={animation:{Feature:DR},exit:{Feature:NR}};function Fa(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ja(e){return{point:{x:e.pageX,y:e.pageY}}}const LR=e=>t=>mm(t)&&e(t,Ja(t));function ta(e,t,n,r){return Fa(e,t,LR(n),r)}function AS({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function IR({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function $R(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const RS=1e-4,zR=1-RS,BR=1+RS,OS=.01,VR=0-OS,UR=0+OS;function vt(e){return e.max-e.min}function HR(e,t,n){return Math.abs(e-t)<=n}function k0(e,t,n,r=.5){e.origin=r,e.originPoint=Pe(t.min,t.max,e.origin),e.scale=vt(n)/vt(t),e.translate=Pe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=zR&&e.scale<=BR||isNaN(e.scale))&&(e.scale=1),(e.translate>=VR&&e.translate<=UR||isNaN(e.translate))&&(e.translate=0)}function na(e,t,n,r){k0(e.x,t.x,n.x,r?r.originX:void 0),k0(e.y,t.y,n.y,r?r.originY:void 0)}function E0(e,t,n){e.min=n.min+t.min,e.max=e.min+vt(t)}function WR(e,t,n){E0(e.x,t.x,n.x),E0(e.y,t.y,n.y)}function T0(e,t,n){e.min=t.min-n.min,e.max=e.min+vt(t)}function ra(e,t,n){T0(e.x,t.x,n.x),T0(e.y,t.y,n.y)}const C0=()=>({translate:0,scale:1,origin:0,originPoint:0}),As=()=>({x:C0(),y:C0()}),_0=()=>({min:0,max:0}),Ne=()=>({x:_0(),y:_0()});function Yt(e){return[e("x"),e("y")]}function _d(e){return e===void 0||e===1}function Ep({scale:e,scaleX:t,scaleY:n}){return!_d(e)||!_d(t)||!_d(n)}function yi(e){return Ep(e)||DS(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function DS(e){return P0(e.x)||P0(e.y)}function P0(e){return e&&e!=="0%"}function zu(e,t,n){const r=e-n,i=t*r;return n+i}function j0(e,t,n,r,i){return i!==void 0&&(e=zu(e,i,r)),zu(e,n,r)+t}function Tp(e,t=0,n=1,r,i){e.min=j0(e.min,t,n,r,i),e.max=j0(e.max,t,n,r,i)}function FS(e,{x:t,y:n}){Tp(e.x,t.translate,t.scale,t.originPoint),Tp(e.y,n.translate,n.scale,n.originPoint)}const A0=.999999999999,R0=1.0000000000001;function qR(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Os(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,FS(e,o)),r&&yi(s.latestValues)&&Os(e,s.latestValues))}t.x<R0&&t.x>A0&&(t.x=1),t.y<R0&&t.y>A0&&(t.y=1)}function Rs(e,t){e.min=e.min+t,e.max=e.max+t}function O0(e,t,n,r,i=.5){const s=Pe(e.min,e.max,i);Tp(e,t,n,s,r)}function Os(e,t){O0(e.x,t.x,t.scaleX,t.scale,t.originX),O0(e.y,t.y,t.scaleY,t.scale,t.originY)}function NS(e,t){return AS($R(e.getBoundingClientRect(),t))}function KR(e,t,n){const r=NS(e,n),{scroll:i}=t;return i&&(Rs(r.x,i.offset.x),Rs(r.y,i.offset.y)),r}const MS=({current:e})=>e?e.ownerDocument.defaultView:null,D0=(e,t)=>Math.abs(e-t);function GR(e,t){const n=D0(e.x,t.x),r=D0(e.y,t.y);return Math.sqrt(n**2+r**2)}class LS{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const c=jd(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=GR(c.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:h}=c,{timestamp:v}=nt;this.history.push({...h,timestamp:v});const{onStart:b,onMove:m}=this.handlers;f||(b&&b(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=Pd(f,this.transformPagePoint),we.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{this.end();const{onEnd:p,onSessionEnd:h,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=jd(c.type==="pointercancel"?this.lastMoveEventInfo:Pd(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(c,b),h&&h(c,b)},!mm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=Ja(t),a=Pd(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=nt;this.history=[{...l,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,jd(a,this.history)),this.removeListeners=Za(ta(this.contextWindow,"pointermove",this.handlePointerMove),ta(this.contextWindow,"pointerup",this.handlePointerUp),ta(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ni(this.updatePoint)}}function Pd(e,t){return t?{point:t(e.point)}:e}function F0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function jd({point:e},t){return{point:e,delta:F0(e,IS(t)),offset:F0(e,QR(t)),velocity:YR(t,.1)}}function QR(e){return e[0]}function IS(e){return e[e.length-1]}function YR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=IS(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>zn(t)));)n--;if(!r)return{x:0,y:0};const s=Bn(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function XR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Pe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Pe(n,e,r.max):Math.min(e,n)),e}function N0(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function ZR(e,{top:t,left:n,bottom:r,right:i}){return{x:N0(e.x,n,i),y:N0(e.y,t,r)}}function M0(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function JR(e,t){return{x:M0(e.x,t.x),y:M0(e.y,t.y)}}function eO(e,t){let n=.5;const r=vt(e),i=vt(t);return i>r?n=Ca(t.min,t.max-r,e.min):r>i&&(n=Ca(e.min,e.max-i,t.min)),fr(0,1,n)}function tO(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Cp=.35;function nO(e=Cp){return e===!1?e=0:e===!0&&(e=Cp),{x:L0(e,"left","right"),y:L0(e,"top","bottom")}}function L0(e,t,n){return{min:I0(e,t),max:I0(e,n)}}function I0(e,t){return typeof e=="number"?e:e[t]||0}const rO=new WeakMap;class iO{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ne(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:c}=this.getProps();c?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ja(d).point)},s=(d,c)=>{const{drag:f,dragPropagation:p,onDragStart:h}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ej(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Yt(b=>{let m=this.getAxisMotionValue(b).get()||0;if(Un.test(m)){const{projection:x}=this.visualElement;if(x&&x.layout){const w=x.layout.layoutBox[b];w&&(m=vt(w)*(parseFloat(m)/100))}}this.originPoint[b]=m}),h&&we.postRender(()=>h(d,c)),pp(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},o=(d,c)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:h,onDrag:v}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:b}=c;if(p&&this.currentDirection===null){this.currentDirection=sO(b),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",c.point,b),this.updateAxis("y",c.point,b),this.visualElement.render(),v&&v(d,c)},a=(d,c)=>this.stop(d,c),l=()=>Yt(d=>{var c;return this.getAnimationState(d)==="paused"&&((c=this.getAxisMotionValue(d).animation)==null?void 0:c.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new LS(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:MS(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&we.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!_l(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=XR(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Ps(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=ZR(r.layoutBox,t):this.constraints=!1,this.elastic=nO(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Yt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=tO(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ps(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=KR(r,i.root,this.visualElement.getTransformPagePoint());let o=JR(i.layout.layoutBox,s);if(n){const a=n(IR(o));this.hasMutatedConstraints=!!a,a&&(o=AS(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Yt(d=>{if(!_l(d,n,this.currentDirection))return;let c=l&&l[d]||{};o&&(c={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,h={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...c};return this.startAxisValueAnimation(d,h)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return pp(this.visualElement,t),r.start(Mm(t,r,0,n,this.visualElement,!1))}stopAnimation(){Yt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Yt(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Yt(n=>{const{drag:r}=this.getProps();if(!_l(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-Pe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ps(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Yt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=eO({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Yt(o=>{if(!_l(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Pe(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;rO.set(this.visualElement,this);const t=this.visualElement.current,n=ta(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ps(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),we.read(r);const o=Fa(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Yt(d=>{const c=this.getAxisMotionValue(d);c&&(this.originPoint[d]+=l[d].translate,c.set(c.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Cp,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function _l(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function sO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class oO extends li{constructor(t){super(t),this.removeGroupControls=on,this.removeListeners=on,this.controls=new iO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||on}unmount(){this.removeGroupControls(),this.removeListeners()}}const $0=e=>(t,n)=>{e&&we.postRender(()=>e(t,n))};class aO extends li{constructor(){super(...arguments),this.removePointerDownListener=on}onPointerDown(t){this.session=new LS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:MS(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:$0(t),onStart:$0(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&we.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=ta(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Xl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function z0(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Fo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(G.test(e))e=parseFloat(e);else return e;const n=z0(e,t.target.x),r=z0(e,t.target.y);return`${n}% ${r}%`}},lO={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=ri.parse(e);if(i.length>5)return r;const s=ri.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=Pe(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};class uO extends g.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;_j(cO),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Xl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||we.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),hm.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function $S(e){const[t,n]=Eb(),r=g.useContext(rm);return y.jsx(uO,{...e,layoutGroup:r,switchLayoutGroup:g.useContext(Lb),isPresent:t,safeToRemove:n})}const cO={borderRadius:{...Fo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fo,borderTopRightRadius:Fo,borderBottomLeftRadius:Fo,borderBottomRightRadius:Fo,boxShadow:lO};function dO(e,t,n){const r=ft(e)?e:Pa(e);return r.start(Mm("",r,t,n)),r.animation}function fO(e){return e instanceof SVGElement&&e.tagName!=="svg"}const pO=(e,t)=>e.depth-t.depth;class hO{constructor(){this.children=[],this.isDirty=!1}add(t){om(this.children,t),this.isDirty=!0}remove(t){am(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(pO),this.isDirty=!1,this.children.forEach(t)}}function mO(e,t){const n=Vn.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(ni(r),e(s-t))};return we.read(r,!0),()=>ni(r)}const zS=["TopLeft","TopRight","BottomLeft","BottomRight"],gO=zS.length,B0=e=>typeof e=="string"?parseFloat(e):e,V0=e=>typeof e=="number"||G.test(e);function vO(e,t,n,r,i,s){i?(e.opacity=Pe(0,n.opacity??1,yO(r)),e.opacityExit=Pe(t.opacity??1,0,xO(r))):s&&(e.opacity=Pe(t.opacity??1,n.opacity??1,r));for(let o=0;o<gO;o++){const a=`border${zS[o]}Radius`;let l=U0(t,a),u=U0(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||V0(l)===V0(u)?(e[a]=Math.max(Pe(B0(l),B0(u),r),0),(Un.test(u)||Un.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=Pe(t.rotate||0,n.rotate||0,r))}function U0(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const yO=BS(0,.5,iS),xO=BS(.5,.95,on);function BS(e,t,n){return r=>r<e?0:r>t?1:n(Ca(e,t,r))}function H0(e,t){e.min=t.min,e.max=t.max}function Gt(e,t){H0(e.x,t.x),H0(e.y,t.y)}function W0(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function q0(e,t,n,r,i){return e-=t,e=zu(e,1/n,r),i!==void 0&&(e=zu(e,1/i,r)),e}function wO(e,t=0,n=1,r=.5,i,s=e,o=e){if(Un.test(t)&&(t=parseFloat(t),t=Pe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Pe(s.min,s.max,r);e===s&&(a-=t),e.min=q0(e.min,t,n,a,i),e.max=q0(e.max,t,n,a,i)}function K0(e,t,[n,r,i],s,o){wO(e,t[n],t[r],t[i],t.scale,s,o)}const bO=["x","scaleX","originX"],SO=["y","scaleY","originY"];function G0(e,t,n,r){K0(e.x,t,bO,n?n.x:void 0,r?r.x:void 0),K0(e.y,t,SO,n?n.y:void 0,r?r.y:void 0)}function Q0(e){return e.translate===0&&e.scale===1}function VS(e){return Q0(e.x)&&Q0(e.y)}function Y0(e,t){return e.min===t.min&&e.max===t.max}function kO(e,t){return Y0(e.x,t.x)&&Y0(e.y,t.y)}function X0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function US(e,t){return X0(e.x,t.x)&&X0(e.y,t.y)}function Z0(e){return vt(e.x)/vt(e.y)}function J0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class EO{constructor(){this.members=[]}add(t){om(this.members,t),t.scheduleRender()}remove(t){if(am(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function TO(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:c,rotateY:f,skewX:p,skewY:h}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),c&&(r+=`rotateX(${c}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),h&&(r+=`skewY(${h}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Ad=["","X","Y","Z"],CO={visibility:"hidden"},ey=1e3;let _O=0;function Rd(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function HS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Xb(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",we,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&HS(r)}function WS({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=_O++,this.animationId=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.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(AO),this.nodes.forEach(NO),this.nodes.forEach(MO),this.nodes.forEach(RO)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new hO)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new um),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=fO(o),this.instance=o;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),e){let c;const f=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,c&&c(),c=mO(f,250),Xl.hasAnimatedSinceResize&&(Xl.hasAnimatedSinceResize=!1,this.nodes.forEach(ny))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:p,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||d.getDefaultTransition()||BO,{onLayoutAnimationStart:b,onLayoutAnimationComplete:m}=d.getProps(),x=!this.targetLayout||!US(this.targetLayout,h),w=!f&&p;if(this.options.layoutRoot||this.resumeFrom||w||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(c,w);const E={...fm(v,"layout"),onPlay:b,onComplete:m};(d.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else f||ny(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ni(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(LO),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&HS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const c=this.path[d];c.shouldResetTransform=!0,c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ty);return}this.isUpdating||this.nodes.forEach(DO),this.isUpdating=!1,this.nodes.forEach(FO),this.nodes.forEach(PO),this.nodes.forEach(jO),this.clearAllSnapshots();const a=Vn.now();nt.delta=fr(0,1e3/60,a-nt.timestamp),nt.timestamp=a,nt.isProcessing=!0,bd.update.process(nt),bd.preRender.process(nt),bd.render.process(nt),nt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(OO),this.sharedNodes.forEach(IO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,we.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){we.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!vt(this.snapshot.measuredBox.x)&&!vt(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ne(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!VS(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&(a||yi(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),VO(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return Ne();const a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(UO))){const{scroll:d}=this.root;d&&(Rs(a.x,d.offset.x),Rs(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=Ne();if(Gt(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:c,options:f}=d;d!==this.root&&c&&f.layoutScroll&&(c.wasRoot&&Gt(a,o),Rs(a.x,c.offset.x),Rs(a.y,c.offset.y))}return a}applyTransform(o,a=!1){const l=Ne();Gt(l,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Os(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),yi(d.latestValues)&&Os(l,d.latestValues)}return yi(this.latestValues)&&Os(l,this.latestValues),l}removeTransform(o){const a=Ne();Gt(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!yi(u.latestValues))continue;Ep(u.latestValues)&&u.updateSnapshot();const d=Ne(),c=u.measurePageBox();Gt(d,c),G0(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return yi(this.latestValues)&&G0(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==nt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var f;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:c}=this.options;if(!(!this.layout||!(d||c))){if(this.resolvedRelativeTargetAt=nt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ne(),this.relativeTargetOrigin=Ne(),ra(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Gt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ne(),this.targetWithTransforms=Ne()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),WR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Gt(this.target,this.layout.layoutBox),FS(this.target,this.targetDelta)):Gt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ne(),this.relativeTargetOrigin=Ne(),ra(this.relativeTargetOrigin,this.target,p.target),Gt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Ep(this.parent.latestValues)||DS(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var h;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===nt.timestamp&&(l=!1),l)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Gt(this.layoutCorrected,this.layout.layoutBox);const c=this.treeScale.x,f=this.treeScale.y;qR(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Ne());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(W0(this.prevProjectionDelta.x,this.projectionDelta.x),W0(this.prevProjectionDelta.y,this.projectionDelta.y)),na(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==c||this.treeScale.y!==f||!J0(this.projectionDelta.x,this.prevProjectionDelta.x)||!J0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=As(),this.projectionDelta=As(),this.projectionDeltaWithTransform=As()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},c=As();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Ne(),p=l?l.source:void 0,h=this.layout?this.layout.source:void 0,v=p!==h,b=this.getStack(),m=!b||b.members.length<=1,x=!!(v&&!m&&this.options.crossfade===!0&&!this.path.some(zO));this.animationProgress=0;let w;this.mixTargetDelta=E=>{const T=E/1e3;ry(c.x,o.x,T),ry(c.y,o.y,T),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ra(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),$O(this.relativeTarget,this.relativeTargetOrigin,f,T),w&&kO(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Ne()),Gt(w,this.relativeTarget)),v&&(this.animationValues=d,vO(d,u,this.latestValues,T,x,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ni(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=we.update(()=>{Xl.hasAnimatedSinceResize=!0,this.currentAnimation=dO(0,ey,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ey),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:d}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&qS(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Ne();const c=vt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+c;const f=vt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}Gt(a,l),Os(a,d),na(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new EO),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Rd("z",o,u,this.animationValues);for(let d=0;d<Ad.length;d++)Rd(`rotate${Ad[d]}`,o,u,this.animationValues),Rd(`skew${Ad[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}getProjectionStyles(o){if(!this.instance||this.isSVG)return;if(!this.isVisible)return CO;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=Yl(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=Yl(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!yi(this.latestValues)&&(p.transform=l?l({},""):"none",this.hasProjected=!1),p}const d=u.animationValues||u.latestValues;this.applyTransformsToTarget(),a.transform=TO(this.projectionDeltaWithTransform,this.treeScale,d),l&&(a.transform=l(d,a.transform));const{x:c,y:f}=this.projectionDelta;a.transformOrigin=`${c.origin*100}% ${f.origin*100}% 0`,u.animationValues?a.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const p in Aa){if(d[p]===void 0)continue;const{correct:h,applyTo:v,isCSSVariable:b}=Aa[p],m=a.transform==="none"?d[p]:h(d[p],u);if(v){const x=v.length;for(let w=0;w<x;w++)a[v[w]]=m}else b?this.options.visualElement.renderState.vars[p]=m:a[p]=m}return this.options.layoutId&&(a.pointerEvents=u===this?Yl(o==null?void 0:o.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(ty),this.root.sharedNodes.clear()}}}function PO(e){e.updateLayout()}function jO(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?Yt(c=>{const f=o?t.measuredBox[c]:t.layoutBox[c],p=vt(f);f.min=r[c].min,f.max=f.min+p}):qS(s,t.layoutBox,r)&&Yt(c=>{const f=o?t.measuredBox[c]:t.layoutBox[c],p=vt(r[c]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+p)});const a=As();na(a,r,t.layoutBox);const l=As();o?na(l,e.applyTransform(i,!0),t.measuredBox):na(l,r,t.layoutBox);const u=!VS(a);let d=!1;if(!e.resumeFrom){const c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:f,layout:p}=c;if(f&&p){const h=Ne();ra(h,t.layoutBox,f.layoutBox);const v=Ne();ra(v,r,p.layoutBox),US(h,v)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=h,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function AO(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function RO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function OO(e){e.clearSnapshot()}function ty(e){e.clearMeasurements()}function DO(e){e.isLayoutDirty=!1}function FO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ny(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function NO(e){e.resolveTargetDelta()}function MO(e){e.calcProjection()}function LO(e){e.resetSkewAndRotation()}function IO(e){e.removeLeadSnapshot()}function ry(e,t,n){e.translate=Pe(t.translate,0,n),e.scale=Pe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function iy(e,t,n,r){e.min=Pe(t.min,n.min,r),e.max=Pe(t.max,n.max,r)}function $O(e,t,n,r){iy(e.x,t.x,n.x,r),iy(e.y,t.y,n.y,r)}function zO(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const BO={duration:.45,ease:[.4,0,.1,1]},sy=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),oy=sy("applewebkit/")&&!sy("chrome/")?Math.round:on;function ay(e){e.min=oy(e.min),e.max=oy(e.max)}function VO(e){ay(e.x),ay(e.y)}function qS(e,t,n){return e==="position"||e==="preserve-aspect"&&!HR(Z0(t),Z0(n),.2)}function UO(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const HO=WS({attachResizeListener:(e,t)=>Fa(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Od={current:void 0},KS=WS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Od.current){const e=new HO({});e.mount(window),e.setOptions({layoutScroll:!0}),Od.current=e}return Od.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),WO={pan:{Feature:aO},drag:{Feature:oO,ProjectionNode:KS,MeasureLayout:$S}};function ly(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&we.postRender(()=>s(t,Ja(t)))}class qO extends li{mount(){const{current:t}=this.node;t&&(this.unmount=nj(t,(n,r)=>(ly(this.node,r,"Start"),i=>ly(this.node,i,"End"))))}unmount(){}}class KO extends li{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Za(Fa(this.node.current,"focus",()=>this.onFocus()),Fa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function uy(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&we.postRender(()=>s(t,Ja(t)))}class GO extends li{mount(){const{current:t}=this.node;t&&(this.unmount=oj(t,(n,r)=>(uy(this.node,r,"Start"),(i,{success:s})=>uy(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const _p=new WeakMap,Dd=new WeakMap,QO=e=>{const t=_p.get(e.target);t&&t(e)},YO=e=>{e.forEach(QO)};function XO({root:e,...t}){const n=e||document;Dd.has(n)||Dd.set(n,{});const r=Dd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(YO,{root:e,...t})),r[i]}function ZO(e,t,n){const r=XO(t);return _p.set(e,n),r.observe(e),()=>{_p.delete(e),r.unobserve(e)}}const JO={some:0,all:1};class e3 extends li{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:JO[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:c}=this.node.getProps(),f=u?d:c;f&&f(l)};return ZO(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(t3(t,n))&&this.startObserver()}unmount(){}}function t3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const n3={inView:{Feature:e3},tap:{Feature:GO},focus:{Feature:KO},hover:{Feature:qO}},r3={layout:{ProjectionNode:KS,MeasureLayout:$S}},Pp={current:null},GS={current:!1};function i3(){if(GS.current=!0,!!im)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Pp.current=e.matches;e.addListener(t),t()}else Pp.current=!1}const s3=[...xS,ct,ri],o3=e=>s3.find(yS(e)),a3=new WeakMap;function l3(e,t,n){for(const r in t){const i=t[r],s=n[r];if(ft(i))e.addValue(r,i);else if(ft(s))e.addValue(r,Pa(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,Pa(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const cy=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class u3{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Dm,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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 p=Vn.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,we.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:d}=o;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=yc(n),this.isVariantNode=Nb(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const h=f[p];l[p]!==void 0&&ft(h)&&h.set(l[p],!1)}}mount(t){this.current=t,a3.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),GS.current||i3(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Pp.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ni(this.notifyUpdate),ni(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ts.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&we.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in uo){const n=uo[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ne()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<cy.length;r++){const i=cy[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=l3(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pa(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(gS(r)||oS(r))?r=parseFloat(r):!o3(r)&&ri.test(n)&&(r=pS(t,n)),this.setBaseTarget(t,ft(r)?r.get():r)),ft(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=_m(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ft(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new um),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class QS extends u3{constructor(){super(...arguments),this.KeyframeResolver=wS}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ft(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function c3(e){return window.getComputedStyle(e)}class d3 extends QS{constructor(){super(...arguments),this.type="html",this.renderInstance=qb}readValueFromInstance(t,n){if(ts.has(n))return EA(t,n);{const r=c3(t),i=(xm(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return NS(t,n)}build(t,n,r){Sm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Pm(t,n,r)}}class f3 extends QS{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ne,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Wb(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ts.has(n)){const r=fS(n);return r&&r.default||0}return n=Kb.has(n)?n:ym(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Qb(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&we.postRender(this.updateDimensions)}build(t,n,r){Tm(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){Gb(t,n,r,i)}mount(t){this.isSVGTag=Cm(t.tagName),super.mount(t)}}const p3=(e,t)=>Em(e)?new f3(t):new d3(t,{allowProjection:e!==g.Fragment}),h3=Xj({...MR,...n3,...WO,...r3},p3),Te=pj(h3);class m3{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(r=>{r.start(t.nativeEvent||t,n)})}}const g3=()=>new m3;function v3(){return hc(g3)}const y3=e=>["zink","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"].includes(e),Ft=e=>{const[t,n]=e.split("-");return y3(t)?n?`var(--color-${t}-${n})`:`var(--color-${e}-500)`:`var(--color-${e})`};var Tr=(e=>(e.None="none",e.Sm="sm",e.Md="md",e.Lg="lg",e.Xl="xl",e.Full="full",e))(Tr||{});const YS=g.createContext({}),x3={[Q.Background]:"",[Q.Border]:"initial",[Q.TooltipText]:Ft("blue-700"),[Q.TooltipBackground]:Ft("blue-100"),[Q.TooltipBorder]:Ft("blue-500"),[Q.HeaderBackground]:Ft("blue-600"),[Q.HeaderBorder]:"initial",[Q.HeaderText]:"white",[Q.FooterBackground]:"",[Q.FooterBorder]:"",[Q.FooterText]:"",[Q.MessageAdminBackground]:"",[Q.MessageAdminText]:"",[Q.MessageVisitorBackground]:"",[Q.MessageVisitorText]:"",[Q.GreeterBackground]:"white",[Q.GreeterText]:Ft("slate-700"),[Q.GreeterBorder]:Ft("slate-200"),[Q.GreeterTopBackground]:"linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%)",[Q.GreeterTopText]:"white",[Q.GreeterButtonBackground]:Ft("indigo-600"),[Q.GreeterButtonText]:Ft("white"),[Q.ButtonBackground]:Ft("indigo-600"),[Q.ButtonText]:Ft("white"),[Q.InputBackground]:Ft("white"),[Q.InputText]:Ft("slate-800"),[Q.InputBorder]:Ft("slate-200")},w3={[Tr.None]:"0px",[Tr.Sm]:"var(--radius-xs)",[Tr.Md]:"var(--radius-sm)",[Tr.Lg]:"var(--radius-md)",[Tr.Xl]:"var(--radius-lg)",[Tr.Full]:"calc(infinity * 1px)"},b3=e=>{const t={...x3};if(!e||!e.appearance||!e.appearance.design||!e.appearance.design.colors)return t;for(const n in e.appearance.design.colors){const r=n;e.appearance.design.colors[r]&&(t[r]=e.appearance.design.colors[r])}return t};function S3({children:e,widget:t}){const n=b3(t),r=t&&t.appearance&&t.appearance.design&&t.appearance.design.border_radius?t.appearance.design.border_radius:Tr.Md,i=o=>n[o],s=()=>w3[r];return y.jsx(YS.Provider,{value:{colors:n,getColor:i,getRadius:s},children:e})}const hr=()=>g.useContext(YS);function rn({children:e,type:t="button",variant:n="primary",kind:r="solid",size:i="md",disabled:s=!1,rounded:o=!1,className:a,textKey:l=Q.ButtonText,bgKey:u=Q.ButtonBackground,animations:d={},withoutTheming:c,...f}){const p=hr();return y.jsx(Te.button,{type:t,className:fe("flex items-center justify-center focus:!ring-0 font-medium",{"rounded-full":o&&i!=="xs","rounded-lg":!o},a,qv[n]&&qv[n][r],IP[i][o?"rounded":"default"]),disabled:s,style:!c&&{color:p.getColor(l),backgroundColor:p.getColor(u),...o?{}:{borderRadius:p.getRadius()}},...d,...f,children:e})}function ve(){}ve.Home=function(t){return y.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:y.jsx("path",{d:"M3 13h1v7c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-7h1a1 1 0 00.707-1.707l-9-9a.999.999 0 00-1.414 0l-9 9A1 1 0 003 13zm7 7v-5h4v5h-4zm2-15.586l6 6V15l.001 5H16v-5c0-1.103-.897-2-2-2h-4c-1.103 0-2 .897-2 2v5H6v-9.586l6-6z"})})};ve.Chat=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});ve.Menu=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})});ve.MessageTyping=({className:e="size-5",...t})=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 9.75a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 0 1 .778-.332 48.294 48.294 0 0 0 5.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});ve.Check=function(t){return y.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",height:"1em",width:"1em",...t,children:y.jsx("path",{d:"M12.736 3.97a.733.733 0 011.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 01-1.065.02L3.217 8.384a.757.757 0 010-1.06.733.733 0 011.047 0l3.052 3.093 5.4-6.425a.247.247 0 01.02-.022z"})})};ve.Website=function(t){return y.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:[y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14 7a1 1 0 00-1 1v8a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1h-4zm3 2h-2v6h2V9z",clipRule:"evenodd"}),y.jsx("path",{fill:"currentColor",d:"M6 7a1 1 0 000 2h4a1 1 0 100-2H6zM6 11a1 1 0 100 2h4a1 1 0 100-2H6zM5 16a1 1 0 011-1h4a1 1 0 110 2H6a1 1 0 01-1-1z"}),y.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 3a3 3 0 00-3 3v12a3 3 0 003 3h16a3 3 0 003-3V6a3 3 0 00-3-3H4zm16 2H4a1 1 0 00-1 1v12a1 1 0 001 1h16a1 1 0 001-1V6a1 1 0 00-1-1z",clipRule:"evenodd"})]})};ve.ArrowDown=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"})});ve.XCircle=({className:e="e-5",...t})=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});ve.X=({className:e="e-5",...t})=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})});ve.PaperAirplane=({className:e="e-5",...t})=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})});ve.Spin=function(t){return y.jsx("svg",{"data-name":"Layer 1",viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:y.jsx("path",{d:"M6.804 15a1 1 0 00-1.366-.366l-1.732 1a1 1 0 001 1.732l1.732-1A1 1 0 006.804 15zM3.706 8.366l1.732 1a1 1 0 101-1.732l-1.732-1a1 1 0 00-1 1.732zM6 12a1 1 0 00-1-1H3a1 1 0 000 2h2a1 1 0 001-1zm11.196-3a1 1 0 001.366.366l1.732-1a1 1 0 10-1-1.732l-1.732 1A1 1 0 0017.196 9zM15 6.804a1 1 0 001.366-.366l1-1.732a1 1 0 10-1.732-1l-1 1.732A1 1 0 0015 6.804zm5.294 8.83l-1.732-1a1 1 0 10-1 1.732l1.732 1a1 1 0 001-1.732zm-3.928 1.928a1 1 0 10-1.732 1l1 1.732a1 1 0 101.732-1zM21 11h-2a1 1 0 000 2h2a1 1 0 000-2zm-9 7a1 1 0 00-1 1v2a1 1 0 002 0v-2a1 1 0 00-1-1zm-3-.804a1 1 0 00-1.366.366l-1 1.732a1 1 0 001.732 1l1-1.732A1 1 0 009 17.196zM12 2a1 1 0 00-1 1v2a1 1 0 002 0V3a1 1 0 00-1-1z"})})};const qn=Object.create(null);qn.open="0";qn.close="1";qn.ping="2";qn.pong="3";qn.message="4";qn.upgrade="5";qn.noop="6";const Zl=Object.create(null);Object.keys(qn).forEach(e=>{Zl[qn[e]]=e});const jp={type:"error",data:"parser error"},XS=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ZS=typeof ArrayBuffer=="function",JS=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Lm=({type:e,data:t},n,r)=>XS&&t instanceof Blob?n?r(t):dy(t,r):ZS&&(t instanceof ArrayBuffer||JS(t))?n?r(t):dy(new Blob([t]),r):r(qn[e]+(t||"")),dy=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function fy(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Fd;function k3(e,t){if(XS&&e.data instanceof Blob)return e.data.arrayBuffer().then(fy).then(t);if(ZS&&(e.data instanceof ArrayBuffer||JS(e.data)))return t(fy(e.data));Lm(e,!1,n=>{Fd||(Fd=new TextEncoder),t(Fd.encode(n))})}const py="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ho=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<py.length;e++)Ho[py.charCodeAt(e)]=e;const E3=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r<n;r+=4)s=Ho[e.charCodeAt(r)],o=Ho[e.charCodeAt(r+1)],a=Ho[e.charCodeAt(r+2)],l=Ho[e.charCodeAt(r+3)],d[i++]=s<<2|o>>4,d[i++]=(o&15)<<4|a>>2,d[i++]=(a&3)<<6|l&63;return u},T3=typeof ArrayBuffer=="function",Im=(e,t)=>{if(typeof e!="string")return{type:"message",data:ek(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:C3(e.substring(1),t)}:Zl[n]?e.length>1?{type:Zl[n],data:e.substring(1)}:{type:Zl[n]}:jp},C3=(e,t)=>{if(T3){const n=E3(e);return ek(n,t)}else return{base64:!0,data:e}},ek=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},tk="",_3=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{Lm(s,!1,a=>{r[o]=a,++i===n&&t(r.join(tk))})})},P3=(e,t)=>{const n=e.split(tk),r=[];for(let i=0;i<n.length;i++){const s=Im(n[i],t);if(r.push(s),s.type==="error")break}return r};function j3(){return new TransformStream({transform(e,t){k3(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Nd;function Pl(e){return e.reduce((t,n)=>t+n.length,0)}function jl(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function A3(e,t){Nd||(Nd=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(Pl(n)<1)break;const l=jl(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Pl(n)<2)break;const l=jl(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Pl(n)<8)break;const l=jl(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(jp);break}i=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Pl(n)<i)break;const l=jl(n,i);a.enqueue(Im(s?l:Nd.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(jp);break}}}})}const nk=4;function Ie(e){if(e)return R3(e)}function R3(e){for(var t in Ie.prototype)e[t]=Ie.prototype[t];return e}Ie.prototype.on=Ie.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Ie.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Ie.prototype.off=Ie.prototype.removeListener=Ie.prototype.removeAllListeners=Ie.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Ie.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Ie.prototype.emitReserved=Ie.prototype.emit;Ie.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Ie.prototype.hasListeners=function(e){return!!this.listeners(e).length};const wc=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),tn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),O3="arraybuffer";function rk(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const D3=tn.setTimeout,F3=tn.clearTimeout;function bc(e,t){t.useNativeTimers?(e.setTimeoutFn=D3.bind(tn),e.clearTimeoutFn=F3.bind(tn)):(e.setTimeoutFn=tn.setTimeout.bind(tn),e.clearTimeoutFn=tn.clearTimeout.bind(tn))}const N3=1.33;function M3(e){return typeof e=="string"?L3(e):Math.ceil((e.byteLength||e.size)*N3)}function L3(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function ik(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function I3(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function $3(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class z3 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class $m extends Ie{constructor(t){super(),this.writable=!1,bc(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new z3(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Im(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=I3(t);return n.length?"?"+n:""}}class B3 extends $m{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};P3(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,_3(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=ik()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let sk=!1;try{sk=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const V3=sk;function U3(){}class H3 extends B3{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Hn extends Ie{constructor(t,n,r){super(),this.createRequest=t,bc(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=rk(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Hn.requestsCount++,Hn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=U3,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Hn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Hn.requestsCount=0;Hn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",hy);else if(typeof addEventListener=="function"){const e="onpagehide"in tn?"pagehide":"unload";addEventListener(e,hy,!1)}}function hy(){for(let e in Hn.requests)Hn.requests.hasOwnProperty(e)&&Hn.requests[e].abort()}const W3=function(){const e=ok({xdomain:!1});return e&&e.responseType!==null}();class q3 extends H3{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=W3&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Hn(ok,this.uri(),t)}}function ok(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||V3))return new XMLHttpRequest}catch{}if(!t)try{return new tn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ak=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class K3 extends $m{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=ak?{}:rk(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Lm(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&wc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=ik()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Md=tn.WebSocket||tn.MozWebSocket;class G3 extends K3{createSocket(t,n,r){return ak?new Md(t,n,r):n?new Md(t,n):new Md(t)}doWrite(t,n){this.ws.send(n)}}class Q3 extends $m{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=A3(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=j3();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&wc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Y3={websocket:G3,webtransport:Q3,polling:q3},X3=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Z3=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ap(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=X3.exec(e||""),s={},o=14;for(;o--;)s[Z3[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=J3(s,s.path),s.queryKey=eD(s,s.query),s}function J3(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function eD(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Rp=typeof addEventListener=="function"&&typeof removeEventListener=="function",Jl=[];Rp&&addEventListener("offline",()=>{Jl.forEach(e=>e())},!1);class Xr extends Ie{constructor(t,n){if(super(),this.binaryType=O3,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Ap(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Ap(n.host).host);bc(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),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},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=$3(this.opts.query)),Rp&&(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"})},Jl.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=nk,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Xr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Xr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),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 t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=M3(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,wc(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Xr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){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(),Rp&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Jl.indexOf(this._offlineEventListener);r!==-1&&Jl.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Xr.protocol=nk;class tD extends Xr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Xr.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",c=>{if(!r)if(c.type==="pong"&&c.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Xr.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const o=c=>{const f=new Error("probe error: "+c);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};function a(){o("transport closed")}function l(){o("socket closed")}function u(c){n&&c.name!==n.name&&s()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let nD=class extends tD{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>Y3[i]).filter(i=>!!i)),super(t,r)}};function rD(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Ap(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const iD=typeof ArrayBuffer=="function",sD=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,lk=Object.prototype.toString,oD=typeof Blob=="function"||typeof Blob<"u"&&lk.call(Blob)==="[object BlobConstructor]",aD=typeof File=="function"||typeof File<"u"&&lk.call(File)==="[object FileConstructor]";function zm(e){return iD&&(e instanceof ArrayBuffer||sD(e))||oD&&e instanceof Blob||aD&&e instanceof File}function eu(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(eu(e[n]))return!0;return!1}if(zm(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return eu(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&eu(e[n]))return!0;return!1}function lD(e){const t=[],n=e.data,r=e;return r.data=Op(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Op(e,t){if(!e)return e;if(zm(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Op(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Op(e[r],t));return n}return e}function uD(e,t){return e.data=Dp(e.data,t),delete e.attachments,e}function Dp(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Dp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Dp(e[n],t));return e}const cD=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],dD=5;var le;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(le||(le={}));class fD{constructor(t){this.replacer=t}encode(t){return(t.type===le.EVENT||t.type===le.ACK)&&eu(t)?this.encodeAsBinary({type:t.type===le.EVENT?le.BINARY_EVENT:le.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===le.BINARY_EVENT||t.type===le.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=lD(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function my(e){return Object.prototype.toString.call(e)==="[object Object]"}class Bm extends Ie{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===le.BINARY_EVENT;r||n.type===le.BINARY_ACK?(n.type=r?le.EVENT:le.ACK,this.reconstructor=new pD(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(zm(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(le[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===le.BINARY_EVENT||r.type===le.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(s,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(Bm.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case le.CONNECT:return my(n);case le.DISCONNECT:return n===void 0;case le.CONNECT_ERROR:return typeof n=="string"||my(n);case le.EVENT:case le.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&cD.indexOf(n[0])===-1);case le.ACK:case le.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class pD{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=uD(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const hD=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Bm,Encoder:fD,get PacketType(){return le},protocol:dD},Symbol.toStringTag,{value:"Module"}));function xn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const mD=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class uk extends Ie{constructor(t,n,r){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=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[xn(t,"open",this.onopen.bind(this)),xn(t,"packet",this.onpacket.bind(this)),xn(t,"error",this.onerror.bind(this)),xn(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,s;if(mD.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:le.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,c=n.pop();this._registerAckCallback(d,c),o.id=d}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:le.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case le.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 le.EVENT:case le.BINARY_EVENT:this.onevent(t);break;case le.ACK:case le.BINARY_ACK:this.onack(t);break;case le.DISCONNECT:this.ondisconnect();break;case le.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:le.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:le.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function bo(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}bo.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};bo.prototype.reset=function(){this.attempts=0};bo.prototype.setMin=function(e){this.ms=e};bo.prototype.setMax=function(e){this.max=e};bo.prototype.setJitter=function(e){this.jitter=e};class Fp extends Ie{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,bc(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new bo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||hD;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new nD(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=xn(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=xn(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(xn(t,"ping",this.onping.bind(this)),xn(t,"data",this.ondata.bind(this)),xn(t,"error",this.onerror.bind(this)),xn(t,"close",this.onclose.bind(this)),xn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){wc(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new uk(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const No={};function tu(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=rD(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=No[i]&&s in No[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Fp(r,t):(No[i]||(No[i]=new Fp(r,t)),l=No[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(tu,{Manager:Fp,Socket:uk,io:tu,connect:tu});const nu=e=>{const t=document.cookie.split(";").find(n=>n.includes(e));return t?t.split("=")[1]:null};var Wn=(e=>(e.CustomerToken="lc:customer:token",e.CustomerRefreshToken="lc:customer:refresh_token",e.DeviceId="lc:device:id",e))(Wn||{});const Ld=(e,t)=>{localStorage.setItem(e,t)},Bs=e=>localStorage.getItem(e),gy=()=>{localStorage.removeItem("lc:customer:token"),localStorage.removeItem("lc:customer:refresh_token"),localStorage.removeItem("lc:device:id")},ck=g.createContext(null),ns=()=>g.useContext(ck),gD=({children:e})=>{const[t,n]=g.useState(null),[r,i]=g.useState(!1),s=()=>{const c=tu(E2,{transports:["websocket"],auth:{customer_token:Bs(Wn.CustomerToken)||nu("customer_token"),device_id:Bs(Wn.DeviceId)||nu("device_id"),customer_refresh_token:Bs(Wn.CustomerRefreshToken)||nu("customer_refresh_token")}});c.on("error",f=>{console.error("Websocket error",f)}),c.on("connect",()=>{n(c),i(!0)})},o=()=>{t&&(t.connect(),i(!0))},a=()=>{t&&(t.disconnect(),i(!1))},l=(c,f)=>{t&&t.on(c,f)},u=(c,f)=>{t&&t.off(c,f)},d=(c,f,p)=>{t&&t.emit(c,f,p)};return y.jsx(ck.Provider,{value:{socket:t,connected:r,connect:s,reconnect:o,disconnect:a,on:l,off:u,emit:d},children:e})};var Kn=(e=>(e.ChatView="chat:user:view",e.ChatClose="chat:user:close",e.MessageList="message:list",e.MessageCreate="message:create",e.MessageTyping="message:typing",e.WidgetOpen="widget:open",e.WidgetClose="widget:close",e.PageChange="page-change",e))(Kn||{}),rt=(e=>(e.MessageAgentCreate="message:agent:create",e.MessageAgentTyping="message:agent:typing",e.Banned="banned",e.ChatUserClose="chat:user:close",e.ChatUserAssignee="chat:user:assignee",e.ChatToggleUpload="chat:user:upload:toggle",e))(rt||{});const Vm=e=>{const t=pb(),n=(r,i)=>{var o;const s=((o=z$.find(a=>a.name===r))==null?void 0:o.path)??"/";return typeof i=="object"&&s.includes(":")?Object.entries(i).reduce((a,[l,u])=>a.replace(`:${l}`,u),s):i?`${s}?${i}`:s};return{push:(r,i)=>{t(n(r,i),e)},path:n}};function vD(e){return e&&typeof e=="object"&&"customer_token"in e&&"customer_refresh_token"in e}const yD=()=>Jh({mutationFn:e=>vo(`clients/${e.client_id}/chats`,{method:"POST",body:JSON.stringify({inputs:e.inputs,client_id:void 0,widget_id:e.widget_id,history:e.history})})}),xD=e=>vo(`clients/${e}/chats`),Np=e=>vo(`clients/${e}/chats`,{method:"DELETE"}),wD=(e,t)=>vo("review",{method:"POST",body:JSON.stringify({rating:e,comment:t||void 0}),headers:{"X-Customer-Token":Bs(Wn.CustomerToken)||"","X-Customer-Refresh-Token":Bs(Wn.CustomerRefreshToken)||"","X-Device-Id":Bs(Wn.DeviceId)||""}}),bD=()=>Jh({mutationFn:e=>wD(e.rating,e.comment)}),SD=e=>Jh({mutationFn:t=>vo(`clients/${e}/chats/files`,{method:"POST",body:P2({files:t},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})});function kD(e){return e&&typeof e=="object"&&"file_urls"in e}const Bu=(e,t,n)=>{const r=typeof window<"u"?window:void 0;g.useEffect(()=>(r.addEventListener(e,t),()=>{r.removeEventListener(e,t,!1)}),[e,t,r])},So=()=>typeof window<"u"?/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent):!1;function Mp({text:e}){var o,a,l,u;const{widget:t,isHaveChat:n}=un(),r=hr(),[i,s]=g.useState(!0);return i?y.jsxs(Te.div,{initial:{opacity:0,scale:.8,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:10},transition:{type:"spring",damping:20,stiffness:300},className:fe("absolute bottom-full mb-3 p-3 shadow-lg whitespace-nowrap","w-auto right-0"),style:{borderRadius:r.getRadius(),backgroundColor:r.getColor(Q.TooltipBackground),color:r.getColor(Q.TooltipText)},children:[y.jsx("button",{onClick:()=>s(!1),className:"absolute top-2 right-2 p-1 rounded-full hover:bg-black/10 transition-colors","aria-label":"Kapat",children:y.jsx(ve.X,{className:"size-3"})}),y.jsx(Te.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.1,duration:.3},className:"text-sm font-medium pr-5",style:{color:r.getColor(Q.TooltipText)},children:e||(n?(a=(o=t==null?void 0:t.appearance)==null?void 0:o.design)==null?void 0:a.tooltip_message_active:(u=(l=t==null?void 0:t.appearance)==null?void 0:l.design)==null?void 0:u.tooltip_message)||"Bizimle sohbet edin!"}),y.jsx("div",{className:fe("absolute bottom-0 right-4 w-3 h-3 transform rotate-45 translate-y-1.5 bg-blue-100")})]}):null}const ED="/notify.mp3",TD=async e=>{await new Audio(e||ED).play()};function vy({fallback:e,fallbackOpen:t}){const[n]=g.useState(window.document.title),r=ns(),{isHaveChat:i,open:s,soundPath:o}=un(),[a,l]=g.useState(!0),[u,d]=g.useState(0),[c,f]=g.useState(null),p=()=>{TD(o)},h=(v,b)=>{if(c&&clearInterval(c),v||!i||b===0||Number.isNaN(b)){window.document.title=n,f(null);return}const m=setInterval(()=>{if(v||!i||b===0||Number.isNaN(b)){window.document.title=n,clearInterval(m),f(null);return}const x=`${b} Yeni mesajınız var! - ${n}`;window.document.title!==x?window.document.title=x:window.document.title=n},1e3);return f(m),()=>{clearInterval(m),f(null)}};return g.useEffect(()=>h(s&&a,u),[u,s,a]),g.useEffect(()=>{const v=()=>{l(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",v,!1),()=>{document.removeEventListener("visibilitychange",v)}},[]),g.useEffect(()=>{if(i&&s&&a&&d(0),!r||!i||s&&a)return;const v=()=>{!i||s&&a||(d(b=>b+1),p())};return r.on(rt.MessageAgentCreate,v),r.on(rt.ChatUserAssignee,p),()=>{r.off(rt.MessageAgentCreate,v),r.off(rt.ChatUserAssignee,p)}},[r,i,s,a]),s?null:!i||u===0?t?e:null:y.jsx(Mp,{text:"Yeni mesajlar var!"})}function CD({children:e,defaultOpen:t,border:n}){var L,ne,ee,J;const r=ns(),{open:i,setOpen:s,setIsHaveChat:o,isHaveChat:a,widget:l}=un(),[u]=g.useState(!0),d=Vm(),c=Qa(),f=hr(),p=So(),[h,v]=g.useState({x:0,y:0}),b=v3(),m=g.useRef(null),x=g.useRef(null),[w,E]=g.useState(!1);g.useEffect(()=>((()=>{E("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{E(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{E(!0)})}),[]),g.useEffect(()=>{a&&c.pathname==="/"&&d.push("chat")},[a]);const T=te=>{if(!m.current||!x.current)return te;const H=m.current.getBoundingClientRect(),X={width:window.innerWidth,height:window.innerHeight},O={top:20,right:20,bottom:40,left:20};let M=te.x,V=te.y;return H.right+M-h.x>X.width-O.right&&(M=X.width-O.right-H.width-(H.left-h.x)),H.left+M-h.x<O.left&&(M=O.left-(H.left-h.x)),H.bottom+V-h.y>X.height-O.bottom&&(V=X.height-O.bottom-H.height-(H.top-h.y)),H.top+V-h.y<O.top&&(V=O.top-(H.top-h.y)),{x:M,y:V}},C=()=>{s(!0),r&&r.emit(Kn.WidgetOpen,{})},S=()=>{s(!1),r&&r.emit(Kn.WidgetClose,{})},_=()=>{s(!1),o(!1),Np(l.client_id),d.push("registration")};g.useEffect(()=>{if(t&&!p&&s(!0),!(!r||!l))return r.on(rt.Banned,_),()=>{r.off(rt.Banned,_)}},[]),g.useEffect(()=>(p&&i?document.body.style.setProperty("overflow","hidden","important"):document.body.style.setProperty("overflow","auto","important"),()=>{document.body.style.setProperty("overflow","auto","important")}),[p,i]);function j(te){w&&b.start(te)}const R=()=>{document.documentElement.style.setProperty("--app-height",`${window.innerHeight}px`)};return Bu("resize",R),Bu("orientationchange",R),y.jsx("section",{className:"relative w-full h-full",ref:x,children:y.jsxs(Yr,{children:[i&&y.jsx(Te.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{type:"spring",damping:25,stiffness:300,duration:.3},style:{width:p?"100%":((ne=(L=l==null?void 0:l.appearance)==null?void 0:L.design)==null?void 0:ne.width)||"21rem",height:p?"var(--app-height, 100dvh)":((J=(ee=l==null?void 0:l.appearance)==null?void 0:ee.design)==null?void 0:J.height)||"30rem",left:p?"0":"",right:p?"0px !important":"",maxHeight:p?"var(--app-height, 100dvh)":"",borderColor:f.getColor(Q.Border),boxShadow:"0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05)"},className:fe("fixed z-300 overflow-hidden rounded-xl",{"border border-solid dark:border-zink-500":n,"bottom-12 right-12":!p,"!bottom-0 !right-0":p}),children:e}),!w&&y.jsx("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:y.jsxs(Yr,{children:[y.jsx(vy,{fallback:y.jsx(Mp,{}),fallbackOpen:u}),!i&&y.jsxs(rn,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:C,children:[y.jsx(Te.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:fe("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:f.getColor(Q.ButtonBackground)}}),y.jsx(ve.Chat,{className:"size-7"})]}),i&&!p&&y.jsx(rn,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:S,children:y.jsx(ve.X,{className:"size-7"})})]})}),w&&y.jsx(Te.div,{ref:m,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:h.x,y:h.y},drag:w,dragControls:b,dragMomentum:!1,dragElastic:0,onDragEnd:(te,H)=>{const X={x:h.x+H.offset.x,y:h.y+H.offset.y},O=T(X);v(O)},children:y.jsxs(Yr,{children:[y.jsx(vy,{fallback:y.jsx(Mp,{}),fallbackOpen:u}),!i&&y.jsx("div",{className:"cursor-move",onPointerDown:j,children:y.jsxs(rn,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:C,children:[y.jsx(Te.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:fe("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:f.getColor(Q.ButtonBackground)}}),y.jsx(ve.Chat,{className:"size-7"})]})}),i&&!p&&y.jsx(rn,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:S,children:y.jsx(ve.X,{className:"size-7"})})]})})]})})}function dk(e){const{widget:t}=un();return y.jsx(S3,{widget:t,children:y.jsx(CD,{...e})})}function rs(e){this._maxSize=e,this.clear()}rs.prototype.clear=function(){this._size=0,this._values=Object.create(null)};rs.prototype.get=function(e){return this._values[e]};rs.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var _D=/[^.^\]^[]+|(?=\[\]|\.\.)/g,fk=/^\d+$/,PD=/^\d/,jD=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,AD=/^\s*(['"]?)(.*?)(\1)\s*$/,Um=512,yy=new rs(Um),xy=new rs(Um),wy=new rs(Um),$i={Cache:rs,split:Lp,normalizePath:Id,setter:function(e){var t=Id(e);return xy.get(e)||xy.set(e,function(r,i){for(var s=0,o=t.length,a=r;s<o-1;){var l=t[s];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;a=a[t[s++]]}a[t[s]]=i})},getter:function(e,t){var n=Id(e);return wy.get(e)||wy.set(e,function(i){for(var s=0,o=n.length;s<o;)if(i!=null||!t)i=i[n[s++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(Hm(n)||fk.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){RD(Array.isArray(e)?e:Lp(e),t,n)}};function Id(e){return yy.get(e)||yy.set(e,Lp(e).map(function(t){return t.replace(AD,"$2")}))}function Lp(e){return e.match(_D)||[""]}function RD(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(FD(i)&&(i='"'+i+'"'),a=Hm(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function Hm(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function OD(e){return e.match(PD)&&!e.match(fk)}function DD(e){return jD.test(e)}function FD(e){return!Hm(e)&&(OD(e)||DD(e))}const ND=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Sc=e=>e.match(ND)||[],kc=e=>e[0].toUpperCase()+e.slice(1),Wm=(e,t)=>Sc(e).join(t).toLowerCase(),pk=e=>Sc(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),MD=e=>kc(pk(e)),LD=e=>Wm(e,"_"),ID=e=>Wm(e,"-"),$D=e=>kc(Wm(e," ")),zD=e=>Sc(e).map(kc).join(" ");var $d={words:Sc,upperFirst:kc,camelCase:pk,pascalCase:MD,snakeCase:LD,kebabCase:ID,sentenceCase:$D,titleCase:zD},qm={exports:{}};qm.exports=function(e){return hk(BD(e),e)};qm.exports.array=hk;function hk(e,t){var n=e.length,r=new Array(n),i={},s=n,o=VD(t),a=UD(e);for(t.forEach(function(u){if(!a.has(u[0])||!a.has(u[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||l(e[s],s,new Set);return r;function l(u,d,c){if(c.has(u)){var f;try{f=", node was:"+JSON.stringify(u)}catch{f=""}throw new Error("Cyclic dependency"+f)}if(!a.has(u))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(u));if(!i[d]){i[d]=!0;var p=o.get(u)||new Set;if(p=Array.from(p),d=p.length){c.add(u);do{var h=p[--d];l(h,a.get(h),c)}while(d);c.delete(u)}r[--n]=u}}}function BD(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function VD(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function UD(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var HD=qm.exports;const WD=Qi(HD),qD=Object.prototype.toString,KD=Error.prototype.toString,GD=RegExp.prototype.toString,QD=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",YD=/^Symbol\((.*)\)(.*)$/;function XD(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function by(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return XD(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return QD.call(e).replace(YD,"Symbol($1)");const r=qD.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+KD.call(e)+"]":r==="RegExp"?GD.call(e):null}function Zr(e,t){let n=by(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=by(this[r],t);return s!==null?s:i},2)}function mk(e){return e==null?[]:[].concat(e)}let gk,vk,yk,ZD=/\$\{\s*(\w+)\s*\}/g;gk=Symbol.toStringTag;class Sy{constructor(t,n,r,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[gk]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],mk(t).forEach(s=>{if(_t.isError(s)){this.errors.push(...s.errors);const o=s.inner.length?s.inner:[s];this.inner.push(...o)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}vk=Symbol.hasInstance;yk=Symbol.toStringTag;class _t extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(ZD,(i,s)=>Zr(n[s])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i,s){const o=new Sy(t,n,r,i);if(s)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[yk]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,_t)}static[vk](t){return Sy[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let On={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${Zr(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Zr(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${Zr(n,!0)}\``+i}},St={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},JD={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Ip={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},eF={isValue:"${path} field must be ${value}"},ru={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},tF={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},nF={notType:e=>{const{path:t,value:n,spec:r}=e,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${Zr(n,!0)}\``;if(n.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${Zr(n,!0)}\``}return _t.formatError(On.notType,e)}};Object.assign(Object.create(null),{mixed:On,string:St,number:JD,date:Ip,object:ru,array:tF,boolean:eF,tuple:nF});const Km=e=>e&&e.__isYupSchema__;class Vu{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:s}=n,o=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new Vu(t,(a,l)=>{var u;let d=o(...a)?i:s;return(u=d==null?void 0:d(l))!=null?u:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(s=>s.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!Km(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const Al={context:"$",value:"."};class is{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Al.context,this.isValue=this.key[0]===Al.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Al.context:this.isValue?Al.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&$i.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}is.prototype.__isYupRef=!0;const _i=e=>e==null;function hs(e){function t({value:n,path:r="",options:i,originalValue:s,schema:o},a,l){const{name:u,test:d,params:c,message:f,skipAbsent:p}=e;let{parent:h,context:v,abortEarly:b=o.spec.abortEarly,disableStackTrace:m=o.spec.disableStackTrace}=i;function x(L){return is.isRef(L)?L.getValue(n,h,v):L}function w(L={}){const ne=Object.assign({value:n,originalValue:s,label:o.spec.label,path:L.path||r,spec:o.spec,disableStackTrace:L.disableStackTrace||m},c,L.params);for(const J of Object.keys(ne))ne[J]=x(ne[J]);const ee=new _t(_t.formatError(L.message||f,ne),n,ne.path,L.type||u,ne.disableStackTrace);return ee.params=ne,ee}const E=b?a:l;let T={path:r,parent:h,type:u,from:i.from,createError:w,resolve:x,options:i,originalValue:s,schema:o};const C=L=>{_t.isError(L)?E(L):L?l(null):E(w())},S=L=>{_t.isError(L)?E(L):a(L)};if(p&&_i(n))return C(!0);let j;try{var R;if(j=d.call(T,n,T),typeof((R=j)==null?void 0:R.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${T.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(j).then(C,S)}}catch(L){S(L);return}C(j)}return t.OPTIONS=e,t}function rF(e,t,n,r=n){let i,s,o;return t?($i.forEach(t,(a,l,u)=>{let d=l?a.slice(1,a.length-1):a;e=e.resolve({context:r,parent:i,value:n});let c=e.type==="tuple",f=u?parseInt(d,10):0;if(e.innerType||c){if(c&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&f>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[f],e=c?e.spec.types[f]:e.innerType}if(!u){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);i=n,n=n&&n[d],e=e.fields[d]}s=d,o=l?"["+a+"]":"."+a}),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}class Uu extends Set{describe(){const t=[];for(const n of this.values())t.push(is.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new Uu(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Ds(e,t=new Map){if(Km(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Ds(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,i]of e.entries())n.set(r,Ds(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Ds(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Ds(i,t)}else throw Error(`Unable to clone ${e}`);return n}class Gn{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Uu,this._blacklist=new Uu,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(On.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Ds(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(s=>{t.tests.forEach(o=>{s.test(o.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,s)=>s.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i,s;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(s=t.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",s=r._cast(t,n);if(n.assert!==!1&&!r.isType(s)){if(i&&_i(s))return s;let o=Zr(t),a=Zr(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
96
96
 
97
97
  attempted value: ${o}
98
98
  `+(a!==o?`result of cast: ${a}`:""))}return s}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,s)=>s.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,i){let{path:s,originalValue:o=t,strict:a=this.spec.strict}=n,l=t;a||(l=this._cast(l,Object.assign({assert:!1},n)));let u=[];for(let d of Object.values(this.internalTests))d&&u.push(d);this.runTests({path:s,value:l,originalValue:o,options:n,tests:u},r,d=>{if(d.length)return i(d,l);this.runTests({path:s,value:l,originalValue:o,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:s,value:o,originalValue:a,path:l,options:u}=t,d=v=>{i||(i=!0,n(v,o))},c=v=>{i||(i=!0,r(v,o))},f=s.length,p=[];if(!f)return c([]);let h={value:o,originalValue:a,path:l,options:u,schema:this};for(let v=0;v<s.length;v++){const b=s[v];b(h,d,function(x){x&&(Array.isArray(x)?p.push(...x):p.push(x)),--f<=0&&c(p)})}}asNestedTest({key:t,index:n,parent:r,parentPath:i,originalParent:s,options:o}){const a=t??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof a=="number";let u=r[a];const d=Object.assign({},o,{strict:!0,parent:r,value:u,originalValue:s[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${i||""}[${l?a:`"${a}"`}]`:(i?`${i}.`:"")+t});return(c,f,p)=>this.resolve(d)._validate(u,d,f,p)}validate(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return new Promise((o,a)=>i._validate(t,n,(l,u)=>{_t.isError(l)&&(l.value=u),a(l)},(l,u)=>{l.length?a(new _t(l,u,void 0,void 0,s)):o(u)}))}validateSync(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s,o=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return i._validate(t,Object.assign({},n,{sync:!0}),(a,l)=>{throw _t.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new _t(a,t,void 0,void 0,o);s=l}),s}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(_t.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(_t.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Ds(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=hs({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=hs({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=On.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=On.notNull){return this.nullability(!1,t)}required(t=On.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=On.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=hs(n),s=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(s||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=mk(t).map(s=>new is(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(typeof n=="function"?new Vu(i,n):Vu.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=hs({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=On.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=hs({message:n,name:"oneOf",skipAbsent:!0,test(i){let s=this.schema._whitelist,o=s.resolveAll(this.resolve);return o.includes(i)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:o}})}}),r}notOneOf(t,n=On.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=hs({message:n,name:"notOneOf",test(i){let s=this.schema._blacklist,o=s.resolveAll(this.resolve);return o.includes(i)?this.createError({params:{values:Array.from(s).join(", "),resolved:o}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:s,nullable:o}=n.spec;return{meta:i,label:r,optional:s,nullable:o,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,u,d)=>d.findIndex(c=>c.name===l.name)===u)}}}Gn.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Gn.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=rF(this,t,n,r.context);return o[e](i&&i[s],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])Gn.prototype[e]=Gn.prototype.oneOf;for(const e of["not","nope"])Gn.prototype[e]=Gn.prototype.notOneOf;const iF=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function sF(e){const t=$p(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function $p(e){var t,n;const r=iF.exec(e);return r?{year:Xn(r[1]),month:Xn(r[2],1)-1,day:Xn(r[3],1),hour:Xn(r[4]),minute:Xn(r[5]),second:Xn(r[6]),millisecond:r[7]?Xn(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:Xn(r[10]),minuteOffset:Xn(r[11])}:null}function Xn(e,t=0){return Number(e)||t}let oF=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,aF=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,lF=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,uF="^\\d{4}-\\d{2}-\\d{2}",cF="\\d{2}:\\d{2}:\\d{2}",dF="(([+-]\\d{2}(:?\\d{2})?)|Z)",fF=new RegExp(`${uF}T${cF}(\\.\\d+)?${dF}$`),pF=e=>_i(e)||e===e.trim(),hF={}.toString();function Hu(){return new xk}class xk extends Gn{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===hF?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||On.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=St.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=St.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=St.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,s;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:s}=n:i=n),this.test({name:s||"matches",message:i||St.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=St.email){return this.matches(oF,{name:"email",message:t,excludeEmptyString:!0})}url(t=St.url){return this.matches(aF,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=St.uuid){return this.matches(lF,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,i;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:i=void 0}=t:n=t),this.matches(fF,{name:"datetime",message:n||St.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||St.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:s=>{if(!s||r)return!0;const o=$p(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||St.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;const o=$p(s);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=St.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:pF})}lowercase(t=St.lowercase){return this.transform(n=>_i(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>_i(n)||n===n.toLowerCase()})}uppercase(t=St.uppercase){return this.transform(n=>_i(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>_i(n)||n===n.toUpperCase()})}}Hu.prototype=xk.prototype;let mF=new Date(""),gF=e=>Object.prototype.toString.call(e)==="[object Date]";class Ec extends Gn{constructor(){super({type:"date",check(t){return gF(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=sF(t),isNaN(t)?Ec.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(is.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Ip.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=Ip.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}Ec.INVALID_DATE=mF;Ec.prototype;function vF(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([o,a])=>`${o}-${a}`));function s(o,a){let l=$i.split(o)[0];r.add(l),i.has(`${a}-${l}`)||n.push([a,l])}for(const o of Object.keys(e)){let a=e[o];r.add(o),is.isRef(a)&&a.isSibling?s(a.path,o):Km(a)&&"deps"in a&&a.deps.forEach(l=>s(l,o))}return WD.array(Array.from(r),n).reverse()}function ky(e,t){let n=1/0;return e.some((r,i)=>{var s;if((s=t.path)!=null&&s.includes(r))return n=i,!0}),n}function wk(e){return(t,n)=>ky(e,t)-ky(e,n)}const yF=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function iu(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=iu(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=iu(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(iu)}):"optional"in e?e.optional():e}const xF=(e,t)=>{const n=[...$i.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=$i.getter($i.join(n),!0)(e);return!!(i&&r in i)};let Ey=e=>Object.prototype.toString.call(e)==="[object Object]";function Ty(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const wF=wk([]);function Gm(e){return new bk(e)}class bk extends Gn{constructor(t){super({type:"object",check(n){return Ey(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=wF,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let s=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(i).filter(c=>!this._nodes.includes(c))),l={},u=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),d=!1;for(const c of a){let f=s[c],p=c in i;if(f){let h,v=i[c];u.path=(n.path?`${n.path}.`:"")+c,f=f.resolve({value:v,context:n.context,parent:l});let b=f instanceof Gn?f.spec:void 0,m=b==null?void 0:b.strict;if(b!=null&&b.strip){d=d||c in i;continue}h=!n.__validating||!m?f.cast(i[c],u):i[c],h!==void 0&&(l[c]=h)}else p&&!o&&(l[c]=i[c]);(p!==c in l||l[c]!==i[c])&&(d=!0)}return d?l:i}_validate(t,n={},r,i){let{from:s=[],originalValue:o=t,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:o},...s],n.__validating=!0,n.originalValue=o,super._validate(t,n,r,(l,u)=>{if(!a||!Ey(u)){i(l,u);return}o=o||u;let d=[];for(let c of this._nodes){let f=this.fields[c];!f||is.isRef(f)||d.push(f.asNestedTest({options:n,key:c,parent:u,parentPath:n.path,originalParent:o}))}this.runTests({tests:d,value:u,originalValue:o,options:n},r,c=>{i(c.sort(this._sortErrors).concat(l),u)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,s]of Object.entries(this.fields)){const o=r[i];r[i]=o===void 0?s:o}return n.withMutation(i=>i.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var i;const s=this.fields[r];let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[r]})),n[r]=s&&"getDefault"in s?s.getDefault(o):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=vF(t,n),r._sortErrors=wk(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return iu(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,i])=>t.includes(r)&&t.includes(i)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let i=$i.getter(t,!0);return this.transform(s=>{if(!s)return s;let o=s;return xF(s,t)&&(o=Object.assign({},s),r||delete o[t],o[n]=i(s)),o})}json(){return this.transform(yF)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||ru.exact,test(n){if(n==null)return!0;const r=Ty(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=ru.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const s=Ty(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=ru.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys($d.camelCase)}snakeCase(){return this.transformKeys($d.snakeCase)}constantCase(){return this.transformKeys(t=>$d.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[s,o]of Object.entries(n.fields)){var i;let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[s]})),r.fields[s]=o.describe(a)}return r}}Gm.prototype=bk.prototype;var bF=function(t){return SF(t)&&!kF(t)};function SF(e){return!!e&&typeof e=="object"}function kF(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||CF(e)}var EF=typeof Symbol=="function"&&Symbol.for,TF=EF?Symbol.for("react.element"):60103;function CF(e){return e.$$typeof===TF}function _F(e){return Array.isArray(e)?[]:{}}function Wu(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Na(_F(e),e,t):e}function PF(e,t,n){return e.concat(t).map(function(r){return Wu(r,n)})}function jF(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=Wu(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=Wu(t[i],n):r[i]=Na(e[i],t[i],n)}),r}function Na(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||PF,n.isMergeableObject=n.isMergeableObject||bF;var r=Array.isArray(t),i=Array.isArray(e),s=r===i;return s?r?n.arrayMerge(e,t,n):jF(e,t,n):Wu(t,n)}Na.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Na(r,i,n)},{})};var zp=Na,Sk=typeof global=="object"&&global&&global.Object===Object&&global,AF=typeof self=="object"&&self&&self.Object===Object&&self,Qn=Sk||AF||Function("return this")(),ii=Qn.Symbol,kk=Object.prototype,RF=kk.hasOwnProperty,OF=kk.toString,Mo=ii?ii.toStringTag:void 0;function DF(e){var t=RF.call(e,Mo),n=e[Mo];try{e[Mo]=void 0;var r=!0}catch{}var i=OF.call(e);return r&&(t?e[Mo]=n:delete e[Mo]),i}var FF=Object.prototype,NF=FF.toString;function MF(e){return NF.call(e)}var LF="[object Null]",IF="[object Undefined]",Cy=ii?ii.toStringTag:void 0;function ss(e){return e==null?e===void 0?IF:LF:Cy&&Cy in Object(e)?DF(e):MF(e)}function Ek(e,t){return function(n){return e(t(n))}}var Qm=Ek(Object.getPrototypeOf,Object);function os(e){return e!=null&&typeof e=="object"}var $F="[object Object]",zF=Function.prototype,BF=Object.prototype,Tk=zF.toString,VF=BF.hasOwnProperty,UF=Tk.call(Object);function _y(e){if(!os(e)||ss(e)!=$F)return!1;var t=Qm(e);if(t===null)return!0;var n=VF.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Tk.call(n)==UF}function HF(){this.__data__=[],this.size=0}function Ck(e,t){return e===t||e!==e&&t!==t}function Tc(e,t){for(var n=e.length;n--;)if(Ck(e[n][0],t))return n;return-1}var WF=Array.prototype,qF=WF.splice;function KF(e){var t=this.__data__,n=Tc(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():qF.call(t,n,1),--this.size,!0}function GF(e){var t=this.__data__,n=Tc(t,e);return n<0?void 0:t[n][1]}function QF(e){return Tc(this.__data__,e)>-1}function YF(e,t){var n=this.__data__,r=Tc(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function mr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}mr.prototype.clear=HF;mr.prototype.delete=KF;mr.prototype.get=GF;mr.prototype.has=QF;mr.prototype.set=YF;function XF(){this.__data__=new mr,this.size=0}function ZF(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function JF(e){return this.__data__.get(e)}function eN(e){return this.__data__.has(e)}function el(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var tN="[object AsyncFunction]",nN="[object Function]",rN="[object GeneratorFunction]",iN="[object Proxy]";function _k(e){if(!el(e))return!1;var t=ss(e);return t==nN||t==rN||t==tN||t==iN}var zd=Qn["__core-js_shared__"],Py=function(){var e=/[^.]+$/.exec(zd&&zd.keys&&zd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function sN(e){return!!Py&&Py in e}var oN=Function.prototype,aN=oN.toString;function as(e){if(e!=null){try{return aN.call(e)}catch{}try{return e+""}catch{}}return""}var lN=/[\\^$.*+?()[\]{}|]/g,uN=/^\[object .+?Constructor\]$/,cN=Function.prototype,dN=Object.prototype,fN=cN.toString,pN=dN.hasOwnProperty,hN=RegExp("^"+fN.call(pN).replace(lN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mN(e){if(!el(e)||sN(e))return!1;var t=_k(e)?hN:uN;return t.test(as(e))}function gN(e,t){return e==null?void 0:e[t]}function ls(e,t){var n=gN(e,t);return mN(n)?n:void 0}var Ma=ls(Qn,"Map"),La=ls(Object,"create");function vN(){this.__data__=La?La(null):{},this.size=0}function yN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var xN="__lodash_hash_undefined__",wN=Object.prototype,bN=wN.hasOwnProperty;function SN(e){var t=this.__data__;if(La){var n=t[e];return n===xN?void 0:n}return bN.call(t,e)?t[e]:void 0}var kN=Object.prototype,EN=kN.hasOwnProperty;function TN(e){var t=this.__data__;return La?t[e]!==void 0:EN.call(t,e)}var CN="__lodash_hash_undefined__";function _N(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=La&&t===void 0?CN:t,this}function Gi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Gi.prototype.clear=vN;Gi.prototype.delete=yN;Gi.prototype.get=SN;Gi.prototype.has=TN;Gi.prototype.set=_N;function PN(){this.size=0,this.__data__={hash:new Gi,map:new(Ma||mr),string:new Gi}}function jN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Cc(e,t){var n=e.__data__;return jN(t)?n[typeof t=="string"?"string":"hash"]:n.map}function AN(e){var t=Cc(this,e).delete(e);return this.size-=t?1:0,t}function RN(e){return Cc(this,e).get(e)}function ON(e){return Cc(this,e).has(e)}function DN(e,t){var n=Cc(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function ui(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ui.prototype.clear=PN;ui.prototype.delete=AN;ui.prototype.get=RN;ui.prototype.has=ON;ui.prototype.set=DN;var FN=200;function NN(e,t){var n=this.__data__;if(n instanceof mr){var r=n.__data__;if(!Ma||r.length<FN-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ui(r)}return n.set(e,t),this.size=n.size,this}function ko(e){var t=this.__data__=new mr(e);this.size=t.size}ko.prototype.clear=XF;ko.prototype.delete=ZF;ko.prototype.get=JF;ko.prototype.has=eN;ko.prototype.set=NN;function MN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var jy=function(){try{var e=ls(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Pk(e,t,n){t=="__proto__"&&jy?jy(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var LN=Object.prototype,IN=LN.hasOwnProperty;function jk(e,t,n){var r=e[t];(!(IN.call(e,t)&&Ck(r,n))||n===void 0&&!(t in e))&&Pk(e,t,n)}function _c(e,t,n,r){var i=!n;n||(n={});for(var s=-1,o=t.length;++s<o;){var a=t[s],l=void 0;l===void 0&&(l=e[a]),i?Pk(n,a,l):jk(n,a,l)}return n}function $N(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var zN="[object Arguments]";function Ay(e){return os(e)&&ss(e)==zN}var Ak=Object.prototype,BN=Ak.hasOwnProperty,VN=Ak.propertyIsEnumerable,UN=Ay(function(){return arguments}())?Ay:function(e){return os(e)&&BN.call(e,"callee")&&!VN.call(e,"callee")},tl=Array.isArray;function HN(){return!1}var Rk=typeof $t=="object"&&$t&&!$t.nodeType&&$t,Ry=Rk&&typeof zt=="object"&&zt&&!zt.nodeType&&zt,WN=Ry&&Ry.exports===Rk,Oy=WN?Qn.Buffer:void 0,qN=Oy?Oy.isBuffer:void 0,Ok=qN||HN,KN=9007199254740991,GN=/^(?:0|[1-9]\d*)$/;function QN(e,t){var n=typeof e;return t=t??KN,!!t&&(n=="number"||n!="symbol"&&GN.test(e))&&e>-1&&e%1==0&&e<t}var YN=9007199254740991;function Dk(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=YN}var XN="[object Arguments]",ZN="[object Array]",JN="[object Boolean]",eM="[object Date]",tM="[object Error]",nM="[object Function]",rM="[object Map]",iM="[object Number]",sM="[object Object]",oM="[object RegExp]",aM="[object Set]",lM="[object String]",uM="[object WeakMap]",cM="[object ArrayBuffer]",dM="[object DataView]",fM="[object Float32Array]",pM="[object Float64Array]",hM="[object Int8Array]",mM="[object Int16Array]",gM="[object Int32Array]",vM="[object Uint8Array]",yM="[object Uint8ClampedArray]",xM="[object Uint16Array]",wM="[object Uint32Array]",Se={};Se[fM]=Se[pM]=Se[hM]=Se[mM]=Se[gM]=Se[vM]=Se[yM]=Se[xM]=Se[wM]=!0;Se[XN]=Se[ZN]=Se[cM]=Se[JN]=Se[dM]=Se[eM]=Se[tM]=Se[nM]=Se[rM]=Se[iM]=Se[sM]=Se[oM]=Se[aM]=Se[lM]=Se[uM]=!1;function bM(e){return os(e)&&Dk(e.length)&&!!Se[ss(e)]}function Ym(e){return function(t){return e(t)}}var Fk=typeof $t=="object"&&$t&&!$t.nodeType&&$t,ia=Fk&&typeof zt=="object"&&zt&&!zt.nodeType&&zt,SM=ia&&ia.exports===Fk,Bd=SM&&Sk.process,fo=function(){try{var e=ia&&ia.require&&ia.require("util").types;return e||Bd&&Bd.binding&&Bd.binding("util")}catch{}}(),Dy=fo&&fo.isTypedArray,kM=Dy?Ym(Dy):bM,EM=Object.prototype,TM=EM.hasOwnProperty;function Nk(e,t){var n=tl(e),r=!n&&UN(e),i=!n&&!r&&Ok(e),s=!n&&!r&&!i&&kM(e),o=n||r||i||s,a=o?$N(e.length,String):[],l=a.length;for(var u in e)(t||TM.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||QN(u,l)))&&a.push(u);return a}var CM=Object.prototype;function Xm(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||CM;return e===n}var _M=Ek(Object.keys,Object),PM=Object.prototype,jM=PM.hasOwnProperty;function AM(e){if(!Xm(e))return _M(e);var t=[];for(var n in Object(e))jM.call(e,n)&&n!="constructor"&&t.push(n);return t}function Mk(e){return e!=null&&Dk(e.length)&&!_k(e)}function Zm(e){return Mk(e)?Nk(e):AM(e)}function RM(e,t){return e&&_c(t,Zm(t),e)}function OM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var DM=Object.prototype,FM=DM.hasOwnProperty;function NM(e){if(!el(e))return OM(e);var t=Xm(e),n=[];for(var r in e)r=="constructor"&&(t||!FM.call(e,r))||n.push(r);return n}function Jm(e){return Mk(e)?Nk(e,!0):NM(e)}function MM(e,t){return e&&_c(t,Jm(t),e)}var Lk=typeof $t=="object"&&$t&&!$t.nodeType&&$t,Fy=Lk&&typeof zt=="object"&&zt&&!zt.nodeType&&zt,LM=Fy&&Fy.exports===Lk,Ny=LM?Qn.Buffer:void 0,My=Ny?Ny.allocUnsafe:void 0;function IM(e,t){if(t)return e.slice();var n=e.length,r=My?My(n):new e.constructor(n);return e.copy(r),r}function Ik(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function $M(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s}function $k(){return[]}var zM=Object.prototype,BM=zM.propertyIsEnumerable,Ly=Object.getOwnPropertySymbols,eg=Ly?function(e){return e==null?[]:(e=Object(e),$M(Ly(e),function(t){return BM.call(e,t)}))}:$k;function VM(e,t){return _c(e,eg(e),t)}function zk(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var UM=Object.getOwnPropertySymbols,Bk=UM?function(e){for(var t=[];e;)zk(t,eg(e)),e=Qm(e);return t}:$k;function HM(e,t){return _c(e,Bk(e),t)}function Vk(e,t,n){var r=t(e);return tl(e)?r:zk(r,n(e))}function WM(e){return Vk(e,Zm,eg)}function qM(e){return Vk(e,Jm,Bk)}var Bp=ls(Qn,"DataView"),Vp=ls(Qn,"Promise"),Up=ls(Qn,"Set"),Hp=ls(Qn,"WeakMap"),Iy="[object Map]",KM="[object Object]",$y="[object Promise]",zy="[object Set]",By="[object WeakMap]",Vy="[object DataView]",GM=as(Bp),QM=as(Ma),YM=as(Vp),XM=as(Up),ZM=as(Hp),tr=ss;(Bp&&tr(new Bp(new ArrayBuffer(1)))!=Vy||Ma&&tr(new Ma)!=Iy||Vp&&tr(Vp.resolve())!=$y||Up&&tr(new Up)!=zy||Hp&&tr(new Hp)!=By)&&(tr=function(e){var t=ss(e),n=t==KM?e.constructor:void 0,r=n?as(n):"";if(r)switch(r){case GM:return Vy;case QM:return Iy;case YM:return $y;case XM:return zy;case ZM:return By}return t});var JM=Object.prototype,e5=JM.hasOwnProperty;function t5(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&e5.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Uy=Qn.Uint8Array;function tg(e){var t=new e.constructor(e.byteLength);return new Uy(t).set(new Uy(e)),t}function n5(e,t){var n=t?tg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var r5=/\w*$/;function i5(e){var t=new e.constructor(e.source,r5.exec(e));return t.lastIndex=e.lastIndex,t}var Hy=ii?ii.prototype:void 0,Wy=Hy?Hy.valueOf:void 0;function s5(e){return Wy?Object(Wy.call(e)):{}}function o5(e,t){var n=t?tg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var a5="[object Boolean]",l5="[object Date]",u5="[object Map]",c5="[object Number]",d5="[object RegExp]",f5="[object Set]",p5="[object String]",h5="[object Symbol]",m5="[object ArrayBuffer]",g5="[object DataView]",v5="[object Float32Array]",y5="[object Float64Array]",x5="[object Int8Array]",w5="[object Int16Array]",b5="[object Int32Array]",S5="[object Uint8Array]",k5="[object Uint8ClampedArray]",E5="[object Uint16Array]",T5="[object Uint32Array]";function C5(e,t,n){var r=e.constructor;switch(t){case m5:return tg(e);case a5:case l5:return new r(+e);case g5:return n5(e,n);case v5:case y5:case x5:case w5:case b5:case S5:case k5:case E5:case T5:return o5(e,n);case u5:return new r;case c5:case p5:return new r(e);case d5:return i5(e);case f5:return new r;case h5:return s5(e)}}var qy=Object.create,_5=function(){function e(){}return function(t){if(!el(t))return{};if(qy)return qy(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function P5(e){return typeof e.constructor=="function"&&!Xm(e)?_5(Qm(e)):{}}var j5="[object Map]";function A5(e){return os(e)&&tr(e)==j5}var Ky=fo&&fo.isMap,R5=Ky?Ym(Ky):A5,O5="[object Set]";function D5(e){return os(e)&&tr(e)==O5}var Gy=fo&&fo.isSet,F5=Gy?Ym(Gy):D5,N5=1,M5=2,L5=4,Uk="[object Arguments]",I5="[object Array]",$5="[object Boolean]",z5="[object Date]",B5="[object Error]",Hk="[object Function]",V5="[object GeneratorFunction]",U5="[object Map]",H5="[object Number]",Wk="[object Object]",W5="[object RegExp]",q5="[object Set]",K5="[object String]",G5="[object Symbol]",Q5="[object WeakMap]",Y5="[object ArrayBuffer]",X5="[object DataView]",Z5="[object Float32Array]",J5="[object Float64Array]",e4="[object Int8Array]",t4="[object Int16Array]",n4="[object Int32Array]",r4="[object Uint8Array]",i4="[object Uint8ClampedArray]",s4="[object Uint16Array]",o4="[object Uint32Array]",ye={};ye[Uk]=ye[I5]=ye[Y5]=ye[X5]=ye[$5]=ye[z5]=ye[Z5]=ye[J5]=ye[e4]=ye[t4]=ye[n4]=ye[U5]=ye[H5]=ye[Wk]=ye[W5]=ye[q5]=ye[K5]=ye[G5]=ye[r4]=ye[i4]=ye[s4]=ye[o4]=!0;ye[B5]=ye[Hk]=ye[Q5]=!1;function sa(e,t,n,r,i,s){var o,a=t&N5,l=t&M5,u=t&L5;if(o!==void 0)return o;if(!el(e))return e;var d=tl(e);if(d){if(o=t5(e),!a)return Ik(e,o)}else{var c=tr(e),f=c==Hk||c==V5;if(Ok(e))return IM(e,a);if(c==Wk||c==Uk||f&&!i){if(o=l||f?{}:P5(e),!a)return l?HM(e,MM(o,e)):VM(e,RM(o,e))}else{if(!ye[c])return i?e:{};o=C5(e,c,a)}}s||(s=new ko);var p=s.get(e);if(p)return p;s.set(e,o),F5(e)?e.forEach(function(b){o.add(sa(b,t,n,b,e,s))}):R5(e)&&e.forEach(function(b,m){o.set(m,sa(b,t,n,m,e,s))});var h=u?l?qM:WM:l?Jm:Zm,v=d?void 0:h(e);return MN(v||e,function(b,m){v&&(m=b,b=e[m]),jk(o,m,sa(b,t,n,m,e,s))}),o}var a4=1,l4=4;function Rl(e){return sa(e,a4|l4)}var Qy=Array.isArray,Yy=Object.keys,u4=Object.prototype.hasOwnProperty,c4=typeof Element<"u";function Wp(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Qy(e),r=Qy(t),i,s,o;if(n&&r){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!Wp(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var a=e instanceof Date,l=t instanceof Date;if(a!=l)return!1;if(a&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,d=t instanceof RegExp;if(u!=d)return!1;if(u&&d)return e.toString()==t.toString();var c=Yy(e);if(s=c.length,s!==Yy(t).length)return!1;for(i=s;i--!==0;)if(!u4.call(t,c[i]))return!1;if(c4&&e instanceof Element&&t instanceof Element)return e===t;for(i=s;i--!==0;)if(o=c[i],!(o==="_owner"&&e.$$typeof)&&!Wp(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var d4=function(t,n){try{return Wp(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}};const xi=Qi(d4);var f4=4;function Xy(e){return sa(e,f4)}function qk(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var p4="[object Symbol]";function ng(e){return typeof e=="symbol"||os(e)&&ss(e)==p4}var h4="Expected a function";function rg(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(h4);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(rg.Cache||ui),n}rg.Cache=ui;var m4=500;function g4(e){var t=rg(e,function(r){return n.size===m4&&n.clear(),r}),n=t.cache;return t}var v4=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,y4=/\\(\\)?/g,x4=g4(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(v4,function(n,r,i,s){t.push(i?s.replace(y4,"$1"):r||n)}),t}),w4=1/0;function b4(e){if(typeof e=="string"||ng(e))return e;var t=e+"";return t=="0"&&1/e==-w4?"-0":t}var S4=1/0,Zy=ii?ii.prototype:void 0,Jy=Zy?Zy.toString:void 0;function Kk(e){if(typeof e=="string")return e;if(tl(e))return qk(e,Kk)+"";if(ng(e))return Jy?Jy.call(e):"";var t=e+"";return t=="0"&&1/e==-S4?"-0":t}function k4(e){return e==null?"":Kk(e)}function Gk(e){return tl(e)?qk(e,b4):ng(e)?[e]:Ik(x4(k4(e)))}var Qk={exports:{}},he={};/** @license React v16.13.1